Skip to content

Commit

Permalink
Merge branch 'private-release/v1.2.0-221' into zowe-release/v1.2.0-221
Browse files Browse the repository at this point in the history
Signed-off-by: Uladzislau <[email protected]>
  • Loading branch information
KUGDev committed Mar 19, 2024
2 parents 784a60e + f5bd87d commit 29c1166
Show file tree
Hide file tree
Showing 26 changed files with 448 additions and 437 deletions.
22 changes: 22 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,28 @@

All notable changes to the Zowe IntelliJ Plugin will be documented in this file.

## `1.2.0 (2024-xx-yy)`

* Feature: TSO CLI PA1 button functionality added ([48834cac](https://github.com/zowe/zowe-explorer-intellij/commit/48834cac))
* Feature: Allocation units clarification added ([1ff218e4](https://github.com/zowe/zowe-explorer-intellij/commit/1ff218e4))
* Feature: Now after allocating a dataset, a notification is shown instead of a dialog window ([20343651](https://github.com/zowe/zowe-explorer-intellij/commit/20343651))
* Feature: VFS_CHANGES topic rework for encoding purposes ([3adaded3](https://github.com/zowe/zowe-explorer-intellij/commit/3adaded3))
* Feature: Close all files in editor, related to the file/folder/dataset/member being deleted ([8a0d9980](https://github.com/zowe/zowe-explorer-intellij/commit/8a0d9980))


* Bugfix: GitHub issue #159: Zowe config detection doesn't work correctly ([c73226f6](https://github.com/zowe/zowe-explorer-intellij/commit/c73226f6))
* Bugfix: Warning during working set creation without masks/job filters is missing ([4fd0b22c](https://github.com/zowe/zowe-explorer-intellij/commit/4fd0b22c))
* Bugfix: When opened file tabs bar is full, opening any dataset or USS file preserves only last 2 items Explorer items in the bar ([3a822fbb](https://github.com/zowe/zowe-explorer-intellij/commit/3a822fbb))
* Bugfix: Unclear error message for list datasets/jobs when password is expired ([74fe5e86](https://github.com/zowe/zowe-explorer-intellij/commit/74fe5e86))
* Bugfix: In dataset allocation dialog window, dataset name is reset when an error is received ([218f5a3a](https://github.com/zowe/zowe-explorer-intellij/commit/218f5a3a))
* Bugfix: Issue creating member with the same name as the existing one ([6ebae1a0](https://github.com/zowe/zowe-explorer-intellij/commit/6ebae1a0))
* Bugfix: "Overwrite for All" causes caches conflicts when dataset member is being copied to a USS with rewrite ([90b9ce17](https://github.com/zowe/zowe-explorer-intellij/commit/90b9ce17))
* Bugfix: "Cut/Paste" doesn't work when moving a sequential dataset to a partitioned dataset ([f1cf4a9d](https://github.com/zowe/zowe-explorer-intellij/commit/f1cf4a9d))
* Bugfix: Incorrect warning message when uploading a local file to a PDS ([6d9e5de3](https://github.com/zowe/zowe-explorer-intellij/commit/6d9e5de3))
* Bugfix: It is possible to create a dataset when a connection is removed or invalid ([3df02fde](https://github.com/zowe/zowe-explorer-intellij/commit/3df02fde))
* Bugfix: TSO EXEC command without operands causes the CLI to hang ([d071960a](https://github.com/zowe/zowe-explorer-intellij/commit/d071960a))
* Bugfix: Connection is not fully reset to the last successful state and it causes errors ([f6d5a72e](https://github.com/zowe/zowe-explorer-intellij/commit/f6d5a72e))

## `1.1.2 (2024-01-22)`

* Bugfix: Sync action does not work after file download ([bfb125d7](https://github.com/zowe/zowe-explorer-intellij/commit/bfb125d7))
Expand Down
49 changes: 22 additions & 27 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ buildscript {

plugins {
id("org.sonarqube") version "3.3"
id("org.jetbrains.intellij") version "1.14.2"
kotlin("jvm") version "1.8.10"
id("org.jetbrains.intellij") version "1.17.2"
kotlin("jvm") version "1.9.22"
java
id("org.jetbrains.kotlinx.kover") version "0.6.1"
}
Expand All @@ -33,9 +33,9 @@ apply(from = "gradle/sonar.gradle")

group = "org.zowe"
version = "1.2.0-221"
val remoteRobotVersion = "0.11.21"
val remoteRobotVersion = "0.11.22"
val okHttp3Version = "4.12.0"
val kotestVersion = "5.6.2"
val kotestVersion = "5.8.1"

repositories {
mavenCentral()
Expand Down Expand Up @@ -65,23 +65,20 @@ dependencies {
implementation("com.squareup.retrofit2:converter-gson:2.9.0")
implementation("com.squareup.retrofit2:converter-scalars:2.9.0")
implementation("com.squareup.okhttp3:okhttp:$okHttp3Version")
implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.6.20")
implementation("org.jetbrains.kotlin:kotlin-reflect:1.6.20")
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.4")
implementation("org.jgrapht:jgrapht-core:1.5.1")
implementation("org.jgrapht:jgrapht-core:1.5.2")
implementation("com.starxg:java-keytar:1.0.0")
implementation("org.zowe.sdk:zowe-kotlin-sdk:0.4.0")
implementation("com.ibm.mq:com.ibm.mq.allclient:9.3.4.1")
testImplementation("io.mockk:mockk:1.13.5")
testImplementation("org.junit.jupiter:junit-jupiter-api:5.9.2")
testImplementation("io.mockk:mockk:1.13.9")
testImplementation("org.junit.jupiter:junit-jupiter-api:5.10.1")
testImplementation("io.kotest:kotest-assertions-core:$kotestVersion")
testImplementation("io.kotest:kotest-runner-junit5:$kotestVersion")
testImplementation("com.intellij.remoterobot:remote-robot:$remoteRobotVersion")
testImplementation("com.intellij.remoterobot:remote-fixtures:$remoteRobotVersion")
testImplementation("com.squareup.okhttp3:mockwebserver:$okHttp3Version")
testImplementation("com.squareup.okhttp3:okhttp-tls:$okHttp3Version")
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:5.9.2")
testRuntimeOnly("org.junit.vintage:junit-vintage-engine:5.9.2")
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:5.10.1")
testRuntimeOnly("org.junit.vintage:junit-vintage-engine:5.10.1")
}

intellij {
Expand All @@ -96,6 +93,10 @@ tasks {
}
}

withType<Copy> {
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
}

patchPluginXml {
sinceBuild.set("221.5080")
untilBuild.set("222.*")
Expand Down Expand Up @@ -167,6 +168,15 @@ tasks {
dependsOn(createOpenApiSourceJar)
from(createOpenApiSourceJar) { into("lib/src") }
}

downloadRobotServerPlugin {
version.set(remoteRobotVersion)
}

runIdeForUiTests {
systemProperty("idea.trust.all.projects", "true")
systemProperty("ide.show.tips.on.startup.default.value", "false")
}
}

/**
Expand Down Expand Up @@ -256,18 +266,3 @@ val SmokeUiTest = task<Test>("smokeUiTest") {
isDisabled.set(true)
}
}

tasks {
withType<Copy> {
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
}
}

tasks.downloadRobotServerPlugin {
version.set(remoteRobotVersion)
}

tasks.runIdeForUiTests {
systemProperty("idea.trust.all.projects", "true")
systemProperty("ide.show.tips.on.startup.default.value", "false")
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
/*
* This program and the accompanying materials are made available under the terms of the
* Eclipse Public License v2.0 which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-v20.html
*
* SPDX-License-Identifier: EPL-2.0
*
* Copyright IBA Group 2020
*/

package org.zowe.explorer.common

import java.util.*

class SettingsPropertyManager

/**
* Properties from the settings.properties file
*/
internal val settingsProperties by lazy {
Properties().apply {
load(SettingsPropertyManager::class.java.classLoader.getResourceAsStream("settings.properties"))
}
}

/**
* Check if the debug mode is enabled
*/
fun isDebugModeEnabled(): Boolean {
return settingsProperties.getProperty("debug.mode")?.toBoolean() ?: false
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,13 @@ import org.zowe.explorer.ui.build.tso.config.TSOConfigWrapper
import org.zowe.explorer.ui.build.tso.ui.TSOSessionParams
import org.zowe.explorer.utils.cancelByIndicator
import org.zowe.explorer.utils.log
import org.zowe.explorer.dataops.operations.MessageType as MessageTypeEnum
import org.zowe.kotlinsdk.MessageType
import org.zowe.kotlinsdk.TsoApi
import org.zowe.kotlinsdk.TsoData
import org.zowe.kotlinsdk.TsoResponse
import io.ktor.util.*
import retrofit2.Response
import java.nio.charset.Charset
import java.util.*

/**
* Factory class which represents a TSO operation runner. Defined in plugin.xml
Expand Down Expand Up @@ -85,12 +84,7 @@ class TsoOperationRunner : OperationRunner<TsoOperation, TsoResponse> {
response = api<TsoApi>(state.getConnectionConfig())
.sendMessageToTso(
state.getConnectionConfig().authToken,
body = TsoData(
tsoResponse = MessageType(
version = "0100",
data = operation.message
)
),
body = createTsoData(operation),
servletKey = servletKey
)
.cancelByIndicator(progressIndicator)
Expand Down Expand Up @@ -140,4 +134,51 @@ class TsoOperationRunner : OperationRunner<TsoOperation, TsoResponse> {
return response?.body() ?: throw Exception("Cannot retrieve response from server.")
}

/**
* Create TsoData object depending on the specified message type
* @throws Exception if message type not specified
*/
private fun createTsoData(operation: TsoOperation): TsoData {
return when (operation.messageType) {
MessageTypeEnum.TSO_MESSAGE -> TsoData(
tsoMessage = createMessageType(operation)
)

MessageTypeEnum.TSO_PROMPT -> TsoData(
tsoPrompt = createMessageType(operation)
)

MessageTypeEnum.TSO_RESPONSE -> TsoData(
tsoResponse = createMessageType(operation)
)

null -> throw Exception("Message type not specified")
}
}

/**
* Create MessageType object depending on the specified message data
* @throws Exception if message data not specified
*/
private fun createMessageType(operation: TsoOperation): MessageType {
return when (operation.messageData) {
MessageData.DATA_DATA -> MessageType(
version = "0100",
data = operation.message
)

MessageData.DATA_HIDDEN -> MessageType(
version = "0100",
hidden = operation.message
)

MessageData.DATA_ACTION -> MessageType(
version = "0100",
action = operation.message
)

null -> throw Exception("Message data not specified")
}
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,14 @@

package org.zowe.explorer.explorer.actions

import com.intellij.notification.Notification
import com.intellij.notification.NotificationAction
import com.intellij.notification.NotificationType
import com.intellij.notification.Notifications
import com.intellij.openapi.actionSystem.AnAction
import com.intellij.openapi.actionSystem.AnActionEvent
import com.intellij.openapi.application.runInEdt
import com.intellij.openapi.components.service
import com.intellij.openapi.progress.runModalTask
import com.intellij.openapi.ui.showOkNoDialog
import org.zowe.explorer.common.ui.cleanInvalidateOnExpand
import org.zowe.explorer.common.ui.showUntilDone
import org.zowe.explorer.config.configCrudable
Expand All @@ -24,6 +26,7 @@ import org.zowe.explorer.config.ws.FilesWorkingSetConfig
import org.zowe.explorer.dataops.DataOpsManager
import org.zowe.explorer.dataops.operations.DatasetAllocationOperation
import org.zowe.explorer.dataops.operations.DatasetAllocationParams
import org.zowe.explorer.explorer.ExplorerUnit
import org.zowe.explorer.explorer.FilesWorkingSet
import org.zowe.explorer.explorer.ui.AllocationDialog
import org.zowe.explorer.explorer.ui.DSMaskNode
Expand All @@ -40,6 +43,8 @@ import org.zowe.kotlinsdk.Dataset
import org.zowe.kotlinsdk.DatasetOrganization
import org.zowe.kotlinsdk.DsnameType

const val ALLOCATE_ACTION_NOTIFICATION_GROUP_ID = "org.zowe.explorer.explorer.AllocateActionNotificationGroup"

abstract class AllocateActionBase : AnAction() {

/**
Expand Down Expand Up @@ -135,34 +140,10 @@ abstract class AllocateActionBase : AnAction() {
}
val nodeToClean = parentProbablyDSMaskNode?.castOrNull<FileFetchNode<*, *, *, *, *, *>>()
nodeToClean?.let { cleanInvalidateOnExpand(nodeToClean, view) }

var nodeCleaned = false
runInEdt {
if (
showOkNoDialog(
title = "Dataset ${state.datasetName} Has Been Created",
message = "Would you like to add mask \"${state.datasetName}\" to ${workingSet.name}",
project = e.project,
okText = "Yes",
noText = "No"
)
) {
val filesWorkingSetConfig =
configCrudable.getByUniqueKey<FilesWorkingSetConfig>(workingSet.uuid)?.clone()
if (filesWorkingSetConfig != null) {
nodeToClean?.cleanCache(recursively = false, cleanBatchedQuery = true, sendTopic = false)
nodeCleaned = true

filesWorkingSetConfig.dsMasks.add(DSMask().apply { mask = state.datasetName })
configCrudable.update(filesWorkingSetConfig)
}
}

if (!nodeCleaned) {
nodeToClean?.cleanCache(recursively = false, cleanBatchedQuery = true)
}
}
nodeToClean?.cleanCache(recursively = false, cleanBatchedQuery = true)
initialState.errorMessage = ""

showNotification(state, workingSet)
}
.onFailure { t ->
explorer.reportThrowable(t, e.project)
Expand All @@ -182,4 +163,34 @@ abstract class AllocateActionBase : AnAction() {
override fun isDumbAware(): Boolean {
return true
}

/**
* Shows a notification about successful allocation and suggest adding a mask to the working set
*/
private fun showNotification(
state: DatasetAllocationParams,
workingSet: ExplorerUnit<*>
) {
val notification = Notification(
ALLOCATE_ACTION_NOTIFICATION_GROUP_ID,
"Dataset ${state.datasetName} has been created",
"Would you like to add mask \"${state.datasetName}\" to ${workingSet.name}?",
NotificationType.INFORMATION
)
notification.addActions(
setOf(
NotificationAction.createSimpleExpiring("Add mask") {
val filesWorkingSetConfig =
configCrudable.getByUniqueKey<FilesWorkingSetConfig>(workingSet.uuid)?.clone()
if (filesWorkingSetConfig != null) {
filesWorkingSetConfig.dsMasks.add(DSMask().apply { mask = state.datasetName })
configCrudable.update(filesWorkingSetConfig)
}
},
NotificationAction.createSimpleExpiring("Skip") { }
)
)
notification.setSuggestionType(true)
Notifications.Bus.notify(notification)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import com.intellij.ui.dsl.builder.panel
import com.intellij.ui.dsl.builder.toNullableProperty
import com.intellij.ui.dsl.gridLayout.HorizontalAlign
import com.intellij.ui.layout.selectedValueMatches
import org.zowe.explorer.common.message
import org.zowe.explorer.common.ui.StatefulDialog
import org.zowe.explorer.config.connect.ConnectionConfig
import org.zowe.explorer.config.connect.getUsername
Expand Down Expand Up @@ -133,6 +134,10 @@ class AllocationDialog(project: Project?, config: ConnectionConfig, override var
.bindItem(state.allocationParameters::allocationUnit.toNullableProperty())
.also { spaceUnitBox = it.component }
.widthGroup(sameWidthComboBoxGroup)
contextHelp(
description = message("allocation.dialog.unit.size.hint.description"),
title = message("allocation.dialog.unit.size.hint.title")
)
}
row {
label("Primary allocation: ")
Expand Down
Loading

0 comments on commit 29c1166

Please sign in to comment.