Skip to content

Commit 69fe16f

Browse files
Manage Submission Users Button Enhancement (bcgov#1769)
* Manage submission draft team button fixes * Sonarqube fix * Team List Fix
1 parent efbae72 commit 69fe16f

2 files changed

Lines changed: 31 additions & 16 deletions

File tree

app/frontend/src/components/designer/FormViewerActions.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ watch(
223223
</span>
224224

225225
<!-- Manage submission users -->
226-
<span v-if="submissionId && draftEnabled && !publicForm" class="ml-2">
226+
<span v-if="draftEnabled && !publicForm" class="ml-2">
227227
<ManageSubmissionUsers
228228
:is-draft="isDraft"
229229
:submission-id="submissionId"

app/frontend/src/components/forms/submission/ManageSubmissionUsers.vue

Lines changed: 30 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,16 @@ watch(userSearchInput, async (input) => {
6060
});
6161
6262
initializeSelectedIdp();
63-
getSubmissionUsers();
63+
64+
watch(
65+
() => properties.isDraft,
66+
(newValue) => {
67+
if (newValue) {
68+
getSubmissionUsers();
69+
}
70+
},
71+
{ immediate: true }
72+
);
6473
6574
function onChangeSelectedIdp(newIdp, oldIdp) {
6675
if (newIdp !== oldIdp) {
@@ -244,22 +253,28 @@ defineExpose({
244253
245254
<template>
246255
<span>
247-
<v-tooltip location="bottom">
256+
<v-tooltip
257+
location="bottom"
258+
:lang="locale"
259+
:text="
260+
isDraft
261+
? $t('trans.manageSubmissionUsers.manageTeamMembers')
262+
: $t('trans.manageSubmissionUsers.draftFormInvite')
263+
"
264+
>
248265
<template #activator="{ props }">
249-
<v-btn
250-
color="primary"
251-
icon
252-
v-bind="props"
253-
size="x-small"
254-
:title="$t('trans.manageSubmissionUsers.manageTeamMembers')"
255-
@click="dialog = true"
256-
>
257-
<v-icon icon="mdi:mdi-account-multiple"></v-icon>
258-
</v-btn>
266+
<div v-bind="props" class="d-inline-block">
267+
<v-btn
268+
color="primary"
269+
icon
270+
size="x-small"
271+
:disabled="!isDraft"
272+
@click="dialog = true"
273+
>
274+
<v-icon icon="mdi:mdi-account-multiple"></v-icon>
275+
</v-btn>
276+
</div>
259277
</template>
260-
<span :lang="locale"
261-
>{{ $t('trans.manageSubmissionUsers.manageTeamMembers') }}
262-
</span>
263278
</v-tooltip>
264279
<v-dialog v-model="dialog" width="600">
265280
<v-card :class="{ 'dir-rtl': isRTL }">

0 commit comments

Comments
 (0)