Skip to content

Commit b874247

Browse files
committed
Merge branch 'public-release/v1.2.5-223' into public-release/v2.1.0
Signed-off-by: Uladzislau <[email protected]>
2 parents c6278f6 + a885409 commit b874247

15 files changed

+110
-40
lines changed

.gitignore

+6-1
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,15 @@
11
.gradle
2-
.idea
2+
**/.idea/*
3+
!/.idea/copyright/
4+
!/.idea/copyright/*
5+
!/.idea/runConfigurations/
6+
!/.idea/runConfigurations/*
37
.intellijPlatform
48
/build
59
/ide_for_launch
610
/out
711
/allure-results
12+
**/mock_project/*
813

914
verifier-all.jar
1015

.idea/copyright/ijmp.xml

+6
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/copyright/profiles_settings.xml

+7
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/runConfigurations/_template__of_Kotest.xml

+16
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

CHANGELOG.md

+9
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,15 @@
22

33
All notable changes to the For Mainframe Plugin will be documented in this file.
44

5+
## [Unreleased]
6+
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+
514
## [2.0.1] (2024-11-18)
615

716
### Bugfixes

gradle.properties

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
#
1414
org.gradle.jvmargs=-Xss1M
1515
# SemVer format -> https://semver.org
16-
pluginVersion=2.0.1
16+
pluginVersion=2.1.0
1717
pluginGroup=eu.ibagroup
1818
pluginRepositoryUrl=https://github.com/for-mainframe/For-Mainframe
1919
# Supported build number ranges and IntelliJ Platform versions -> https://plugins.jetbrains.com/docs/intellij/build-number-ranges.html

src/main/kotlin/eu/ibagroup/formainframe/analytics/ui/AnalyticsPolicyDialog.kt

+1
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ class AnalyticsPolicyDialog(
6666
lineWrap = true
6767
wrapStyleWord = true
6868
caretPosition = 0
69+
isEditable = false
6970
}
7071
scrollCell(licenseTextArea)
7172
.align(AlignX.FILL.plus(AlignY.FILL))

src/main/kotlin/eu/ibagroup/formainframe/config/ConfigDeclaration.kt

+7-5
Original file line numberDiff line numberDiff line change
@@ -27,16 +27,15 @@ import eu.ibagroup.formainframe.config.connect.ZOSMFConnectionConfigDeclaration
2727
interface ConfigDeclarationFactory {
2828

2929
/** Creates instance of [ConfigDeclaration]. */
30-
fun buildConfigDeclaration(crudable: Crudable): ConfigDeclaration<*>
30+
fun buildConfigDeclaration(): ConfigDeclaration<*>
3131
}
3232

