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

Exclude wrong version of angular plugins by checking entrypoint content #104

Merged

Conversation

1000TurquoisePogs
Copy link
Member

According to zowe/zlux-app-server#308 you can state what the location of your primary JS file is for loading.
Angular in particular uses this, and we need it to determine whether an installed plugin is appropriate for the desktop that is being loaded (which is detected by query parameters like ?use-v2-desktop=1)

This should be tested by having an angular plugin which does not use the new features of PR 308, having another which does, and testing with/without "?use-v2-desktop=1" in the URL of the desktop.
You should see that depending upon whether a plugin has or does not have v2 or v3 angular content, it will be permitted or omitted from visibility in the desktop.

Copy link
Member

@DivergentEuropeans DivergentEuropeans left a comment

Choose a reason for hiding this comment

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

This looks alright, but may need to change from:
zowe/zlux-app-manager#614 (review)
zowe/zlux-app-server#316 (review)

const searchParams = new URLSearchParams(window.location.search);
const useV2Desktop = searchParams.has("use-v2-desktop") && (searchParams.get("use-v2-desktop") == '1');
let validPlugins = allPlugins.filter((plugin) => {
if (plugin.type != 'application') {
Copy link
Member

Choose a reason for hiding this comment

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

should be plugin?.type if parsePluginDefinitions(result) method returns an array that has undefined values

Copy link
Member

Choose a reason for hiding this comment

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

preferably with an error log in case plugin response text could not be parsed (may be done already upstream in PluginManager)

Copy link
Member Author

Choose a reason for hiding this comment

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

if you dont have a plugin type, you'll fail startup.

1000TurquoisePogs and others added 4 commits August 25, 2024 20:34
Signed-off-by: 1000TurquoisePogs <[email protected]>
Signed-off-by: 1000TurquoisePogs <[email protected]>
Signed-off-by: 1000TurquoisePogs <[email protected]>
Implement lookup from PR 308 of zlux-app-server
@pull-request-size pull-request-size bot added size/M and removed size/S labels Aug 28, 2024
@DivergentEuropeans DivergentEuropeans merged commit 49207af into v3.x/staging Aug 28, 2024
4 of 5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Closed
Development

Successfully merging this pull request may close these issues.

2 participants