Skip to content

Commit

Permalink
Zowe Suite v1.22.0
Browse files Browse the repository at this point in the history
  • Loading branch information
zowe-robot authored Apr 14, 2021
2 parents 65759c2 + 8e91b80 commit 5a680ab
Show file tree
Hide file tree
Showing 18 changed files with 1,134 additions and 907 deletions.
35 changes: 35 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<!-- Thank you for submitting a PR to Zowe! To help us understand, test, and give feedback on your code, please fill in the details below. -->

## Proposed changes
<!-- Describe the big picture of your changes here to communicate to the maintainers why we should accept this pull request. If it fixes a bug or resolves a feature request, be sure to link to that issue. -->

This PR addresses Issue: [*Link to Github issue within https://github.com/zowe/zlux/issues* if any]

This PR depends upon the following PRs:

## Type of change
Please delete options that are not relevant.
- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Change in a documentation
- [ ] Refactor the code
- [ ] Chore, repository cleanup, updates the dependencies.
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)

## PR Checklist
Please delete options that are not relevant.
- [ ] If the changes in this PR are meant for the next release / mainline, this PR targets the "staging" branch.
- [ ] My code follows the style guidelines of this project (see: [Contributing guideline](https://github.com/zowe/zlux/blob/master/CONTRIBUTING.md))
- [ ] I have commented my code, particularly in hard-to-understand areas
- [ ] I have made corresponding changes to the documentation
- [ ] New and existing unit tests pass locally with my changes
- [ ] video or image is included if visual changes are made
- [ ] Relevant update to CHANGELOG.md
- [ ] My changes generate no new warnings
- [ ] I have added tests that prove my fix is effective or that my feature works, or describe a test method below

## Testing
<!-- Describe how this code should be tested. I've you've added an automated or unit test, then describe how to run it. Otherwise, describe how you have tested it and how others should test it. -->

## Further comments
<!-- If this is a relatively large or complex change, kick off the discussion by explaining why you chose the solution you did and what alternatives you considered, or if there are follow-up tasks and TODOs etc... -->
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@

All notable changes to the Zlux App Manager will be documented in this file.

## `1.21.0`

- Adds a global "environment" object in ZoweZLUX which allows for retreiving select environment properties from the zowe instance for conditional decision-making
- Desktop uses the new environment object to determine whether or not to contact ZSS through app-server or through apiml depending on if zss is found on apiml

## `1.18.0`

- Enhanced standalone/single app mode such that Desktop actions (Notifications, right click context menu, etc.) are now available
Expand Down
1,020 changes: 564 additions & 456 deletions bootstrap/package-lock.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion bootstrap/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"ts-loader": "~4.4.2",
"tslint": "~5.10.0",
"typescript": "~2.9.0",
"webpack": "~4.41.0",
"webpack": "~4.46.0",
"webpack-cli": "^3.3.12"
},
"dependencies": {
Expand Down
2 changes: 2 additions & 0 deletions bootstrap/src/bootstrap/dsm-resources.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import { PluginManager } from 'zlux-base/plugin-manager/plugin-manager'
import { DsmUri } from '../uri/dsm-uri'
import { Dispatcher } from 'zlux-base/dispatcher/dispatcher'
import { Environment } from 'zlux-base/environment/environment'
import { Logger } from '../../../../zlux-shared/src/logging/logger'
import { Registry } from 'zlux-base/registry/registry'
import { ZoweNotificationManager } from 'zlux-base/notification-manager/notification-manager'
Expand All @@ -38,6 +39,7 @@ fetch('/ZLUX/plugins/org.zowe.zlux.bootstrap/web/assets/i18n/log/messages_en.jso

export class DSMResources {
static pluginManager = PluginManager
static environment:Environment = new Environment();
static uriBroker:ZLUX.UriBroker = new DsmUri();
static dispatcher:Dispatcher = new Dispatcher(bootstrapLogger);
static logger:Logger = logger;
Expand Down
6 changes: 5 additions & 1 deletion bootstrap/src/bootstrap/rocket-mvd-resources.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import { PluginManager } from 'zlux-base/plugin-manager/plugin-manager'
import { MvdUri } from '../uri/mvd-uri'
import { Dispatcher } from 'zlux-base/dispatcher/dispatcher'
import { Environment } from 'zlux-base/environment/environment'
import { Logger } from '../../../../zlux-shared/src/logging/logger'
import { Registry } from 'zlux-base/registry/registry'
import { ZoweNotificationManager } from 'zlux-base/notification-manager/notification-manager'
Expand All @@ -27,6 +28,8 @@ window.COM_RS_COMMON_LOGGER = logger;
// component logger
export var bootstrapLogger : ZLUX.ComponentLogger = logger.makeComponentLogger("_zsf.bootstrap");

let environment = new Environment();

fetch('/ZLUX/plugins/org.zowe.zlux.bootstrap/web/assets/i18n/log/messages_en.json')
.then((response) => {
return response.json();
Expand All @@ -43,7 +46,8 @@ fetch('/ZLUX/plugins/org.zowe.zlux.bootstrap/web/assets/i18n/log/messages_en.jso
// TODO: Possible duplicate in index.d.ts in zlux-platform ???
export class ZoweZLUXResources {
static pluginManager = PluginManager
static uriBroker:ZLUX.UriBroker = new MvdUri();
static environment:Environment = environment
static uriBroker:ZLUX.UriBroker = new MvdUri(environment);
static dispatcher:Dispatcher = new Dispatcher(bootstrapLogger);
static logger:Logger = logger;
static registry:ZLUX.Registry = new Registry();
Expand Down
4 changes: 4 additions & 0 deletions bootstrap/src/uri/dsm-uri.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,10 @@ export class DsmUri implements ZLUX.UriBroker {
return "";
}

agentRootUri(_uri: string): string {
return "";
}

serverRootUri(_uri: string): string {
return "";
}
Expand Down
69 changes: 63 additions & 6 deletions bootstrap/src/uri/mvd-uri.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,46 @@
*/

import { PluginManager } from 'zlux-base/plugin-manager/plugin-manager'
import { Environment } from 'zlux-base/environment/environment'

const uri_prefix = window.location.pathname.split('ZLUX/plugins/')[0];
const proxy_mode = (uri_prefix !== '/') ? true : false; // Tells whether we're behind API layer (true) or not (false)

export class MvdUri implements ZLUX.UriBroker {
private agentPrefix: string;

constructor(private environment:Environment) {
if (proxy_mode) {
//its ok that this call is async, we can proxy through app-server while we wait to determine
this.fetchAgentPrefix().then(function(){});
} else {
this.agentPrefix = uri_prefix;
}
}

fetchAgentPrefix(): Promise<string> {
return new Promise((resolve)=> {
if (proxy_mode && !this.agentPrefix) {
this.environment.getAgentConfig().then((agentConfig)=> {
if (agentConfig) {
if (agentConfig.mediationLayer && agentConfig.mediationLayer.enabled && agentConfig.mediationLayer.serviceName) {
let version = agentConfig.mediationLayer.serviceVersion || 'v1';
let name = agentConfig.mediationLayer.serviceName;
this.agentPrefix = `/api/${version}/${name}/`
}
}
resolve(this.agentPrefix);
}).catch((err)=> {
if (err.status!=401) {
//401 can be a timing issue where we call this before login, but other errors should result in fallback to zlux proxying
this.agentPrefix = uri_prefix;
}
resolve(this.agentPrefix);
});
} else {resolve(this.agentPrefix);}
});
}

rasUri(uri: string): string {
return `${this.serverRootUri(`ras/${uri}`)}`;
}
Expand Down Expand Up @@ -57,17 +92,17 @@ export class MvdUri implements ZLUX.UriBroker {
let routeParam = route;
let absPathParam = encodeURIComponent(absPath).replace(/\%2F/gi,'/');

return `${this.serverRootUri(`unixfile/${routeParam}/${absPathParam}${params}`)}`.replace(/(\/+)/g,'/');
return `${this.agentRootUri(`unixfile/${routeParam}/${absPathParam}${params}`)}`.replace(/(\/+)/g,'/');
}
omvsSegmentUri(): string {
return `${this.serverRootUri('omvs')}`;
return `${this.agentRootUri('omvs')}`;
}
datasetContentsUri(dsn: string): string {
return `${this.serverRootUri(`datasetContents/${encodeURIComponent(dsn).replace(/\%2F/gi,'/')}`)}`;
return `${this.agentRootUri(`datasetContents/${encodeURIComponent(dsn).replace(/\%2F/gi,'/')}`)}`;
}
VSAMdatasetContentsUri(dsn: string, closeAfter?: boolean): string {
let closeAfterParam = closeAfter ? '?closeAfter=' + closeAfter : '';
return `${this.serverRootUri(`VSAMdatasetContents/${dsn}${closeAfterParam}`)}`;
return `${this.agentRootUri(`VSAMdatasetContents/${dsn}${closeAfterParam}`)}`;
}
datasetMetadataHlqUri(updateCache?: boolean | undefined, types?: string | undefined, workAreaSize?: number | undefined, resumeName?: string | undefined, resumeCatalogName?: string | undefined): string {
let updateCacheParam = updateCache ? 'updateCache=' + updateCache : '';
Expand All @@ -79,7 +114,7 @@ export class MvdUri implements ZLUX.UriBroker {
let paramArray = [updateCacheParam, typesParam, workAreaSizeParam, resumeNamesParam, resumeCatalogNameParam];
let params = this.createParamURL(paramArray);

return `${this.serverRootUri(`datasetMetadata/hlq${params}`)}`;
return `${this.agentRootUri(`datasetMetadata/hlq${params}`)}`;
}
datasetMetadataUri(dsn: string, detail?: string | undefined, types?: string | undefined, listMembers?: boolean | undefined, workAreaSize?: number | undefined, includeMigrated?: boolean | undefined, includeUnprintable?: boolean | undefined, resumeName?: string | undefined, resumeCatalogName?: string | undefined, addQualifiers?: string | undefined): string {
let detailParam = detail ? 'detail=' + detail : '';
Expand All @@ -94,7 +129,7 @@ export class MvdUri implements ZLUX.UriBroker {

let paramArray = [detailParam, typesParam, workAreaSizeParam, listMembersParam, includeMigratedParam, includeUnprintableParam, resumeNameParam, resumeCatalogNameParam, addQualifiersParam];
let params = this.createParamURL(paramArray);
return `${this.serverRootUri(`datasetMetadata/name/${dsn}${params}`)}`;
return `${this.agentRootUri(`datasetMetadata/name/${dsn}${params}`)}`;
}
pluginRootUri(pluginDefinition: ZLUX.Plugin): string {
let identifier = (pluginDefinition as any).identifier || pluginDefinition.getIdentifier();
Expand All @@ -111,6 +146,28 @@ export class MvdUri implements ZLUX.UriBroker {
}
}

agentRootUri(uri: string): string {
if (!this.agentPrefix) {
this.fetchAgentPrefix();
//async, therefore return with server proxy until answer known
return this.serverRootUri(uri);
} else {
return `${this.agentPrefix}${uri}`;
}
}

agentRootUriAsync(uri: string): Promise<string> {
return new Promise((resolve) => {
if (!this.agentPrefix) {
this.fetchAgentPrefix().then((prefix:string)=> {
resolve(`${prefix}${uri}`);
});
} else {
resolve(`${this.agentPrefix}${uri}`);
}
});
}

serverRootUri(uri: string): string {
return `${uri_prefix}${uri}`;
}
Expand Down
44 changes: 18 additions & 26 deletions system-apps/admin-notification-app/webClient/package-lock.json

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

6 changes: 3 additions & 3 deletions system-apps/app-generator/nodeServer/package-lock.json

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

3 changes: 1 addition & 2 deletions system-apps/app-generator/nodeServer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@
"description": "Back-end for App Generator",
"scripts": {
"build": "rm -rf ../lib && tsc && npm run copy:modules",
"copy:modules": "node ./scripts/copy.js",
"test": "echo \"Error: no test specified\" && exit 1"
"copy:modules": "node ./scripts/copy.js"
},
"author": "",
"license": "EPL-2.0",
Expand Down
2 changes: 1 addition & 1 deletion system-apps/app-generator/webClient/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
"ng": "ng",
"start": "ng serve",
"build": "ng build --prod && gzipper --brotli --output-file-format [filename].[ext].[compressExt] -e png --verbose ../web",
"test": "ng test",
"test:once": "ng test --watch=false",
"test:dev": "ng test",
"lint": "ng lint",
"e2e": "ng e2e"
},
Expand Down
24 changes: 12 additions & 12 deletions system-apps/app-prop-viewer/webClient/package-lock.json

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

Loading

0 comments on commit 5a680ab

Please sign in to comment.