3333
/**
3434
* Declares config class, that will be stored in persisted state [ConfigService].
3535
* @param T template parameter that specifies config class.
36-
* @property crudable instance of [Crudable] through which to work with config data.
3736
* @author Valiantsin Krus
3837
*/
39-
abstract class ConfigDeclaration<T: Any>(val crudable: Crudable) {
38+
abstract class ConfigDeclaration<T: Any> {
4039

4140
/** Instance of connection config class */
4241
abstract val clazz: Class<out T>
@@ -79,8 +78,11 @@ abstract class ConfigDeclaration<T: Any>(val crudable: Crudable) {
7978
}
8079

8180

82-
/** Provider decider in for config class. */
83-
abstract fun getDecider(): ConfigDecider<T>
81+
/**
82+
* Provider decider in for config class.
83+
* @param crudable instance of [Crudable] through which to work with config data.
84+
* */
85+
abstract fun getDecider(crudable: Crudable): ConfigDecider<T>
8486

8587
/** Builds configurable that will be displayed in settings. */
8688
open fun getConfigurable(): BoundSearchableConfigurable? = null

src/main/kotlin/eu/ibagroup/formainframe/config/ConfigServiceImpl.kt

+8-4
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ class ConfigServiceImpl : ConfigService {
7676
/** List of registered config declarations */
7777
private val configDeclarations: List<ConfigDeclaration<out Any>> by lazy {
7878
ConfigDeclaration.EP.extensionList.map {
79-
it.buildConfigDeclaration(crudable)
79+
it.buildConfigDeclaration()
8080
}
8181
}
8282

@@ -152,15 +152,17 @@ internal fun makeCrudableWithoutListeners(
152152
credentialsGetter: () -> MutableList<Credentials> = { mutableListOf() },
153153
stateGetter: () -> ConfigStateV2,
154154
): Crudable {
155+
lateinit var crudable: Crudable
156+
155157
val crudableLists = CrudableLists(
156158
addFilter = object : AddFilter {
157159
override operator fun <T : Any> invoke(clazz: Class<out T>, addingRow: T): Boolean {
158-
return ConfigService.getService().getConfigDeclaration(clazz).getDecider().canAdd(addingRow)
160+
return ConfigService.getService().getConfigDeclaration(clazz).getDecider(crudable).canAdd(addingRow)
159161
}
160162
},
161163
updateFilter = object : UpdateFilter {
162164
override operator fun <T : Any> invoke(clazz: Class<out T>, currentRow: T, updatingRow: T): Boolean {
163-
return ConfigService.getService().getConfigDeclaration(clazz).getDecider().canUpdate(currentRow, updatingRow)
165+
return ConfigService.getService().getConfigDeclaration(clazz).getDecider(crudable).canUpdate(currentRow, updatingRow)
164166
}
165167
},
166168
nextUuidProvider = { UUID.randomUUID().toString() },
@@ -174,5 +176,7 @@ internal fun makeCrudableWithoutListeners(
174176
}
175177
}
176178
)
177-
return ConcurrentCrudable(crudableLists, SimpleReadWriteAdapter())
179+
180+
crudable = ConcurrentCrudable(crudableLists, SimpleReadWriteAdapter())
181+
return crudable
178182
}

src/main/kotlin/eu/ibagroup/formainframe/config/connect/ConnectionConfigDeclaration.kt

+1-4
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,13 @@ package eu.ibagroup.formainframe.config.connect
1616
import com.intellij.openapi.options.BoundSearchableConfigurable
1717
import eu.ibagroup.formainframe.config.ConfigDeclaration
1818
import eu.ibagroup.formainframe.config.connect.ui.CollectedConfigurable
19-
import eu.ibagroup.formainframe.utils.crudable.Crudable
2019

2120
/**
2221
* Abstract class to declare connection configs.
2322
* @param Connection The system (such as zosmf, cics etc.) connection class to work with (see [ConnectionConfigBase]).
24-
* @param crudable [Crudable] instance to get data from.
2523
* @author Valiantsin Krus
2624
*/
27-
abstract class ConnectionConfigDeclaration<Connection: ConnectionConfigBase>(crudable: Crudable)
28-
: ConfigDeclaration<Connection>(crudable) {
25+
abstract class ConnectionConfigDeclaration<Connection : ConnectionConfigBase> : ConfigDeclaration<Connection>() {
2926

3027
companion object {
3128
/** list of available connection configurables. */

src/main/kotlin/eu/ibagroup/formainframe/config/connect/CredentialsConfigDeclaration.kt

+6-7
Original file line numberDiff line numberDiff line change
@@ -22,25 +22,24 @@ import eu.ibagroup.formainframe.utils.crudable.Crudable
2222
* Factory to create instance of [CredentialsConfigDeclaration].
2323
* @author Valiantsin Krus
2424
*/
25-
class CredentialsConfigDeclarationFactory: ConfigDeclarationFactory {
26-
override fun buildConfigDeclaration(crudable: Crudable): ConfigDeclaration<*> {
27-
return CredentialsConfigDeclaration(crudable)
25+
class CredentialsConfigDeclarationFactory : ConfigDeclarationFactory {
26+
override fun buildConfigDeclaration(): ConfigDeclaration<*> {
27+
return CredentialsConfigDeclaration()
2828
}
2929
}
3030

3131
/**
3232
* Declares config to work with credentials. It is the only class that is necessary to declare without
3333
* any logical load. All the logic of storing credentials securely is described in [CredentialService].
34-
* @param crudable instance of [Crudable] (not used in this class).
3534
* @author Valiantsin Krus
3635
*/
37-
class CredentialsConfigDeclaration(crudable: Crudable): ConfigDeclaration<Credentials>(crudable) {
36+
class CredentialsConfigDeclaration : ConfigDeclaration<Credentials>() {
3837

3938
override val clazz = Credentials::class.java
4039
override val configPriority = -100.0
4140

42-
override fun getDecider(): ConfigDecider<Credentials> {
43-
return object: ConfigDecider<Credentials>() {
41+
override fun getDecider(crudable: Crudable): ConfigDecider<Credentials> {
42+
return object : ConfigDecider<Credentials>() {
4443
override fun canUpdate(currentRow: Credentials, updatingRow: Credentials) = true
4544
override fun canAdd(row: Credentials) = true
4645
}

src/main/kotlin/eu/ibagroup/formainframe/config/connect/ZOSMFConnectionConfigDeclaration.kt

+4-6
Original file line numberDiff line numberDiff line change
@@ -26,24 +26,22 @@ import eu.ibagroup.formainframe.utils.crudable.getByColumnLambda
2626
* @author Valiantsin Krus
2727
*/
2828
class ConnectionConfigDeclarationFactory : ConfigDeclarationFactory {
29-
override fun buildConfigDeclaration(crudable: Crudable): ConfigDeclaration<*> {
30-
return ZOSMFConnectionConfigDeclaration(crudable)
29+
override fun buildConfigDeclaration(): ConfigDeclaration<*> {
30+
return ZOSMFConnectionConfigDeclaration()
3131
}
3232
}
3333

3434
/**
3535
* Declares connection config that will represent connection to zosmf.
36-
* @param crudable instance of [Crudable] through which to work with config data.
3736
* @author Valiantsin Krus
3837
*/
39-
class ZOSMFConnectionConfigDeclaration(crudable: Crudable) :
40-
ConnectionConfigDeclaration<ConnectionConfig>(crudable) {
38+
class ZOSMFConnectionConfigDeclaration : ConnectionConfigDeclaration<ConnectionConfig>() {
4139

4240
override val clazz = ConnectionConfig::class.java
4341
override val useCredentials = true
4442
override val configPriority = 1.0
4543

46-
override fun getDecider(): ConfigDecider<ConnectionConfig> {
44+
override fun getDecider(crudable: Crudable): ConfigDecider<ConnectionConfig> {
4745
return object : ConfigDecider<ConnectionConfig>() {
4846
/**
4947
* Enables to add connection config only if no existing connection with such name found.

src/main/kotlin/eu/ibagroup/formainframe/config/ws/WorkingSetConfigDeclaration.kt

+6-8
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ import eu.ibagroup.formainframe.utils.crudable.Crudable
2626
*/
2727
class FilesWorkingSetConfigDeclarationFactory : ConfigDeclarationFactory {
2828

29-
override fun buildConfigDeclaration(crudable: Crudable): ConfigDeclaration<*> {
30-
return object : WorkingSetConfigDeclaration<FilesWorkingSetConfig>(crudable, FilesWorkingSetConfig::class.java) {
29+
override fun buildConfigDeclaration(): ConfigDeclaration<*> {
30+
return object : WorkingSetConfigDeclaration<FilesWorkingSetConfig>(FilesWorkingSetConfig::class.java) {
3131
override val configPriority = 3.0
3232
override fun getConfigurable() = FilesWSConfigurable()
3333
}
@@ -40,8 +40,8 @@ class FilesWorkingSetConfigDeclarationFactory : ConfigDeclarationFactory {
4040
* @author Valiantsin Krus
4141
*/
4242
class JesWorkingSetConfigDeclarationFactory : ConfigDeclarationFactory {
43-
override fun buildConfigDeclaration(crudable: Crudable): ConfigDeclaration<*> {
44-
return object : WorkingSetConfigDeclaration<JesWorkingSetConfig>(crudable, JesWorkingSetConfig::class.java) {
43+
override fun buildConfigDeclaration(): ConfigDeclaration<*> {
44+
return object : WorkingSetConfigDeclaration<JesWorkingSetConfig>(JesWorkingSetConfig::class.java) {
4545
override val configPriority = 2.0
4646
override fun getConfigurable() = JesWsConfigurable()
4747
}
@@ -50,16 +50,14 @@ class JesWorkingSetConfigDeclarationFactory : ConfigDeclarationFactory {
5050

5151
/**
5252
* Abstract class with wrapped logic of working with working sets configs.
53-
* @param crudable instance of [Crudable] through which to work with config data.
5453
* @param clazz instance of class that implements [WorkingSetConfig].
5554
* @author Valiantsin Krus.
5655
*/
5756
abstract class WorkingSetConfigDeclaration<WS : WorkingSetConfig>(
58-
crudable: Crudable,
5957
override val clazz: Class<out WS>
60-
) : ConfigDeclaration<WS>(crudable) {
58+
) : ConfigDeclaration<WS>() {
6159

62-
override fun getDecider(): ConfigDecider<WS> {
60+
override fun getDecider(crudable: Crudable): ConfigDecider<WS> {
6361
return object : ConfigDecider<WS>() {
6462

6563
/**

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

+8-3
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,8 @@ class LocalFileToUssDirMoverFactory : OperationRunnerFactory {
4646
*/
4747
class LocalFileToUssDirMover(val dataOpsManager: DataOpsManager) : AbstractFileMover() {
4848

49+
private val sourceContentType = "text/plain; charset=UTF-8"
50+
4951
/**
5052
* Checks that source is local file, dest is uss directory, and destination
5153
* file is located on remote system (by fetching its attributes).
@@ -82,16 +84,19 @@ class LocalFileToUssDirMover(val dataOpsManager: DataOpsManager) : AbstractFileM
8284

8385
val pathToFile = destAttributes.path + "/" + newName
8486

85-
val contentToUpload = sourceFile.contentsToByteArray().toMutableList()
87+
val currentFileContent = sourceFile.contentsToByteArray()
8688
val xIBMDataType =
8789
if (sourceFile.fileType.isBinary) XIBMDataType(XIBMDataType.Type.BINARY) else XIBMDataType(XIBMDataType.Type.TEXT)
8890

91+
val contentToUpload = if (sourceFile.fileType.isBinary) currentFileContent else
92+
currentFileContent.toString(sourceFile.charset).encodeToByteArray()
8993

9094
val response = apiWithBytesConverter<DataAPI>(destConnectionConfig).writeToUssFile(
9195
authorizationToken = destConnectionConfig.authToken,
9296
filePath = FilePath(pathToFile),
93-
body = contentToUpload.toByteArray(),
94-
xIBMDataType = xIBMDataType
97+
body = contentToUpload,
98+
xIBMDataType = xIBMDataType,
99+
contentType = sourceContentType
95100
).applyIfNotNull(progressIndicator) { indicator ->
96101
cancelByIndicator(indicator)
97102
}.execute()

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

+24-1
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,24 @@ class AddJobsFilterDialog(
5454
lateinit var prefixField: JBTextField
5555
lateinit var ownerField: JBTextField
5656
lateinit var jobIdField: JBTextField
57+
lateinit var dialogPanel: DialogPanel
5758
val sameWidthGroup = "ADD_JOB_FILTER_DIALOG_LABELS_WIDTH_GROUP"
5859

59-
return panel {
60+
class ValidatePrefix(
61+
var componentsToIsJobId: List<Pair<JBTextField, Boolean>>
62+
) : DialogValidation {
63+
override fun validate(): ValidationInfo? {
64+
dialogPanel.validateAll()
65+
var validationInfo: ValidationInfo? = null
66+
componentsToIsJobId.forEach { (component, isJobId) ->
67+
validationInfo = validateJobFilter(prefixField.text, ownerField.text, jobIdField.text, state.ws.masks, component, isJobId)
68+
if (validationInfo != null) return validationInfo
69+
}
70+
return null
71+
}
72+
}
73+
74+
dialogPanel = panel {
6075
row {
6176
label("JES working set: ")
6277
if (wsSize > 1) {
@@ -102,5 +117,13 @@ class AddJobsFilterDialog(
102117
.align(AlignX.FILL)
103118
}
104119
}
120+
.apply{
121+
validationsOnInput=mapOf(
122+
prefixField to listOf(ValidatePrefix(listOf(prefixField to false, ownerField to false, jobIdField to true))),
123+
ownerField to listOf(ValidatePrefix(listOf(ownerField to false, prefixField to false, jobIdField to true))),
124+
jobIdField to listOf(ValidatePrefix(listOf(jobIdField to true, prefixField to false, ownerField to false)))
125+
)
126+
}
127+
return dialogPanel
105128
}
106129
}

0 commit comments

Comments
 (0)