Skip to content

Commit

Permalink
Merge pull request #315 from zowe/encodeURL
Browse files Browse the repository at this point in the history
encoding the data content in the URL
  • Loading branch information
1000TurquoisePogs authored Jan 6, 2023
2 parents 2261a04 + 864a1cf commit 8954c67
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 12 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`

Expand Down
14 changes: 7 additions & 7 deletions webClient/package-lock.json

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

2 changes: 1 addition & 1 deletion webClient/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
}
Expand Down

0 comments on commit 8954c67

Please sign in to comment.