From f61ad78e56d0e1fd1f4b0d3f1d14575c23248144 Mon Sep 17 00:00:00 2001 From: ipula Date: Tue, 16 Jul 2024 18:23:14 +0200 Subject: [PATCH] add tailwind css classes --- public/globals.js | 30 ++- .../AcceptInvitationHeader.vue | 17 -- .../AcceptInvitationPage.stories.js | 89 +++++++- .../acceptInvitation/AcceptInvitationPage.vue | 135 ++++-------- .../AcceptInvitationPageStore.js | 34 ++- .../AcceptInvitationReview.vue | 143 +++++-------- .../AcceptInvitationUserAccountDetails.vue | 113 +++++----- .../AcceptInvitationUserDetailsForms.vue | 37 ++-- .../AcceptInvitationUserRoles.vue | 14 +- .../AcceptInvitationVerifyOrcid.vue | 19 +- ...tationMock.js => invitationNewUserMock.js} | 6 +- .../invitationUserNotVerifiedOrcidMock.js | 23 ++ .../mocks/invitationUserVerifiedOrcidMock.js | 23 ++ .../acceptInvitation/mocks/pageInitConfig.js | 197 ++++++++++++++++-- .../pageInitConfigUserNotVerifiedOrcid.js | 42 ++++ .../mocks/pageInitConfigUserVerifiedOrcid.js | 6 + .../UserInvitationDetailsFormStep.vue | 102 ++++----- .../userInvitation/UserInvitationHeader.vue | 14 +- .../userInvitation/UserInvitationPage.vue | 136 ++++-------- .../userInvitation/UserInvitationPageStore.js | 15 +- .../UserInvitationSearchFormStep.vue | 58 +++--- .../UserInvitationUserGroupsTable.vue | 39 +--- .../userInvitation/mocks/pageInitConfig.js | 18 +- 23 files changed, 759 insertions(+), 551 deletions(-) delete mode 100644 src/pages/acceptInvitation/AcceptInvitationHeader.vue rename src/pages/acceptInvitation/mocks/{invitationMock.js => invitationNewUserMock.js} (75%) create mode 100644 src/pages/acceptInvitation/mocks/invitationUserNotVerifiedOrcidMock.js create mode 100644 src/pages/acceptInvitation/mocks/invitationUserVerifiedOrcidMock.js create mode 100644 src/pages/acceptInvitation/mocks/pageInitConfigUserNotVerifiedOrcid.js create mode 100644 src/pages/acceptInvitation/mocks/pageInitConfigUserVerifiedOrcid.js diff --git a/public/globals.js b/public/globals.js index 8f6e1d2d0..0ae6174a0 100644 --- a/public/globals.js +++ b/public/globals.js @@ -177,6 +177,7 @@ window.pkp = { 'common.view': 'View', 'common.viewWithName': 'View {$name}', 'common.yes': 'Yes', + 'common.back': 'Back', 'dashboard.acceptOrDeclineRequestDate': 'Please accept or decline this request {$date}', 'dashboard.action': 'Action', @@ -527,13 +528,38 @@ window.pkp = { 'submissions.incomplete': 'Incomplete', todo: '##todo##', 'user.email': 'Email', + 'user.emailAddress': 'Email Address', 'user.orcid': 'ORCID iD', 'user.username': 'Username', + 'user.password': 'Password', + 'user.givenName': 'Given Name', + 'user.familyName': 'Family Name', + 'user.affiliation': 'Affiliation', + 'user.country': 'Country', 'validator.required': 'This field is required.', 'invitation.notification.closeBtn':'View all users', - 'user.password': 'Password', 'invitation.orcid.acceptInvitation.message':'Not verified. You can verify your ORCID iD from your profile section in OJS', - + 'userInvitation.emailField.description':'e.g. aeinstein@example.com', + 'userInvitation.usernameField.description':'e.g. mickeymouse', + 'userInvitation.orcidField.description':'e.g. 0000-0000-0000-0000', + 'userInvitation.roleTable.role':'Role', + 'userInvitation.roleTable.startDate':'Start Date', + 'userInvitation.roleTable.endDate':'End Date', + 'userInvitation.roleTable.journalMasthead':'Journal Masthead', + 'userInvitation.modal.title':'Invitation Sent', + 'userInvitation.modal.message':'{$email} has been invited to new role in OJS.You can be updated about users on the User and Roles page, your ojs notification and/ or your email', + 'userInvitation.modal.button':'View All Users', + 'acceptInvitation.usernameField.description':'It should be 10 characters long and could be a combination of uppercase letters, lowercase letters or numbers', + 'acceptInvitation.passwordField.description':'It should be 12 characters long and should be a combination of uppercase letters, lowercase letters, numbers and symbols', + 'acceptInvitation.review.userDetails':'User Details', + 'acceptInvitation.review.accountDetails':'Account Details', + 'acceptInvitation.verifyOrcid':'Verify ORCID iD', + 'acceptInvitation.skipVerifyOrcid':'Skip ORCID verification', + 'acceptInvitation.modal.title':"You've been assigned a new role in OJS", + 'acceptInvitation.modal.message':'Congratulations on your new role in OJS! You might now have access to new options. If you need assistance navigating the system, please click on the “Help” buttons throughout the interface for guidance', + 'acceptInvitation.modal.button':'View All Submissions', + 'acceptInvitation.privacyStatement.btn':'Privacy Statement', + 'acceptInvitation.privacyStatement.label':'Yes, I agree to have my data collected and stored according to the', }, tinyMCE: { diff --git a/src/pages/acceptInvitation/AcceptInvitationHeader.vue b/src/pages/acceptInvitation/AcceptInvitationHeader.vue deleted file mode 100644 index f67629358..000000000 --- a/src/pages/acceptInvitation/AcceptInvitationHeader.vue +++ /dev/null @@ -1,17 +0,0 @@ - - - diff --git a/src/pages/acceptInvitation/AcceptInvitationPage.stories.js b/src/pages/acceptInvitation/AcceptInvitationPage.stories.js index 4268f7f6a..b76cb54bb 100644 --- a/src/pages/acceptInvitation/AcceptInvitationPage.stories.js +++ b/src/pages/acceptInvitation/AcceptInvitationPage.stories.js @@ -1,14 +1,18 @@ import AcceptInvitationPage from './AcceptInvitationPage.vue'; import {http, HttpResponse} from 'msw'; import PageInitConfigMock from './mocks/pageInitConfig'; -import invitationMock from './mocks/invitationMock'; +import pageInitConfigUserVerifiedOrcid from './mocks/pageInitConfigUserVerifiedOrcid'; +import pageInitConfigUserNotVerifiedOrcid from './mocks/pageInitConfigUserNotVerifiedOrcid'; +import invitationNewUserMock from './mocks/invitationNewUserMock'; +import invitationUserVerifiedOrcidMock from './mocks/invitationUserVerifiedOrcidMock'; +import invitationUserNotVerifiedOrcidMock from './mocks/invitationUserNotVerifiedOrcidMock'; export default { title: 'Pages/AcceptInvitation', component: AcceptInvitationPage, }; -export const Init = { +export const NewUser = { render: (args) => ({ components: {AcceptInvitationPage}, setup() { @@ -22,7 +26,7 @@ export const Init = { http.get( 'https://mock/index.php/publicknowledge/api/v1/invitations/65/key/8aqc3W', async (r) => { - return HttpResponse.json(invitationMock, {status: 200}); + return HttpResponse.json(invitationNewUserMock, {status: 200}); }, ), http.post( @@ -40,6 +44,9 @@ export const Init = { if (!Object.keys(postBody).includes('affiliation')) { errors['affiliation'] = ['This field is required']; } + if (!Object.keys(postBody).includes('familyName')) { + errors['familyName'] = ['This field is required']; + } if (!Object.keys(postBody).includes('country')) { errors['country'] = ['This field is required']; } @@ -60,7 +67,7 @@ export const Init = { http.post( 'https://mock/index.php/publicknowledge/api/v1/invitations/65/key/8aqc3W/finalize', async (r) => { - return HttpResponse.json(invitationMock, {status: 201}); + return HttpResponse.json({}, {status: 201}); }, ), ], @@ -68,3 +75,77 @@ export const Init = { }, args: PageInitConfigMock, }; + +export const ExistingUserWithOrcidVerified = { + render: (args) => ({ + components: {AcceptInvitationPage}, + setup() { + return {args}; + }, + template: '', + }), + parameters: { + msw: { + handlers: [ + http.get( + 'https://mock/index.php/publicknowledge/api/v1/invitations/65/key/8aqc3W', + async (r) => { + return HttpResponse.json(invitationUserVerifiedOrcidMock, { + status: 200, + }); + }, + ), + http.post( + 'https://mock/index.php/publicknowledge/api/v1/invitations/65/key/8aqc3W/refine', + async () => { + return HttpResponse.json({}, {status: 200}); + }, + ), + http.post( + 'https://mock/index.php/publicknowledge/api/v1/invitations/65/key/8aqc3W/finalize', + async (r) => { + return HttpResponse.json({}, {status: 201}); + }, + ), + ], + }, + }, + args: pageInitConfigUserVerifiedOrcid, +}; + +export const ExistingUserWithNotOrcidVerified = { + render: (args) => ({ + components: {AcceptInvitationPage}, + setup() { + return {args}; + }, + template: '', + }), + parameters: { + msw: { + handlers: [ + http.get( + 'https://mock/index.php/publicknowledge/api/v1/invitations/65/key/8aqc3W', + async (r) => { + return HttpResponse.json(invitationUserNotVerifiedOrcidMock, { + status: 200, + }); + }, + ), + http.post( + 'https://mock/index.php/publicknowledge/api/v1/invitations/65/key/8aqc3W/refine', + async () => { + return HttpResponse.json({}, {status: 200}); + }, + ), + http.post( + 'https://mock/index.php/publicknowledge/api/v1/invitations/65/key/8aqc3W/finalize', + async (r) => { + return HttpResponse.json({}, {status: 201}); + }, + ), + ], + }, + }, + args: pageInitConfigUserNotVerifiedOrcid, +}; diff --git a/src/pages/acceptInvitation/AcceptInvitationPage.vue b/src/pages/acceptInvitation/AcceptInvitationPage.vue index 1b15d7749..ed21d6993 100644 --- a/src/pages/acceptInvitation/AcceptInvitationPage.vue +++ b/src/pages/acceptInvitation/AcceptInvitationPage.vue @@ -1,12 +1,7 @@