Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

21570 - Tweaks for short name details view #3055

Merged
merged 4 commits into from
Oct 1, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions auth-web/src/components/pay/eft/ShortNameFinancialDialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
large
color="primary"
data-test="dialog-ok-button"
:disabled="isFormValid()"
:disabled="isFormInvalid()"
@click="patchShortName()"
>
Save
Expand Down Expand Up @@ -84,7 +84,7 @@ export default defineComponent({
},
emits: ['on-patch', 'close-short-name-email-dialog'],
setup (props, { emit }) {
const emailAddressRules = CommonUtils.emailRules()
const emailAddressRules = CommonUtils.emailRules(true)
const modalDialog: Ref<InstanceType<typeof ModalDialog>> = ref(null)
const accountLinkingErrorDialog: Ref<InstanceType<typeof ModalDialog>> = ref(null)
const state = reactive<any>({
Expand All @@ -94,13 +94,13 @@ export default defineComponent({
isDialogTypeCasSupplierNumber: computed(() => props.shortNameFinancialDialogType === 'CAS_SUPPLIER_NUMBER')
})

function isFormValid () {
function isFormInvalid () {
if (state.isDialogTypeEmail) {
return emailAddressRules.every(rule => rule(state.email) !== true)
return !state.email || emailAddressRules.some(rule => rule(state.email) !== true)
} else if (state.isDialogTypeCasSupplierNumber) {
return !state.casSupplierNumber
}
return false
return true
}

function openAccountLinkingDialog (item: EFTShortnameResponse, dialogType) {
Expand Down Expand Up @@ -158,7 +158,7 @@ export default defineComponent({
patchShortName,
emailAddressRules,
dialogTitle,
isFormValid
isFormInvalid
}
}
})
Expand Down
28 changes: 21 additions & 7 deletions auth-web/src/views/pay/eft/ShortNameDetailsView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<h1 class="view-header__title">
{{ shortNameDetails.shortName }}
</h1>
<p class="mt-6 mb-0">
<p class="mt-3 mb-0 unsettled-amount">
<span class="font-weight-bold">Unsettled Amount: </span>{{ unsettledAmount }}
</p>
</div>
Expand All @@ -29,29 +29,29 @@
<span class="font-weight-bold">CAS Supplier Number: </span>
{{ shortName.casSupplierNumber || 'N/A' }}
<span
class="primary--text cursor-pointer"
class="pl-4 primary--text cursor-pointer"
data-test="btn-edit"
@click="openShortNameSupplierNumberDialog()"
>
<v-icon
color="primary"
size="20"
> mdi-pencil</v-icon>
> mdi-pencil-outline</v-icon>
Edit
</span>
</div>
<div class="overflow-wrap">
<span class="font-weight-bold">Email: </span>
{{ shortName.email || 'N/A' }}
<span class="email">{{ shortName.email || 'N/A' }}</span>
<span
class="primary--text cursor-pointer"
class="pl-4 primary--text cursor-pointer"
data-test="btn-edit"
@click="openShortNameEmailDialog()"
>
<v-icon
color="primary"
size="20"
> mdi-pencil</v-icon>
> mdi-pencil-outline</v-icon>
Edit
</span>
</div>
Expand Down Expand Up @@ -240,6 +240,20 @@ export default defineComponent({

<style lang="scss" scoped>
@import '@/assets/scss/theme.scss';
.email {
word-wrap: break-word;
word-break: break-all;
}
.view-header__title {
font-size: 24px;
line-height: 32px;
}
.unsettled-amount {
font-size: 18px;
}
.shortname-info {
font-size: 18px;
}
#shortname-details {
padding-top: 0;
}
Expand All @@ -265,7 +279,7 @@ export default defineComponent({
flex: 1 1 100%;
}
.shortname-info {
flex: 0 0 320px;
flex: 0 0 380px;
}
&:after {
content: '';
Expand Down
Loading