Skip to content

Commit

Permalink
24438 - fix: remove extra contact from frozen alert; fix spelling. (#93)
Browse files Browse the repository at this point in the history
* 24438 - fix: remove extra contact from frozen alert; fix spelling.

* refactor: how to select the items from the list.

* style: align alert header items vertical center
  • Loading branch information
hfekete authored Dec 4, 2024
1 parent 53e945c commit 71e3690
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 26 deletions.
4 changes: 2 additions & 2 deletions src/components/bcros/ContactInfo.vue
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<template>
<ul data-cy="contact-info">
<li v-for="contact, i in contacts" :key="'contact-' + i" class="flex" data-cy="contact-info-item">
<li v-for="contact, i in contacts" :key="'contact-' + i" class="flex mt-1.5" data-cy="contact-info-item">
<!-- NB: *weird bug* - the UIcon is not rendering unless there is a comment below containing the name for it -->
<!-- <UIcon name="i-mdi-phone" /> -->
<!-- <UIcon name="i-mdi-email" /> -->
<UIcon
class="text-[18px] text-primary-600 mt-[3px]"
class="text-[18px] text-primary-600"
:name="contact.icon"
data-cy="contact-icon"
/>
Expand Down
57 changes: 34 additions & 23 deletions src/components/bcros/alert/index.vue
Original file line number Diff line number Diff line change
@@ -1,30 +1,32 @@
<template>
<div data-cy="alert-display" class="px-3 py-3">
<UIcon
v-if="showHeader"
:class="`${iconColour} mr-2 font-semibold`"
:name="iconName"
data-cy="alert-icon"
/>
<span v-if="showHeader" class="font-semibold flex-auto">{{ alertHeader }}</span>
<UButton
v-if="showHeader"
color="primary"
:icon="actualExpanded ? 'i-mdi-chevron-up' : 'i-mdi-chevron-down'"
:label="actualExpanded ? 'Hide Details' : 'View Details'"
trailing
variant="ghost"
class="float-right"
:ui="{ icon: { base: 'transition-all' } }"
@click="toggleExpanded()"
/>
<div class="flex items-center justify-center">
<UIcon
v-if="showHeader"
:class="`${iconColour} mr-2 font-semibold`"
:name="iconName"
data-cy="alert-icon"
/>
<span v-if="showHeader" class="font-semibold flex-auto">{{ alertHeader }}</span>
<UButton
v-if="showHeader"
color="primary"
:icon="actualExpanded ? 'i-mdi-chevron-up' : 'i-mdi-chevron-down'"
:label="actualExpanded ? 'Hide Details' : 'View Details'"
trailing
variant="ghost"
class="float-right"
:ui="{ icon: { base: 'transition-all' } }"
@click="toggleExpanded()"
/>
</div>
<div v-if="actualExpanded && showDescription" data-cy="alert-description">
<p>{{ $t(alertDescription) }}</p>
<p v-if="contact" class="mt-3">
{{ contact }}:
<p v-if="contactText" class="mt-3">
{{ contactText }}:
</p>
<p v-if="contact" class="mt-3">
<bcros-contact-info class="font-normal font-16 mt-4" :contacts="getContactInfo('registries')" />
<p v-if="contactText" class="mt-3">
<bcros-contact-info class="font-normal font-16 mt-4" :contacts="bcrosContacts" />
</p>
</div>
</div>
Expand Down Expand Up @@ -82,7 +84,7 @@ const alertDescription = computed((): string => {
return description
})
const contact = computed((): string => {
const contactText = computed((): string => {
// 1 - assistance
// 2 - questions
// 3 - must contact
Expand All @@ -99,4 +101,13 @@ const contact = computed((): string => {
return t('alerts.contact')
})
const bcrosContacts = computed(() => {
const contacts = getContactInfo('registries')
if (AlertTypesE.FROZEN === props.alert.alertType) {
return contacts.filter(contact => contact.label.toLowerCase() === 'email')
}
return contacts
})
</script>
2 changes: 1 addition & 1 deletion src/lang/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -604,7 +604,7 @@
"nonentity": "This corporation is not an entity",
"amalgamation": ""
},
"contact": "For assitance, please contact BC Registries staff",
"contact": "For assistance, please contact BC Registries staff",
"contact2": "If you have any questions, please contact BC Registries staff",
"contact3": "To resolve this issue, you MUST contact BC Registries staff",
"contact4": "If further action is required, please contact BC Registries staff"
Expand Down

0 comments on commit 71e3690

Please sign in to comment.