Skip to content

Commit

Permalink
Release/v1.2.0-231 is created
Browse files Browse the repository at this point in the history
Signed-off-by: Uladzislau <[email protected]>
  • Loading branch information
KUGDev committed Mar 13, 2024
2 parents 0ad65cc + da59b19 commit 4707bb3
Show file tree
Hide file tree
Showing 20 changed files with 112 additions and 57 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ All notable changes to the Zowe IntelliJ Plugin will be documented in this file.

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

* Feature: GitHub issue #165: IntelliJ 2023.3 support ([81f24fa3](https://github.com/zowe/zowe-explorer-intellij/commit/81f24fa3))


* Bugfix: Sync action does not work after file download ([bfb125d7](https://github.com/zowe/zowe-explorer-intellij/commit/bfb125d7))
* Bugifx: "Skip This Files" doesn't work when uploading local file to PDS ([749b2d4b](https://github.com/zowe/zowe-explorer-intellij/commit/749b2d4b))
* Bugifx: "Use new name" doesn't work for copying partitioned dataset to USS folder ([26d865be](https://github.com/zowe/zowe-explorer-intellij/commit/26d865be))
Expand Down
10 changes: 5 additions & 5 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ apply(plugin = "org.jetbrains.intellij")
apply(from = "gradle/sonar.gradle")

group = "org.zowe"
version = "1.2.0-223"
version = "1.2.0-231"
val remoteRobotVersion = "0.11.21"
val okHttp3Version = "4.12.0"
val kotestVersion = "5.6.2"
Expand Down Expand Up @@ -85,7 +85,7 @@ dependencies {
}

intellij {
version.set("2022.3")
version.set("2023.1")
}

tasks {
Expand All @@ -97,13 +97,13 @@ tasks {
}

patchPluginXml {
sinceBuild.set("223.7571")
untilBuild.set("223.*")
sinceBuild.set("231.8109")
untilBuild.set("233.*")
changeNotes.set(
"""
<b>New features:</b>
<ul>
<li>None at the moment</li>
<li>GitHub issue #165: IntelliJ 2023.3 support</li>
</ul>
<br>
<b>Fixed bugs:</b>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,16 @@ package org.zowe.explorer.config

import com.intellij.openapi.components.service
import com.intellij.openapi.project.Project
import com.intellij.openapi.vcs.changes.shelf.ShelveChangesManager.PostStartupActivity
import com.intellij.openapi.startup.ProjectActivity

/**
* Activity to prepare configs.
* @author Valiantsin Krus.
*/
class ConfigStartupActivity: PostStartupActivity() {
class ConfigStartupActivity: ProjectActivity {

/** Registers all config classes and migrate configs to state v2. */
override fun runActivity(project: Project) {
override suspend fun execute(project: Project) {
service<ConfigService>().apply {
registerAllConfigClasses()
service<OldConfigService>().state?.let { oldState ->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ package org.zowe.explorer.config
import com.intellij.openapi.components.service
import com.intellij.openapi.options.Configurable
import com.intellij.openapi.options.TabbedConfigurable
import com.intellij.openapi.progress.runBackgroundableTask
import org.zowe.explorer.config.settings.ui.SettingsConfigurable

/**
Expand Down Expand Up @@ -55,8 +56,10 @@ class MainframeConfigurable : TabbedConfigurable() {
* @see com.intellij.openapi.options.UnnamedConfigurable.reset
*/
override fun reset() {
ConfigSandbox.instance.fetch()
super.reset()
runBackgroundableTask(title = "Reset changes", cancellable = false) {
ConfigSandbox.instance.fetch()
super.reset()
}
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ package org.zowe.explorer.config.connect.ui.zosmf

import com.intellij.icons.AllIcons
import com.intellij.openapi.components.service
import com.intellij.openapi.progress.runBackgroundableTask
import com.intellij.openapi.project.Project
import com.intellij.openapi.ui.MessageDialogBuilder
import com.intellij.openapi.ui.MessageType
Expand Down Expand Up @@ -365,11 +366,13 @@ class ConnectionDialog(
state.password = getPassword(lastSuccessfulState.connectionConfig)
state.isAllowSsl = lastSuccessfulState.isAllowSsl
state.zVersion = lastSuccessfulState.zVersion
CredentialService.instance.setCredentials(
connectionConfigUuid = lastSuccessfulState.connectionUuid,
username = getUsername(lastSuccessfulState.connectionConfig),
password = getPassword(lastSuccessfulState.connectionConfig)
)
runBackgroundableTask("Setting credentials", project, false) {
CredentialService.instance.setCredentials(
connectionConfigUuid = lastSuccessfulState.connectionUuid,
username = getUsername(lastSuccessfulState.connectionConfig),
password = getPassword(lastSuccessfulState.connectionConfig)
)
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ package org.zowe.explorer.config.connect.ui.zosmf
import com.intellij.openapi.application.ApplicationManager
import com.intellij.openapi.application.invokeLater
import com.intellij.openapi.options.BoundSearchableConfigurable
import com.intellij.openapi.progress.runBackgroundableTask
import com.intellij.openapi.ui.DialogPanel
import com.intellij.openapi.ui.Messages
import com.intellij.openapi.ui.showOkCancelDialog
Expand Down Expand Up @@ -287,11 +288,13 @@ class ZOSMFConnectionConfigurable : BoundSearchableConfigurable("z/OSMF Connecti

/** Reset the Connections table changes. Updates UI when the changes were introduced */
override fun reset() {
val wasModified = isModified
rollbackSandbox<Credentials>()
rollbackSandbox<ConnectionConfig>()
if (wasModified) {
panel?.updateUI()
runBackgroundableTask(title = "Reset changes", cancellable = false) {
val wasModified = isModified
rollbackSandbox<Credentials>()
rollbackSandbox<ConnectionConfig>()
if (wasModified) {
panel?.updateUI()
}
}
}

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

package org.zowe.explorer.editor

import com.intellij.openapi.application.runInEdt
import com.intellij.openapi.components.service
import com.intellij.openapi.editor.Editor
import com.intellij.openapi.editor.ex.EditorEx
import com.intellij.openapi.editor.ex.FocusChangeListener
import com.intellij.openapi.progress.runBackgroundableTask
import com.intellij.openapi.ui.isComponentUnderMouse
import org.zowe.explorer.config.ConfigService
import org.zowe.explorer.dataops.DataOpsManager
Expand Down Expand Up @@ -67,11 +69,20 @@ class FileEditorFocusListener: FocusChangeListener {
val previousContent = contentSynchronizer?.successfulContentStorage(syncProvider)
val needToUpload = contentSynchronizer?.isFileUploadNeeded(syncProvider) == true
if (!(currentContent contentEquals previousContent) && needToUpload) {
val incompatibleEncoding = !checkEncodingCompatibility(file, project)
if (incompatibleEncoding && !showSaveAnywayDialog(file.charset)) {
return
runBackgroundableTask(
title = "Synchronizing ${file.name}...",
project = project,
cancellable = true
) {
val incompatibleEncoding = !checkEncodingCompatibility(file, project)
runInEdt {
if (incompatibleEncoding && !showSaveAnywayDialog(file.charset)) {
return@runInEdt
}
runWriteActionInEdtAndWait { syncProvider.saveDocument() }
sendTopic(AutoSyncFileListener.AUTO_SYNC_FILE, project).sync(file)
}
}
sendTopic(AutoSyncFileListener.AUTO_SYNC_FILE, project).sync(file)
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

package org.zowe.explorer.editor

import com.intellij.openapi.application.runWriteAction
import com.intellij.openapi.project.Project
import com.intellij.openapi.project.ProjectManager
import com.intellij.openapi.project.ProjectManagerListener
Expand Down Expand Up @@ -69,9 +70,11 @@ class ProjectCloseListener : ProjectManagerListener {
* @param project the project to filter encoding mappings.
*/
override fun projectClosingBeforeSave(project: Project) {
val encodingManager = EncodingProjectManager.getInstance(project) as EncodingProjectManagerImpl
val filteredMappings = encodingManager.allMappings.toMutableMap().filter { it.key !is MFVirtualFile }
encodingManager.setMapping(filteredMappings)
runWriteAction {
val encodingManager = EncodingProjectManager.getInstance(project) as EncodingProjectManagerImpl
val filteredMappings = encodingManager.allMappings.toMutableMap().filter { it.key !is MFVirtualFile }
encodingManager.setMapping(filteredMappings)
}
super.projectClosingBeforeSave(project)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,20 @@
package org.zowe.explorer.editor

import com.intellij.openapi.project.Project
import com.intellij.openapi.startup.StartupActivity
import com.intellij.openapi.startup.ProjectActivity
import com.intellij.openapi.wm.StatusBar
import com.intellij.openapi.wm.StatusBarWidgetFactory

/**
* Project post startup activity.
*/
class ProjectStartupActivity: StartupActivity.DumbAware {
class ProjectStartupActivity: ProjectActivity {

/**
* Implementation of [StartupActivity.runActivity].
* Implementation of [ProjectActivity.execute].
* Unregisters widget factories that provide status bar widgets that are overridden in the plugin.
*/
override fun runActivity(project: Project) {
override suspend fun execute(project: Project) {
val extensionPoint = StatusBarWidgetFactory.EP_NAME.point
extensionPoint.extensionList.filter {
it.id == StatusBar.StandardWidgets.ENCODING_PANEL || it.id == StatusBar.StandardWidgets.LINE_SEPARATOR_PANEL
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,18 @@ import com.intellij.openapi.vfs.VirtualFile
import com.intellij.openapi.wm.StatusBar
import com.intellij.openapi.wm.StatusBarWidget
import com.intellij.openapi.wm.impl.status.EncodingPanel
import kotlinx.coroutines.CoroutineScope
import org.zowe.explorer.editor.isMfVirtualFile

const val MF_ENCODING_PANEL_WIDGET = "ZoweMF" + StatusBar.StandardWidgets.ENCODING_PANEL

/**
* Encoding panel in status bar with correctly display for MF files.
*/
class MfEncodingPanel(project: Project): EncodingPanel(project) {
class MfEncodingPanel(project: Project, scope: CoroutineScope): EncodingPanel(project, scope) {

override fun createInstance(project: Project): StatusBarWidget {
return MfEncodingPanel(project)
return MfEncodingPanel(project, scope)
}

/** Widget is not enabled for MF files. */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,25 @@ package org.zowe.explorer.editor.status

import com.intellij.openapi.project.Project
import com.intellij.openapi.wm.StatusBarWidget
import com.intellij.openapi.wm.impl.status.EncodingPanelWidgetFactory
import com.intellij.ui.UIBundle
import com.intellij.openapi.wm.impl.status.widget.StatusBarEditorBasedWidgetFactory
import kotlinx.coroutines.CoroutineScope

/**
* Status bar widget factory for [MfEncodingPanel].
*/
class MfEncodingPanelWidgetFactory : EncodingPanelWidgetFactory() {
class MfEncodingPanelWidgetFactory: StatusBarEditorBasedWidgetFactory() {

override fun getId(): String {
return MF_ENCODING_PANEL_WIDGET
}

override fun createWidget(project: Project): StatusBarWidget {
return MfEncodingPanel(project)
override fun getDisplayName(): String {
return UIBundle.message("status.bar.encoding.widget.name")
}

override fun createWidget(project: Project, scope: CoroutineScope): StatusBarWidget {
return MfEncodingPanel(project, scope)
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,17 @@ import com.intellij.openapi.wm.StatusBarWidget
import com.intellij.openapi.wm.impl.status.LineSeparatorPanel
import org.zowe.explorer.editor.isMfVirtualFile
import org.zowe.explorer.editor.isUssVirtualFile
import kotlinx.coroutines.CoroutineScope

const val MF_LINE_SEPARATOR_PANEL_WIDGET = "ZoweMF" + StatusBar.StandardWidgets.LINE_SEPARATOR_PANEL

/**
* Line separator panel in status bar with correctly display for MF files.
*/
class MfLineSeparatorPanel(project: Project): LineSeparatorPanel(project) {
class MfLineSeparatorPanel(project: Project, scope: CoroutineScope): LineSeparatorPanel(project, scope) {

override fun createInstance(project: Project): StatusBarWidget {
return MfLineSeparatorPanel(project)
return MfLineSeparatorPanel(project, scope)
}

/** Widget is not enabled for all MF files except USS files. */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,25 @@ package org.zowe.explorer.editor.status

import com.intellij.openapi.project.Project
import com.intellij.openapi.wm.StatusBarWidget
import com.intellij.openapi.wm.impl.status.LineSeparatorWidgetFactory
import com.intellij.openapi.wm.impl.status.widget.StatusBarEditorBasedWidgetFactory
import com.intellij.ui.UIBundle
import kotlinx.coroutines.CoroutineScope

/**
* Status bar widget factory for [MfLineSeparatorPanel].
*/
class MfLineSeparatorWidgetFactory : LineSeparatorWidgetFactory() {
class MfLineSeparatorWidgetFactory: StatusBarEditorBasedWidgetFactory() {

override fun getId(): String {
return MF_LINE_SEPARATOR_PANEL_WIDGET
}

override fun createWidget(project: Project): StatusBarWidget {
return MfLineSeparatorPanel(project)
override fun getDisplayName(): String {
return UIBundle.message("status.bar.line.separator.widget.name")
}

override fun createWidget(project: Project, scope: CoroutineScope): StatusBarWidget {
return MfLineSeparatorPanel(project, scope)
}

}
14 changes: 9 additions & 5 deletions src/main/kotlin/org/zowe/explorer/explorer/ui/WorkingSetNode.kt
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ package org.zowe.explorer.explorer.ui
import com.intellij.icons.AllIcons
import com.intellij.ide.projectView.PresentationData
import com.intellij.ide.util.treeView.AbstractTreeNode
import com.intellij.openapi.progress.runBackgroundableTask
import com.intellij.openapi.project.Project
import com.intellij.ui.LayeredIcon
import com.intellij.ui.SimpleTextAttributes
Expand Down Expand Up @@ -80,10 +81,13 @@ abstract class WorkingSetNode<Connection : ConnectionConfigBase, MaskType>(
* @param presentation the presentation, which explanatory text will be assigned to
*/
protected fun addInfo(presentation: PresentationData) {
val connectionConfig = value.connectionConfig ?: return
val url = value.connectionConfig?.url ?: return
val username = getUsername(connectionConfig)
val formedUsername = if (connectionConfig.zoweConfigPath == null) username else "*".repeat(username.length)
presentation.addText(" $formedUsername on ${connectionConfig.name} [${url}]", SimpleTextAttributes.GRAYED_ATTRIBUTES)
runBackgroundableTask("Getting connection information", project, false) {
val connectionConfig = value.connectionConfig ?: return@runBackgroundableTask
val url = value.connectionConfig?.url ?: return@runBackgroundableTask
val username = getUsername(connectionConfig)
val formedUsername = if (connectionConfig.zoweConfigPath == null) username else "*".repeat(username.length)
presentation.addText(" $formedUsername on ${connectionConfig.name} [${url}]", SimpleTextAttributes.GRAYED_ATTRIBUTES)
apply(presentation)
}
}
}
3 changes: 2 additions & 1 deletion src/main/kotlin/org/zowe/explorer/utils/encodingUtils.kt
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import com.intellij.ide.IdeBundle
import com.intellij.openapi.actionSystem.ActionUpdateThread
import com.intellij.openapi.actionSystem.AnActionEvent
import com.intellij.openapi.actionSystem.DefaultActionGroup
import com.intellij.openapi.application.runReadAction
import com.intellij.openapi.fileEditor.FileDocumentManager
import com.intellij.openapi.project.DumbAwareAction
import com.intellij.openapi.project.Project
Expand Down Expand Up @@ -210,7 +211,7 @@ fun createCharsetsActionGroup(virtualFile: VirtualFile, attributes: RemoteUssAtt
*/
fun checkEncodingCompatibility(file: VirtualFile, project: Project): Boolean {
var compatible = true
val psiFile = PsiManager.getInstance(project).findFile(file)
val psiFile = runReadAction { PsiManager.getInstance(project).findFile(file) }
psiFile?.let {
val inspectionProfile = InspectionProjectProfileManager.getInstance(project).currentProfile
val inspectionTool = inspectionProfile.getInspectionTool("ZoweMFLossyEncoding", project)
Expand Down
Loading

0 comments on commit 4707bb3

Please sign in to comment.