Skip to content

Commit

Permalink
Merge branch 'private-release/v1.1.3-221' into private-release/v1.2.0…
Browse files Browse the repository at this point in the history
…-221
  • Loading branch information
KUGDev committed Mar 13, 2024
2 parents 61ee53c + f78c63a commit 0d9cf09
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ class AllocationDialog(project: Project?, config: ConnectionConfig, override var
.bindText(state::datasetName)
.also {
datasetNameField = it.component
datasetNameField.text = "${HLQ}.<CHANGEME>"
datasetNameField.text.ifEmpty { datasetNameField.text = "${HLQ}.<CHANGEME>" }
}
.onApply { state.datasetName = state.datasetName.uppercase() }
.horizontalAlign(HorizontalAlign.FILL)
Expand All @@ -98,7 +98,7 @@ class AllocationDialog(project: Project?, config: ConnectionConfig, override var
.bindText(state::memberName)
.also {
memberNameField = it.component
memberNameField.text = "SAMPLE"
memberNameField.text.ifEmpty { memberNameField.text = "SAMPLE" }
}
.onApply { state.memberName = state.memberName.uppercase() }
.horizontalAlign(HorizontalAlign.FILL)
Expand Down Expand Up @@ -301,7 +301,7 @@ class AllocationDialog(project: Project?, config: ConnectionConfig, override var
*/
private fun doPresetAssignment(preset: Presets) {
val dataContainer = Presets.initDataClass(preset)
memberNameField.text = "SAMPLE"
memberNameField.text.ifEmpty { memberNameField.text = "SAMPLE" }
datasetOrganizationBox.selectedItem = dataContainer.datasetOrganization
spaceUnitBox.selectedItem = dataContainer.spaceUnit
primaryAllocationField.text = dataContainer.primaryAllocation.toString()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -324,35 +324,36 @@ class ExplorerPasteProvider : PasteProvider {

// conflicts end
// specific configs resolution
val ussToPdsWarnings = pasteDestinations
val ussOrLocalFileToPdsWarnings = pasteDestinations
.mapNotNull { destFile ->
val destAttributes = dataOpsManager.tryToGetAttributes(destFile)
if (destAttributes !is RemoteDatasetAttributes) null
else {
val sourceUssAttributes = sourceFiles
.filter { sourceFile ->
val sourceAttributes = dataOpsManager.tryToGetAttributes(sourceFile)
sourceAttributes is RemoteUssAttributes || sourceFile is VirtualFileImpl
sourceAttributes is RemoteUssAttributes || sourceFile.isInLocalFileSystem
}
sourceUssAttributes.map { Pair(destFile, it) }.ifEmpty { null }
}
}
.flatten()

if (
ussToPdsWarnings.isNotEmpty() &&
!showYesNoDialog(
"USS File To PDS Placing",
"You are about to place USS file to PDS. All lines exceeding the record length will be truncated.",
null,
"Ok",
"Skip This Files",
AllIcons.General.WarningDialog
)
) {
conflictsResolutions.addAll(
ussToPdsWarnings.map { ConflictResolution(it.second, it.first).apply { resolveBySkip() } }
)
if (ussOrLocalFileToPdsWarnings.isNotEmpty()) {
val isLocalFilesPresent = ussOrLocalFileToPdsWarnings.find { it.second.isInLocalFileSystem } != null
val fileTypesPattern = if (isLocalFilesPresent) "Local Files" else "USS Files"
if (!showYesNoDialog(
"$fileTypesPattern to PDS Placing",
"You are about to place $fileTypesPattern to PDS. All lines exceeding the record length will be truncated.",
null,
"Ok",
"Skip This Files",
AllIcons.General.WarningDialog
)) {
conflictsResolutions.addAll(
ussOrLocalFileToPdsWarnings.map { ConflictResolution(it.second, it.first).apply { resolveBySkip() } }
)
}
}
// specific conflicts resolution end

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,7 @@ class ExplorerPasteProviderTestSpec : WithApplicationShouldSpec({
every { mockedSourceAttributes.isDirectory } returns false
every { mockedSourceNodeData.node } returns mockedSourceNode
every { mockedSourceNodeData.file } returns mockedSourceFile
every { mockedSourceFile.isInLocalFileSystem } returns false
every { mockedSourceNodeData.attributes } returns mockedSourceAttributes

// children of target
Expand Down Expand Up @@ -394,6 +395,7 @@ class ExplorerPasteProviderTestSpec : WithApplicationShouldSpec({
val mockedSourceFile = mockk<MFVirtualFile>()
val mockedSourceAttributes = mockk<RemoteDatasetAttributes>()
every { mockedSourceFile.name } returns "TEST.FILE"
every { mockedSourceFile.isInLocalFileSystem } returns false
every { mockedSourceAttributes.name } returns "TEST.FILE"
every { mockedSourceAttributes.isPastePossible } returns false
every { mockedSourceAttributes.isDirectory } returns false
Expand Down Expand Up @@ -1251,6 +1253,7 @@ class ExplorerPasteProviderTestSpec : WithApplicationShouldSpec({
every { mockedSourceFile.name } returns fileName
every { mockedSourceFile.isDirectory } returns isDirectory
every { mockedSourceFile.parent } returns parent
every { mockedSourceFile.isInLocalFileSystem } returns false

val mockedSourceAttributes = if (sourceAttributes != null) {
sourceAttributes
Expand Down

0 comments on commit 0d9cf09

Please sign in to comment.