Skip to content

Commit 6fbfe05

Browse files
committed
Merge branch 'private-release/v1.2.5-221' into private-release/v1.2.5-223
2 parents 79ebff2 + af0bdac commit 6fbfe05

3 files changed

Lines changed: 42 additions & 13 deletions

File tree

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,13 @@ All notable changes to the For Mainframe Plugin will be documented in this file.
44

55
## [Unreleased]
66

7+
### Bugfixes
8+
9+
* Bugfix: Fixed error when uploading local file to USS ([c5dcd7fa](https://github.com/zowe/zowe-explorer-intellij/commit/c5dcd7fa))
10+
* Bugfix: Fixed issue when error message does not disappear after errors are corrected in a Job Filter ([64a6d209](https://github.com/zowe/zowe-explorer-intellij/commit/64a6d209))
11+
* Bugfix: Privacy Policy was open for modifications ([cd917844](https://github.com/zowe/zowe-explorer-intellij/commit/cd917844))
12+
* Bugfix: Fixed NullPointerException on cancel operation ([f8d08fd4](https://github.com/zowe/zowe-explorer-intellij/commit/f8d08fd4))
13+
714
## [1.2.4-221] (2024-11-18)
815

916
### Bugfixes

src/main/kotlin/eu/ibagroup/formainframe/dataops/operations/mover/LocalFileToUssDirMover.kt

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@ class LocalFileToUssDirMoverFactory : OperationRunnerFactory {
4242
*/
4343
class LocalFileToUssDirMover(val dataOpsManager: DataOpsManager) : AbstractFileMover() {
4444

45+
private val sourceContentType = "text/plain; charset=UTF-8"
46+
4547
/**
4648
* Checks that source is local file, dest is uss directory, and destination
4749
* file is located on remote system (by fetching its attributes).
@@ -78,16 +80,19 @@ class LocalFileToUssDirMover(val dataOpsManager: DataOpsManager) : AbstractFileM
7880

7981
val pathToFile = destAttributes.path + "/" + newName
8082

81-
val contentToUpload = sourceFile.contentsToByteArray().toMutableList()
83+
val currentFileContent = sourceFile.contentsToByteArray()
8284
val xIBMDataType =
8385
if (sourceFile.fileType.isBinary) XIBMDataType(XIBMDataType.Type.BINARY) else XIBMDataType(XIBMDataType.Type.TEXT)
8486

87+
val contentToUpload = if (sourceFile.fileType.isBinary) currentFileContent else
88+
currentFileContent.toString(sourceFile.charset).encodeToByteArray()
8589

8690
val response = apiWithBytesConverter<DataAPI>(destConnectionConfig).writeToUssFile(
8791
authorizationToken = destConnectionConfig.authToken,
8892
filePath = FilePath(pathToFile),
89-
body = contentToUpload.toByteArray(),
90-
xIBMDataType = xIBMDataType
93+
body = contentToUpload,
94+
xIBMDataType = xIBMDataType,
95+
contentType = sourceContentType
9196
).applyIfNotNull(progressIndicator) { indicator ->
9297
cancelByIndicator(indicator)
9398
}.execute()

src/main/kotlin/eu/ibagroup/formainframe/explorer/ui/AddJobsFilterDialog.kt

Lines changed: 27 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,10 @@
1111
package eu.ibagroup.formainframe.explorer.ui
1212

1313
import com.intellij.openapi.project.Project
14+
import com.intellij.openapi.ui.DialogPanel
1415
import com.intellij.openapi.ui.DialogWrapper
16+
import com.intellij.openapi.ui.ValidationInfo
17+
import com.intellij.openapi.ui.validation.DialogValidation
1518
import com.intellij.ui.components.JBTextField
1619
import com.intellij.ui.dsl.builder.bindText
1720
import com.intellij.ui.dsl.builder.panel
@@ -35,9 +38,24 @@ class AddJobsFilterDialog(
3538
lateinit var prefixField: JBTextField
3639
lateinit var ownerField: JBTextField
3740
lateinit var jobIdField: JBTextField
41+
lateinit var dialogPanel: DialogPanel
3842
val sameWidthGroup = "ADD_JOB_FILTER_DIALOG_LABELS_WIDTH_GROUP"
3943

40-
return panel {
44+
class ValidatePrefix(
45+
var componentsToIsJobId: List<Pair<JBTextField, Boolean>>
46+
) : DialogValidation {
47+
override fun validate(): ValidationInfo? {
48+
dialogPanel.validateAll()
49+
var validationInfo: ValidationInfo? = null
50+
componentsToIsJobId.forEach { (component, isJobId) ->
51+
validationInfo = validateJobFilter(prefixField.text, ownerField.text, jobIdField.text, state.ws.masks, component, isJobId)
52+
if (validationInfo != null) return validationInfo
53+
}
54+
return null
55+
}
56+
}
57+
58+
dialogPanel = panel {
4159
row {
4260
label("JES working set: ")
4361
.widthGroup(sameWidthGroup)
@@ -49,9 +67,6 @@ class AddJobsFilterDialog(
4967
textField()
5068
.bindText(state::prefix)
5169
.also { prefixField = it.component }
52-
.validationOnApply {
53-
validateJobFilter(it.text, ownerField.text, jobIdField.text, state.ws.masks, it, false)
54-
}
5570
.horizontalAlign(HorizontalAlign.FILL)
5671
}
5772
row {
@@ -60,9 +75,6 @@ class AddJobsFilterDialog(
6075
textField()
6176
.bindText(state::owner)
6277
.also { ownerField = it.component }
63-
.validationOnApply {
64-
validateJobFilter(prefixField.text, it.text, jobIdField.text, state.ws.masks, it, false)
65-
}
6678
.horizontalAlign(HorizontalAlign.FILL)
6779
}
6880
row {
@@ -71,11 +83,16 @@ class AddJobsFilterDialog(
7183
textField()
7284
.bindText(state::jobId)
7385
.also { jobIdField = it.component }
74-
.validationOnApply {
75-
validateJobFilter(prefixField.text, ownerField.text, it.text, state.ws.masks, it, true)
76-
}
7786
.horizontalAlign(HorizontalAlign.FILL)
7887
}
7988
}
89+
.apply{
90+
validationsOnInput=mapOf(
91+
prefixField to listOf(ValidatePrefix(listOf(prefixField to false, ownerField to false, jobIdField to true))),
92+
ownerField to listOf(ValidatePrefix(listOf(ownerField to false, prefixField to false, jobIdField to true))),
93+
jobIdField to listOf(ValidatePrefix(listOf(jobIdField to true, prefixField to false, ownerField to false)))
94+
)
95+
}
96+
return dialogPanel
8097
}
8198
}

0 commit comments

Comments
 (0)