From 03dbe272fc6da7eb0425a296c584578da374b8e6 Mon Sep 17 00:00:00 2001 From: Chad Scharf <3904944+cscharf@users.noreply.github.com> Date: Thu, 25 Jun 2020 15:18:21 -0400 Subject: [PATCH 1/3] Added referenceId to register component --- src/app/accounts/register.component.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/app/accounts/register.component.ts b/src/app/accounts/register.component.ts index 22815af339..a617bf8c8e 100644 --- a/src/app/accounts/register.component.ts +++ b/src/app/accounts/register.component.ts @@ -77,6 +77,9 @@ export class RegisterComponent extends BaseRegisterComponent { if (qParams.layout != null) { this.layout = qParams.layout; } + if (qParams.reference != null) { + this.referenceId = qParams.reference; + } if (queryParamsSub != null) { queryParamsSub.unsubscribe(); } @@ -96,6 +99,12 @@ export class RegisterComponent extends BaseRegisterComponent { if (this.policies != null) { this.enforcedPolicyOptions = await this.policyService.getMasterPasswordPolicyOptions(this.policies); } + + const referenceId = ('; ' + document.cookie).split('; reference=').pop().split(';').shift(); + this.referenceId = this.referenceId || referenceId; + if (this.referenceId === '') { + this.referenceId = null; + } } async submit() { From 869ee217eb4fcc8b279088108489762a89608822 Mon Sep 17 00:00:00 2001 From: Chad Scharf <3904944+cscharf@users.noreply.github.com> Date: Thu, 25 Jun 2020 15:51:26 -0400 Subject: [PATCH 2/3] Updated jslib --- jslib | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jslib b/jslib index 635a6fd0d8..57ace40845 160000 --- a/jslib +++ b/jslib @@ -1 +1 @@ -Subproject commit 635a6fd0d8758384021d674d9140266f9976e9e0 +Subproject commit 57ace4084556758fdc2989cf1a8cf6a5d1736a29 From 88c8c8ae55edf81251df231552d5934d027b8873 Mon Sep 17 00:00:00 2001 From: Chad Scharf <3904944+cscharf@users.noreply.github.com> Date: Thu, 25 Jun 2020 16:30:45 -0400 Subject: [PATCH 3/3] referenceId PR feedback + lint fix --- src/app/accounts/register.component.ts | 11 +++++------ src/app/layouts/organization-layout.component.ts | 2 +- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/src/app/accounts/register.component.ts b/src/app/accounts/register.component.ts index a617bf8c8e..9a8aa41a68 100644 --- a/src/app/accounts/register.component.ts +++ b/src/app/accounts/register.component.ts @@ -79,6 +79,11 @@ export class RegisterComponent extends BaseRegisterComponent { } if (qParams.reference != null) { this.referenceId = qParams.reference; + } else { + this.referenceId = ('; ' + document.cookie).split('; reference=').pop().split(';').shift(); + } + if (this.referenceId === '') { + this.referenceId = null; } if (queryParamsSub != null) { queryParamsSub.unsubscribe(); @@ -99,12 +104,6 @@ export class RegisterComponent extends BaseRegisterComponent { if (this.policies != null) { this.enforcedPolicyOptions = await this.policyService.getMasterPasswordPolicyOptions(this.policies); } - - const referenceId = ('; ' + document.cookie).split('; reference=').pop().split(';').shift(); - this.referenceId = this.referenceId || referenceId; - if (this.referenceId === '') { - this.referenceId = null; - } } async submit() { diff --git a/src/app/layouts/organization-layout.component.ts b/src/app/layouts/organization-layout.component.ts index 79abc291a5..67269d9e25 100644 --- a/src/app/layouts/organization-layout.component.ts +++ b/src/app/layouts/organization-layout.component.ts @@ -8,8 +8,8 @@ import { ActivatedRoute } from '@angular/router'; import { BroadcasterService } from 'jslib/angular/services/broadcaster.service'; -import { UserService } from 'jslib/abstractions/user.service'; import { EnvironmentService } from 'jslib/abstractions/environment.service'; +import { UserService } from 'jslib/abstractions/user.service'; import { Organization } from 'jslib/models/domain/organization';