-
Notifications
You must be signed in to change notification settings - Fork 106
Preventing Same-DASD & Same-DSN Drag-and-Drop #3827
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
Open
ATorrise
wants to merge
15
commits into
main
Choose a base branch
from
fix/copy-same-lpar
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 5 commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
c0e9516
fix
ATorrise 07a1253
changelog
ATorrise eec9d16
moving changes to pass tests
ATorrise 9ce37bf
Update packages/zowe-explorer/CHANGELOG.md
ATorrise eb64d62
Update CHANGELOG.md
ATorrise 33ed2ee
Merge remote-tracking branch 'origin/main' into fix/copy-same-lpar
ATorrise 812fb2f
updated shared utils
ATorrise fe604b0
updated functioning logic
ATorrise f0cc3e3
logic
ATorrise 3d6aff3
pds an ds logic fix
ATorrise 30621b3
implementation working for uss and ds :)
ATorrise f5791f5
tests
ATorrise 9332790
changes to isSamePhysicalDataset that might help w testing
ATorrise 68ad91d
testing
ATorrise 168fd26
fixed sharedutils.unit.test
ATorrise File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -189,9 +189,8 @@ export class DatasetTree extends ZoweTreeProvider<IZoweDatasetTreeNode> implemen | |
| try { | ||
| const encodingInfo = await sourceNode.getEncoding(); | ||
| // If the encoding is binary, we need to force upload it as binary | ||
| const queryString = `forceUpload=true${ | ||
| encodingInfo?.kind === "binary" ? "&encoding=binary" : encodingInfo?.kind === "other" ? "&encoding=" + encodingInfo?.codepage : "" | ||
| }`; | ||
| const queryString = `forceUpload=true${encodingInfo?.kind === "binary" ? "&encoding=binary" : encodingInfo?.kind === "other" ? "&encoding=" + encodingInfo?.codepage : "" | ||
| }`; | ||
| await DatasetFSProvider.instance.writeFile( | ||
| destUri.with({ | ||
| query: queryString, | ||
|
|
@@ -227,6 +226,7 @@ export class DatasetTree extends ZoweTreeProvider<IZoweDatasetTreeNode> implemen | |
| } | ||
|
|
||
| let target = targetNode; | ||
|
|
||
| if (target) { | ||
| for (const item of droppedItems.value) { | ||
| const node = this.draggedNodes[item.uri.path]; | ||
|
|
@@ -252,6 +252,20 @@ export class DatasetTree extends ZoweTreeProvider<IZoweDatasetTreeNode> implemen | |
| Gui.errorMessage(vscode.l10n.t(message)); | ||
| return; | ||
| } | ||
|
|
||
| // If moving to the same system/lpar but different profile, stop the drag entirely | ||
| const targetSys = target?.getProfile?.().profile.host; | ||
| const srcNode = this.draggedNodes[item.uri.path]; | ||
| const sourceSys = srcNode?.getProfile?.().profile.host; | ||
|
|
||
| if (targetSys == sourceSys) { | ||
| await Gui.errorMessage( | ||
| vscode.l10n.t( | ||
| "Cannot move: the source and target are the same dataset on the same system. You're viewing it under a different profile. Any changes you need to view with target profile can be seen via a refresh." | ||
|
||
| ) | ||
| ); | ||
| return; // stop the drop entirely | ||
| } | ||
| } | ||
| } | ||
|
|
||
|
|
@@ -1754,15 +1768,15 @@ export class DatasetTree extends ZoweTreeProvider<IZoweDatasetTreeNode> implemen | |
| // Adapt menus to user based on the node that was interacted with | ||
| const specifier = isSession | ||
| ? vscode.l10n.t({ | ||
| message: "all PDS members in {0}", | ||
| args: [node.label as string], | ||
| comment: ["Node label"], | ||
| }) | ||
| message: "all PDS members in {0}", | ||
| args: [node.label as string], | ||
| comment: ["Node label"], | ||
| }) | ||
| : vscode.l10n.t({ | ||
| message: "the PDS members in {0}", | ||
| args: [node.label as string], | ||
| comment: ["Node label"], | ||
| }); | ||
| message: "the PDS members in {0}", | ||
| args: [node.label as string], | ||
| comment: ["Node label"], | ||
| }); | ||
| const selection = await Gui.showQuickPick( | ||
| DatasetUtils.DATASET_SORT_OPTS.map((opt, i) => ({ | ||
| label: sortOpts.method === i ? `${opt} $(check)` : opt, | ||
|
|
@@ -1827,10 +1841,10 @@ export class DatasetTree extends ZoweTreeProvider<IZoweDatasetTreeNode> implemen | |
| node.filter = newFilter; | ||
| node.description = newFilter | ||
| ? vscode.l10n.t({ | ||
| message: "Filter: {0}", | ||
| args: [newFilter.value], | ||
| comment: ["Filter value"], | ||
| }) | ||
| message: "Filter: {0}", | ||
| args: [newFilter.value], | ||
| comment: ["Filter value"], | ||
| }) | ||
| : null; | ||
| this.nodeDataChanged(node); | ||
|
|
||
|
|
@@ -1891,15 +1905,15 @@ export class DatasetTree extends ZoweTreeProvider<IZoweDatasetTreeNode> implemen | |
| // Adapt menus to user based on the node that was interacted with | ||
| const specifier = isSession | ||
| ? vscode.l10n.t({ | ||
| message: "all PDS members in {0}", | ||
| args: [node.label as string], | ||
| comment: ["Node label"], | ||
| }) | ||
| message: "all PDS members in {0}", | ||
| args: [node.label as string], | ||
| comment: ["Node label"], | ||
| }) | ||
| : vscode.l10n.t({ | ||
| message: "the PDS members in {0}", | ||
| args: [node.label as string], | ||
| comment: ["Node label"], | ||
| }); | ||
| message: "the PDS members in {0}", | ||
| args: [node.label as string], | ||
| comment: ["Node label"], | ||
| }); | ||
| const clearFilter = isSession | ||
| ? `$(clear-all) ${vscode.l10n.t("Clear filter for profile")}` | ||
| : `$(clear-all) ${vscode.l10n.t("Clear filter for PDS")}`; | ||
|
|
||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.