Skip to content

Commit

Permalink
WIP: More Invitation fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
ewhanson committed Dec 10, 2024
1 parent c29367c commit 433ad41
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/pages/acceptInvitation/AcceptInvitationPage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
{{ t('common.back') }}
</PkpButton>
<PkpButton
v-if="!store.isOnFirstStep"
v-if="store.currentStep.id !== 'verifyOrcid'"
:is-primary="true"
@click="store.nextStep"
>
Expand Down
20 changes: 17 additions & 3 deletions src/pages/acceptInvitation/AcceptInvitationVerifyOrcid.vue
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,11 @@ import {defineProps} from 'vue';
import {useLocalize} from '@/composables/useLocalize';
import {useAcceptInvitationPageStore} from './AcceptInvitationPageStore';
defineProps({});
const props = defineProps({
orcidUrl: {type: String, required: true},
orcidOAuthUrl: {type: String, required: true},
});
const store = useAcceptInvitationPageStore();
const {t} = useLocalize();
Expand All @@ -28,10 +32,20 @@ const {t} = useLocalize();
*/
function skipOrcid() {
delete store.acceptInvitationPayload.userOrcid;
store.openStep(store.steps[1 + store.currentStepIndex].id);
store.openStep(store.steps.value[1 + store.currentStepIndex].id);
}
function verifyOrcid() {
store.openStep(store.steps[1 + store.currentStepIndex].id);
openOrcidOAuth();
store.openStep(store.steps.value[1 + store.currentStepIndex].id);
}
function openOrcidOAuth() {
const oauthWindow = window.open(
props.orcidOAuthUrl,
'_blank',
'toolbar=no, scrollbars=yes, width=540, height=700, top=500, left=500',
);
oauthWindow.opener = self;
}
</script>

0 comments on commit 433ad41

Please sign in to comment.