Skip to content

Commit

Permalink
Merge branch 'zowe-release/v1.2.5-221' into zowe-release/v1.2.5-223
Browse files Browse the repository at this point in the history
Signed-off-by: Uladzislau <[email protected]>
  • Loading branch information
KUGDev committed Jan 7, 2025
2 parents 568d4e4 + 8a0549f commit 13eb818
Show file tree
Hide file tree
Showing 9 changed files with 103 additions and 16 deletions.
7 changes: 6 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
.gradle
.idea
**/.idea/*
!/.idea/copyright/
!/.idea/copyright/*
!/.idea/runConfigurations/
!/.idea/runConfigurations/*
.intellijPlatform
/build
/ide_for_launch
/out
/allure-results
**/mock_project/*

verifier-all.jar

Expand Down
6 changes: 6 additions & 0 deletions .idea/copyright/ijmp.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions .idea/copyright/profiles_settings.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 16 additions & 0 deletions .idea/runConfigurations/_template__of_Kotest.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@

All notable changes to the Zowe Explorer plug-in for IntelliJ IDEA will be documented in this file.

## [Unreleased]

### Bugfixes

* Bugfix: Fixed error when uploading local file to USS ([c5dcd7fa](https://github.com/zowe/zowe-explorer-intellij/commit/c5dcd7fa))
* 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))
* Bugfix: Fixed NullPointerException on cancel operation ([f8d08fd4](https://github.com/zowe/zowe-explorer-intellij/commit/f8d08fd4))

## [1.2.4-223] (2024-11-18)

### Bugfixes
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ org.gradle.jvmargs=-Xss1M
platformVersion = 2022.3

# SemVer format -> https://semver.org
pluginVersion = 1.2.4-223
pluginVersion = 1.2.5-223
pluginGroup = org.zowe
pluginRepositoryUrl = https://github.com/zowe/zowe-explorer-intellij

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ class LocalFileToUssDirMoverFactory : OperationRunnerFactory {
*/
class LocalFileToUssDirMover(val dataOpsManager: DataOpsManager) : AbstractFileMover() {

private val sourceContentType = "text/plain; charset=UTF-8"

/**
* Checks that source is local file, dest is uss directory, and destination
* file is located on remote system (by fetching its attributes).
Expand Down Expand Up @@ -82,16 +84,19 @@ class LocalFileToUssDirMover(val dataOpsManager: DataOpsManager) : AbstractFileM

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

val contentToUpload = sourceFile.contentsToByteArray().toMutableList()
val currentFileContent = sourceFile.contentsToByteArray()
val xIBMDataType =
if (sourceFile.fileType.isBinary) XIBMDataType(XIBMDataType.Type.BINARY) else XIBMDataType(XIBMDataType.Type.TEXT)

val contentToUpload = if (sourceFile.fileType.isBinary) currentFileContent else
currentFileContent.toString(sourceFile.charset).encodeToByteArray()

val response = apiWithBytesConverter<DataAPI>(destConnectionConfig).writeToUssFile(
authorizationToken = destConnectionConfig.authToken,
filePath = FilePath(pathToFile),
body = contentToUpload.toByteArray(),
xIBMDataType = xIBMDataType
body = contentToUpload,
xIBMDataType = xIBMDataType,
contentType = sourceContentType
).applyIfNotNull(progressIndicator) { indicator ->
cancelByIndicator(indicator)
}.execute()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,10 @@
package org.zowe.explorer.explorer.ui

import com.intellij.openapi.project.Project
import com.intellij.openapi.ui.DialogPanel
import com.intellij.openapi.ui.DialogWrapper
import com.intellij.openapi.ui.ValidationInfo
import com.intellij.openapi.ui.validation.DialogValidation
import com.intellij.ui.components.JBTextField
import com.intellij.ui.dsl.builder.bindText
import com.intellij.ui.dsl.builder.panel
Expand All @@ -35,9 +38,24 @@ class AddJobsFilterDialog(
lateinit var prefixField: JBTextField
lateinit var ownerField: JBTextField
lateinit var jobIdField: JBTextField
lateinit var dialogPanel: DialogPanel
val sameWidthGroup = "ADD_JOB_FILTER_DIALOG_LABELS_WIDTH_GROUP"

return panel {
class ValidatePrefix(
var componentsToIsJobId: List<Pair<JBTextField, Boolean>>
) : DialogValidation {
override fun validate(): ValidationInfo? {
dialogPanel.validateAll()
var validationInfo: ValidationInfo? = null
componentsToIsJobId.forEach { (component, isJobId) ->
validationInfo = validateJobFilter(prefixField.text, ownerField.text, jobIdField.text, state.ws.masks, component, isJobId)
if (validationInfo != null) return validationInfo
}
return null
}
}

dialogPanel = panel {
row {
label("JES working set: ")
.widthGroup(sameWidthGroup)
Expand All @@ -49,9 +67,6 @@ class AddJobsFilterDialog(
textField()
.bindText(state::prefix)
.also { prefixField = it.component }
.validationOnApply {
validateJobFilter(it.text, ownerField.text, jobIdField.text, state.ws.masks, it, false)
}
.horizontalAlign(HorizontalAlign.FILL)
}
row {
Expand All @@ -60,9 +75,6 @@ class AddJobsFilterDialog(
textField()
.bindText(state::owner)
.also { ownerField = it.component }
.validationOnApply {
validateJobFilter(prefixField.text, it.text, jobIdField.text, state.ws.masks, it, false)
}
.horizontalAlign(HorizontalAlign.FILL)
}
row {
Expand All @@ -71,11 +83,16 @@ class AddJobsFilterDialog(
textField()
.bindText(state::jobId)
.also { jobIdField = it.component }
.validationOnApply {
validateJobFilter(prefixField.text, ownerField.text, it.text, state.ws.masks, it, true)
}
.horizontalAlign(HorizontalAlign.FILL)
}
}
.apply{
validationsOnInput=mapOf(
prefixField to listOf(ValidatePrefix(listOf(prefixField to false, ownerField to false, jobIdField to true))),
ownerField to listOf(ValidatePrefix(listOf(ownerField to false, prefixField to false, jobIdField to true))),
jobIdField to listOf(ValidatePrefix(listOf(jobIdField to true, prefixField to false, ownerField to false)))
)
}
return dialogPanel
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,29 @@ abstract class ExplorerTreeView<Connection: ConnectionConfigBase, U : WorkingSet

private var treeModel: AsyncTreeModel

/**
* Function is called when onFetchCancelled event has been raised.
* It searches for nodes by provided @param Query, looks through the tree and collects
* TreePath objects on Promise resolution. For every found TreePath collapses this path
* @param query - query on which 'fetch cancelled' event has been occurred
*/
private fun collapseNodesByQuery(query: Query<*, *>) {
// Collapse only those nodes for which TreePath has been resolved.
// If tree path cannot be resolved as the result of Promise resolution,
// it means that node does not present in the tree model anymore
myFsTreeStructure.findByPredicate { it is FetchNode && it.query == query }
.mapNotNull { myStructure.promisePath(it, myTree).get() }
.forEach { foundTreePath ->
treeModel.onValidThread {
myTree.collapsePath(foundTreePath)
synchronized(myNodesToInvalidateOnExpand) {
val node = foundTreePath.lastPathComponent
myNodesToInvalidateOnExpand.add(node)
}
}
}
}

/**
* Get node by provided query and invalidate them. The nodes will be either collapsed or invalidated on this action, basing on the provided parameters
* @param query the query to search nodes by
Expand Down Expand Up @@ -326,7 +349,7 @@ abstract class ExplorerTreeView<Connection: ConnectionConfigBase, U : WorkingSet
}

override fun <R : Any, Q : Query<R, Unit>> onFetchCancelled(query: Q) {
getNodesByQueryAndInvalidate(query, collapse = true, invalidate = false)
collapseNodesByQuery(query)
}

override fun <R : Any, Q : Query<R, Unit>> onFetchFailure(query: Q, throwable: Throwable) {
Expand Down

0 comments on commit 13eb818

Please sign in to comment.