diff --git a/CHANGELOG.md b/CHANGELOG.md index 310027ca..3ae1570b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ - Bugfix: Added a few rules for JCL syntax highlighter - Bugfix: Set USS path to correct directory, when opening the directory or file in new browser tab respectively - Added the feature to copy the line content and copy URL link to open a file at a specific line +- Bugfix: Getting 400 BAD REQUEST in browser when opening the file or dataset in a new browser tab ## `3.0.0` diff --git a/webClient/package-lock.json b/webClient/package-lock.json index eb6c8342..c5bc2bb9 100644 --- a/webClient/package-lock.json +++ b/webClient/package-lock.json @@ -36,7 +36,7 @@ "@angular/router": "~12.0.0", "@types/node": "~8.10.59", "@zlux/widgets": "git+https://github.com/zowe/zlux-widgets.git#feature/upgrade-angular", - "@zowe/zlux-angular-file-tree": "1.2.0-RC2", + "@zowe/zlux-angular-file-tree": "1.3.0", "angular2-template-loader": "~0.6.2", "codelyzer": "~5.1.0", "compression-webpack-plugin": "~6.1.1", @@ -3765,9 +3765,9 @@ } }, "node_modules/@zowe/zlux-angular-file-tree": { - "version": "1.2.0-RC2", - "resolved": "https://zowe.jfrog.io/zowe/api/npm/npm-release/@zowe/zlux-angular-file-tree/-/@zowe/zlux-angular-file-tree-1.2.0-RC2.tgz", - "integrity": "sha512-MlRxipAqPlmiZghXoeCIVFnIIzm7/gsGAiELEWZF9H52uM8muk38acn6vGcioJgxmbUPNRc0zi5zfRUJjLxAoA==", + "version": "1.3.0", + "resolved": "https://zowe.jfrog.io/zowe/api/npm/npm-release/@zowe/zlux-angular-file-tree/-/@zowe/zlux-angular-file-tree-1.3.0.tgz", + "integrity": "sha512-8RiiP29snju1hTdJ802e2sxTNU9UvoSlUzVu+c2qEosXU4vcyzahypLxj26JYczB2Gk72sUetQBkhNKR+yyqxw==", "dev": true, "dependencies": { "@angular/animations": "12.0.0", @@ -22928,9 +22928,9 @@ } }, "@zowe/zlux-angular-file-tree": { - "version": "1.2.0-RC2", - "resolved": "https://zowe.jfrog.io/zowe/api/npm/npm-release/@zowe/zlux-angular-file-tree/-/@zowe/zlux-angular-file-tree-1.2.0-RC2.tgz", - "integrity": "sha512-MlRxipAqPlmiZghXoeCIVFnIIzm7/gsGAiELEWZF9H52uM8muk38acn6vGcioJgxmbUPNRc0zi5zfRUJjLxAoA==", + "version": "1.3.0", + "resolved": "https://zowe.jfrog.io/zowe/api/npm/npm-release/@zowe/zlux-angular-file-tree/-/@zowe/zlux-angular-file-tree-1.3.0.tgz", + "integrity": "sha512-8RiiP29snju1hTdJ802e2sxTNU9UvoSlUzVu+c2qEosXU4vcyzahypLxj26JYczB2Gk72sUetQBkhNKR+yyqxw==", "dev": true, "requires": { "@angular/animations": "12.0.0", diff --git a/webClient/package.json b/webClient/package.json index c455ae68..162a99c5 100644 --- a/webClient/package.json +++ b/webClient/package.json @@ -35,7 +35,7 @@ "@angular/router": "~12.0.0", "@types/node": "~8.10.59", "@zlux/widgets": "git+https://github.com/zowe/zlux-widgets.git#feature/upgrade-angular", - "@zowe/zlux-angular-file-tree": "1.2.0-RC2", + "@zowe/zlux-angular-file-tree": "1.3.0", "angular2-template-loader": "~0.6.2", "codelyzer": "~5.1.0", "compression-webpack-plugin": "~6.1.1", diff --git a/webClient/src/app/editor/code-editor/monaco/monaco.component.ts b/webClient/src/app/editor/code-editor/monaco/monaco.component.ts index d19a474a..7cedaf12 100644 --- a/webClient/src/app/editor/code-editor/monaco/monaco.component.ts +++ b/webClient/src/app/editor/code-editor/monaco/monaco.component.ts @@ -257,10 +257,10 @@ export class MonacoComponent implements OnInit, OnChanges { let link = ''; if(activeFile.model.isDataset){ filePath = activeFile.model.path; - link = `${window.location.origin}${window.location.pathname}?pluginId=${this.pluginDefinition.getBasePlugin().getIdentifier()}:data:{"type":"openDataset","name":"${encodeURIComponent(filePath)}","lines":"${lines}","toggleTree":true}`; + link = `${window.location.origin}${window.location.pathname}?pluginId=${this.pluginDefinition.getBasePlugin().getIdentifier()}:data:${encodeURIComponent(`{"type":"openDataset","name":"${filePath}","lines":"${lines}","toggleTree":true}`)}`; } else { filePath = activeFile.model.path + "/" + activeFile.model.name; - link = `${window.location.origin}${window.location.pathname}?pluginId=${this.pluginDefinition.getBasePlugin().getIdentifier()}:data:{"type":"openFile","name":"${encodeURIComponent(filePath)}","lines":"${lines}","toggleTree":true}`; + link = `${window.location.origin}${window.location.pathname}?pluginId=${this.pluginDefinition.getBasePlugin().getIdentifier()}:data:${encodeURIComponent(`{"type":"openFile","name":"${filePath}","lines":"${lines}","toggleTree":true}`)}`; } navigator.clipboard.writeText(link).then(() => { this.log.debug("Permalink copied to clipboard"); diff --git a/webClient/src/app/editor/project-tree/project-tree.component.ts b/webClient/src/app/editor/project-tree/project-tree.component.ts index c8fd871c..926e6da0 100644 --- a/webClient/src/app/editor/project-tree/project-tree.component.ts +++ b/webClient/src/app/editor/project-tree/project-tree.component.ts @@ -246,11 +246,11 @@ export class ProjectTreeComponent { onOpenInNewTab($event: any){ if ($event.data === 'File'){ const baseURI = `${window.location.origin}${window.location.pathname}`; - const newWindow = window.open(`${baseURI}?pluginId=${this.pluginDefinition.getBasePlugin().getIdentifier()}:data:{"type":"openFile","name":"${encodeURIComponent($event.path)}","toggleTree":true}`, '_blank'); + const newWindow = window.open(`${baseURI}?pluginId=${this.pluginDefinition.getBasePlugin().getIdentifier()}:data:${encodeURIComponent(`{"type":"openFile","name":"${$event.path}","toggleTree":true}`)}`, '_blank'); newWindow.focus(); } else{ const baseURI = `${window.location.origin}${window.location.pathname}`; - const newWindow = window.open(`${baseURI}?pluginId=${this.pluginDefinition.getBasePlugin().getIdentifier()}:data:{"type":"openDataset","name":"${encodeURIComponent($event.data.path)}","toggleTree":true}`, '_blank'); + const newWindow = window.open(`${baseURI}?pluginId=${this.pluginDefinition.getBasePlugin().getIdentifier()}:data:${encodeURIComponent(`{"type":"openDataset","name":"${$event.data.path}","toggleTree":true}`)}`, '_blank'); newWindow.focus(); } }