Skip to content

Commit

Permalink
Merge branch 'bugfix/IJMP-1977-Delete-disabled-when-multiple-USS-entr…
Browse files Browse the repository at this point in the history
…ies-are-selected' into 'release/v2.0.2'

IJMP-1977-Delete-disabled-when-multiple-USS-entries-are-selected

See merge request ijmp/for-mainframe!613
  • Loading branch information
ATsikhamirau committed Nov 20, 2024
2 parents 6050e19 + 3dbd7c3 commit 33f2341
Showing 1 changed file with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -593,12 +593,14 @@ class FileExplorerView(
return true
val nodeAndFilePairs = optimizeDeletion(selected)
return if (nodeAndFilePairs.isNotEmpty()) {
// Enable deletion for the following selection only:
// 1) nodes selection have identical attribute types only, e.g. RemoteUssAttributes, RemoteDatasetAttributes
// 2) Nodes selection does not contain different nature, e.g. UssDirNode and DsMaskNode
// 3) nodes selection is accepted by delete operation
// Nested nodes selection, e.g. Directory + SubDirectory + SubDirectory file is handled by optimizeDeletion
val filesAttrTypes = nodeAndFilePairs.mapNotNull { it.first.attributes }.map { it::class.simpleName }.distinct()
var checkForUss = true
if (filesAttrTypes.any { it == "RemoteUssAttributes" })
checkForUss = nodeAndFilePairs.map { it.first.node::class.simpleName }.distinct().size == 1
filesAttrTypes.size == 1 && wsNodes.isEmpty() && deleteOperations.any { op ->
dataOpsManager.isOperationSupported(op) && checkForUss
dataOpsManager.isOperationSupported(op)
}
} else false
}
Expand Down

0 comments on commit 33f2341

Please sign in to comment.