Skip to content

Commit

Permalink
Merge branch 'v3.x/staging' into enhancement/cdk
Browse files Browse the repository at this point in the history
  • Loading branch information
timgerstel authored Nov 19, 2024
2 parents 184f8c2 + 02ad097 commit a39a242
Show file tree
Hide file tree
Showing 5 changed files with 85 additions and 64 deletions.
21 changes: 20 additions & 1 deletion virtual-desktop/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 4 additions & 3 deletions virtual-desktop/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
"@angular/platform-browser-dynamic": "~18.0.0",
"@angular/router": "~18.0.0",
"@popperjs/core": "^2.11.8",
"@zlux/widgets": "github:zowe/zlux-widgets#v3.x/master",
"angular-l10n": "^16.0.0",
"bootstrap": "~5.3.2",
"core-js": "~3.38.1",
Expand All @@ -35,7 +36,7 @@
"ngx-file-drop": "^16.0.0",
"ngx-i18nsupport": "~0.17.1",
"popper.js": "~1.14.7",
"requirejs": "~2.3.6",
"requirejs": "~2.3.7",
"rxjs": "~7.8.1",
"tslib": "^2.6.3",
"typeface-roboto": "~1.1.13",
Expand All @@ -53,5 +54,5 @@
"tslint": "~6.1.0",
"tslint-react": "~5.0.0",
"typescript": "~5.4.5"
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { FormsModule } from '@angular/forms';
// import { ZluxPopupManagerModule } from '@zlux/widgets';
import { ZluxPopupManagerModule } from '@zlux/widgets';
import { LoginComponent } from './login/login.component';
import { AuthenticationManager } from './authentication-manager.service';
import { StartURLManagerModule } from '../start-url-manager';
Expand All @@ -25,7 +25,7 @@ import { provideHttpClient } from '@angular/common/http';
imports: [
CommonModule,
FormsModule,
// ZluxPopupManagerModule,
ZluxPopupManagerModule,
StartURLManagerModule,
],
declarations: [
Expand Down
114 changes: 57 additions & 57 deletions virtual-desktop/src/app/authentication-manager/idleWarn.service.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
// import moment from 'moment';
import moment from 'moment';
import { Injectable } from '@angular/core';
// import { ZluxPopupManagerService, ZluxErrorSeverity } from '@zlux/widgets';
import { ZluxPopupManagerService, ZluxErrorSeverity } from '@zlux/widgets';
import { L10nTranslationService } from 'angular-l10n';
import { BaseLogger } from 'virtual-desktop-logger';
// import { Subscription } from 'rxjs';
import { Subscription } from 'rxjs';
import { StorageService } from './storage.service';

@Injectable()
Expand All @@ -13,25 +13,25 @@ export class IdleWarnService {
private readonly logger: ZLUX.ComponentLogger = BaseLogger;

constructor(
// private popupManager: ZluxPopupManagerService,
private popupManager: ZluxPopupManagerService,
public translation: L10nTranslationService,
private storageService: StorageService
) {
}

public createRetryErrorReport(renewSession: any, isIdle: any) {
this.removeErrorReport();
// this.report = this.popupManager.createErrorReport(
// ZluxErrorSeverity.WARNING,
// this.translation.translate('Session Renewal Error'),
// this.translation.translate('Session could not be renewed. Logout will occur unless renewed. Click here to retry.'),
// {
// blocking: false,
// buttons: [this.translation.translate('Retry'), this.translation.translate('Dismiss')]
// }
// );
this.report = this.popupManager.createErrorReport(
ZluxErrorSeverity.WARNING,
this.translation.translate('Session Renewal Error'),
this.translation.translate('Session could not be renewed. Logout will occur unless renewed. Click here to retry.'),
{
blocking: false,
buttons: [this.translation.translate('Retry'), this.translation.translate('Dismiss')]
}
);

// this.report.subscription = new Subscription();
this.report.subscription = new Subscription();
this.onUserActionSubscribe(renewSession,'Retry');
this.onActivitySubscribe(renewSession, isIdle);
}
Expand All @@ -48,51 +48,51 @@ export class IdleWarnService {

public createContinueErrorReport(renewSession: any, isIdle: any, expirationInMS: number, desktopSize: any) {
this.removeErrorReport();
// let popupStyle;
let popupStyle;

// /* According to the size of the desktop, we move the expiration prompt to align with the app bar */
// switch (desktopSize) {
// case 3: {
// popupStyle = {
// 'margin-bottom': '70px',
// 'margin-right': '-5px'
// };
// break;
// }
// case 1: {
// popupStyle = {
// 'margin-bottom': '15px',
// 'margin-right': '-10px'
// };
// break;
// }
// default: {
// popupStyle = {
// 'margin-bottom': '35px',
// 'margin-right': '-5px'
// };
// break;
// }
// }
/* According to the size of the desktop, we move the expiration prompt to align with the app bar */
switch (desktopSize) {
case 3: {
popupStyle = {
'margin-bottom': '70px',
'margin-right': '-5px'
};
break;
}
case 1: {
popupStyle = {
'margin-bottom': '15px',
'margin-right': '-10px'
};
break;
}
default: {
popupStyle = {
'margin-bottom': '35px',
'margin-right': '-5px'
};
break;
}
}

// this.report = this.popupManager.createErrorReport(
// ZluxErrorSeverity.WARNING,
// this.translation.translate('Session Expiring Soon'),
// //TODO: Add translation
// //this.translation.translate('You will be logged out at ', { expirationInMS: moment().add(expirationInMS/1000, 'seconds').format('LT') }),
// this.translation.translate('You will be logged out at ' + moment().add(expirationInMS/1000, 'seconds').format('LT')),
// {
// blocking: false,
// buttons: [this.translation.translate('Continue session')],
// timestamp: false,
// theme: "dark",
// style: popupStyle,
// callToAction: true
// });
this.report = this.popupManager.createErrorReport(
ZluxErrorSeverity.WARNING,
this.translation.translate('Session Expiring Soon'),
//TODO: Add translation
//this.translation.translate('You will be logged out at ', { expirationInMS: moment().add(expirationInMS/1000, 'seconds').format('LT') }),
this.translation.translate('You will be logged out at ' + moment().add(expirationInMS/1000, 'seconds').format('LT')),
{
blocking: false,
buttons: [this.translation.translate('Continue session')],
timestamp: false,
theme: "dark",
style: popupStyle,
callToAction: true
});

// this.report.subscription = new Subscription();
// this.onUserActionSubscribe(renewSession, 'Continue session');
// this.onActivitySubscribe(renewSession, isIdle);
this.report.subscription = new Subscription();
this.onUserActionSubscribe(renewSession, 'Continue session');
this.onActivitySubscribe(renewSession, isIdle);
}


Expand All @@ -110,7 +110,7 @@ export class IdleWarnService {

removeErrorReport() {
if (this.report) {
// this.popupManager.removeReport(this.report.id);
this.popupManager.removeReport(this.report.id);
this.report.subscription.unsubscribe();
this.report = undefined;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,8 @@ export class Angular2PluginFactory extends PluginFactory {
(plugin: MvdNativeAngularPlugin) => {
this.translationLoaderService.getTranslationProviders(pluginDefinition.getBasePlugin()).then(providers => {
resolve(new CompiledPlugin(plugin.pluginComponent, plugin.pluginModule, providers));
});
},
(failure: any) => reject(failure));
});
});
}
Expand Down

0 comments on commit a39a242

Please sign in to comment.