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

New Desktop ID #614

Merged
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
3 changes: 2 additions & 1 deletion bootstrap/src/assets/i18n/log/messages_en.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
"ZWED5041I":"ectxt=",
"ZWED5042I":"dispatcher.invokeAction on context %s",
"ZWED5043I":"RESERVED: MVD standalone container requested with pluginId %s",
"ZWED5324I":"RESERVED: The requested Desktop version (%s) is in maintenance mode. To use the newest Desktop version instead, remove the query parameter 'use-v2-desktop'.",
1000TurquoisePogs marked this conversation as resolved.
Show resolved Hide resolved

"ZWED5000W":"RESERVED: Desktop attempted to change instanceId for iframe instance=%s, message=%s",
"ZWED5001W":"pluginWSUri not implemented yet!",
Expand Down Expand Up @@ -99,4 +100,4 @@
"ZWED5041E":"RESERVED: Plugin type is not present",
"ZWED5042E":"RESERVED: Plugin type is not a string",
"ZWED5043E":"RESERVED: %s is not a valid semantic version"
}
}
17 changes: 11 additions & 6 deletions bootstrap/src/bootstrap/bootstrap-manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
import { Plugin } from 'zlux-base/plugin-manager/plugin'
import { PluginManager } from 'zlux-base/plugin-manager/plugin-manager'
import { ZoweZLUXResources } from './rocket-mvd-resources'
import { DSMResources } from './dsm-resources'

export class BootstrapManager {
private static bootstrapPerformed = false;
Expand All @@ -22,11 +21,7 @@ export class BootstrapManager {
const uriBroker = window['GIZA_ENVIRONMENT'];
console.log("ZWED5004I - bootstrapGlobalResources standaloneContainerRequested flag value: ", standaloneContainerRequested);
console.log("ZWED5005I - bootstrapGlobalResources GIZA_ENVIRONMENT value: ", uriBroker);
if (standaloneContainerRequested && uriBroker && uriBroker.toUpperCase() === 'DSM') {
window.ZoweZLUX = DSMResources;
} else {
window.ZoweZLUX = ZoweZLUXResources;
}
window.ZoweZLUX = ZoweZLUXResources;
}

private static bootstrapDesktopPlugin(desktop: ZLUX.Plugin, injectionCallback: (plugin: ZLUX.Plugin) => Promise<void>) {
Expand Down Expand Up @@ -61,8 +56,18 @@ export class BootstrapManager {
console.log(`ZWED5007I - ${desktops.length} desktops available`);
console.log('ZWED5008I - desktops: ', desktops);

const searchParams = new URLSearchParams(window.location.search);
const v2Desktop = desktops.filter((desktop)=> { desktop.getIdentifier() == "org.zowe.zlux.ng2desktop" });
const v3Desktop = desktops.filter((desktop)=> { desktop.getIdentifier() == "org.zowe.zlux.ivydesktop" });
const useV2Desktop = v2Desktop.length == 1 && searchParams.has("use-v2-desktop") && (searchParams.get("use-v2-desktop") == '1');

if (desktops.length == 0) {
console.error("ZWED5012E - No desktops available to bootstrap.");
} else if (useV2Desktop) {
console.error("ZWED5324I - The requested Desktop version (V2) is in maintenance mode. To use the newest Desktop version instead, remove the query parameter 'use-v2-desktop'.");
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i should leave a code comment here: i want this to be colored, but its not really an error.
also change to console.warn

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So like we touched about on Friday's call, there's utility functions for this @1000TurquoisePogs. The window.location.search stuff is not important enough for duplication but here it is if you want better organization:
getAllApp2AppArgsFromURL( ) in
zlux-app-manager\virtual-desktop\src\app\start-url-manager\start-url-manager.service.ts

What is relatively important is there's a registration process for stuff like this that should be followed, see:
zlux-app-manager\bootstrap\src\main.ts
processApp2AppArgs( )

URL query params get assigned values in window global object and then those get checked for future reference

BootstrapManager.bootstrapDesktopPlugin(v2Desktop[0], injectionCallback);
} else if (v3Desktop.length == 1) {
BootstrapManager.bootstrapDesktopPlugin(v3Desktop[0], injectionCallback);
} else {
BootstrapManager.bootstrapDesktopPlugin(desktops[0], injectionCallback);
}
Expand Down
60 changes: 0 additions & 60 deletions bootstrap/src/bootstrap/dsm-resources.ts

This file was deleted.

1 change: 0 additions & 1 deletion bootstrap/src/bootstrap/rocket-mvd-resources.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ import { Logger } from '../../../../zlux-shared/src/logging/logger'
import { Registry } from 'zlux-base/registry/registry'
import { ZoweNotificationManager } from 'zlux-base/notification-manager/notification-manager'
import { SimpleGlobalization } from '../i18n/simple-globalization'
// import { VirtualDesktopAdapter } from '../abstract-virtual-desktop/virtual-desktop-adapter'

// This is the core logger
let logger = new Logger();
Expand Down
187 changes: 0 additions & 187 deletions bootstrap/src/uri/dsm-uri.ts

This file was deleted.

2 changes: 1 addition & 1 deletion virtual-desktop/pluginDefinition.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"identifier": "org.zowe.zlux.ng2desktop",
"identifier": "org.zowe.zlux.ivydesktop",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is a lot of places we now need to change this:
zlux-app-manager\virtual-desktop\src\app\shared\logger.ts
zlux-app-manager\virtual-desktop\src\app\start-url-manager\start-url-manager.service.ts
zlux-app-manager\virtual-desktop\src\app\window-manager\mvd-window-manager\personalization-panel\personalization-panel.component.ts possibly?
probably others

so do a text search & see if it makes sense to change there too

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

logger & start-url-manager = done
others = no, they seem to have different ids. "org.zowe.zlux.ng2desktop.settings" is not "org.zowe.zlux.ng2desktop". Changing it could have consequences like breaking saved settings.
That may be desirable at some point in the future but I don't see the case for it now.

"apiVersion": "2.0.0",
"pluginVersion": "0.0.0-zlux.version.replacement",
"pluginType": "desktop",
Expand Down