From b10344ee123cc815dc56fa2372e927d473acaad0 Mon Sep 17 00:00:00 2001 From: Trae Yelovich Date: Tue, 24 Sep 2024 11:15:09 -0400 Subject: [PATCH 1/7] fix(ProfilesUtils): Do not reload window unless only v1 profiles present Signed-off-by: Trae Yelovich --- packages/zowe-explorer/CHANGELOG.md | 1 + .../__tests__/__unit__/utils/ProfilesUtils.unit.test.ts | 5 +++++ packages/zowe-explorer/src/utils/ProfilesUtils.ts | 2 +- 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/packages/zowe-explorer/CHANGELOG.md b/packages/zowe-explorer/CHANGELOG.md index de89e47b21..db973ef98f 100644 --- a/packages/zowe-explorer/CHANGELOG.md +++ b/packages/zowe-explorer/CHANGELOG.md @@ -15,6 +15,7 @@ All notable changes to the "vscode-extension-for-zowe" extension will be documen - Fixed issue where file extensions were removed from data sets, causing language detection to sometimes fail for Zowe Explorer extenders. [#3121](https://github.com/zowe/zowe-explorer-vscode/issues/3121) - Fixed an issue where copying and pasting a file/folder in the USS tree would fail abruptly, displaying an error. [#3128](https://github.com/zowe/zowe-explorer-vscode/issues/3128) - To fix Strange behaviour of Job label under Job Favorites. [#2632](https://github.com/zowe/zowe-explorer-vscode/issues/2632) +- Fixed issue where Zowe Explorer would reload the VS Code window during initialization when no config files are present. [#3147](https://github.com/zowe/zowe-explorer-vscode/issues/3147) ## `3.0.0-next.202409132122` diff --git a/packages/zowe-explorer/__tests__/__unit__/utils/ProfilesUtils.unit.test.ts b/packages/zowe-explorer/__tests__/__unit__/utils/ProfilesUtils.unit.test.ts index 4fda6fcfde..98a4442c43 100644 --- a/packages/zowe-explorer/__tests__/__unit__/utils/ProfilesUtils.unit.test.ts +++ b/packages/zowe-explorer/__tests__/__unit__/utils/ProfilesUtils.unit.test.ts @@ -349,6 +349,10 @@ describe("ProfilesUtils unit tests", () => { inspect: jest.fn(), update: jest.fn(), }); + const onlyV1ProfsExistMock = new MockedProperty(imperative.ProfileInfo, "onlyV1ProfilesExist", { + configurable: true, + get: () => true, + }); const executeCommandMock = jest.spyOn(vscode.commands, "executeCommand").mockImplementation(); const getValueMock = jest.spyOn(ZoweLocalStorage, "getValue").mockReturnValue(undefined); const setValueMock = jest.spyOn(ZoweLocalStorage, "setValue").mockImplementation(); @@ -361,6 +365,7 @@ describe("ProfilesUtils unit tests", () => { getConfigurationMock.mockRestore(); getValueMock.mockRestore(); setValueMock.mockRestore(); + onlyV1ProfsExistMock[Symbol.dispose](); profInfoSpy.mockRestore(); }); diff --git a/packages/zowe-explorer/src/utils/ProfilesUtils.ts b/packages/zowe-explorer/src/utils/ProfilesUtils.ts index 8b49b0ed38..3f89504ff6 100644 --- a/packages/zowe-explorer/src/utils/ProfilesUtils.ts +++ b/packages/zowe-explorer/src/utils/ProfilesUtils.ts @@ -349,7 +349,7 @@ export class ProfilesUtils { // VS Code registers our updated TreeView IDs. Otherwise, VS Code's "Refresh Extensions" option will break v3 init. const ussPersistentSettings = vscode.workspace.getConfiguration("Zowe-USS-Persistent"); const upgradingFromV1 = ZoweLocalStorage.getValue(Definitions.LocalStorageKey.V1_MIGRATION_STATUS); - if (ussPersistentSettings != null && upgradingFromV1 == null) { + if (ussPersistentSettings != null && upgradingFromV1 == null && imperative.ProfileInfo.onlyV1ProfilesExist) { ZoweLocalStorage.setValue(Definitions.LocalStorageKey.V1_MIGRATION_STATUS, Definitions.V1MigrationStatus.JustMigrated); await vscode.commands.executeCommand("workbench.action.reloadWindow"); } From f1fd805ca2da7350ba2ecdd4cffbfed824e3ee1e Mon Sep 17 00:00:00 2001 From: Trae Yelovich Date: Tue, 24 Sep 2024 12:39:50 -0400 Subject: [PATCH 2/7] refactor: ZoweLocalStorage.setValue returns Thenable; await setValue calls Signed-off-by: Trae Yelovich --- .../__unit__/utils/ProfilesUtils.unit.test.ts | 50 +++++++++++++++---- packages/zowe-explorer/src/extension.ts | 2 +- .../src/tools/ZoweLocalStorage.ts | 4 +- .../zowe-explorer/src/utils/ProfilesUtils.ts | 9 ++-- 4 files changed, 48 insertions(+), 17 deletions(-) diff --git a/packages/zowe-explorer/__tests__/__unit__/utils/ProfilesUtils.unit.test.ts b/packages/zowe-explorer/__tests__/__unit__/utils/ProfilesUtils.unit.test.ts index 98a4442c43..1b1e193ac0 100644 --- a/packages/zowe-explorer/__tests__/__unit__/utils/ProfilesUtils.unit.test.ts +++ b/packages/zowe-explorer/__tests__/__unit__/utils/ProfilesUtils.unit.test.ts @@ -370,6 +370,41 @@ describe("ProfilesUtils unit tests", () => { profInfoSpy.mockRestore(); }); + it("should not reload the window during migration if imperative.ProfileInfo.onlyV1ProfilesExist is false", async () => { + const profInfoSpy = jest.spyOn(ProfilesUtils, "getProfileInfo").mockReturnValueOnce({ + readProfilesFromDisk: jest.fn(), + hasValidSchema: false, + getTeamConfig: () => ({ + exists: false, + }), + } as never); + const getConfigurationMock = jest.spyOn(vscode.workspace, "getConfiguration").mockReturnValue({ + persistent: true, + get: jest.fn(), + has: jest.fn(), + inspect: jest.fn(), + update: jest.fn(), + }); + const onlyV1ProfsExistMock = new MockedProperty(imperative.ProfileInfo, "onlyV1ProfilesExist", { + configurable: true, + get: () => false, + }); + const executeCommandMock = jest.spyOn(vscode.commands, "executeCommand").mockImplementation(); + const getValueMock = jest.spyOn(ZoweLocalStorage, "getValue").mockReturnValue(undefined); + const setValueMock = jest.spyOn(ZoweLocalStorage, "setValue").mockImplementation(); + await ProfilesUtils.readConfigFromDisk(true); + expect(getConfigurationMock).toHaveBeenCalledWith("Zowe-USS-Persistent"); + expect(getValueMock).toHaveBeenCalledWith(Definitions.LocalStorageKey.V1_MIGRATION_STATUS); + expect(executeCommandMock).not.toHaveBeenCalledWith("workbench.action.reloadWindow"); + executeCommandMock.mockRestore(); + getConfigurationMock.mockRestore(); + getValueMock.mockRestore(); + setValueMock.mockRestore(); + onlyV1ProfsExistMock[Symbol.dispose](); + + profInfoSpy.mockRestore(); + }); + it("should call v1ProfileOptions if team config does not exist and only v1 profiles exist", async () => { const fakeProfInfo = { readProfilesFromDisk: jest.fn(), @@ -1175,33 +1210,30 @@ describe("ProfilesUtils unit tests", () => { }; } - it("should return early if the migration status is nullish", () => { + it("should return early if the migration status is nullish", async () => { const blockMocks = getBlockMocks(); blockMocks.getValueMock.mockReturnValueOnce(undefined); - ProfilesUtils.handleV1MigrationStatus(); + await ProfilesUtils.handleV1MigrationStatus(); expect(blockMocks.setValueMock).not.toHaveBeenCalled(); blockMocks.getValueMock.mockRestore(); }); - it("should call executeCommand with zowe.ds.addSession if the migration status is CreateConfigSelected", () => { + it("should call executeCommand with zowe.ds.addSession if the migration status is CreateConfigSelected", async () => { const blockMocks = getBlockMocks(); const executeCommandMock = jest.spyOn(vscode.commands, "executeCommand").mockImplementation(); blockMocks.getValueMock.mockReturnValueOnce(Definitions.V1MigrationStatus.CreateConfigSelected); blockMocks.setValueMock.mockImplementation(); - ProfilesUtils.handleV1MigrationStatus(); + await ProfilesUtils.handleV1MigrationStatus(); expect(executeCommandMock.mock.lastCall?.[0]).toBe("zowe.ds.addSession"); blockMocks.getValueMock.mockRestore(); blockMocks.setValueMock.mockRestore(); }); - it("should clear the v1 migration status once the migration status is handled", () => { + it("should clear the v1 migration status once the migration status is handled", async () => { const blockMocks = getBlockMocks(); blockMocks.getValueMock.mockReturnValueOnce(Definitions.V1MigrationStatus.JustMigrated); - blockMocks.setValueMock.mockImplementation(); - ProfilesUtils.handleV1MigrationStatus(); - expect(blockMocks.setValueMock).toHaveBeenCalledWith(Definitions.LocalStorageKey.V1_MIGRATION_STATUS, undefined); + await ProfilesUtils.handleV1MigrationStatus(); blockMocks.getValueMock.mockRestore(); - blockMocks.setValueMock.mockRestore(); }); }); }); diff --git a/packages/zowe-explorer/src/extension.ts b/packages/zowe-explorer/src/extension.ts index d4e39adac3..5fe3bb1813 100644 --- a/packages/zowe-explorer/src/extension.ts +++ b/packages/zowe-explorer/src/extension.ts @@ -56,7 +56,7 @@ export async function activate(context: vscode.ExtensionContext): Promise(key, defaultValue); } - public static setValue(key: Definitions.LocalStorageKey | PersistenceSchemaEnum, value: T): void { + public static setValue(key: Definitions.LocalStorageKey | PersistenceSchemaEnum, value: T): Thenable { ZoweLogger.trace("ZoweLocalStorage.setValue called."); - ZoweLocalStorage.storage.update(key, value); + return ZoweLocalStorage.storage.update(key, value); } } diff --git a/packages/zowe-explorer/src/utils/ProfilesUtils.ts b/packages/zowe-explorer/src/utils/ProfilesUtils.ts index 3f89504ff6..02ba4be21d 100644 --- a/packages/zowe-explorer/src/utils/ProfilesUtils.ts +++ b/packages/zowe-explorer/src/utils/ProfilesUtils.ts @@ -350,7 +350,7 @@ export class ProfilesUtils { const ussPersistentSettings = vscode.workspace.getConfiguration("Zowe-USS-Persistent"); const upgradingFromV1 = ZoweLocalStorage.getValue(Definitions.LocalStorageKey.V1_MIGRATION_STATUS); if (ussPersistentSettings != null && upgradingFromV1 == null && imperative.ProfileInfo.onlyV1ProfilesExist) { - ZoweLocalStorage.setValue(Definitions.LocalStorageKey.V1_MIGRATION_STATUS, Definitions.V1MigrationStatus.JustMigrated); + await ZoweLocalStorage.setValue(Definitions.LocalStorageKey.V1_MIGRATION_STATUS, Definitions.V1MigrationStatus.JustMigrated); await vscode.commands.executeCommand("workbench.action.reloadWindow"); } if (imperative.ProfileInfo.onlyV1ProfilesExist) { @@ -359,7 +359,7 @@ export class ProfilesUtils { } } - public static handleV1MigrationStatus(): void { + public static async handleV1MigrationStatus(): Promise { const migrationStatus = ZoweLocalStorage.getValue(Definitions.LocalStorageKey.V1_MIGRATION_STATUS); if (migrationStatus == null) { // If there is no v1 migration status, return. @@ -369,9 +369,8 @@ export class ProfilesUtils { // Open the "Add Session" quick pick if the user selected "Create New" in the v1 migration prompt. if (migrationStatus === Definitions.V1MigrationStatus.CreateConfigSelected) { vscode.commands.executeCommand("zowe.ds.addSession", SharedTreeProviders.ds); + await ZoweLocalStorage.setValue(Definitions.LocalStorageKey.V1_MIGRATION_STATUS, Definitions.V1MigrationStatus.JustMigrated); } - - ZoweLocalStorage.setValue(Definitions.LocalStorageKey.V1_MIGRATION_STATUS, undefined); } public static async promptCredentials(node: IZoweTreeNode): Promise { @@ -537,7 +536,7 @@ export class ProfilesUtils { switch (selection) { case createButton: { ZoweLogger.info("Create new team configuration chosen."); - ZoweLocalStorage.setValue(Definitions.LocalStorageKey.V1_MIGRATION_STATUS, Definitions.V1MigrationStatus.CreateConfigSelected); + await ZoweLocalStorage.setValue(Definitions.LocalStorageKey.V1_MIGRATION_STATUS, Definitions.V1MigrationStatus.CreateConfigSelected); break; } case convertButton: { From f109bbe4fc74a462a704cbdd58414be136880922 Mon Sep 17 00:00:00 2001 From: Trae Yelovich Date: Tue, 24 Sep 2024 15:42:13 -0400 Subject: [PATCH 3/7] feat: Dialog for new ZE users when no configs detected Signed-off-by: Trae Yelovich --- .../__unit__/utils/ProfilesUtils.unit.test.ts | 78 +++++++++++++++++++ packages/zowe-explorer/src/extension.ts | 2 +- .../zowe-explorer/src/utils/ProfilesUtils.ts | 21 +++++ 3 files changed, 100 insertions(+), 1 deletion(-) diff --git a/packages/zowe-explorer/__tests__/__unit__/utils/ProfilesUtils.unit.test.ts b/packages/zowe-explorer/__tests__/__unit__/utils/ProfilesUtils.unit.test.ts index 1b1e193ac0..520639e15b 100644 --- a/packages/zowe-explorer/__tests__/__unit__/utils/ProfilesUtils.unit.test.ts +++ b/packages/zowe-explorer/__tests__/__unit__/utils/ProfilesUtils.unit.test.ts @@ -1236,4 +1236,82 @@ describe("ProfilesUtils unit tests", () => { blockMocks.getValueMock.mockRestore(); }); }); + + describe("promptUserWithNoConfigs", () => { + it("prompts the user if they don't have any Zowe client configs", async () => { + const profInfoMock = jest.spyOn(ProfilesUtils, "getProfileInfo").mockResolvedValue({ + getTeamConfig: () => ({ exists: false }), + } as any); + const onlyV1ProfsExistMock = new MockedProperty(imperative.ProfileInfo, "onlyV1ProfilesExist", { + configurable: true, + get: () => false, + }); + const showMessageSpy = jest.spyOn(Gui, "showMessage"); + await ProfilesUtils.promptUserWithNoConfigs(); + expect(showMessageSpy).toHaveBeenCalledWith( + "No Zowe client configurations were detected. Click 'Create New' to create a new Zowe team configuration.", + { items: ["Create New"] } + ); + expect(profInfoMock).toHaveBeenCalled(); + profInfoMock.mockRestore(); + onlyV1ProfsExistMock[Symbol.dispose](); + }); + it("executes zowe.ds.addSession if the user selects 'Create New' in the prompt", async () => { + const profInfoMock = jest.spyOn(ProfilesUtils, "getProfileInfo").mockResolvedValue({ + getTeamConfig: () => ({ exists: false }), + } as any); + const onlyV1ProfsExistMock = new MockedProperty(imperative.ProfileInfo, "onlyV1ProfilesExist", { + configurable: true, + get: () => false, + }); + const showMessageSpy = jest.spyOn(Gui, "showMessage").mockResolvedValue("Create New"); + const executeCommandMock = jest.spyOn(vscode.commands, "executeCommand").mockImplementation(); + await ProfilesUtils.promptUserWithNoConfigs(); + expect(showMessageSpy).toHaveBeenCalledWith( + "No Zowe client configurations were detected. Click 'Create New' to create a new Zowe team configuration.", + { items: ["Create New"] } + ); + expect(profInfoMock).toHaveBeenCalled(); + expect(executeCommandMock).toHaveBeenCalledWith("zowe.ds.addSession"); + executeCommandMock.mockRestore(); + profInfoMock.mockRestore(); + onlyV1ProfsExistMock[Symbol.dispose](); + }); + it("does not prompt the user if they have a Zowe team config", async () => { + const profInfoMock = jest.spyOn(ProfilesUtils, "getProfileInfo").mockResolvedValue({ + getTeamConfig: () => ({ exists: true }), + } as any); + const onlyV1ProfsExistMock = new MockedProperty(imperative.ProfileInfo, "onlyV1ProfilesExist", { + configurable: true, + get: () => false, + }); + const showMessageSpy = jest.spyOn(Gui, "showMessage"); + await ProfilesUtils.promptUserWithNoConfigs(); + expect(showMessageSpy).not.toHaveBeenCalledWith( + "No Zowe client configurations were detected. Click 'Create New' to create a new Zowe team configuration.", + { items: ["Create New"] } + ); + expect(profInfoMock).toHaveBeenCalled(); + profInfoMock.mockRestore(); + onlyV1ProfsExistMock[Symbol.dispose](); + }); + it("does not prompt the user if they have v1 profiles", async () => { + const profInfoMock = jest.spyOn(ProfilesUtils, "getProfileInfo").mockResolvedValue({ + getTeamConfig: () => ({ exists: false }), + } as any); + const onlyV1ProfsExistMock = new MockedProperty(imperative.ProfileInfo, "onlyV1ProfilesExist", { + configurable: true, + get: () => true, + }); + const showMessageSpy = jest.spyOn(Gui, "showMessage"); + await ProfilesUtils.promptUserWithNoConfigs(); + expect(showMessageSpy).not.toHaveBeenCalledWith( + "No Zowe client configurations were detected. Click 'Create New' to create a new Zowe team configuration.", + { items: ["Create New"] } + ); + expect(profInfoMock).toHaveBeenCalled(); + profInfoMock.mockRestore(); + onlyV1ProfsExistMock[Symbol.dispose](); + }); + }); }); diff --git a/packages/zowe-explorer/src/extension.ts b/packages/zowe-explorer/src/extension.ts index 5fe3bb1813..4ba08c94dd 100644 --- a/packages/zowe-explorer/src/extension.ts +++ b/packages/zowe-explorer/src/extension.ts @@ -57,7 +57,7 @@ export async function activate(context: vscode.ExtensionContext): Promise { + const profInfo = await ProfilesUtils.getProfileInfo(); + if (!profInfo.getTeamConfig().exists && !imperative.ProfileInfo.onlyV1ProfilesExist) { + Gui.showMessage( + vscode.l10n.t("No Zowe client configurations were detected. Click 'Create New' to create a new Zowe team configuration."), + { + items: [vscode.l10n.t("Create New")], + } + ).then(async (selection) => { + if (selection === vscode.l10n.t("Create New")) { + await vscode.commands.executeCommand("zowe.ds.addSession"); + } + }); + } + } + public static async promptCredentials(node: IZoweTreeNode): Promise { ZoweLogger.trace("ProfilesUtils.promptCredentials called."); const mProfileInfo = await Constants.PROFILES_CACHE.getProfileInfo(); From 05372fdca3c7999cf7850a4cf76e7b5e1be1cfd5 Mon Sep 17 00:00:00 2001 From: Trae Yelovich Date: Tue, 24 Sep 2024 15:44:26 -0400 Subject: [PATCH 4/7] chore: update ZE changelog Signed-off-by: Trae Yelovich --- packages/zowe-explorer/CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/zowe-explorer/CHANGELOG.md b/packages/zowe-explorer/CHANGELOG.md index db973ef98f..05c25c5e2c 100644 --- a/packages/zowe-explorer/CHANGELOG.md +++ b/packages/zowe-explorer/CHANGELOG.md @@ -6,6 +6,8 @@ All notable changes to the "vscode-extension-for-zowe" extension will be documen ### New features and enhancements +- Added a notification with an option to create a new configuration when a user does not have any Zowe client configurations. [#3148](https://github.com/zowe/zowe-explorer-vscode/pull/3148) + ### Bug fixes - The "Zowe Resources" panel is now hidden by default until Zowe Explorer reveals it to display a table or other data. [#3113](https://github.com/zowe/zowe-explorer-vscode/issues/3113) From 543f98fa2933d2c9703cd704408c3387ef8b462d Mon Sep 17 00:00:00 2001 From: Trae Yelovich Date: Tue, 24 Sep 2024 15:47:07 -0400 Subject: [PATCH 5/7] chore: run prepublish Signed-off-by: Trae Yelovich --- packages/zowe-explorer/l10n/bundle.l10n.json | 55 ++++++++++---------- packages/zowe-explorer/l10n/poeditor.json | 19 +++---- 2 files changed, 38 insertions(+), 36 deletions(-) diff --git a/packages/zowe-explorer/l10n/bundle.l10n.json b/packages/zowe-explorer/l10n/bundle.l10n.json index 38aa626ec4..b1db509755 100644 --- a/packages/zowe-explorer/l10n/bundle.l10n.json +++ b/packages/zowe-explorer/l10n/bundle.l10n.json @@ -41,6 +41,8 @@ "Install": "Install", "Reload": "Reload", "No valid schema was found for the active team configuration. This may introduce issues with profiles in Zowe Explorer.": "No valid schema was found for the active team configuration. This may introduce issues with profiles in Zowe Explorer.", + "No Zowe client configurations were detected. Click 'Create New' to create a new Zowe team configuration.": "No Zowe client configurations were detected. Click 'Create New' to create a new Zowe team configuration.", + "Create New": "Create New", "\"Update Credentials\" operation not supported when \"autoStore\" is false": "\"Update Credentials\" operation not supported when \"autoStore\" is false", "Connection Name": "Connection Name", "Enter a name for the connection.": "Enter a name for the connection.", @@ -85,7 +87,6 @@ }, "Zowe Profiles initialized successfully.": "Zowe Profiles initialized successfully.", "Convert Existing Profiles": "Convert Existing Profiles", - "Create New": "Create New", "Operation cancelled": "Operation cancelled", "Tree Item is not a Zowe Explorer item.": "Tree Item is not a Zowe Explorer item.", "Zowe Explorer": "Zowe Explorer", @@ -170,32 +171,6 @@ "Required API functions for pasting (fileList and copy/uploadFromBuffer) were not found.": "Required API functions for pasting (fileList and copy/uploadFromBuffer) were not found.", "Uploading USS files...": "Uploading USS files...", "Error uploading files": "Error uploading files", - "The 'move' function is not implemented for this USS API.": "The 'move' function is not implemented for this USS API.", - "Could not list USS files: Empty path provided in URI": "Could not list USS files: Empty path provided in URI", - "Profile does not exist for this file.": "Profile does not exist for this file.", - "$(sync~spin) Saving USS file...": "$(sync~spin) Saving USS file...", - "Renaming {0} failed due to API error: {1}/File pathError message": { - "message": "Renaming {0} failed due to API error: {1}", - "comment": [ - "File path", - "Error message" - ] - }, - "Deleting {0} failed due to API error: {1}/File nameError message": { - "message": "Deleting {0} failed due to API error: {1}", - "comment": [ - "File name", - "Error message" - ] - }, - "No error details given": "No error details given", - "Error fetching destination {0} for paste action: {1}/USS pathError message": { - "message": "Error fetching destination {0} for paste action: {1}", - "comment": [ - "USS path", - "Error message" - ] - }, "Downloaded: {0}/Download time": { "message": "Downloaded: {0}", "comment": [ @@ -266,6 +241,32 @@ "initializeUSSFavorites.error.buttonRemove": "initializeUSSFavorites.error.buttonRemove", "File does not exist. It may have been deleted.": "File does not exist. It may have been deleted.", "$(sync~spin) Pulling from Mainframe...": "$(sync~spin) Pulling from Mainframe...", + "The 'move' function is not implemented for this USS API.": "The 'move' function is not implemented for this USS API.", + "Could not list USS files: Empty path provided in URI": "Could not list USS files: Empty path provided in URI", + "Profile does not exist for this file.": "Profile does not exist for this file.", + "$(sync~spin) Saving USS file...": "$(sync~spin) Saving USS file...", + "Renaming {0} failed due to API error: {1}/File pathError message": { + "message": "Renaming {0} failed due to API error: {1}", + "comment": [ + "File path", + "Error message" + ] + }, + "Deleting {0} failed due to API error: {1}/File nameError message": { + "message": "Deleting {0} failed due to API error: {1}", + "comment": [ + "File name", + "Error message" + ] + }, + "No error details given": "No error details given", + "Error fetching destination {0} for paste action: {1}/USS pathError message": { + "message": "Error fetching destination {0} for paste action: {1}", + "comment": [ + "USS path", + "Error message" + ] + }, "{0} location/Node type": { "message": "{0} location", "comment": [ diff --git a/packages/zowe-explorer/l10n/poeditor.json b/packages/zowe-explorer/l10n/poeditor.json index be85961d07..c31493948c 100644 --- a/packages/zowe-explorer/l10n/poeditor.json +++ b/packages/zowe-explorer/l10n/poeditor.json @@ -440,6 +440,8 @@ "Install": "", "Reload": "", "No valid schema was found for the active team configuration. This may introduce issues with profiles in Zowe Explorer.": "", + "No Zowe client configurations were detected. Click 'Create New' to create a new Zowe team configuration.": "", + "Create New": "", "\"Update Credentials\" operation not supported when \"autoStore\" is false": "", "Connection Name": "", "Enter a name for the connection.": "", @@ -453,7 +455,6 @@ "Failed to initialize Zowe folder: {0}": "", "Zowe Profiles initialized successfully.": "", "Convert Existing Profiles": "", - "Create New": "", "Operation cancelled": "", "Tree Item is not a Zowe Explorer item.": "", "Zowe Explorer": "", @@ -493,14 +494,6 @@ "Required API functions for pasting (fileList and copy/uploadFromBuffer) were not found.": "", "Uploading USS files...": "", "Error uploading files": "", - "The 'move' function is not implemented for this USS API.": "", - "Could not list USS files: Empty path provided in URI": "", - "Profile does not exist for this file.": "", - "$(sync~spin) Saving USS file...": "", - "Renaming {0} failed due to API error: {1}": "", - "Deleting {0} failed due to API error: {1}": "", - "No error details given": "", - "Error fetching destination {0} for paste action: {1}": "", "Downloaded: {0}": "", "Encoding: {0}": "", "Binary": "", @@ -529,6 +522,14 @@ "initializeUSSFavorites.error.buttonRemove": "", "File does not exist. It may have been deleted.": "", "$(sync~spin) Pulling from Mainframe...": "", + "The 'move' function is not implemented for this USS API.": "", + "Could not list USS files: Empty path provided in URI": "", + "Profile does not exist for this file.": "", + "$(sync~spin) Saving USS file...": "", + "Renaming {0} failed due to API error: {1}": "", + "Deleting {0} failed due to API error: {1}": "", + "No error details given": "", + "Error fetching destination {0} for paste action: {1}": "", "{0} location": "", "Choose a location to create the {0}": "", "Name of file or directory": "", From b6f7165fc229f150e3945548c16316267f8b4420 Mon Sep 17 00:00:00 2001 From: Trae Yelovich Date: Tue, 24 Sep 2024 16:03:58 -0400 Subject: [PATCH 6/7] fix(tests): Add mock for promptUserWithNoConfigs Signed-off-by: Trae Yelovich --- .../zowe-explorer/__tests__/__unit__/extension.unit.test.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/packages/zowe-explorer/__tests__/__unit__/extension.unit.test.ts b/packages/zowe-explorer/__tests__/__unit__/extension.unit.test.ts index 98683ba35c..b8bf53784a 100644 --- a/packages/zowe-explorer/__tests__/__unit__/extension.unit.test.ts +++ b/packages/zowe-explorer/__tests__/__unit__/extension.unit.test.ts @@ -94,6 +94,7 @@ async function createGlobalMocks() { getZoweDir: jest.fn(), }; }), + mockPromptUserWithNoConfigs: jest.fn(), mockUpdateCredMgrSetting: jest.fn(), mockWriteOverridesFile: jest.fn(), mockProfCacheProfileInfo: createInstanceOfProfileInfo(), @@ -361,6 +362,10 @@ async function createGlobalMocks() { get: globalMocks.mockImperativeProfileInfo, configurable: true, }); + Object.defineProperty(ProfilesUtils, "promptUserWithNoConfigs", { + value: globalMocks.mockPromptUserWithNoConfigs, + configurable: true, + }); // Create a mocked extension context const mockExtensionCreator = jest.fn( From 7c3f0c76a2015ba52f103321ab47f304d5a20cc7 Mon Sep 17 00:00:00 2001 From: Trae Yelovich Date: Tue, 24 Sep 2024 16:09:48 -0400 Subject: [PATCH 7/7] chore: update ZE changelog entry Signed-off-by: Trae Yelovich --- packages/zowe-explorer/CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/zowe-explorer/CHANGELOG.md b/packages/zowe-explorer/CHANGELOG.md index 05c25c5e2c..a9a9fbacf6 100644 --- a/packages/zowe-explorer/CHANGELOG.md +++ b/packages/zowe-explorer/CHANGELOG.md @@ -6,7 +6,7 @@ All notable changes to the "vscode-extension-for-zowe" extension will be documen ### New features and enhancements -- Added a notification with an option to create a new configuration when a user does not have any Zowe client configurations. [#3148](https://github.com/zowe/zowe-explorer-vscode/pull/3148) +- Users can now follow a prompt to create a new Zowe client configuration. The prompt displays when VS Code is opened with Zowe Explorer installed, but the user does not have any Zowe client configurations. [#3148](https://github.com/zowe/zowe-explorer-vscode/pull/3148) ### Bug fixes