-
Notifications
You must be signed in to change notification settings - Fork 217
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
Skyeden-3020 | retransimission with detached consumers #1938
Changes from 5 commits
04857b0
af7732b
5b064e3
fce5065
efb0a96
b7144a9
cda592e
17e1e7a
09fec0f
0ba9900
5780ef7
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 |
---|---|---|
|
@@ -4,6 +4,7 @@ | |
import { useDialog } from '@/composables/dialog/use-dialog/useDialog'; | ||
import { useI18n } from 'vue-i18n'; | ||
import ConfirmationDialog from '@/components/confirmation-dialog/ConfirmationDialog.vue'; | ||
import LoadingSpinner from '@/components/loading-spinner/LoadingSpinner.vue'; | ||
|
||
const { t } = useI18n(); | ||
|
||
|
@@ -13,8 +14,8 @@ | |
}>(); | ||
|
||
const emit = defineEmits<{ | ||
retransmit: [fromDate: string]; | ||
skipAllMessages: []; | ||
retransmit: [fromDate: string, onComplete: () => void]; | ||
skipAllMessages: [onComplete: () => void]; | ||
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. is this necessary to have onComplete here? 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. Actually, now that I think about it, a cleaner way would be to eliminate that and lift the state to the parent component. |
||
}>(); | ||
|
||
const retransmitFrom = ref(new Date().toISOString().slice(0, -5)); | ||
|
@@ -42,17 +43,20 @@ | |
disableActionButton: disableSkipAllMessagesActionButton, | ||
} = useDialog(); | ||
|
||
const retransmitting = ref(false); | ||
const skippingAllMessages = ref(false); | ||
|
||
async function retransmit() { | ||
disableRetransmitActionButton(); | ||
emit('retransmit', `${retransmitFrom.value}Z`); | ||
enableRetransmitActionButton(); | ||
retransmitting.value = true; | ||
emit('retransmit', `${retransmitFrom.value}Z`, retransmissionCompleted); | ||
closeRetransmitDialog(); | ||
} | ||
|
||
async function skipMessages() { | ||
disableSkipAllMessagesActionButton(); | ||
emit('skipAllMessages'); | ||
enableSkipAllMessagesActionButton(); | ||
skippingAllMessages.value = true; | ||
emit('skipAllMessages', skippingAllMessagesCompleted); | ||
closeSkipAllMessagesDialog(); | ||
} | ||
|
||
|
@@ -68,6 +72,16 @@ | |
subscriptionFqn: subscriptionQualifiedName, | ||
}), | ||
); | ||
|
||
function retransmissionCompleted() { | ||
retransmitting.value = false; | ||
enableRetransmitActionButton(); | ||
} | ||
|
||
function skippingAllMessagesCompleted() { | ||
skippingAllMessages.value = false; | ||
enableSkipAllMessagesActionButton(); | ||
} | ||
</script> | ||
|
||
<template> | ||
|
@@ -113,11 +127,15 @@ | |
</v-col> | ||
<v-col md="3"> | ||
<v-btn | ||
:disabled="retransmitting || skippingAllMessages" | ||
color="red" | ||
@click="openRetransmitDialog" | ||
data-testid="retransmitButton" | ||
> | ||
{{ $t('subscription.manageMessagesCard.retransmitButton') }} | ||
<loading-spinner v-if="retransmitting"></loading-spinner> | ||
<span v-else> | ||
{{ $t('subscription.manageMessagesCard.retransmitButton') }} | ||
</span> | ||
</v-btn> | ||
</v-col> | ||
</v-row> | ||
|
@@ -128,12 +146,16 @@ | |
{{ $t('subscription.manageMessagesCard.skipAllMessagesTitle') }} | ||
</p> | ||
<v-btn | ||
:disabled="retransmitting || skippingAllMessages" | ||
color="red" | ||
class="mt-2" | ||
@click="openSkipAllMessagesDialog" | ||
data-testid="skipAllMessagesButton" | ||
> | ||
{{ $t('subscription.manageMessagesCard.skipAllMessagesButton') }} | ||
<loading-spinner v-if="skippingAllMessages"></loading-spinner> | ||
<span v-else> | ||
{{ $t('subscription.manageMessagesCard.skipAllMessagesButton') }} | ||
</span> | ||
</v-btn> | ||
</v-card-item> | ||
</v-form> | ||
|
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.
❤️