Skip to content

Commit

Permalink
IJMP-2145 Indexes have been added to zowe connections names
Browse files Browse the repository at this point in the history
Signed-off-by: Katsiaryna Tsytsenia <[email protected]>
  • Loading branch information
Katsiaryna Tsytsenia authored and Katsiaryna Tsytsenia committed Jan 27, 2025
1 parent 2d9acd1 commit 4c8da62
Show file tree
Hide file tree
Showing 11 changed files with 1,728 additions and 803 deletions.
17 changes: 13 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ concurrency:

jobs:
build:
runs-on: ubuntu-22.04
runs-on: ubuntu-latest
strategy:
matrix:
product: ["IC-231","IC-233","IC-242","IC-243"]
Expand All @@ -41,6 +41,9 @@ jobs:
pluginVerifierHomeDir: ${{ steps.properties.outputs.pluginVerifierHomeDir }}
steps:

- name: Install libsecret-tools
run: sudo apt-get install -y libsecret-tools

- name: Checkout the plugin GitHub repository
uses: actions/checkout@v4

Expand Down Expand Up @@ -101,7 +104,7 @@ jobs:

test_and_sonar:
needs: [build]
runs-on: ubuntu-22.04
runs-on: ubuntu-latest
strategy:
matrix:
product: ["IC-231","IC-233","IC-242","IC-243"]
Expand All @@ -122,6 +125,9 @@ jobs:
fail-fast: false
steps:

- name: Install libsecret-tools
run: sudo apt-get install -y libsecret-tools

- name: Checkout the plugin GitHub repository
uses: actions/checkout@v4

Expand All @@ -145,7 +151,7 @@ jobs:
- name: Publish tests result to artifacts
uses: actions/upload-artifact@v4
with:
name: tests-summary-success-report-${{ matrix.product }}
name: tests-report-${{ matrix.product }}
path: ${{ github.workspace }}/build/reports/tests

- name: Publish code coverage report to artifacts
Expand Down Expand Up @@ -174,7 +180,7 @@ jobs:
verify:
if: ${{ contains(github.ref, 'refs/heads/release/') || contains(github.ref, 'refs/heads/main') }}
needs: [build]
runs-on: ubuntu-22.04
runs-on: ubuntu-latest
strategy:
matrix:
product: ["IC-231","IC-233","IC-242","IC-243"]
Expand All @@ -201,6 +207,9 @@ jobs:
tool-cache: false
large-packages: false

- name: Install libsecret-tools
run: sudo apt-get install -y libsecret-tools

- name: Checkout the plugin GitHub repository
uses: actions/checkout@v4

Expand Down
10 changes: 8 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,14 @@ on:

jobs:
changelog-and-preparations:
runs-on: ubuntu-22.04
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
steps:

- name: Install libsecret-tools
run: sudo apt-get install -y libsecret-tools

- name: Checkout the plugin GitHub repository
uses: actions/checkout@v4
Expand Down Expand Up @@ -108,7 +111,7 @@ jobs:
release:
needs: [changelog-and-preparations]
runs-on: ubuntu-22.04
runs-on: ubuntu-latest
permissions:
contents: write
strategy:
Expand All @@ -131,6 +134,9 @@ jobs:
fail-fast: false
steps:

- name: Install libsecret-tools
run: sudo apt-get install -y libsecret-tools

- name: Checkout the plugin GitHub repository
uses: actions/checkout@v4

Expand Down
12 changes: 12 additions & 0 deletions src/main/kotlin/org/zowe/explorer/utils/miscUtils.kt
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ import org.zowe.explorer.explorer.WorkingSet
import org.zowe.explorer.explorer.ui.ExplorerTreeView
import org.zowe.explorer.explorer.ui.ExplorerUnitTreeNodeBase
import java.awt.Dimension
import java.io.InputStream
import java.time.LocalDateTime
import java.time.ZoneId
import java.time.format.DateTimeFormatter
Expand Down Expand Up @@ -398,3 +399,14 @@ fun createHelpButton(): JButton {
fun Presentation.addTooltip(tooltipText: String) {
this.putClientProperty(Key(JComponent.TOOL_TIP_TEXT_KEY), tooltipText)
}

/**
* Function returns an input stream for reading the specified resource.
* This function is required for testing purposes
* @param classLoader - current ClassLoader
* @param strPath - the resource path
* @return fn input stream for reading the resource; null if the resource could not be found
*/
fun getResourceAsStreamWrappable(classLoader: ClassLoader, strPath: String): InputStream? {
return classLoader.getResourceAsStream(strPath)
}
9 changes: 3 additions & 6 deletions src/main/kotlin/org/zowe/explorer/zowe/ZoweStartupActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,7 @@ const val ZOWE_CONFIG_NAME = "zowe.config.json"
*/
fun showNotificationForAddUpdateZoweConfigIfNeeded(project: Project, type: ZoweConfigType) {
val zoweConfigService = ZoweConfigService.getInstance(project)
val zoweConfigState = zoweConfigService.getZoweConfigState(type = type)

if (zoweConfigState == ZoweConfigState.NEED_TO_ADD) {
if (zoweConfigService.findAllZosmfExistingConnection(type).isEmpty()) {
val topic = if (type == ZoweConfigType.LOCAL)
LOCAL_ZOWE_CONFIG_CHANGED
else
Expand All @@ -61,7 +59,7 @@ fun showNotificationForAddUpdateZoweConfigIfNeeded(project: Project, type: ZoweC
addAction(object : DumbAwareAction("Add $type Zowe Connection") {
override fun actionPerformed(e: AnActionEvent) {
ZoweConfigService.getInstance(project)
.addOrUpdateZoweConfig(false, true, type)
.addOrUpdateZoweConfig(true, true, type)
hideBalloon()
}
}).notify(project)
Expand All @@ -76,8 +74,7 @@ fun showNotificationForAddUpdateZoweConfigIfNeeded(project: Project, type: ZoweC
*/
fun showDialogForDeleteZoweConfigIfNeeded(project: Project, type: ZoweConfigType) {
val zoweConfigService = ZoweConfigService.getInstance(project)
val zoweConfigState = zoweConfigService.getZoweConfigState(type = type)
if (zoweConfigState != ZoweConfigState.NEED_TO_ADD && zoweConfigState != ZoweConfigState.NOT_EXISTS) {
if (zoweConfigService.findAllZosmfExistingConnection(type).isNotEmpty()) {
val choice = Messages.showDialog(
project,
"$type Zowe config file has been deleted.\n" +
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,12 @@ interface ZoweConfigService {
*/
fun checkAndRemoveOldZoweConnection(type: ZoweConfigType)

/**
* Finds All existing connections related to zowe.config.json.
* @return list of found ConnectionConfigs related to zowe config if it exists or null otherwise.
*/
fun findAllZosmfExistingConnection(type: ZoweConfigType): List<ConnectionConfig>

companion object {
fun getInstance(project: Project): ZoweConfigService = project.getService(ZoweConfigService::class.java)
val lock = ReentrantReadWriteLock()
Expand Down
Loading

0 comments on commit 4c8da62

Please sign in to comment.