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

encoding the data content in the URL #315

Merged
merged 3 commits into from
Jan 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
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
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