-
Notifications
You must be signed in to change notification settings - Fork 49
26434_use_magic_link_instead_local_code #836
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
Changes from all commits
3049796
db8e769
213d8e2
0bb5897
0e205e2
75abafb
87d4f3f
bce3622
211e885
cbe8ab9
0ec2964
b5b1ece
249b31c
643e43a
2411bf1
47796e7
b6e550e
cce8b87
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 |
|---|---|---|
|
|
@@ -247,4 +247,34 @@ export class CommonMixin extends Vue { | |
| scrollTo (id: string): void { | ||
| return document.getElementById(id)?.scrollIntoView() | ||
| } | ||
|
|
||
| /** Get a magic link. */ | ||
| magicLink (nr: any): string { | ||
| const businessRegistryUrl = sessionStorage.getItem('BUSINESS_REGISTRY_URL') | ||
| const accountId = +JSON.parse(sessionStorage.getItem('CURRENT_ACCOUNT'))?.id || 0 | ||
| const phone = nr.applicants?.phoneNumber || '' | ||
| let magic_link_route = '' | ||
| switch (nr.request_action_cd) { | ||
| case NrRequestActionCodes.NEW_BUSINESS: | ||
| magic_link_route = [EntityTypes.SP, EntityTypes.GP].includes(nr.entity_type_cd) | ||
|
Contributor
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. Please test with a SP and a GP. I just want to be certain that the correct types are being used here (since Namrequest/Namex use their own, partly overlapping and partly conflicting, enum), even though it looks like you're using the right code from the processed NR. |
||
| ? 'registerNow' | ||
|
JazzarKarim marked this conversation as resolved.
|
||
| : 'incorporateNow' | ||
| break | ||
| case NrRequestActionCodes.AMALGAMATE: | ||
| magic_link_route = 'amalgamateNow' | ||
| break | ||
| case NrRequestActionCodes.MOVE: | ||
| magic_link_route = 'continueInNow' | ||
| break | ||
| default: | ||
| throw new Error(`No route defined for action code '${nr.request_action_cd}' for the magic link.`) | ||
| } | ||
|
severinbeauvais marked this conversation as resolved.
|
||
|
|
||
| return ( | ||
| `${businessRegistryUrl}${magic_link_route}` + | ||
| `?nr=${encodeURIComponent(nr.nrNum)}` + | ||
| `&phone=${encodeURIComponent(phone)}` + | ||
| `&accountid=${encodeURIComponent(accountId)}` | ||
| ) | ||
| } | ||
| } | ||
|
Contributor
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. Since we now redirect to a magic link to create a business from a NR, can a bunch of code be deleted from this mixin ? |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -38,14 +38,6 @@ export default class Signin extends Mixins(LoadKeycloakRolesMixin, NrAffiliation | |
| this.loadKeycloakRoles() | ||
| await this.updateUser() | ||
|
|
||
| // if there is stored NR data to process then affiliate it now | ||
| const nr = JSON.parse(sessionStorage.getItem('NR_DATA')) | ||
| if (nr) { | ||
| await this.createAffiliation(nr) | ||
| // clear NR data for next time | ||
| sessionStorage.removeItem('NR_DATA') | ||
| } | ||
|
|
||
|
Contributor
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. Please test this by:
Contributor
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. I just tried this (in Dev) and it failed, but the task trace shows that it came through created (not signin), so this may be OK. Can you think of any other path that would hit signin before (or instead of) created?
Contributor
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.
Contributor
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. I couldn't find an existing ticket for the account id bug so I created this one:
Contributor
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. I'd like Bobby to test this but I think it's resolved. Let me know what you find. |
||
| // go to main app page | ||
| await this.$router.push('/') | ||
| } | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,14 +1,15 @@ | ||
| import AnalyzeResults from '@/components/new-request/analyze-results.vue' | ||
| import testData from './api/get-name-analysis' | ||
| import { createLocalVue, mount } from '@vue/test-utils' | ||
| // import AnalyzeResults from '@/components/new-request/analyze-results.vue' | ||
| // import testData from './api/get-name-analysis' | ||
| import { createLocalVue } from '@vue/test-utils' | ||
| // import { mount } from '@vue/test-utils' | ||
| // import newReqModule from '@/store/new-request-module' | ||
| import Vuetify from 'vuetify' | ||
|
|
||
| document['getSelection'] = jest.fn() | ||
|
|
||
| const localVue = createLocalVue() | ||
| localVue.use(Vuetify) | ||
| const vuetify = new Vuetify() | ||
| // const vuetify = new Vuetify() | ||
|
Contributor
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. Normally I would ask for unused code to be deleted instead of commented out... However, this is Namerequest UI, and I know the test suites are incomplete, so it's possible the unused code will one day be used. Hence, I'm OK with the commented-out code in this special case. |
||
|
|
||
| // function setState (data) { | ||
| // newReqModule.mutateEntityType('CR') | ||
|
|
||


Uh oh!
There was an error while loading. Please reload this page.