Skip to content

Commit

Permalink
Updated popup content and implementation
Browse files Browse the repository at this point in the history
Signed-off-by: AadeshNichite <anichite@progress.com>
  • Loading branch information
AadeshNichite committed Sep 19, 2024
1 parent ecb7969 commit 90f43ab
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 53 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ <h1>
</div>
<div class="message">
<p>
{{ body }}
I acknowledge and agree that use of Progress Chef Habitat Builder is governed by and subject to the terms and conditions of the End User License Agreement for
Progress Chef located at <a href="https://www.chef.io/end-user-license-agreement" target="_blank">Progress Chef EULA</a>
</p>
</div>
</span>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,6 @@ export class EulaConfirmDialog {
return this.data.heading || 'Confirm';
}

get body() {
return this.data.body || 'Are you sure?';
}

get action() {
return this.data.action || 'do it';
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@
<div class="body">
<div class="content">
<section class="upper">
<a mat-raised-button color="primary" class="button" (click)="showEulaPopup(loginUrl,'login')">
<a mat-raised-button color="primary" class="button" (click)="showEulaPopup(loginUrl)">
<hab-icon [symbol]="providerType"></hab-icon>
<span>Sign In with {{ providerName }}</span>
</a>
</section>
<section class="lower">
<p *ngIf="signupUrl">
Don't have a {{ providerName }} account?
<a (click)="showEulaPopup(signupUrl,'signUp')" target="_blank">Sign up here</a>.
<a href="{{ signupUrl }}" target="_blank">Sign up here</a>.
</p>
<p>
New to Habitat? Signing in will also create a new account.
Expand Down
66 changes: 20 additions & 46 deletions components/builder-web/app/sign-in-page/sign-in-page.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,53 +61,27 @@ export class SignInPageComponent implements OnDestroy {
this.store.dispatch(setLayout('default'));
}

showEulaPopup(URL, popupFor) {
if (popupFor === 'signUp') {
if (!localStorage.getItem('singUpShowEulaPopup') && !localStorage.getItem('singUpEulaAccept')) {
this.confirmDialog
.open(EulaConfirmDialog, {
width: '530px',
disableClose: true,
data: {
heading: 'End Users License Agreement',
body: `I acknowledge and agree that use of Chef Habitat Builder is governed by and subject to the terms and conditions of the End User License Agreement for Chef`,
action: 'Continue',
signupUrl: URL
}
}).afterClosed()
.subscribe((data) => {
if (data) {
localStorage.setItem('singUpEulaAccept', 'true');
localStorage.setItem('singUpShowEulaPopup', 'false');
window.open(URL);
}
});
} else {
window.open(URL);
}
showEulaPopup(URL) {
if (!localStorage.getItem('loginShowEulaPopup') && !localStorage.getItem('loginEulaAccept')) {
this.confirmDialog
.open(EulaConfirmDialog, {
width: '530px',
disableClose: true,
data: {
heading: 'End Users License Agreement',
action: 'Continue',
signupUrl: URL
}
}).afterClosed()
.subscribe((data) => {
if (data) {
localStorage.setItem('loginEulaAccept', 'true');
localStorage.setItem('loginShowEulaPopup', 'false');
window.open(this.loginUrl, '_self');
}
});
} else {
if (!localStorage.getItem('loginShowEulaPopup') && !localStorage.getItem('loginEulaAccept')) {
this.confirmDialog
.open(EulaConfirmDialog, {
width: '530px',
disableClose: true,
data: {
heading: 'End Users License Agreement',
body: `I acknowledge and agree that use of Progress Chef Habitat Builder is governed by and subject to the terms and conditions of the End User License Agreement for Progress Chef`,
action: 'Continue',
signupUrl: URL
}
}).afterClosed()
.subscribe((data) => {
if (data) {
localStorage.setItem('loginEulaAccept', 'true');
localStorage.setItem('loginShowEulaPopup', 'false');
window.open(this.loginUrl, '_self');
}
});
} else {
window.open(URL, '_self');
}
window.open(URL, '_self');
}
}
}

0 comments on commit 90f43ab

Please sign in to comment.