Skip to content

Commit 4ebb551

Browse files
ipulajardakotesovec
authored andcommitted
update invitation page url and add separate prop user extended meta data
1 parent a73c583 commit 4ebb551

File tree

5 files changed

+30
-30
lines changed

5 files changed

+30
-30
lines changed

src/managers/UserAccessManager/UserAccessManagerStore.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ export const useUserAccessManagerStore = defineComponentStore(
111111
* redirect to send invitation page
112112
*/
113113
function editUser({user}) {
114-
const {redirectToPage} = useUrl(`invitation/editUser/${user.id}`);
114+
const {redirectToPage} = useUrl(`management/settings/user/${user.id}`);
115115
redirectToPage();
116116
}
117117

src/managers/UserInvitationManager/UserInvitationManagerStore.js

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import {defineComponentStore} from '@/utils/defineComponentStore';
2-
import {useUrl} from '@/composables/useUrl';
32
import {useAnnouncer} from '@/composables/useAnnouncer';
3+
import {useUrl} from '@/composables/useUrl';
44
import {useLocalize} from '@/composables/useLocalize';
55
import {useFetchPaginated} from '@/composables/useFetchPaginated';
66
import {useFetch} from '@/composables/useFetch';
@@ -21,9 +21,9 @@ export const useUserInvitationManagerStore = defineComponentStore(
2121
/**
2222
* redirect to send invitation page
2323
*/
24-
const {pageUrl: sendInvitationPageUrl} = useUrl('invitation/invite');
24+
const {redirectToPage} = useUrl('invitation/create/userRoleAssignment');
2525
function createNewInvitation() {
26-
window.location = sendInvitationPageUrl.value;
26+
redirectToPage();
2727
}
2828

2929
/**
@@ -81,6 +81,9 @@ export const useUserInvitationManagerStore = defineComponentStore(
8181
}
8282

8383
function handleEditInvitation(invitationObj) {
84+
const {redirectToPage: redirectToEditInvitationPage} = useUrl(
85+
`invitation/edit/${invitationObj.id}`,
86+
);
8487
openDialog({
8588
title: t('userInvitation.edit.title'),
8689
message: t('userInvitation.edit.message'),
@@ -89,8 +92,7 @@ export const useUserInvitationManagerStore = defineComponentStore(
8992
label: t('userInvitation.edit.title'),
9093
isPrimary: true,
9194
callback: async (close) => {
92-
window.location =
93-
sendInvitationPageUrl.value + '/' + invitationObj.id;
95+
redirectToEditInvitationPage();
9496
},
9597
},
9698
{
@@ -132,7 +134,7 @@ export const useUserInvitationManagerStore = defineComponentStore(
132134
actions: [
133135
{
134136
label: t('invitation.cancelInvite.title'),
135-
isPrimary: true,
137+
isWarnable: true,
136138
callback: async (close) => {
137139
const {apiUrl: cancelApiUrl} = useUrl(
138140
`invitations/${invitationObj.id}/cancel`,

src/pages/userInvitation/UserInvitationExtendedMetaData.vue

Lines changed: 14 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
heading-element="h4"
55
:heading="t('user.url')"
66
:value="
7-
store.invitationPayload.homePageUrl
8-
? store.invitationPayload.homePageUrl
7+
store.invitationUserData.homePageUrl
8+
? store.invitationUserData.homePageUrl
99
: '--'
1010
"
1111
></FormDisplayItemBasic>
@@ -14,60 +14,52 @@
1414
heading-element="h4"
1515
:heading="t('user.phone')"
1616
:value="
17-
store.invitationPayload.phone ? store.invitationPayload.phone : '--'
17+
store.invitationUserData.phone ? store.invitationUserData.phone : '--'
1818
"
1919
></FormDisplayItemBasic>
2020
<FormDisplayItemBasic
2121
heading-element="h4"
2222
:heading="t('user.workingLanguages')"
2323
:value="
24-
store.invitationPayload.locales ? store.invitationPayload.locales : '--'
25-
"
26-
></FormDisplayItemBasic>
27-
28-
<FormDisplayItemBasic
29-
heading-element="h4"
30-
:heading="t('user.interests')"
31-
:value="
32-
localize(store.invitationPayload.reviewerInterests)
33-
? localize(store.invitationPayload.reviewerInterests)
24+
store.invitationUserData.locales
25+
? store.invitationUserData.locales
3426
: '--'
3527
"
3628
></FormDisplayItemBasic>
3729

3830
<FormDisplayItemBasic
3931
heading-element="h4"
40-
:heading="t('user.affiliation')"
32+
:heading="t('user.interests')"
4133
:value="
42-
localize(store.invitationPayload.affiliation)
43-
? localize(store.invitationPayload.affiliation)
34+
localize(store.invitationUserData.reviewerInterests)
35+
? localize(store.invitationUserData.reviewerInterests)
4436
: '--'
4537
"
4638
></FormDisplayItemBasic>
4739
<FormDisplayItemBasic
4840
heading-element="h4"
4941
:heading="t('user.bioStatement')"
5042
:html-value="
51-
localize(store.invitationPayload.biography)
52-
? localize(store.invitationPayload.biography)
43+
localize(store.invitationUserData.biography)
44+
? localize(store.invitationUserData.biography)
5345
: '--'
5446
"
5547
></FormDisplayItemBasic>
5648
<FormDisplayItemBasic
5749
heading-element="h4"
5850
:heading="t('user.mailingAddress')"
5951
:html-value="
60-
store.invitationPayload.mailingAddress
61-
? store.invitationPayload.mailingAddress
52+
store.invitationUserData.mailingAddress
53+
? store.invitationUserData.mailingAddress
6254
: '--'
6355
"
6456
></FormDisplayItemBasic>
6557
<FormDisplayItemBasic
6658
heading-element="h4"
6759
:heading="t('user.signature')"
6860
:html-value="
69-
localize(store.invitationPayload.signature)
70-
? localize(store.invitationPayload.signature)
61+
localize(store.invitationUserData.signature)
62+
? localize(store.invitationUserData.signature)
7163
: '--'
7264
"
7365
></FormDisplayItemBasic>

src/pages/userInvitation/UserInvitationPage.vue

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,10 @@ const props = defineProps({
128128
type: String,
129129
required: true,
130130
},
131+
invitationUserData: {
132+
type: Array,
133+
required: true,
134+
},
131135
});
132136
const {t} = useLocalize();
133137
const wrapper = ref(null);

src/pages/userInvitation/UserInvitationPageStore.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ export const useUserInvitationPageStore = defineComponentStore(
2323
const updatedPayload = ref({});
2424
const invitationType = ref(pageInitConfig.invitationType);
2525
const invitationMode = ref(pageInitConfig.invitationMode);
26+
const invitationUserData = ref(pageInitConfig.invitationUserData);
2627
const detectChanges = ref(false);
2728

2829
function updatePayload(fieldName, value, initialValue = true) {
@@ -349,7 +350,7 @@ export const useUserInvitationPageStore = defineComponentStore(
349350
},
350351
},
351352
],
352-
modalStyle: 'success',
353+
modalStyle: 'primary',
353354
});
354355
} else {
355356
isSubmitting.value = false;
@@ -411,6 +412,7 @@ export const useUserInvitationPageStore = defineComponentStore(
411412
updatePayload,
412413
registerActionForStepId,
413414
emailTemplatesApiUrl,
415+
invitationUserData,
414416

415417
currentStep,
416418
currentStepIndex,

0 commit comments

Comments
 (0)