Skip to content
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

Mods to leverage @pega/auth package for authManager and configAccess … #84

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27,653 changes: 5,837 additions & 21,816 deletions package-lock.json

Large diffs are not rendered by default.

5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@pega/angular-sdk-components",
"version": "8.23.10",
"version": "23.1.0",
"description": "Angular SDK packaging: bridge and components, overrides",
"main": "index.ts",
"private": true,
Expand Down Expand Up @@ -40,7 +40,7 @@
"copy-core": "shx cp constellation/constellation-core*.* dist/constellation/prerequisite",
"compress-angularsdk": "node compress-with-assets.mjs",
"copy-extra-deprecated": "shx cp constellation/lib_asset.json dist/lib_asset.json",
"copy-index": "shx cp dist/index.html dist/simpleportal.html && shx cp dist/index.html dist/portal.html && shx cp dist/index.html dist/fullportal.html && shx cp dist/index.html dist/embedded.html && shx cp dist/index.html dist/mashup.html && shx cp packages/angular-sdk-components/src/auth.html dist/auth.html",
"copy-index": "shx cp dist/index.html dist/simpleportal.html && shx cp dist/index.html dist/portal.html && shx cp dist/index.html dist/fullportal.html && shx cp dist/index.html dist/embedded.html && shx cp dist/index.html dist/mashup.html && shx cp node_modules/@pega/auth/lib/oauth-client/authDone.html dist/auth.html && shx cp node_modules/@pega/auth/lib/oauth-client/authDone.js dist/authDone.js",
"make-mashup-dir": "cd ./dist && shx mkdir -p constellation && cd ./constellation && shx mkdir -p prerequisite && shx mkdir -p assets && cd ./assets && shx mkdir -p icons",
"build-angularsdk": "shx rm -rf ./dist && ng build angular-sdk-components && npm run copy-index && npm run make-mashup-dir",
"build-angular-sdk-library": "ng build angular-sdk-library && node scripts/copy-map.js",
Expand Down Expand Up @@ -69,6 +69,7 @@
"@angular/router": "^15.2.8",
"@mdi/angular-material": "^5.0.45",
"@mdi/svg": "^5.0.45",
"@pega/auth": "^0.1.2",
"@pega/constellationjs": "SDK-8.8.3",
"core-js": "^2.6.12",
"dayjs": "^1.10.5",
Expand Down
72 changes: 0 additions & 72 deletions packages/angular-sdk-components/src/auth.html

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { MatListModule } from '@angular/material/list';
import { interval } from 'rxjs';
import { AngularPConnectService } from '../../../_bridge/angular-pconnect';
import { ProgressSpinnerService } from '../../../_messages/progress-spinner.service';
import { AuthService } from '../../../_services/auth.service';
import { logout } from '@pega/auth/lib/sdk-auth-manager';
import { Utils } from '../../../_helpers/utils';

declare const window: any;
Expand Down Expand Up @@ -53,28 +53,31 @@ export class NavbarComponent implements OnInit {
private angularPConnect: AngularPConnectService,
private chRef: ChangeDetectorRef,
private psService: ProgressSpinnerService,
private aService: AuthService,
private ngZone: NgZone,
private utils: Utils
) {}

ngOnInit(): void {
if (!this.PCore$) {
this.PCore$ = window.PCore;
}

// First thing in initialization is registering and subscribing to the AngularPConnect service
this.angularPConnectData = this.angularPConnect.registerAndSubscribeComponent(this, this.onStateChange);

this.navIcon$ = this.utils.getSDKStaticContentUrl().concat('assets/pzpega-logo-mark.svg');

// this is a dummy "get", because right now images are in http and the main screen is https
// so the images don't load automatically. This call, makes an initial hit that allows the
// rest of the images to show up
this.loadImage(this.navIcon$);

this.initComponent();
this.localizedVal = this.PCore$.getLocaleUtils().getLocaleValue;
// Need to make sure sdk-config is loaded (relying on utils class was insufficient)
this.utils.checkConfig().then( () => {
if (!this.PCore$) {
this.PCore$ = window.PCore;
}

// First thing in initialization is registering and subscribing to the AngularPConnect service
this.angularPConnectData = this.angularPConnect.registerAndSubscribeComponent(this, this.onStateChange);

this.navIcon$ = this.utils.getSDKStaticContentUrl().concat('assets/pzpega-logo-mark.svg');

// this is a dummy "get", because right now images are in http and the main screen is https
// so the images don't load automatically. This call, makes an initial hit that allows the
// rest of the images to show up
this.loadImage(this.navIcon$);

this.initComponent();
this.localizedVal = this.PCore$.getLocaleUtils().getLocaleValue;

});
}

// ngOnDestroy
Expand Down Expand Up @@ -169,7 +172,7 @@ export class NavbarComponent implements OnInit {
}

navPanelLogoutClick() {
this.aService.logout().then(() => {
logout().then(() => {
// Reload the page to kick off the login
window.location.reload();
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { MatIconModule } from '@angular/material/icon';
import { MatToolbarModule } from '@angular/material/toolbar';
import { AngularPConnectService } from '../../../_bridge/angular-pconnect';
import { ProgressSpinnerService } from '../../../_messages/progress-spinner.service';
import { AuthService } from '../../../_services/auth.service';
import { logout } from '@pega/auth/lib/sdk-auth-manager';
import { Utils } from '../../../_helpers/utils';
import { CommonModule } from '@angular/common';
import { MatButtonToggleModule } from '@angular/material/button-toggle';
Expand Down Expand Up @@ -49,30 +49,31 @@ export class WssNavBarComponent {
navIcon$: string;

constructor(
private utils: Utils,
private angularPConnect: AngularPConnectService,
private cdRef: ChangeDetectorRef,
private psService: ProgressSpinnerService,
private aService: AuthService,
private ngZone: NgZone,
private utils: Utils
private ngZone: NgZone
) {}

ngOnInit(): void {
if (!this.PCore$) {
this.PCore$ = window.PCore;
}

// First thing in initialization is registering and subscribing to the AngularPConnect service
this.angularPConnectData = this.angularPConnect.registerAndSubscribeComponent(this, this.onStateChange);

this.navIcon$ = this.utils.getSDKStaticContentUrl().concat('assets/pzpega-logo-mark.svg');

// this is a dummy "get", because right now images are in http and the main screen is https
// so the images don't load automatically. This call, makes an initial hit that allows the
// rest of the images to show up
this.loadImage(this.navIcon$);

this.initComponent();
this.utils.checkConfig().then(() => {
if (!this.PCore$) {
this.PCore$ = window.PCore;
}

// First thing in initialization is registering and subscribing to the AngularPConnect service
this.angularPConnectData = this.angularPConnect.registerAndSubscribeComponent(this, this.onStateChange);

this.navIcon$ = this.utils.getSDKStaticContentUrl().concat('assets/pzpega-logo-mark.svg');

// this is a dummy "get", because right now images are in http and the main screen is https
// so the images don't load automatically. This call, makes an initial hit that allows the
// rest of the images to show up
this.loadImage(this.navIcon$);

this.initComponent();
});
}

// ngOnDestroy
Expand Down Expand Up @@ -166,7 +167,7 @@ export class WssNavBarComponent {
}

navPanelLogoutClick() {
this.aService.logout().then(() => {
logout().then(() => {
// Reload the page to kick off the login
window.location.reload();
});
Expand Down
Loading