-
Notifications
You must be signed in to change notification settings - Fork 18
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
Todo Section - Dialogs #28
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,29 @@ | ||
<script setup lang="ts"> | ||
const todosStore = useBcrosTodos() | ||
|
||
const prop = defineProps({ | ||
todos: { type: Array<TodoItemI>, required: true } | ||
}) | ||
|
||
const authorizeAffiliationError = ref(todosStore.authorizeAffiliationsErrors.length > 0) | ||
const loadAffiliationInvitationError = ref(todosStore.loadAffiliationsError.length > 0) | ||
|
||
const authorizeAffiliationErrorOptions: DialogOptionsI = { | ||
title: 'Error updating affiliation invitation.', | ||
text: 'An error happened while updating affiliation invitation.', | ||
textExtra: ['Please try again later.'], | ||
hideClose: true, | ||
buttons: [{ text: 'Ok', slotId: 'ok', color: 'primary', onClickClose: true }] | ||
} | ||
|
||
const loadAffiliationInvitationErrorOptions: DialogOptionsI = { | ||
title: 'Error fetching affiliation invitation.', | ||
text: 'An error happened while fetching affiliation invitation.', | ||
textExtra: ['Please try again later.'], | ||
hideClose: true, | ||
buttons: [{ text: 'Ok', slotId: 'ok', color: 'primary', onClickClose: true }] | ||
} | ||
|
||
const isExpandedInternal: Ref<boolean[]> = ref([]) | ||
|
||
const isExpanded = computed({ | ||
|
@@ -28,9 +49,26 @@ const expand = (index: number, expanded: boolean) => { | |
|
||
<template> | ||
<div | ||
id="todoList" | ||
class="flex flex-col" | ||
data-cy="todoItemList" | ||
> | ||
<!-- error dialog (fetching affiliation request) --> | ||
<BcrosDialog | ||
attach="#todoList" | ||
:display="loadAffiliationInvitationError" | ||
:options="loadAffiliationInvitationErrorOptions" | ||
@close="loadAffiliationInvitationError = false" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Would it make sense to clear error queue if they are acknowledged and have this as a computed value ? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good point. Updated |
||
/> | ||
|
||
<!-- error dialog (accepting affiliation request) --> | ||
<BcrosDialog | ||
attach="#todoList" | ||
:display="authorizeAffiliationError" | ||
:options="authorizeAffiliationErrorOptions" | ||
@close="authorizeAffiliationError = false" | ||
/> | ||
|
||
<template v-if="todos.length > 0"> | ||
<BcrosTodoItem | ||
v-for="(todoItem, index) in todos" | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
<script setup lang="ts"> | ||
defineEmits<{(e:'close'): void}>() | ||
|
||
const prop = defineProps({ | ||
display: { type: Boolean, required: true }, | ||
errors: { type: Array<any>, required: true } | ||
}) | ||
|
||
const { isStaffAccount } = useBcrosAccount() | ||
|
||
const cancelPaymentDialogOptions = computed(() => { | ||
const title = 'Unable to Cancel Payment' | ||
|
||
const text = (prop.errors.length < 1) | ||
? 'We were unable to cancel your payment.' | ||
: 'We were unable to cancel your payment due to the following errors:' | ||
|
||
return { | ||
title, text, hideClose: true, buttons: [{ text: 'OK', slotId: 'ok', color: 'primary', onClickClose: true }] | ||
} as DialogOptionsI | ||
}) | ||
</script> | ||
|
||
<template> | ||
<BcrosDialog | ||
attach="#todoList" | ||
:display="display" | ||
:options="cancelPaymentDialogOptions" | ||
@close="$emit('close')" | ||
> | ||
<template #content> | ||
<p v-for="(error, index) in errors" :key="index"> | ||
{{ error.error || error.message }} | ||
</p> | ||
<template v-if="!isStaffAccount"> | ||
<p> | ||
If you need help, please contact us. | ||
hfekete marked this conversation as resolved.
Show resolved
Hide resolved
|
||
</p> | ||
<BcrosContactInfo :contacts="getContactInfo('registries')" class="mt-5" /> | ||
</template> | ||
</template> | ||
</BcrosDialog> | ||
</template> | ||
|
||
<style scoped> | ||
</style> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
<script setup lang="ts"> | ||
defineEmits<{(e:'close'): void}>() | ||
|
||
const prop = defineProps({ | ||
display: { type: Boolean, required: true }, | ||
errors: { type: Array<any>, required: true }, | ||
warnings: { type: Array<any>, required: true } | ||
}) | ||
|
||
const { isStaffAccount } = useBcrosAccount() | ||
|
||
const deleteErrorDialogOptions = computed(() => { | ||
const title = (prop.errors.length > 0 || prop.warnings.length < 1) | ||
? 'Unable to Delete Filing' | ||
: 'Filing Deleted with Warnings' | ||
|
||
let text = '' | ||
if (prop.errors.length + prop.warnings.length < 1) { | ||
text = 'We were unable to delete your filing.' | ||
} else if (prop.errors.length > 0) { | ||
text = 'We were unable to delete your filing due to the following errors:' | ||
} else { | ||
text = 'Please note the following:' | ||
} | ||
|
||
return { | ||
title, text, hideClose: true, buttons: [{ text: 'OK', slotId: 'ok', color: 'primary', onClickClose: true }] | ||
} as DialogOptionsI | ||
}) | ||
</script> | ||
|
||
<template> | ||
<BcrosDialog | ||
attach="#todoList" | ||
:display="display" | ||
:options="deleteErrorDialogOptions" | ||
@close="$emit('close')" | ||
> | ||
<template #content> | ||
<p v-for="(error, index) in errors" :key="index"> | ||
{{ error.error || error.message }} | ||
</p> | ||
<p v-for="(warning, index) in warnings" :key="index"> | ||
{{ warning.warning || warning.message }} | ||
</p> | ||
<template v-if="!isStaffAccount"> | ||
<p> | ||
If you need help, please contact us. | ||
</p> | ||
<BcrosContactInfo :contacts="getContactInfo('registries')" class="mt-5" /> | ||
</template> | ||
</template> | ||
</BcrosDialog> | ||
</template> | ||
|
||
<style scoped> | ||
</style> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this going to be internationalized ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes I agree I think this should all be from the lang file
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Many texts in the dashboard are from the imported enums or functions, so the content can't be fully internationalized until those texts from the external source are updated. But I agree that we need to use the lang file in the new dashboard.
I have updated the i18n stuff for the dialogs. There are many other places in the todo section that i18n need to be applied. I will change that later in a separate PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Create a ticket if you dont have it, for the next PR