From e41198c802f1f8d034e00457916b4525a4bc1b66 Mon Sep 17 00:00:00 2001 From: Lauren Li Date: Thu, 5 Dec 2019 17:02:06 -0500 Subject: [PATCH 01/16] Update datasets incorrect profile message for Theia case Signed-off-by: Lauren Li --- package-lock.json | 22 +++++++++++----------- src/DatasetTree.ts | 10 ++++++++-- 2 files changed, 19 insertions(+), 13 deletions(-) diff --git a/package-lock.json b/package-lock.json index 803de6fd1e..ceb4f1343a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "vscode-extension-for-zowe", - "version": "0.29.0", + "version": "1.0.0", "lockfileVersion": 1, "requires": true, "dependencies": { @@ -178,9 +178,9 @@ } }, "@brightside/core": { - "version": "2.34.1", - "resolved": "https://dl.bintray.com//ca/brightside/@brightside/core/-/@brightside/core-2.34.1.tgz", - "integrity": "sha1-BvuhnNr/ZeDh1uTzU3kr5FQhEzc=", + "version": "2.36.0", + "resolved": "https://dl.bintray.com//ca/brightside/@brightside/core/-/@brightside/core-2.36.0.tgz", + "integrity": "sha1-w57BIJFAI9VVSR9YdekAqcRPNoU=", "requires": { "@brightside/imperative": "2.7.4", "get-stdin": "7.0.0", @@ -7705,17 +7705,17 @@ "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=" }, "ssh2": { - "version": "0.8.6", - "resolved": "https://registry.npmjs.org/ssh2/-/ssh2-0.8.6.tgz", - "integrity": "sha512-T0cPmEtmtC8WxSupicFDjx3vVUdNXO8xu2a/D5bjt8ixOUCe387AgvxU3mJgEHpu7+Sq1ZYx4d3P2pl/yxMH+w==", + "version": "0.8.7", + "resolved": "https://registry.npmjs.org/ssh2/-/ssh2-0.8.7.tgz", + "integrity": "sha512-/u1BO12kb0lDVxJXejWB9pxyF3/ncgRqI9vPCZuPzo05pdNDzqUeQRavScwSPsfMGK+5H/VRqp1IierIx0Bcxw==", "requires": { - "ssh2-streams": "~0.4.7" + "ssh2-streams": "~0.4.8" } }, "ssh2-streams": { - "version": "0.4.7", - "resolved": "https://registry.npmjs.org/ssh2-streams/-/ssh2-streams-0.4.7.tgz", - "integrity": "sha512-JhF8BNfeguOqVHOLhXjzLlRKlUP8roAEhiT/y+NcBQCqpRUupLNrRf2M+549OPNVGx21KgKktug4P3MY/IvTig==", + "version": "0.4.8", + "resolved": "https://registry.npmjs.org/ssh2-streams/-/ssh2-streams-0.4.8.tgz", + "integrity": "sha512-auxXfgYySz2vYw7TMU7PK7vFI7EPvhvTH8/tZPgGaWocK4p/vwCMiV3icz9AEkb0R40kOKZtFtqYIxDJyJiytw==", "requires": { "asn1": "~0.2.0", "bcrypt-pbkdf": "^1.0.2", diff --git a/src/DatasetTree.ts b/src/DatasetTree.ts index 21c160f80c..6fa6ac3afc 100644 --- a/src/DatasetTree.ts +++ b/src/DatasetTree.ts @@ -97,14 +97,20 @@ export class DatasetTree implements vscode.TreeDataProvider { node.iconPath = applyIcons(node); this.mFavorites.push(node); } catch(e) { + let appName: string; + if (extension.ISTHEIA === true) { + appName = "Theia"; + } else { + appName = "VS Code"; + } vscode.window.showErrorMessage( localize("initializeFavorites.error.profile1", "Error: You have Zowe Data Set favorites that refer to a non-existent CLI profile named: ") + sesName + localize("intializeFavorites.error.profile2", ". To resolve this, you can create a profile with this name, ") + localize("initializeFavorites.error.profile3", - "or remove the favorites with this profile name from the Zowe-DS-Persistent setting, ") + - localize("initializeFavorites.error.profile4", "which can be found in your VS Code user settings.")); + "or remove the favorites with this profile name from the Zowe-DS-Persistent setting, which can be found in your ") + + appName + localize("initializeFavorites.error.profile4", " user settings.")); continue; } } else if (favoriteSearchPattern.test(line)) { From 9d78dead651d046e2214f9f99e1633b02201d65d Mon Sep 17 00:00:00 2001 From: Lauren Li Date: Fri, 6 Dec 2019 09:27:28 -0500 Subject: [PATCH 02/16] Update localization for v1.0.0 Signed-off-by: Lauren Li --- gulpfile.js | 2 +- i18n/sample/src/Profiles.i18n.json | 3 +- i18n/sample/src/ZosJobsProvider.i18n.json | 15 ++++++++- i18n/sample/src/extension.i18n.json | 2 +- i18n/sample/src/utils.i18n.json | 4 +++ stringUpdateScript.js | 37 ++++++++++++++++++++--- 6 files changed, 55 insertions(+), 8 deletions(-) diff --git a/gulpfile.js b/gulpfile.js index a4b292c4d0..26f251cd8a 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -25,7 +25,7 @@ const outDest = 'out'; // For new languages, add { folderName: 'ISO-639-3-Code-for-language', id: 'vscode-locale-id' } to array below // Ex. for Chinese add: { folderName: 'zho', id: 'zh-cn' } /* ************************* ADD NEW LANGUAGES HERE ******************************** */ -const languages = []; +const languages = [{folderName:'fra', id:'fr'}]; /* ********************************************************************************* */ const cleanTask = function() { return del(['out/**', 'package.nls.*.json', 'vscode-extension-for-zowe*.vsix']); diff --git a/i18n/sample/src/Profiles.i18n.json b/i18n/sample/src/Profiles.i18n.json index 30dd3592fa..916f1dc256 100644 --- a/i18n/sample/src/Profiles.i18n.json +++ b/i18n/sample/src/Profiles.i18n.json @@ -1,12 +1,13 @@ { "loadNamedProfile.error.profileName": "Could not find profile named: ", "loadNamedProfile.error.period": ".", + "loadNamedProfile.warn.noDefaultProfile": "Unable to locate a default profile. CLI may not be installed. ", "createNewConnection.option.prompt.url.placeholder": "https://url:port", "createNewConnection.option.prompt.url": "Enter a z/OSMF URL in the format 'https://url:port'.", "createNewConnection.enterzosmfURL": "No valid value for z/OSMF URL. Operation Cancelled", "createNewConnection.option.prompt.userName.placeholder": "Optional: User Name", "createNewConnection.option.prompt.userName": "Enter the user name for the connection", - "createNewConnection.option.prompt.passWord.placeholder": "Optional: Password", + "createNewConnection.option.prompt.password.placeholder": "Optional: Password", "createNewConnection.option.prompt.password": "Enter a password for the connection", "createNewConnection.option.prompt.ru.placeholder": "Reject Unauthorized Connections", "createNewConnection.rejectUnauthorize": "Operation Cancelled", diff --git a/i18n/sample/src/ZosJobsProvider.i18n.json b/i18n/sample/src/ZosJobsProvider.i18n.json index b8842d986a..6dc4083b6e 100644 --- a/i18n/sample/src/ZosJobsProvider.i18n.json +++ b/i18n/sample/src/ZosJobsProvider.i18n.json @@ -1,4 +1,17 @@ { + "FavoriteSession": "Favorites", "deleteJob.job": "Job ", - "deleteJob.delete": " deleted" + "deleteJob.delete": " deleted", + "initializeFavorites.log.debug": "initializing favorites", + "initializeJobsFavorites.error.profile1": "Error: You have Jobs favorites that refer to a non-existent CLI profile named: ", + "initializeJobsFavorites.error.profile2": ". To resolve this, you can create a profile with this name, ", + "initializeJobsFavorites.error.profile3": "or remove the favorites with this profile name from the Zowe-Jobs-Persistent setting, ", + "initializeJobsFavorites.error.profile4": "which can be found in your VS Code user settings.", + "searchHistory.options.prompt": "Select a filter", + "enterPattern.pattern": "No selection made.", + "jobsFilterPrompt.option.prompt.owner": "Enter the Job Owner. Default is *.", + "jobsFilterPrompt.enterPrefix": "Search Cancelled", + "jobsFilterPrompt.option.prompt.prefix": "Enter a Job prefix. Default is *.", + "jobsFilterPrompt.option.prompt.jobid": "Enter a Job id", + "SpecifyCriteria": "Create new.." } \ No newline at end of file diff --git a/i18n/sample/src/extension.i18n.json b/i18n/sample/src/extension.i18n.json index 66bf989920..10080f717b 100644 --- a/i18n/sample/src/extension.i18n.json +++ b/i18n/sample/src/extension.i18n.json @@ -90,9 +90,9 @@ "saveFile.log.error.session": "Couldn't locate session when saving data set!", "saveFile.log.debug.saving": "Saving file ", "saveFile.error.saveFailed": "Data set failed to save. Data set may have been deleted on mainframe.", + "saveFile.response.save.title": "Saving data set...", "saveFile.error.ZosmfEtagMismatchError": "Rest API failure with HTTP(S) status 412", "saveFile.error.etagMismatch": "Remote file has been modified in the meantime.\nSelect 'Compare' to resolve the conflict.", - "saveFile.response.save.title": "Saving data set...", "saveUSSFile.log.debug.saveRequest": "save requested for USS file ", "saveUSSFile.response.title": "Saving file...", "saveUSSFile.log.error.save": "Error encountered when saving USS file: ", diff --git a/i18n/sample/src/utils.i18n.json b/i18n/sample/src/utils.i18n.json index e69de29bb2..c94418e55b 100644 --- a/i18n/sample/src/utils.i18n.json +++ b/i18n/sample/src/utils.i18n.json @@ -0,0 +1,4 @@ +{ + "zosJobsProvider.option.prompt.createOwner": "Owner/Prefix Job Search", + "zosJobsProvider.option.prompt.createId": "Job Id search" +} \ No newline at end of file diff --git a/stringUpdateScript.js b/stringUpdateScript.js index 1818730cee..bdeec70c80 100644 --- a/stringUpdateScript.js +++ b/stringUpdateScript.js @@ -1,33 +1,62 @@ +/* +* 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 Contributors to the Zowe Project. * +* * +*/ + +// This script creates the i18n/sample template used for adding/updating i18n files fs = require('fs'); + +// Read localization metadata files +// Consider adding support for creating directories in the filepath if they don't exist yet +var parsedUssNodeActions = JSON.parse(fs.readFileSync('./out/src/uss/ussNodeActions.nls.metadata.json').toString()); +var keysPairsUssNodeActions = {}; var parsedDatasetTree = JSON.parse(fs.readFileSync('./out/src/DatasetTree.nls.metadata.json').toString()); var keysPairsDatasetTree = {}; var parsedExtension = JSON.parse(fs.readFileSync('./out/src/extension.nls.metadata.json').toString()); var keysPairsExtension = {}; var parsedProfileLoader = JSON.parse(fs.readFileSync('./out/src/ProfileLoader.nls.metadata.json').toString()); var keysPairsProfileLoader = {}; +var parsedProfiles = JSON.parse(fs.readFileSync('./out/src/Profiles.nls.metadata.json').toString()); +var keysPairsProfiles = {}; var parsedUSSTree = JSON.parse(fs.readFileSync('./out/src/USSTree.nls.metadata.json').toString()); var keysPairsUSSTree = {}; -var parsedUssNodeActions = JSON.parse(fs.readFileSync('./out/src/uss/ussNodeActions.nls.metadata.json').toString()); -var keysPairsUssNodeActions = {}; +var parsedUtils = JSON.parse(fs.readFileSync('./out/src/utils.nls.metadata.json').toString()); +var keysPairsUtils = {}; +var parsedZosJobsProvider = JSON.parse(fs.readFileSync('./out/src/ZosJobsProvider.nls.metadata.json').toString()); +var keysPairsZosJobsProvider = {}; var parsedZoweNode = JSON.parse(fs.readFileSync('./out/src/ZoweNode.nls.metadata.json').toString()); var keysPairsZoweNode = {}; var parsedZoweUSSNode = JSON.parse(fs.readFileSync('./out/src/ZoweUSSNode.nls.metadata.json').toString()); var keysPairsZoweUSSNode = {}; var keysPairsPackage = JSON.parse(fs.readFileSync('./package.nls.json').toString()); + // Extract localization key/value pairs from metadata files +parsedUssNodeActions.keys.forEach((key, i) => keysPairsUssNodeActions[key] = parsedUssNodeActions.messages[i]); parsedDatasetTree.keys.forEach((key, i) => keysPairsDatasetTree[key] = parsedDatasetTree.messages[i]); parsedExtension.keys.forEach((key, i) => keysPairsExtension[key] = parsedExtension.messages[i]); parsedProfileLoader.keys.forEach((key, i) => keysPairsProfileLoader[key] = parsedProfileLoader.messages[i]); +parsedProfiles.keys.forEach((key, i) => keysPairsProfiles[key] = parsedProfiles.messages[i]); parsedUSSTree.keys.forEach((key, i) => keysPairsUSSTree[key] = parsedUSSTree.messages[i]); -parsedUssNodeActions.keys.forEach((key, i) => keysPairsUssNodeActions[key] = parsedUssNodeActions.messages[i]); +parsedUtils.keys.forEach((key, i) => keysPairsUtils[key] = parsedUtils.messages[i]); +parsedZosJobsProvider.keys.forEach((key, i) => keysPairsZosJobsProvider[key] = parsedZosJobsProvider.messages[i]); parsedZoweNode.keys.forEach((key, i) => keysPairsZoweNode[key] = parsedZoweNode.messages[i]); parsedZoweUSSNode.keys.forEach((key, i) => keysPairsZoweUSSNode[key] = parsedZoweUSSNode.messages[i]); + // Write to i18n sample folder to create template for new languages +fs.writeFileSync('./i18n/sample/src/uss/ussNodeActions.i18n.json', JSON.stringify(keysPairsUssNodeActions, null, 4)); fs.writeFileSync('./i18n/sample/src/DatasetTree.i18n.json', JSON.stringify(keysPairsDatasetTree, null, 4)); fs.writeFileSync('./i18n/sample/src/extension.i18n.json', JSON.stringify(keysPairsExtension, null, 4)); fs.writeFileSync('./i18n/sample/src/ProfileLoader.i18n.json', JSON.stringify(keysPairsProfileLoader, null, 4)); +fs.writeFileSync('./i18n/sample/src/Profiles.i18n.json', JSON.stringify(keysPairsProfiles, null, 4)); fs.writeFileSync('./i18n/sample/src/USSTree.i18n.json', JSON.stringify(keysPairsUSSTree, null, 4)); -fs.writeFileSync('./i18n/sample/src/uss/ussNodeActions.i18n.json', JSON.stringify(keysPairsUssNodeActions, null, 4)); +fs.writeFileSync('./i18n/sample/src/utils.i18n.json', JSON.stringify(keysPairsUtils, null, 4)); +fs.writeFileSync('./i18n/sample/src/ZosJobsProvider.i18n.json', JSON.stringify(keysPairsZosJobsProvider, null, 4)); fs.writeFileSync('./i18n/sample/src/ZoweNode.i18n.json', JSON.stringify(keysPairsZoweNode, null, 4)); fs.writeFileSync('./i18n/sample/src/ZoweUSSNode.i18n.json', JSON.stringify(keysPairsZoweUSSNode, null, 4)); fs.writeFileSync('./i18n/sample/package.i18n.json', JSON.stringify(keysPairsPackage, null, 4)); \ No newline at end of file From 6e630b72417452770967dc86debb5e0e28493a99 Mon Sep 17 00:00:00 2001 From: Lauren Li Date: Fri, 6 Dec 2019 10:12:57 -0500 Subject: [PATCH 03/16] Remove French testing folder from gulpfile Signed-off-by: Lauren Li --- gulpfile.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gulpfile.js b/gulpfile.js index 26f251cd8a..a4b292c4d0 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -25,7 +25,7 @@ const outDest = 'out'; // For new languages, add { folderName: 'ISO-639-3-Code-for-language', id: 'vscode-locale-id' } to array below // Ex. for Chinese add: { folderName: 'zho', id: 'zh-cn' } /* ************************* ADD NEW LANGUAGES HERE ******************************** */ -const languages = [{folderName:'fra', id:'fr'}]; +const languages = []; /* ********************************************************************************* */ const cleanTask = function() { return del(['out/**', 'package.nls.*.json', 'vscode-extension-for-zowe*.vsix']); From e0338268b7a192c4c057e1231319e6b8df5519c3 Mon Sep 17 00:00:00 2001 From: Lauren Li Date: Fri, 6 Dec 2019 14:16:05 -0500 Subject: [PATCH 04/16] Use common utils function for incorrect profile message in data sets, USS, and JES Signed-off-by: Lauren Li --- src/DatasetTree.ts | 10 ++-------- src/USSTree.ts | 6 +++--- src/ZosJobsProvider.ts | 15 ++++++++++++--- src/utils.ts | 13 +++++++++++++ 4 files changed, 30 insertions(+), 14 deletions(-) diff --git a/src/DatasetTree.ts b/src/DatasetTree.ts index 6fa6ac3afc..36c2a8af93 100644 --- a/src/DatasetTree.ts +++ b/src/DatasetTree.ts @@ -17,7 +17,7 @@ import * as nls from "vscode-nls"; import * as extension from "../src/extension"; import { PersistentFilters } from "./PersistentFilters"; import { Profiles } from "./Profiles"; -import { sortTreeItems, applyIcons, FilterDescriptor, FilterItem, resolveQuickPickHelper } from "./utils"; +import { sortTreeItems, applyIcons, FilterDescriptor, FilterItem, getAppName, resolveQuickPickHelper } from "./utils"; import { ZoweNode } from "./ZoweNode"; const localize = nls.config({ messageFormat: nls.MessageFormat.file })(); @@ -97,12 +97,6 @@ export class DatasetTree implements vscode.TreeDataProvider { node.iconPath = applyIcons(node); this.mFavorites.push(node); } catch(e) { - let appName: string; - if (extension.ISTHEIA === true) { - appName = "Theia"; - } else { - appName = "VS Code"; - } vscode.window.showErrorMessage( localize("initializeFavorites.error.profile1", "Error: You have Zowe Data Set favorites that refer to a non-existent CLI profile named: ") + sesName + @@ -110,7 +104,7 @@ export class DatasetTree implements vscode.TreeDataProvider { ". To resolve this, you can create a profile with this name, ") + localize("initializeFavorites.error.profile3", "or remove the favorites with this profile name from the Zowe-DS-Persistent setting, which can be found in your ") + - appName + localize("initializeFavorites.error.profile4", " user settings.")); + getAppName(extension.ISTHEIA) + localize("initializeFavorites.error.profile4", " user settings.")); continue; } } else if (favoriteSearchPattern.test(line)) { diff --git a/src/USSTree.ts b/src/USSTree.ts index fec6e3e81f..953690f4e0 100644 --- a/src/USSTree.ts +++ b/src/USSTree.ts @@ -12,7 +12,7 @@ import * as zowe from "@brightside/core"; // tslint:disable-next-line: no-implicit-dependencies import { IProfileLoaded, Logger } from "@brightside/imperative"; -import { applyIcons, FilterItem, FilterDescriptor, resolveQuickPickHelper, sortTreeItems } from "./utils"; +import { applyIcons, FilterItem, FilterDescriptor, getAppName, resolveQuickPickHelper, sortTreeItems } from "./utils"; import * as vscode from "vscode"; import { ZoweUSSNode } from "./ZoweUSSNode"; import { Profiles } from "./Profiles"; @@ -465,8 +465,8 @@ export class USSTree implements vscode.TreeDataProvider { localize("intializeUSSFavorites.error.profile2", ". To resolve this, you can create a profile with this name, ") + localize("initializeUSSFavorites.error.profile3", - "or remove the favorites with this profile name from the Zowe-USS-Persistent setting, ") + - localize("initializeUSSFavorites.error.profile4", "which can be found in your VS Code user settings.")); + "or remove the favorites with this profile name from the Zowe-USS-Persistent setting, which can be found in your ") + + getAppName(extension.ISTHEIA) + localize("initializeUSSFavorites.error.profile4", " user settings.")); return; } }); diff --git a/src/ZosJobsProvider.ts b/src/ZosJobsProvider.ts index cccace97f0..601bb874d9 100644 --- a/src/ZosJobsProvider.ts +++ b/src/ZosJobsProvider.ts @@ -16,7 +16,16 @@ import { IProfileLoaded, Logger } from "@brightside/imperative"; import { Profiles } from "./Profiles"; import { PersistentFilters } from "./PersistentFilters"; import { Job } from "./ZoweJobNode"; -import { OwnerFilterDescriptor, JobIdFilterDescriptor, applyIcons, FilterItem, FilterDescriptor, resolveQuickPickHelper, sortTreeItems } from "./utils"; +import { + OwnerFilterDescriptor, + JobIdFilterDescriptor, + applyIcons, + FilterItem, + FilterDescriptor, + getAppName, + resolveQuickPickHelper, + sortTreeItems +} from "./utils"; import * as extension from "../src/extension"; import * as nls from "vscode-nls"; const localize = nls.config({ messageFormat: nls.MessageFormat.file })(); @@ -257,8 +266,8 @@ export class ZosJobsProvider implements vscode.TreeDataProvider { localize("initializeJobsFavorites.error.profile2", ". To resolve this, you can create a profile with this name, ") + localize("initializeJobsFavorites.error.profile3", - "or remove the favorites with this profile name from the Zowe-Jobs-Persistent setting, ") + - localize("initializeJobsFavorites.error.profile4", "which can be found in your VS Code user settings.")); + "or remove the favorites with this profile name from the Zowe-Jobs-Persistent setting, which can be found in your ") + + getAppName(extension.ISTHEIA) + localize("initializeJobsFavorites.error.profile4", " user settings.")); return; } }); diff --git a/src/utils.ts b/src/utils.ts index 85739fec82..a8830330da 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -172,3 +172,16 @@ export function concatChildNodes(nodes: ZoweNode[]) { return allNodes; } + +/************************************************************************************************************* + * Determine IDE name to display based on app environment + *************************************************************************************************************/ +export function getAppName(isTheia: boolean) { + let appName: string; + if (isTheia === true) { + appName = "Theia"; + } else { + appName = "VS Code"; + } + return appName; +} From 08228778f65e74a2d0930f31fd47d69ed3db6012 Mon Sep 17 00:00:00 2001 From: Lauren Li Date: Fri, 6 Dec 2019 15:05:11 -0500 Subject: [PATCH 05/16] Remove duplicate context and inline menu items for data sets Signed-off-by: Lauren Li --- package.json | 30 ------------------------------ 1 file changed, 30 deletions(-) diff --git a/package.json b/package.json index b8147b2735..0ba5c3784a 100644 --- a/package.json +++ b/package.json @@ -558,11 +558,6 @@ "command": "zowe.refreshNode", "group": "inline" }, - { - "when": "view == zowe.explorer && viewItem == member_fav", - "command": "zowe.refreshNode", - "group": "inline" - }, { "when": "view == zowe.explorer && viewItem == member_fav", "command": "zowe.refreshNode", @@ -593,16 +588,6 @@ "command": "zowe.refreshNode", "group": "inline" }, - { - "when": "view == zowe.explorer && viewItem == member_fav", - "command": "zowe.renameDataSetMember", - "group": "6_modification@2" - }, - { - "when": "view == zowe.explorer && viewItem == ds", - "command": "zowe.refreshNode", - "group": "inline" - }, { "when": "view == zowe.explorer && viewItem == ds", "command": "zowe.refreshNode", @@ -648,21 +633,6 @@ "command": "zowe.refreshNode", "group": "inline" }, - { - "when": "view == zowe.explorer && viewItem == ds", - "command": "zowe.copyDataSet", - "group": "9_cutcopypaste" - }, - { - "when": "view == zowe.explorer && viewItem == ds", - "command": "zowe.pasteDataSet", - "group": "9_cutcopypaste" - }, - { - "when": "view == zowe.explorer && viewItem == ds_fav", - "command": "zowe.refreshNode", - "group": "inline" - }, { "when": "view == zowe.explorer && viewItem == ds_fav", "command": "zowe.refreshNode", From f744905e217b0c8156cb0bf36023c31fca3b2a4e Mon Sep 17 00:00:00 2001 From: Lauren Li Date: Fri, 6 Dec 2019 16:13:00 -0500 Subject: [PATCH 06/16] Update menu items snapshot Signed-off-by: Lauren Li --- .../__snapshots__/extension.unit.test.ts.snap | 30 ------------------- 1 file changed, 30 deletions(-) diff --git a/__tests__/__unit__/__snapshots__/extension.unit.test.ts.snap b/__tests__/__unit__/__snapshots__/extension.unit.test.ts.snap index 1f925f866d..6c5dd2b788 100644 --- a/__tests__/__unit__/__snapshots__/extension.unit.test.ts.snap +++ b/__tests__/__unit__/__snapshots__/extension.unit.test.ts.snap @@ -152,11 +152,6 @@ Array [ "group": "inline", "when": "view == zowe.explorer && viewItem == member_fav", }, - Object { - "command": "zowe.refreshNode", - "group": "inline", - "when": "view == zowe.explorer && viewItem == member_fav", - }, Object { "command": "zowe.refreshNode", "group": "0_mainframeInteraction", @@ -187,16 +182,6 @@ Array [ "group": "inline", "when": "view == zowe.explorer && viewItem == ds", }, - Object { - "command": "zowe.renameDataSetMember", - "group": "6_modification@2", - "when": "view == zowe.explorer && viewItem == member_fav", - }, - Object { - "command": "zowe.refreshNode", - "group": "inline", - "when": "view == zowe.explorer && viewItem == ds", - }, Object { "command": "zowe.refreshNode", "group": "0_mainframeInteraction", @@ -242,21 +227,6 @@ Array [ "group": "inline", "when": "view == zowe.explorer && viewItem == ds_fav", }, - Object { - "command": "zowe.copyDataSet", - "group": "9_cutcopypaste", - "when": "view == zowe.explorer && viewItem == ds", - }, - Object { - "command": "zowe.pasteDataSet", - "group": "9_cutcopypaste", - "when": "view == zowe.explorer && viewItem == ds", - }, - Object { - "command": "zowe.refreshNode", - "group": "inline", - "when": "view == zowe.explorer && viewItem == ds_fav", - }, Object { "command": "zowe.refreshNode", "group": "0_mainframeInteraction", From 1bef5ad1dbdda0cd533309b9d5d55250f42a0654 Mon Sep 17 00:00:00 2001 From: Peter Haumer <4391934+phaumer@users.noreply.github.com> Date: Fri, 6 Dec 2019 18:25:04 -0800 Subject: [PATCH 07/16] Fixed for USS Signed-off-by: Peter Haumer <4391934+phaumer@users.noreply.github.com> --- .vscode/settings.json | 3 +- package-lock.json | 22 ++--- src/Profiles.ts | 8 +- src/extension.ts | 218 +++++++++++++++++++++++------------------- src/utils.ts | 2 +- 5 files changed, 140 insertions(+), 113 deletions(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index 9fa6551f53..af8b8f2fe0 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -13,5 +13,6 @@ // Turn off tsc task auto detection since we have the necessary tasks as npm scripts "typescript.tsc.autoDetect": "off", // Make sure people do not accidentally forget to sign - "git.alwaysSignOff": true + "git.alwaysSignOff": true, + "typescript.tsdk": "node_modules/typescript/lib" } \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 803de6fd1e..ceb4f1343a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "vscode-extension-for-zowe", - "version": "0.29.0", + "version": "1.0.0", "lockfileVersion": 1, "requires": true, "dependencies": { @@ -178,9 +178,9 @@ } }, "@brightside/core": { - "version": "2.34.1", - "resolved": "https://dl.bintray.com//ca/brightside/@brightside/core/-/@brightside/core-2.34.1.tgz", - "integrity": "sha1-BvuhnNr/ZeDh1uTzU3kr5FQhEzc=", + "version": "2.36.0", + "resolved": "https://dl.bintray.com//ca/brightside/@brightside/core/-/@brightside/core-2.36.0.tgz", + "integrity": "sha1-w57BIJFAI9VVSR9YdekAqcRPNoU=", "requires": { "@brightside/imperative": "2.7.4", "get-stdin": "7.0.0", @@ -7705,17 +7705,17 @@ "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=" }, "ssh2": { - "version": "0.8.6", - "resolved": "https://registry.npmjs.org/ssh2/-/ssh2-0.8.6.tgz", - "integrity": "sha512-T0cPmEtmtC8WxSupicFDjx3vVUdNXO8xu2a/D5bjt8ixOUCe387AgvxU3mJgEHpu7+Sq1ZYx4d3P2pl/yxMH+w==", + "version": "0.8.7", + "resolved": "https://registry.npmjs.org/ssh2/-/ssh2-0.8.7.tgz", + "integrity": "sha512-/u1BO12kb0lDVxJXejWB9pxyF3/ncgRqI9vPCZuPzo05pdNDzqUeQRavScwSPsfMGK+5H/VRqp1IierIx0Bcxw==", "requires": { - "ssh2-streams": "~0.4.7" + "ssh2-streams": "~0.4.8" } }, "ssh2-streams": { - "version": "0.4.7", - "resolved": "https://registry.npmjs.org/ssh2-streams/-/ssh2-streams-0.4.7.tgz", - "integrity": "sha512-JhF8BNfeguOqVHOLhXjzLlRKlUP8roAEhiT/y+NcBQCqpRUupLNrRf2M+549OPNVGx21KgKktug4P3MY/IvTig==", + "version": "0.4.8", + "resolved": "https://registry.npmjs.org/ssh2-streams/-/ssh2-streams-0.4.8.tgz", + "integrity": "sha512-auxXfgYySz2vYw7TMU7PK7vFI7EPvhvTH8/tZPgGaWocK4p/vwCMiV3icz9AEkb0R40kOKZtFtqYIxDJyJiytw==", "requires": { "asn1": "~0.2.0", "bcrypt-pbkdf": "^1.0.2", diff --git a/src/Profiles.ts b/src/Profiles.ts index c63ed3a2aa..13b5c9dcae 100644 --- a/src/Profiles.ts +++ b/src/Profiles.ts @@ -138,7 +138,7 @@ export class Profiles { // Processing stops if there are no profiles detected return validationResult; } - public async createNewConnection(profileName) { + public async createNewConnection(profileName: string): Promise { let userName: string; let passWord: string; let zosmfURL: string; @@ -157,7 +157,7 @@ export class Profiles { // Processing stops if there are no profiles detected if (!zosmfURL) { vscode.window.showInformationMessage(localize("createNewConnection.enterzosmfURL", "No valid value for z/OSMF URL. Operation Cancelled")); - return; + return undefined; } const zosmfUrlParsed = this.validateAndParseUrl(zosmfURL); @@ -197,14 +197,14 @@ export class Profiles { // Processing stops if there are no profiles detected } else { vscode.window.showInformationMessage(localize("createNewConnection.rejectUnauthorize", "Operation Cancelled")); - return; + return undefined; } for (const profile of this.allProfiles) { if (profile.name === profileName) { vscode.window.showErrorMessage(localize("createNewConnection.duplicateProfileName", "Profile name already exists. Please create a profile using a different name")); - return; + return undefined; } } diff --git a/src/extension.ts b/src/extension.ts index a457a9fdb5..747bb01e52 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -619,51 +619,54 @@ export async function addSession(datasetProvider: DatasetTree) { quickpick.show(); choice = await utils.resolveQuickPickHelper(quickpick); quickpick.hide(); - if (choice instanceof utils.FilterDescriptor) { - if (quickpick.value) { - chosenProfile = quickpick.value; - } else { - const options = { - placeHolder: localize("createNewConnection.option.prompt.profileName.placeholder", "Connection Name"), - prompt: localize("createNewConnection.option.prompt.profileName", "Enter a name for the connection"), - value: profileName - }; - profileName = await vscode.window.showInputBox(options); - if (!profileName) { - vscode.window.showInformationMessage(localize("createNewConnection.enterprofileName", - "Profile Name was not supplied. Operation Cancelled")); - return; + if (choice) { + if (choice instanceof utils.FilterDescriptor) { + if (quickpick.value) { + chosenProfile = quickpick.value; + } else { + const options = { + placeHolder: localize("createNewConnection.option.prompt.profileName.placeholder", "Connection Name"), + prompt: localize("createNewConnection.option.prompt.profileName", "Enter a name for the connection"), + value: profileName + }; + profileName = await vscode.window.showInputBox(options); + if (!profileName) { + vscode.window.showInformationMessage(localize("createNewConnection.enterprofileName", + "Profile Name was not supplied. Operation Cancelled")); + return; + } + quickpick.value = profileName; + chosenProfile = quickpick.value; } - quickpick.value = profileName; - chosenProfile = quickpick.value; - } - } else { - chosenProfile = choice.label; - } - if (chosenProfile === quickpick.value) { - log.debug(localize("addSession.log.debug.createNewProfile", "User created a new profile")); - try { - newprofile = await Profiles.getInstance().createNewConnection(chosenProfile); - } catch (error) { - vscode.window.showErrorMessage(error.message); + } else { + chosenProfile = choice.label; } - if (newprofile !== undefined) { + if (chosenProfile === quickpick.value) { + log.debug(localize("addSession.log.debug.createNewProfile", "User created a new profile")); try { - await Profiles.getInstance().listProfile(); + newprofile = await Profiles.getInstance().createNewConnection(chosenProfile); } catch (error) { vscode.window.showErrorMessage(error.message); } - await datasetProvider.addSession(newprofile); - await datasetProvider.refresh(); + if (newprofile !== undefined) { + try { + await Profiles.getInstance().listProfile(); + } catch (error) { + vscode.window.showErrorMessage(error.message); + } + await datasetProvider.addSession(newprofile); + await datasetProvider.refresh(); + } + } else if(chosenProfile) { + log.debug(localize("addSession.log.debug.selectedProfile", "User selected profile ") + chosenProfile); + await datasetProvider.addSession(chosenProfile); + } else { + log.debug(localize("addSession.log.debug.cancelledSelection", "Operation Cancelled")); + vscode.window.showInformationMessage(localize("createNewConnection.enterprofileName", + "Operation Cancelled")); } - } else if(chosenProfile) { - log.debug(localize("addSession.log.debug.selectedProfile", "User selected profile ") + chosenProfile); - await datasetProvider.addSession(chosenProfile); } else { log.debug(localize("addSession.log.debug.cancelledSelection", "Operation Cancelled")); - vscode.window.showInformationMessage(localize("createNewConnection.enterprofileName", - "Operation Cancelled")); - return; } } @@ -681,8 +684,6 @@ export async function addUSSSession(ussFileProvider: USSTree) { const createNewProfile = "Create a New Connection to z/OS"; let newprofile: any; let chosenProfile: string; - let choice: vscode.QuickPickItem; - let profileName: string; let profileNamesList = allProfiles.map((profile) => { return profile.name; @@ -697,43 +698,64 @@ export async function addUSSSession(ussFileProvider: USSTree) { } const createPick = new utils.FilterDescriptor("\uFF0B " + createNewProfile); const items: vscode.QuickPickItem[] = profileNamesList.map((element) => new utils.FilterItem(element)); - const quickpick = vscode.window.createQuickPick(); - quickpick.items = [createPick, ...items]; - quickpick.placeholder =localize("addSession.quickPickOption", + const placeholder = localize("addSession.quickPickOption", "Choose \"Create new...\" to define a new profile or select an existing profile to Add to the USS Explorer"); - quickpick.ignoreFocusOut = true; - quickpick.show(); - choice = await utils.resolveQuickPickHelper(quickpick); - quickpick.hide(); - if (choice instanceof utils.FilterDescriptor) { - if (quickpick.value) { - chosenProfile = quickpick.value; + + if (ISTHEIA) { + const options: vscode.QuickPickOptions = { + placeHolder: placeholder + }; + // get user selection + const choice = (await vscode.window.showQuickPick([createPick, ...items], options)); + if (!choice) { + vscode.window.showInformationMessage(localize("enterPattern.pattern", "No selection made.")); + return; + } + chosenProfile = choice === createPick ? "" : choice.label; + } else { + const quickpick = vscode.window.createQuickPick(); + quickpick.items = [createPick, ...items]; + quickpick.placeholder = placeholder; + quickpick.ignoreFocusOut = true; + quickpick.show(); + const choice = await utils.resolveQuickPickHelper(quickpick); + quickpick.hide(); + if (!choice) { + vscode.window.showInformationMessage(localize("enterPattern.pattern", "No selection made.")); + return; + } + if (choice instanceof utils.FilterDescriptor) { + if (quickpick.value) { + chosenProfile = quickpick.value; + } else { + chosenProfile = ""; + } } else { - const options = { + chosenProfile = choice.label; + } + } + + if (chosenProfile === "") { + let profileName: string; + const options = { placeHolder: localize("createNewConnection.option.prompt.profileName.placeholder", "Connection Name"), prompt: localize("createNewConnection.option.prompt.profileName", "Enter a name for the connection"), value: profileName - }; - profileName = await vscode.window.showInputBox(options); - if (!profileName) { - vscode.window.showInformationMessage(localize("createNewConnection.enterprofileName", - "Profile Name was not supplied. Operation Cancelled")); - return; - } - quickpick.value = profileName; - chosenProfile = quickpick.value; + }; + profileName = await vscode.window.showInputBox(options); + if (!profileName) { + vscode.window.showInformationMessage(localize("createNewConnection.enterprofileName", + "Profile Name was not supplied. Operation Cancelled")); + return; } - } else { - chosenProfile = choice.label; - } - if (chosenProfile === quickpick.value) { + chosenProfile = profileName; log.debug(localize("addSession.log.debug.createNewProfile", "User created a new profile")); try { newprofile = await Profiles.getInstance().createNewConnection(chosenProfile); } catch (error) { vscode.window.showErrorMessage(error.message); } - if (newprofile !== undefined) { + if (newprofile) { try { await Profiles.getInstance().listProfile(); } catch (error) { @@ -2060,46 +2082,50 @@ export async function addJobsSession(jobsProvider: ZosJobsProvider) { quickpick.show(); choice = await utils.resolveQuickPickHelper(quickpick); quickpick.hide(); - if (choice instanceof utils.FilterDescriptor) { - if (quickpick.value) { - chosenProfile = quickpick.value; - } else { - const options = { - placeHolder: localize("createNewConnection.option.prompt.profileName.placeholder", "Connection Name"), - prompt: localize("createNewConnection.option.prompt.profileName", "Enter a name for the connection"), - value: profileName - }; - profileName = await vscode.window.showInputBox(options); - if (!profileName) { - vscode.window.showInformationMessage(localize("createNewConnection.enterprofileName", - "Profile Name was not supplied. Operation Cancelled")); - return; + if (choice) { + if (choice instanceof utils.FilterDescriptor) { + if (quickpick.value) { + chosenProfile = quickpick.value; + } else { + const options = { + placeHolder: localize("createNewConnection.option.prompt.profileName.placeholder", "Connection Name"), + prompt: localize("createNewConnection.option.prompt.profileName", "Enter a name for the connection"), + value: profileName + }; + profileName = await vscode.window.showInputBox(options); + if (!profileName) { + vscode.window.showInformationMessage(localize("createNewConnection.enterprofileName", + "Profile Name was not supplied. Operation Cancelled")); + return; + } + quickpick.value = profileName; + chosenProfile = quickpick.value; } - quickpick.value = profileName; - chosenProfile = quickpick.value; - } - } else { - chosenProfile = choice.label; - } - if (chosenProfile === quickpick.value) { - log.debug(localize("addSession.log.debug.createNewProfile", "User created a new profile")); - try { - newprofile = await Profiles.getInstance().createNewConnection(chosenProfile); - } catch (error) { - vscode.window.showErrorMessage(error.message); + } else { + chosenProfile = choice.label; } - if (newprofile !== undefined) { + if (chosenProfile === quickpick.value) { + log.debug(localize("addSession.log.debug.createNewProfile", "User created a new profile")); try { - await Profiles.getInstance().listProfile(); + newprofile = await Profiles.getInstance().createNewConnection(chosenProfile); } catch (error) { vscode.window.showErrorMessage(error.message); } - await jobsProvider.addSession(newprofile); - await jobsProvider.refresh(); + if (newprofile !== undefined) { + try { + await Profiles.getInstance().listProfile(); + } catch (error) { + vscode.window.showErrorMessage(error.message); + } + await jobsProvider.addSession(newprofile); + await jobsProvider.refresh(); + } + } else if(chosenProfile) { + log.debug(localize("addJobsSession.log.debug.selectedProfile", "User selected profile ") + chosenProfile); + await jobsProvider.addSession(chosenProfile); + } else { + log.debug(localize("addJobsSession.log.debug.cancelledProfile", "User cancelled profile selection")); } - } else if(chosenProfile) { - log.debug(localize("addJobsSession.log.debug.selectedProfile", "User selected profile ") + chosenProfile); - await jobsProvider.addSession(chosenProfile); } else { log.debug(localize("addJobsSession.log.debug.cancelledProfile", "User cancelled profile selection")); } diff --git a/src/utils.ts b/src/utils.ts index 85739fec82..22e405c7e0 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -109,7 +109,7 @@ export function labelHack( node: TreeItem ): void { node.label = node.label.endsWith(" ") ? node.label.substring(0, node.label.length -1 ) : node.label+ " "; } -export function resolveQuickPickHelper(quickpick: QuickPick) { +export async function resolveQuickPickHelper(quickpick: QuickPick): Promise { return new Promise( (c) => quickpick.onDidAccept(() => c(quickpick.activeItems[0]))); } From 178d1fb8610da04fc2fd932b39256217ebe0ae43 Mon Sep 17 00:00:00 2001 From: jellypuno Date: Mon, 9 Dec 2019 10:46:17 +0100 Subject: [PATCH 08/16] Add validation for undefined username and password + more cosmetic fix Signed-off-by: jellypuno --- i18n/sample/src/Profiles.i18n.json | 6 ++++-- i18n/sample/src/extension.i18n.json | 2 +- src/Profiles.ts | 16 ++++++++++++++-- 3 files changed, 19 insertions(+), 5 deletions(-) diff --git a/i18n/sample/src/Profiles.i18n.json b/i18n/sample/src/Profiles.i18n.json index 30dd3592fa..9790789495 100644 --- a/i18n/sample/src/Profiles.i18n.json +++ b/i18n/sample/src/Profiles.i18n.json @@ -5,9 +5,11 @@ "createNewConnection.option.prompt.url": "Enter a z/OSMF URL in the format 'https://url:port'.", "createNewConnection.enterzosmfURL": "No valid value for z/OSMF URL. Operation Cancelled", "createNewConnection.option.prompt.userName.placeholder": "Optional: User Name", - "createNewConnection.option.prompt.userName": "Enter the user name for the connection", + "createNewConnection.option.prompt.userName": "Enter the user name for the connection. Leave blank to not store.", + "createNewConnection.undefined.enteruserName": "Operation Cancelled", "createNewConnection.option.prompt.passWord.placeholder": "Optional: Password", - "createNewConnection.option.prompt.password": "Enter a password for the connection", + "createNewConnection.option.prompt.password": "Enter the password for the connection. Leave blank to not store.", + "createNewConnection.undefined.enterpassWord": "Operation Cancelled", "createNewConnection.option.prompt.ru.placeholder": "Reject Unauthorized Connections", "createNewConnection.rejectUnauthorize": "Operation Cancelled", "createNewConnection.duplicateProfileName": "Profile name already exists. Please create a profile using a different name", diff --git a/i18n/sample/src/extension.i18n.json b/i18n/sample/src/extension.i18n.json index 66bf989920..10080f717b 100644 --- a/i18n/sample/src/extension.i18n.json +++ b/i18n/sample/src/extension.i18n.json @@ -90,9 +90,9 @@ "saveFile.log.error.session": "Couldn't locate session when saving data set!", "saveFile.log.debug.saving": "Saving file ", "saveFile.error.saveFailed": "Data set failed to save. Data set may have been deleted on mainframe.", + "saveFile.response.save.title": "Saving data set...", "saveFile.error.ZosmfEtagMismatchError": "Rest API failure with HTTP(S) status 412", "saveFile.error.etagMismatch": "Remote file has been modified in the meantime.\nSelect 'Compare' to resolve the conflict.", - "saveFile.response.save.title": "Saving data set...", "saveUSSFile.log.debug.saveRequest": "save requested for USS file ", "saveUSSFile.response.title": "Saving file...", "saveUSSFile.log.error.save": "Error encountered when saving USS file: ", diff --git a/src/Profiles.ts b/src/Profiles.ts index c63ed3a2aa..7a0b592032 100644 --- a/src/Profiles.ts +++ b/src/Profiles.ts @@ -164,19 +164,31 @@ export class Profiles { // Processing stops if there are no profiles detected options = { placeHolder: localize("createNewConnection.option.prompt.userName.placeholder", "Optional: User Name"), - prompt: localize("createNewConnection.option.prompt.userName", "Enter the user name for the connection"), + prompt: localize("createNewConnection.option.prompt.userName", "Enter the user name for the connection. Leave blank to not store."), value: userName }; userName = await vscode.window.showInputBox(options); + if (userName === undefined) { + vscode.window.showInformationMessage(localize("createNewConnection.undefined.enteruserName", + "Operation Cancelled")); + return; + } + options = { placeHolder: localize("createNewConnection.option.prompt.password.placeholder", "Optional: Password"), - prompt: localize("createNewConnection.option.prompt.password", "Enter a password for the connection"), + prompt: localize("createNewConnection.option.prompt.password", "Enter the password for the connection. Leave blank to not store."), password: true, value: passWord }; passWord = await vscode.window.showInputBox(options); + if (passWord === undefined) { + vscode.window.showInformationMessage(localize("createNewConnection.undefined.enterpassWord", + "Operation Cancelled")); + return; + } + const quickPickOptions: vscode.QuickPickOptions = { placeHolder: localize("createNewConnection.option.prompt.ru.placeholder", "Reject Unauthorized Connections"), ignoreFocusOut: true, From a72d2cd74e57eb0a92d8ad008a887a4814a42bb2 Mon Sep 17 00:00:00 2001 From: Peter Haumer <4391934+phaumer@users.noreply.github.com> Date: Mon, 9 Dec 2019 10:58:19 -0800 Subject: [PATCH 09/16] Add interfaces for one common add session handler Signed-off-by: Peter Haumer <4391934+phaumer@users.noreply.github.com> --- .../extension.integration.test.ts | 4 +- __tests__/__unit__/extension.unit.test.ts | 142 +++++++------ .../__unit__/uss/ussNodeActions.unit.test.ts | 4 +- i18n/sample/src/extension.i18n.json | 4 +- src/DatasetTree.ts | 3 +- src/USSTree.ts | 3 +- src/ZosJobsProvider.ts | 3 +- src/ZoweJobNode.ts | 14 +- src/ZoweNode.ts | 13 +- src/ZoweTree.ts | 42 ++++ src/ZoweUSSNode.ts | 13 +- src/extension.ts | 198 ++---------------- 12 files changed, 176 insertions(+), 267 deletions(-) create mode 100644 src/ZoweTree.ts diff --git a/__tests__/__integration__/extension.integration.test.ts b/__tests__/__integration__/extension.integration.test.ts index 1bf247ca97..7c59865cd5 100644 --- a/__tests__/__integration__/extension.integration.test.ts +++ b/__tests__/__integration__/extension.integration.test.ts @@ -96,7 +96,7 @@ describe("Extension Integration Tests", () => { const stubresolve = sandbox.stub(utils, "resolveQuickPickHelper"); stubresolve.returns(new utils.FilterItem(profileNamesList[0])); - await extension.addSession(testTree); + await extension.addZoweSession(testTree); expect(testTree.mSessionNodes[testTree.mSessionNodes.length - 1].label).to.equal(profileNamesList[0]); }).timeout(TIMEOUT); }); @@ -944,7 +944,7 @@ describe("Extension Integration Tests - USS", () => { const stubresolve = sandbox.stub(utils, "resolveQuickPickHelper"); stubresolve.returns(new utils.FilterItem(profileNamesList[0])); - await extension.addUSSSession(ussTestTree); + await extension.addZoweSession(ussTestTree); expect(ussTestTree.mSessionNodes[ussTestTree.mSessionNodes.length - 1].label).to.equal(profileNamesList[0]); }).timeout(TIMEOUT); }); diff --git a/__tests__/__unit__/extension.unit.test.ts b/__tests__/__unit__/extension.unit.test.ts index cc02bef55b..be9b3c1368 100644 --- a/__tests__/__unit__/extension.unit.test.ts +++ b/__tests__/__unit__/extension.unit.test.ts @@ -153,9 +153,7 @@ describe("Extension Unit Tests", () => { const showInformationMessage = jest.fn(); const showQuickPick = jest.fn(); const createQuickPick = jest.fn(); - const createNewConnection = jest.fn(); - const mockAddSession = jest.fn(); - const mockAddUSSSession = jest.fn(); + const mockAddZoweSession = jest.fn(); const mockAddHistory = jest.fn(); const mockRefresh = jest.fn(); const mockRefreshElement = jest.fn(); @@ -225,7 +223,7 @@ describe("Extension Unit Tests", () => { return { mSessionNodes: [], mFavorites: [], - addSession: mockAddSession, + addSession: mockAddZoweSession, addHistory: mockAddHistory, refresh: mockRefresh, refreshElement: mockRefreshElement, @@ -243,7 +241,7 @@ describe("Extension Unit Tests", () => { const USSTree = jest.fn().mockImplementation(() => { return { mSessionNodes: [], - addSession: mockAddUSSSession, + addSession: mockAddZoweSession, refresh: mockUSSRefresh, addHistory: mockAddHistory, refreshElement: mockUSSRefreshElement, @@ -901,13 +899,13 @@ describe("Extension Unit Tests", () => { }) }); - await extension.addSession(testTree); + await extension.addZoweSession(testTree); expect(showInformationMessage.mock.calls[0][0]).toEqual("Profile Name was not supplied. Operation Cancelled"); }); it("Testing that addSession with supplied profile name", async () => { const entered = undefined; - const addSession = jest.spyOn(extension, "addSession"); + const addSession = jest.spyOn(extension, "addZoweSession"); // Assert edge condition user cancels the input path box createQuickPick.mockReturnValue({ @@ -928,14 +926,14 @@ describe("Extension Unit Tests", () => { }); showInputBox.mockReturnValueOnce("fake"); - await extension.addSession(testTree); - expect(extension.addSession).toHaveBeenCalled(); + await extension.addZoweSession(testTree); + expect(extension.addZoweSession).toHaveBeenCalled(); }); it("Testing that addSession with existing profile", async () => { const entered = ""; - const addSession = jest.spyOn(extension, "addSession"); + const addSession = jest.spyOn(extension, "addZoweSession"); // Assert edge condition user cancels the input path box createQuickPick.mockReturnValue({ @@ -960,13 +958,13 @@ describe("Extension Unit Tests", () => { () => Promise.resolve(createQuickPick()) ); - await extension.addSession(testTree); - expect(extension.addSession).toHaveBeenCalled(); + await extension.addZoweSession(testTree); + expect(extension.addZoweSession).toHaveBeenCalled(); }); it("Testing that addSession with supplied resolveQuickPickHelper", async () => { const entered = "fake"; - const addSession = jest.spyOn(extension, "addSession"); + const addSession = jest.spyOn(extension, "addZoweSession"); // Assert edge condition user cancels the input path box createQuickPick.mockReturnValue({ @@ -986,14 +984,14 @@ describe("Extension Unit Tests", () => { }) }); - await extension.addSession(testTree); - expect(extension.addSession).toHaveBeenCalled(); + await extension.addZoweSession(testTree); + expect(extension.addZoweSession).toHaveBeenCalled(); }); it("Testing that addSession with undefined profile", async () => { const entered = ""; - const addSession = jest.spyOn(extension, "addSession"); + const addSession = jest.spyOn(extension, "addZoweSession"); // Assert edge condition user cancels the input path box createQuickPick.mockReturnValue({ @@ -1018,15 +1016,15 @@ describe("Extension Unit Tests", () => { () => Promise.resolve(createQuickPick()) ); - await extension.addSession(testTree); - expect(extension.addSession).toHaveBeenCalled(); + await extension.addZoweSession(testTree); + expect(extension.addZoweSession).toHaveBeenCalled(); }); it("Testing that addSession if createNewConnection is invalid", async () => { const entered = "fake"; - const addSession = jest.spyOn(extension, "addSession"); + const addSession = jest.spyOn(extension, "addZoweSession"); Object.defineProperty(profileLoader.Profiles, "getInstance", { value: jest.fn(() => { @@ -1058,14 +1056,14 @@ describe("Extension Unit Tests", () => { }) }); - await extension.addSession(testTree); - expect(extension.addSession).toHaveBeenCalled(); + await extension.addZoweSession(testTree); + expect(extension.addZoweSession).toHaveBeenCalled(); }); it("Testing that addSession if listProfile is invalid", async () => { const entered = "fake"; - const addSession = jest.spyOn(extension, "addSession"); + const addSession = jest.spyOn(extension, "addZoweSession"); Object.defineProperty(profileLoader.Profiles, "getInstance", { value: jest.fn(() => { @@ -1097,8 +1095,8 @@ describe("Extension Unit Tests", () => { }) }); - await extension.addSession(testTree); - expect(extension.addSession).toHaveBeenCalled(); + await extension.addZoweSession(testTree); + expect(extension.addZoweSession).toHaveBeenCalled(); }); }); @@ -1507,13 +1505,13 @@ describe("Extension Unit Tests", () => { }); it("Testing that enterPattern is executed successfully for search favorite", async () => { - mockAddSession.mockReset(); + mockAddZoweSession.mockReset(); const favoriteSample = new ZoweNode("[sestest]: HLQ.TEST", vscode.TreeItemCollapsibleState.None, undefined, null); await extension.enterPattern(favoriteSample, testTree); - expect(mockAddSession.mock.calls.length).toBe(1); - expect(mockAddSession.mock.calls[0][0]).toEqual("sestest"); + expect(mockAddZoweSession.mock.calls.length).toBe(1); + expect(mockAddZoweSession.mock.calls[0][0]).toEqual("sestest"); }); it("Testing that saveFile is executed successfully", async () => { @@ -2067,7 +2065,7 @@ describe("Extension Unit Tests", () => { showInformationMessage.mockReset(); }); - it("Testing that addUSSSession will cancel if there is no profile name", async () => { + it("Testing that addZoweSession will cancel if there is no profile name", async () => { const entered = undefined; // Assert edge condition user cancels the input path box @@ -2088,13 +2086,13 @@ describe("Extension Unit Tests", () => { }) }); - await extension.addUSSSession(testTree); + await extension.addZoweSession(testTree); expect(showInformationMessage.mock.calls[0][0]).toEqual("Profile Name was not supplied. Operation Cancelled"); }); - it("Testing that addUSSSession with supplied profile name", async () => { + it("Testing that addZoweSession with supplied profile name", async () => { const entered = undefined; - const addUSSSession = jest.spyOn(extension, "addUSSSession"); + const addZoweSession = jest.spyOn(extension, "addZoweSession"); // Assert edge condition user cancels the input path box createQuickPick.mockReturnValue({ @@ -2115,14 +2113,14 @@ describe("Extension Unit Tests", () => { }); showInputBox.mockReturnValueOnce("fake"); - await extension.addUSSSession(testUSSTree); - expect(extension.addUSSSession).toHaveBeenCalled(); + await extension.addZoweSession(testUSSTree); + expect(extension.addZoweSession).toHaveBeenCalled(); }); - it("Testing that addUSSSession with existing profile", async () => { + it("Testing that addZoweSession with existing profile", async () => { const entered = ""; - const addUSSSession = jest.spyOn(extension, "addUSSSession"); + const addZoweSession = jest.spyOn(extension, "addZoweSession"); // Assert edge condition user cancels the input path box createQuickPick.mockReturnValue({ @@ -2147,13 +2145,13 @@ describe("Extension Unit Tests", () => { () => Promise.resolve(createQuickPick()) ); - await extension.addUSSSession(testUSSTree); - expect(extension.addUSSSession).toHaveBeenCalled(); + await extension.addZoweSession(testUSSTree); + expect(extension.addZoweSession).toHaveBeenCalled(); }); - it("Testing that addUSSSession with supplied resolveQuickPickHelper", async () => { + it("Testing that addZoweSession with supplied resolveQuickPickHelper", async () => { const entered = "fake"; - const addUSSSession = jest.spyOn(extension, "addUSSSession"); + const addZoweSession = jest.spyOn(extension, "addZoweSession"); // Assert edge condition user cancels the input path box createQuickPick.mockReturnValue({ @@ -2173,14 +2171,14 @@ describe("Extension Unit Tests", () => { }) }); - await extension.addUSSSession(testUSSTree); - expect(extension.addUSSSession).toHaveBeenCalled(); + await extension.addZoweSession(testUSSTree); + expect(extension.addZoweSession).toHaveBeenCalled(); }); - it("Testing that addUSSSession with undefined profile", async () => { + it("Testing that addZoweSession with undefined profile", async () => { const entered = ""; - const addUSSSession = jest.spyOn(extension, "addUSSSession"); + const addZoweSession = jest.spyOn(extension, "addZoweSession"); // Assert edge condition user cancels the input path box createQuickPick.mockReturnValue({ @@ -2205,15 +2203,15 @@ describe("Extension Unit Tests", () => { () => Promise.resolve(createQuickPick()) ); - await extension.addUSSSession(testUSSTree); - expect(extension.addUSSSession).toHaveBeenCalled(); + await extension.addZoweSession(testUSSTree); + expect(extension.addZoweSession).toHaveBeenCalled(); }); - it("Testing that addUSSSession if createNewConnection is invalid", async () => { + it("Testing that addZoweSession if createNewConnection is invalid", async () => { const entered = "fake"; - const addUSSSession = jest.spyOn(extension, "addUSSSession"); + const addZoweSession = jest.spyOn(extension, "addZoweSession"); Object.defineProperty(profileLoader.Profiles, "getInstance", { value: jest.fn(() => { @@ -2245,14 +2243,14 @@ describe("Extension Unit Tests", () => { }) }); - await extension.addUSSSession(testUSSTree); - expect(extension.addUSSSession).toHaveBeenCalled(); + await extension.addZoweSession(testUSSTree); + expect(extension.addZoweSession).toHaveBeenCalled(); }); - it("Testing that addUSSSession if listProfile is invalid", async () => { + it("Testing that addZoweSession if listProfile is invalid", async () => { const entered = "fake"; - const addUSSSession = jest.spyOn(extension, "addUSSSession"); + const addZoweSession = jest.spyOn(extension, "addZoweSession"); Object.defineProperty(profileLoader.Profiles, "getInstance", { value: jest.fn(() => { @@ -2284,8 +2282,8 @@ describe("Extension Unit Tests", () => { }) }); - await extension.addUSSSession(testUSSTree); - expect(extension.addUSSSession).toHaveBeenCalled(); + await extension.addZoweSession(testUSSTree); + expect(extension.addZoweSession).toHaveBeenCalled(); }); }); @@ -2830,13 +2828,13 @@ describe("Extension Unit Tests", () => { }) }); - await extension.addJobsSession(testJobsTree); + await extension.addZoweSession(testJobsTree); expect(showInformationMessage.mock.calls[0][0]).toEqual("Profile Name was not supplied. Operation Cancelled"); }); it("Testing that addJobsSession with supplied profile name", async () => { const entered = undefined; - const addJobsSession = jest.spyOn(extension, "addJobsSession"); + const addJobsSession = jest.spyOn(extension, "addZoweSession"); // Assert edge condition user cancels the input path box createQuickPick.mockReturnValue({ @@ -2857,14 +2855,14 @@ describe("Extension Unit Tests", () => { }); showInputBox.mockReturnValueOnce("fake"); - await extension.addJobsSession(testJobsTree); - expect(extension.addJobsSession).toHaveBeenCalled(); + await extension.addZoweSession(testJobsTree); + expect(extension.addZoweSession).toHaveBeenCalled(); }); it("Testing that addJobsSession with existing profile", async () => { const entered = ""; - const addJobsSession = jest.spyOn(extension, "addJobsSession"); + const addJobsSession = jest.spyOn(extension, "addZoweSession"); // Assert edge condition user cancels the input path box createQuickPick.mockReturnValue({ @@ -2889,13 +2887,13 @@ describe("Extension Unit Tests", () => { () => Promise.resolve(createQuickPick()) ); - await extension.addJobsSession(testJobsTree); - expect(extension.addJobsSession).toHaveBeenCalled(); + await extension.addZoweSession(testJobsTree); + expect(extension.addZoweSession).toHaveBeenCalled(); }); it("Testing that addJobsSession with supplied resolveQuickPickHelper", async () => { const entered = "fake"; - const addJobsSession = jest.spyOn(extension, "addJobsSession"); + const addJobsSession = jest.spyOn(extension, "addZoweSession"); // Assert edge condition user cancels the input path box createQuickPick.mockReturnValue({ @@ -2915,14 +2913,14 @@ describe("Extension Unit Tests", () => { }) }); - await extension.addJobsSession(testJobsTree); - expect(extension.addJobsSession).toHaveBeenCalled(); + await extension.addZoweSession(testJobsTree); + expect(extension.addZoweSession).toHaveBeenCalled(); }); it("Testing that addJobsSession with undefined profile", async () => { const entered = ""; - const addJobsSession = jest.spyOn(extension, "addJobsSession"); + const addJobsSession = jest.spyOn(extension, "addZoweSession"); // Assert edge condition user cancels the input path box createQuickPick.mockReturnValue({ @@ -2947,15 +2945,15 @@ describe("Extension Unit Tests", () => { () => Promise.resolve(createQuickPick()) ); - await extension.addJobsSession(testJobsTree); - expect(extension.addJobsSession).toHaveBeenCalled(); + await extension.addZoweSession(testJobsTree); + expect(extension.addZoweSession).toHaveBeenCalled(); }); it("Testing that addJobsSession if createNewConnection is invalid", async () => { const entered = "fake"; - const addJobsSession = jest.spyOn(extension, "addJobsSession"); + const addJobsSession = jest.spyOn(extension, "addZoweSession"); Object.defineProperty(profileLoader.Profiles, "getInstance", { value: jest.fn(() => { @@ -2987,14 +2985,14 @@ describe("Extension Unit Tests", () => { }) }); - await extension.addJobsSession(testJobsTree); - expect(extension.addJobsSession).toHaveBeenCalled(); + await extension.addZoweSession(testJobsTree); + expect(extension.addZoweSession).toHaveBeenCalled(); }); it("Testing that addJobsSession if listProfile is invalid", async () => { const entered = "fake"; - const addJobsSession = jest.spyOn(extension, "addJobsSession"); + const addJobsSession = jest.spyOn(extension, "addZoweSession"); Object.defineProperty(profileLoader.Profiles, "getInstance", { value: jest.fn(() => { @@ -3026,8 +3024,8 @@ describe("Extension Unit Tests", () => { }) }); - await extension.addJobsSession(testJobsTree); - expect(extension.addJobsSession).toHaveBeenCalled(); + await extension.addZoweSession(testJobsTree); + expect(extension.addZoweSession).toHaveBeenCalled(); }); }); diff --git a/__tests__/__unit__/uss/ussNodeActions.unit.test.ts b/__tests__/__unit__/uss/ussNodeActions.unit.test.ts index c7ea782c07..78cd8245d0 100644 --- a/__tests__/__unit__/uss/ussNodeActions.unit.test.ts +++ b/__tests__/__unit__/uss/ussNodeActions.unit.test.ts @@ -25,7 +25,7 @@ const Utilities = jest.fn(); const uss = jest.fn(); const ussFile = jest.fn(); const renameUSSFile = jest.fn(); -const mockAddUSSSession = jest.fn(); +const mockaddZoweSession = jest.fn(); const mockUSSRefresh = jest.fn(); const mockUSSRefreshElement = jest.fn(); const mockGetUSSChildren = jest.fn(); @@ -72,7 +72,7 @@ function getUSSTree() { return { mSessionNodes: [], mFavorites: [ussNodeFav], - addSession: mockAddUSSSession, + addSession: mockaddZoweSession, refresh: mockUSSRefresh, refreshAll: mockUSSRefresh, refreshElement: mockUSSRefreshElement, diff --git a/i18n/sample/src/extension.i18n.json b/i18n/sample/src/extension.i18n.json index 66bf989920..c7d47d5db2 100644 --- a/i18n/sample/src/extension.i18n.json +++ b/i18n/sample/src/extension.i18n.json @@ -29,8 +29,8 @@ "addSession.log.debug.createNewProfile": "User created a new profile", "addSession.log.debug.selectedProfile": "User selected profile ", "addSession.log.debug.cancelledSelection": "Operation Cancelled", - "addUSSSession.log.debug.selectProfile": "User selected profile ", - "addUSSSession.log.debug.cancelledSelection": "User cancelled profile selection", + "addZoweSession.log.debug.selectProfile": "User selected profile ", + "addZoweSession.log.debug.cancelledSelection": "User cancelled profile selection", "createFile.quickPickOption.dataSetType": "Type of Data Set to be Created", "createFile.dataSetBinary": "Data Set Binary", "createFile.dataSetC": "Data Set C", diff --git a/src/DatasetTree.ts b/src/DatasetTree.ts index 21c160f80c..9f008ed636 100644 --- a/src/DatasetTree.ts +++ b/src/DatasetTree.ts @@ -18,6 +18,7 @@ import * as extension from "../src/extension"; import { PersistentFilters } from "./PersistentFilters"; import { Profiles } from "./Profiles"; import { sortTreeItems, applyIcons, FilterDescriptor, FilterItem, resolveQuickPickHelper } from "./utils"; +import { IZoweTree } from "./ZoweTree"; import { ZoweNode } from "./ZoweNode"; const localize = nls.config({ messageFormat: nls.MessageFormat.file })(); @@ -40,7 +41,7 @@ export async function createDatasetTree(log: Logger) { * @class DatasetTree * @implements {vscode.TreeDataProvider} */ -export class DatasetTree implements vscode.TreeDataProvider { +export class DatasetTree implements IZoweTree { private static readonly persistenceSchema: string = "Zowe-DS-Persistent"; private static readonly defaultDialogText: string = "\uFF0B " + localize("ussFilterPrompt.option.prompt.search", "Create a new filter"); diff --git a/src/USSTree.ts b/src/USSTree.ts index fec6e3e81f..52175b1ee2 100644 --- a/src/USSTree.ts +++ b/src/USSTree.ts @@ -14,6 +14,7 @@ import * as zowe from "@brightside/core"; import { IProfileLoaded, Logger } from "@brightside/imperative"; import { applyIcons, FilterItem, FilterDescriptor, resolveQuickPickHelper, sortTreeItems } from "./utils"; import * as vscode from "vscode"; +import { IZoweTree } from "./ZoweTree"; import { ZoweUSSNode } from "./ZoweUSSNode"; import { Profiles } from "./Profiles"; import { PersistentFilters } from "./PersistentFilters"; @@ -40,7 +41,7 @@ export async function createUSSTree(log: Logger) { * @class USSTree * @implements {vscode.TreeDataProvider} */ -export class USSTree implements vscode.TreeDataProvider { +export class USSTree implements IZoweTree { public static readonly defaultDialogText: string = "\uFF0B " + localize("ussFilterPrompt.option.prompt.search", "Create a new filter"); private static readonly persistenceSchema: string = "Zowe-USS-Persistent"; diff --git a/src/ZosJobsProvider.ts b/src/ZosJobsProvider.ts index cccace97f0..25b8cb83d1 100644 --- a/src/ZosJobsProvider.ts +++ b/src/ZosJobsProvider.ts @@ -16,6 +16,7 @@ import { IProfileLoaded, Logger } from "@brightside/imperative"; import { Profiles } from "./Profiles"; import { PersistentFilters } from "./PersistentFilters"; import { Job } from "./ZoweJobNode"; +import { IZoweTree } from "./ZoweTree"; import { OwnerFilterDescriptor, JobIdFilterDescriptor, applyIcons, FilterItem, FilterDescriptor, resolveQuickPickHelper, sortTreeItems } from "./utils"; import * as extension from "../src/extension"; import * as nls from "vscode-nls"; @@ -36,7 +37,7 @@ export async function createJobsTree(log: Logger) { } // tslint:disable-next-line: max-classes-per-file -export class ZosJobsProvider implements vscode.TreeDataProvider { +export class ZosJobsProvider implements IZoweTree { public static readonly JobId = "JobId:"; public static readonly Owner = "Owner:"; public static readonly Prefix = "Prefix:"; diff --git a/src/ZoweJobNode.ts b/src/ZoweJobNode.ts index e834335a55..a7601c62d2 100644 --- a/src/ZoweJobNode.ts +++ b/src/ZoweJobNode.ts @@ -15,11 +15,11 @@ import { Session, IProfileLoaded, Logger } from "@brightside/imperative"; // tslint:disable-next-line: no-duplicate-imports import { IJob, IJobFile } from "@brightside/core"; import * as extension from "./extension"; -import { ZosJobsProvider } from "./ZosJobsProvider"; +import { IZoweTreeNode } from "./ZoweTree"; import * as utils from "./utils"; // tslint:disable-next-line: max-classes-per-file -export class Job extends vscode.TreeItem { +export class Job extends vscode.TreeItem implements IZoweTreeNode { public static readonly JobId = "JobId:"; public static readonly Owner = "Owner:"; public static readonly Prefix = "Prefix:"; @@ -44,6 +44,16 @@ export class Job extends vscode.TreeItem { utils.applyIcons(this); } + /** + * Implements access to profile name + * for {IZoweTreeNode}. + * + * @returns {string} + */ + public getProfileName(): string { + return this.label.trim(); + } + public getSessionName(): string { return this.getSessionNode().label.trim(); } diff --git a/src/ZoweNode.ts b/src/ZoweNode.ts index 34a695efd6..84db261e28 100644 --- a/src/ZoweNode.ts +++ b/src/ZoweNode.ts @@ -15,6 +15,7 @@ import { Session } from "@brightside/imperative"; import * as nls from "vscode-nls"; import * as utils from "./utils"; import * as extension from "../src/extension"; +import { IZoweTreeNode } from "./ZoweTree"; const localize = nls.config({ messageFormat: nls.MessageFormat.file })(); /** @@ -24,7 +25,7 @@ const localize = nls.config({ messageFormat: nls.MessageFormat.file })(); * @class ZoweNode * @extends {vscode.TreeItem} */ -export class ZoweNode extends vscode.TreeItem { +export class ZoweNode extends vscode.TreeItem implements IZoweTreeNode { public command: vscode.Command; public pattern = ""; public dirty = extension.ISTHEIA; // Make sure this is true for theia instances @@ -59,6 +60,16 @@ export class ZoweNode extends vscode.TreeItem { utils.applyIcons(this); } + /** + * Implements access to profile name + * for {IZoweTreeNode}. + * + * @returns {string} + */ + public getProfileName(): string { + return this.label.trim(); + } + /** * Retrieves child nodes of this ZoweNode * diff --git a/src/ZoweTree.ts b/src/ZoweTree.ts new file mode 100644 index 0000000000..e1e1c1a4ed --- /dev/null +++ b/src/ZoweTree.ts @@ -0,0 +1,42 @@ +/* +* 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 Contributors to the Zowe Project. * +* * +*/ + +// TODO: Evolve these interfaces for additional refactoring of the commonalities of +// the three tree views. Consider adding also abstract base classes as well. + +import * as vscode from "vscode"; + +/** + * The base interface for Zowe tree brosers that implement the + * vscode.TreeDataProvider. + * + * @export + * @interface IZoweTree + * @extends {vscode.TreeDataProvider} + * @template T provide a subtype of vscode.TreeItem + */ +export interface IZoweTree extends vscode.TreeDataProvider { + mSessionNodes: T[]; + mFavoriteSession: T; + mFavorites: T[]; + + addSession(sessionName?: string): Promise; + refresh(): void; +} +/** + * The base interface for Zowe tree nodes. + * + * @export + * @interface IZoweTreeNode + */ +export interface IZoweTreeNode { + getProfileName(): string; +} diff --git a/src/ZoweUSSNode.ts b/src/ZoweUSSNode.ts index 3f8f1b03d5..ce9b087d5e 100644 --- a/src/ZoweUSSNode.ts +++ b/src/ZoweUSSNode.ts @@ -13,6 +13,7 @@ import * as zowe from "@brightside/core"; import { Session } from "@brightside/imperative"; import * as vscode from "vscode"; import * as nls from "vscode-nls"; +import { IZoweTreeNode } from "./ZoweTree"; const localize = nls.config({ messageFormat: nls.MessageFormat.file })(); import * as extension from "../src/extension"; import * as utils from "./utils"; @@ -24,7 +25,7 @@ import * as utils from "./utils"; * @class ZoweUSSNode * @extends {vscode.TreeItem} */ -export class ZoweUSSNode extends vscode.TreeItem { +export class ZoweUSSNode extends vscode.TreeItem implements IZoweTreeNode { public command: vscode.Command; public fullPath = ""; public dirty = extension.ISTHEIA; // Make sure this is true for theia instances @@ -79,6 +80,16 @@ export class ZoweUSSNode extends vscode.TreeItem { utils.applyIcons(this); } + /** + * Implements access to profile name + * for {IZoweTreeNode}. + * + * @returns {string} + */ + public getProfileName(): string { + return this.mProfileName; + } + /** * Retrieves child nodes of this ZoweUSSNode * diff --git a/src/extension.ts b/src/extension.ts index 747bb01e52..aab3cfb977 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -14,6 +14,7 @@ import * as fs from "fs"; import { moveSync } from "fs-extra"; import * as path from "path"; import * as vscode from "vscode"; +import { IZoweTree, IZoweTreeNode } from "./ZoweTree"; import { ZoweNode } from "./ZoweNode"; import { Logger, TextUtils, IProfileLoaded, ISession, IProfile, Session } from "@brightside/imperative"; import { DatasetTree, createDatasetTree } from "./DatasetTree"; @@ -135,7 +136,7 @@ export async function activate(context: vscode.ExtensionContext) { context.subscriptions.push(spoolProvider, providerRegistration); if (datasetProvider) { - vscode.commands.registerCommand("zowe.addSession", async () => addSession(datasetProvider)); + vscode.commands.registerCommand("zowe.addSession", async () => addZoweSession(datasetProvider)); vscode.commands.registerCommand("zowe.addFavorite", async (node) => datasetProvider.addFavorite(node)); vscode.commands.registerCommand("zowe.refreshAll", () => refreshAll(datasetProvider)); vscode.commands.registerCommand("zowe.refreshNode", (node) => refreshPS(node)); @@ -205,7 +206,7 @@ export async function activate(context: vscode.ExtensionContext) { if (ussFileProvider) { vscode.commands.registerCommand("zowe.uss.addFavorite", async (node) => ussFileProvider.addUSSFavorite(node)); vscode.commands.registerCommand("zowe.uss.removeFavorite", async (node) => ussFileProvider.removeUSSFavorite(node)); - vscode.commands.registerCommand("zowe.uss.addSession", async () => addUSSSession(ussFileProvider)); + vscode.commands.registerCommand("zowe.uss.addSession", async () => addZoweSession(ussFileProvider)); vscode.commands.registerCommand("zowe.uss.refreshAll", () => ussActions.refreshAllUSS(ussFileProvider)); vscode.commands.registerCommand("zowe.uss.refreshUSS", (node) => refreshUSS(node)); vscode.commands.registerCommand("zowe.uss.fullPath", (node) => ussFileProvider.ussFilterPrompt(node)); @@ -261,7 +262,7 @@ export async function activate(context: vscode.ExtensionContext) { jobsProvider.refresh(); Profiles.getInstance().refresh(); }); - vscode.commands.registerCommand("zowe.addJobsSession", () => addJobsSession(jobsProvider)); + vscode.commands.registerCommand("zowe.addJobsSession", () => addZoweSession(jobsProvider)); vscode.commands.registerCommand("zowe.setOwner", (node) => { setOwner(node, jobsProvider); }); @@ -582,107 +583,17 @@ export async function submitMember(node: ZoweNode) { } /** - * Adds a new Profile to the Dataset treeview by clicking the 'Plus' button and + * Adds a new Profile to the provided treeview by clicking the 'Plus' button and * selecting which profile you would like to add from the drop-down that appears. * The profiles that are in the tree view already will not appear in the - * drop-down + * drop-down. * * @export - * @param {DatasetTree} datasetProvider - our datasetTree object + * @param {USSTree} zoweFileProvider - either the USS, MVS, JES tree */ -export async function addSession(datasetProvider: DatasetTree) { +export async function addZoweSession(zoweFileProvider: IZoweTree) { const allProfiles = (await Profiles.getInstance()).allProfiles; const createNewProfile = "Create a New Connection to z/OS"; - let newprofile: any; - let chosenProfile: string; - let choice: vscode.QuickPickItem; - let profileName: string; - - let profileNamesList = allProfiles.map((profile) => { - return profile.name; - }); - if (profileNamesList.length > 0) { - profileNamesList = profileNamesList.filter((profileNames) => - // Find all cases where a profile is not already displayed - !datasetProvider.mSessionNodes.find((sessionNode) => - sessionNode.label.trim() === profileNames - ) - ); - } - const createPick = new utils.FilterDescriptor("\uFF0B " + createNewProfile); - const items: vscode.QuickPickItem[] = profileNamesList.map((element) => new utils.FilterItem(element)); - const quickpick = vscode.window.createQuickPick(); - quickpick.items = [createPick, ...items]; - quickpick.placeholder = localize("addSession.quickPickOption", - "Choose \"Create new...\" to define a new profile or select an existing profile to Add to the Data Set Explorer"); - quickpick.ignoreFocusOut = true; - quickpick.show(); - choice = await utils.resolveQuickPickHelper(quickpick); - quickpick.hide(); - if (choice) { - if (choice instanceof utils.FilterDescriptor) { - if (quickpick.value) { - chosenProfile = quickpick.value; - } else { - const options = { - placeHolder: localize("createNewConnection.option.prompt.profileName.placeholder", "Connection Name"), - prompt: localize("createNewConnection.option.prompt.profileName", "Enter a name for the connection"), - value: profileName - }; - profileName = await vscode.window.showInputBox(options); - if (!profileName) { - vscode.window.showInformationMessage(localize("createNewConnection.enterprofileName", - "Profile Name was not supplied. Operation Cancelled")); - return; - } - quickpick.value = profileName; - chosenProfile = quickpick.value; - } - } else { - chosenProfile = choice.label; - } - if (chosenProfile === quickpick.value) { - log.debug(localize("addSession.log.debug.createNewProfile", "User created a new profile")); - try { - newprofile = await Profiles.getInstance().createNewConnection(chosenProfile); - } catch (error) { - vscode.window.showErrorMessage(error.message); - } - if (newprofile !== undefined) { - try { - await Profiles.getInstance().listProfile(); - } catch (error) { - vscode.window.showErrorMessage(error.message); - } - await datasetProvider.addSession(newprofile); - await datasetProvider.refresh(); - } - } else if(chosenProfile) { - log.debug(localize("addSession.log.debug.selectedProfile", "User selected profile ") + chosenProfile); - await datasetProvider.addSession(chosenProfile); - } else { - log.debug(localize("addSession.log.debug.cancelledSelection", "Operation Cancelled")); - vscode.window.showInformationMessage(localize("createNewConnection.enterprofileName", - "Operation Cancelled")); - } - } else { - log.debug(localize("addSession.log.debug.cancelledSelection", "Operation Cancelled")); - } -} - -/** - * Adds a new Profile to the USS treeview by clicking the 'Plus' button and - * selecting which profile you would like to add from the drop-down that appears. - * The profiles that are in the tree view already will not appear in the - * drop-down - * - * @export - * @param {USSTree} ussFileProvider - our ussTree object - */ -export async function addUSSSession(ussFileProvider: USSTree) { - const allProfiles = (await Profiles.getInstance()).allProfiles; - const createNewProfile = "Create a New Connection to z/OS"; - let newprofile: any; let chosenProfile: string; let profileNamesList = allProfiles.map((profile) => { @@ -691,8 +602,8 @@ export async function addUSSSession(ussFileProvider: USSTree) { if (profileNamesList) { profileNamesList = profileNamesList.filter((profileNames) => // Find all cases where a profile is not already displayed - !ussFileProvider.mSessionNodes.find((sessionNode) => - sessionNode.mProfileName === profileNames + !zoweFileProvider.mSessionNodes.find((sessionNode) => + sessionNode.getProfileName() === profileNames ) ); } @@ -736,6 +647,7 @@ export async function addUSSSession(ussFileProvider: USSTree) { } if (chosenProfile === "") { + let newprofile: any; let profileName: string; const options = { placeHolder: localize("createNewConnection.option.prompt.profileName.placeholder", "Connection Name"), @@ -761,14 +673,14 @@ export async function addUSSSession(ussFileProvider: USSTree) { } catch (error) { vscode.window.showErrorMessage(error.message); } - await ussFileProvider.addSession(newprofile); - await ussFileProvider.refresh(); + await zoweFileProvider.addSession(newprofile); + await zoweFileProvider.refresh(); } } else if(chosenProfile) { - log.debug(localize("addUSSSession.log.debug.selectProfile", "User selected profile ") + chosenProfile); - await ussFileProvider.addSession(chosenProfile); + log.debug(localize("addZoweSession.log.debug.selectProfile", "User selected profile ") + chosenProfile); + await zoweFileProvider.addSession(chosenProfile); } else { - log.debug(localize("addUSSSession.log.debug.cancelledSelection", "User cancelled profile selection")); + log.debug(localize("addZoweSession.log.debug.cancelledSelection", "User cancelled profile selection")); } } @@ -2053,81 +1965,3 @@ export async function refreshJobsServer(node: Job) { await jobsProvider.refreshElement(node); } } - -export async function addJobsSession(jobsProvider: ZosJobsProvider) { - const allProfiles = (await Profiles.getInstance()).allProfiles; - const createNewProfile = "Create a New Connection to z/OS"; - let newprofile: any; - let chosenProfile: string; - let choice: vscode.QuickPickItem; - let profileName: string; - - let profileNamesList = allProfiles.map((profile) => { - return profile.name; - }); - if (profileNamesList) { - profileNamesList = profileNamesList.filter((profileNames) => - // Find all cases where a profile is not already displayed - !jobsProvider.mSessionNodes.find((sessionNode) => - sessionNode.label.trim() === profileNames - ) - ); - const createPick = new utils.FilterDescriptor("\uFF0B " + createNewProfile); - const items: vscode.QuickPickItem[] = profileNamesList.map((element) => new utils.FilterItem(element)); - const quickpick = vscode.window.createQuickPick(); - quickpick.items = [createPick, ...items]; - quickpick.placeholder = localize("addSession.quickPickOption", - "Choose \"Create new...\" to define a new profile or select an existing profile to Add to the Jobs Explorer"); - quickpick.ignoreFocusOut = true; - quickpick.show(); - choice = await utils.resolveQuickPickHelper(quickpick); - quickpick.hide(); - if (choice) { - if (choice instanceof utils.FilterDescriptor) { - if (quickpick.value) { - chosenProfile = quickpick.value; - } else { - const options = { - placeHolder: localize("createNewConnection.option.prompt.profileName.placeholder", "Connection Name"), - prompt: localize("createNewConnection.option.prompt.profileName", "Enter a name for the connection"), - value: profileName - }; - profileName = await vscode.window.showInputBox(options); - if (!profileName) { - vscode.window.showInformationMessage(localize("createNewConnection.enterprofileName", - "Profile Name was not supplied. Operation Cancelled")); - return; - } - quickpick.value = profileName; - chosenProfile = quickpick.value; - } - } else { - chosenProfile = choice.label; - } - if (chosenProfile === quickpick.value) { - log.debug(localize("addSession.log.debug.createNewProfile", "User created a new profile")); - try { - newprofile = await Profiles.getInstance().createNewConnection(chosenProfile); - } catch (error) { - vscode.window.showErrorMessage(error.message); - } - if (newprofile !== undefined) { - try { - await Profiles.getInstance().listProfile(); - } catch (error) { - vscode.window.showErrorMessage(error.message); - } - await jobsProvider.addSession(newprofile); - await jobsProvider.refresh(); - } - } else if(chosenProfile) { - log.debug(localize("addJobsSession.log.debug.selectedProfile", "User selected profile ") + chosenProfile); - await jobsProvider.addSession(chosenProfile); - } else { - log.debug(localize("addJobsSession.log.debug.cancelledProfile", "User cancelled profile selection")); - } - } else { - log.debug(localize("addJobsSession.log.debug.cancelledProfile", "User cancelled profile selection")); - } - } -} From 0a69e33f10a257be7ab58a08f6c20fb4af71aeaf Mon Sep 17 00:00:00 2001 From: zFernand0 Date: Mon, 9 Dec 2019 14:16:30 -0500 Subject: [PATCH 10/16] Update keywords. This should reflect as Tags on the MarketPlace Signed-off-by: zFernand0 --- package.json | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 0ba5c3784a..e7063dd430 100644 --- a/package.json +++ b/package.json @@ -10,9 +10,14 @@ "icon": "resources/zowe_logo.png", "keywords": [ "mainframe", - "zos", "dataset", - "zowe" + "Zowe", + "explorer", + "z/OS", + "USS", + "JES", + "MVS", + "TSO" ], "categories": [ "Other" From c45ffc1f78e963d2009f247800720403cc4d111f Mon Sep 17 00:00:00 2001 From: Lauren Li Date: Tue, 10 Dec 2019 06:54:39 -0500 Subject: [PATCH 11/16] Update i18n/sample folder for revised incorrect profile message Signed-off-by: Lauren Li --- i18n/sample/src/DatasetTree.i18n.json | 4 ++-- i18n/sample/src/USSTree.i18n.json | 4 ++-- i18n/sample/src/ZosJobsProvider.i18n.json | 4 ++-- i18n/sample/src/__mocks__/DatasetTree.i18n.json | 0 i18n/sample/src/__mocks__/USSTree.i18n.json | 0 i18n/sample/src/decorators/MockMethod.i18n.json | 0 i18n/sample/src/getAllProfiles.i18n.json | 0 i18n/sample/src/getDefaultProfile.i18n.json | 0 8 files changed, 6 insertions(+), 6 deletions(-) delete mode 100644 i18n/sample/src/__mocks__/DatasetTree.i18n.json delete mode 100644 i18n/sample/src/__mocks__/USSTree.i18n.json delete mode 100644 i18n/sample/src/decorators/MockMethod.i18n.json delete mode 100644 i18n/sample/src/getAllProfiles.i18n.json delete mode 100644 i18n/sample/src/getDefaultProfile.i18n.json diff --git a/i18n/sample/src/DatasetTree.i18n.json b/i18n/sample/src/DatasetTree.i18n.json index b1ba79951c..ea2959c31b 100644 --- a/i18n/sample/src/DatasetTree.i18n.json +++ b/i18n/sample/src/DatasetTree.i18n.json @@ -3,8 +3,8 @@ "initializeFavorites.log.debug": "initializing favorites", "initializeFavorites.error.profile1": "Error: You have Zowe Data Set favorites that refer to a non-existent CLI profile named: ", "intializeFavorites.error.profile2": ". To resolve this, you can create a profile with this name, ", - "initializeFavorites.error.profile3": "or remove the favorites with this profile name from the Zowe-DS-Persistent setting, ", - "initializeFavorites.error.profile4": "which can be found in your VS Code user settings.", + "initializeFavorites.error.profile3": "or remove the favorites with this profile name from the Zowe-DS-Persistent setting, which can be found in your ", + "initializeFavorites.error.profile4": " user settings.", "loadNamedProfile.error.profileName": "Initialization Error: Could not find profile named: ", "loadNamedProfile.error.period": ".", "initializeFavorites.fileCorrupted": "Favorites file corrupted: ", diff --git a/i18n/sample/src/USSTree.i18n.json b/i18n/sample/src/USSTree.i18n.json index ecd49a7804..c8f5700be6 100644 --- a/i18n/sample/src/USSTree.i18n.json +++ b/i18n/sample/src/USSTree.i18n.json @@ -9,6 +9,6 @@ "initializeUSSFavorites.lines.title": "Open", "initializeUSSFavorites.error.profile1": "Error: You have Zowe USS favorites that refer to a non-existent CLI profile named: ", "intializeUSSFavorites.error.profile2": ". To resolve this, you can create a profile with this name, ", - "initializeUSSFavorites.error.profile3": "or remove the favorites with this profile name from the Zowe-USS-Persistent setting, ", - "initializeUSSFavorites.error.profile4": "which can be found in your VS Code user settings." + "initializeUSSFavorites.error.profile3": "or remove the favorites with this profile name from the Zowe-USS-Persistent setting, which can be found in your ", + "initializeUSSFavorites.error.profile4": " user settings." } \ No newline at end of file diff --git a/i18n/sample/src/ZosJobsProvider.i18n.json b/i18n/sample/src/ZosJobsProvider.i18n.json index 6dc4083b6e..c8b1d0a3c4 100644 --- a/i18n/sample/src/ZosJobsProvider.i18n.json +++ b/i18n/sample/src/ZosJobsProvider.i18n.json @@ -5,8 +5,8 @@ "initializeFavorites.log.debug": "initializing favorites", "initializeJobsFavorites.error.profile1": "Error: You have Jobs favorites that refer to a non-existent CLI profile named: ", "initializeJobsFavorites.error.profile2": ". To resolve this, you can create a profile with this name, ", - "initializeJobsFavorites.error.profile3": "or remove the favorites with this profile name from the Zowe-Jobs-Persistent setting, ", - "initializeJobsFavorites.error.profile4": "which can be found in your VS Code user settings.", + "initializeJobsFavorites.error.profile3": "or remove the favorites with this profile name from the Zowe-Jobs-Persistent setting, which can be found in your ", + "initializeJobsFavorites.error.profile4": " user settings.", "searchHistory.options.prompt": "Select a filter", "enterPattern.pattern": "No selection made.", "jobsFilterPrompt.option.prompt.owner": "Enter the Job Owner. Default is *.", diff --git a/i18n/sample/src/__mocks__/DatasetTree.i18n.json b/i18n/sample/src/__mocks__/DatasetTree.i18n.json deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/i18n/sample/src/__mocks__/USSTree.i18n.json b/i18n/sample/src/__mocks__/USSTree.i18n.json deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/i18n/sample/src/decorators/MockMethod.i18n.json b/i18n/sample/src/decorators/MockMethod.i18n.json deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/i18n/sample/src/getAllProfiles.i18n.json b/i18n/sample/src/getAllProfiles.i18n.json deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/i18n/sample/src/getDefaultProfile.i18n.json b/i18n/sample/src/getDefaultProfile.i18n.json deleted file mode 100644 index e69de29bb2..0000000000 From ca13a5eb34c5f712a838d0575b8d6f0a00d9a850 Mon Sep 17 00:00:00 2001 From: Lauren Li Date: Tue, 10 Dec 2019 07:30:10 -0500 Subject: [PATCH 12/16] Use package-lock file from zowe master branch Signed-off-by: Lauren Li --- package-lock.json | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/package-lock.json b/package-lock.json index ceb4f1343a..803de6fd1e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "vscode-extension-for-zowe", - "version": "1.0.0", + "version": "0.29.0", "lockfileVersion": 1, "requires": true, "dependencies": { @@ -178,9 +178,9 @@ } }, "@brightside/core": { - "version": "2.36.0", - "resolved": "https://dl.bintray.com//ca/brightside/@brightside/core/-/@brightside/core-2.36.0.tgz", - "integrity": "sha1-w57BIJFAI9VVSR9YdekAqcRPNoU=", + "version": "2.34.1", + "resolved": "https://dl.bintray.com//ca/brightside/@brightside/core/-/@brightside/core-2.34.1.tgz", + "integrity": "sha1-BvuhnNr/ZeDh1uTzU3kr5FQhEzc=", "requires": { "@brightside/imperative": "2.7.4", "get-stdin": "7.0.0", @@ -7705,17 +7705,17 @@ "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=" }, "ssh2": { - "version": "0.8.7", - "resolved": "https://registry.npmjs.org/ssh2/-/ssh2-0.8.7.tgz", - "integrity": "sha512-/u1BO12kb0lDVxJXejWB9pxyF3/ncgRqI9vPCZuPzo05pdNDzqUeQRavScwSPsfMGK+5H/VRqp1IierIx0Bcxw==", + "version": "0.8.6", + "resolved": "https://registry.npmjs.org/ssh2/-/ssh2-0.8.6.tgz", + "integrity": "sha512-T0cPmEtmtC8WxSupicFDjx3vVUdNXO8xu2a/D5bjt8ixOUCe387AgvxU3mJgEHpu7+Sq1ZYx4d3P2pl/yxMH+w==", "requires": { - "ssh2-streams": "~0.4.8" + "ssh2-streams": "~0.4.7" } }, "ssh2-streams": { - "version": "0.4.8", - "resolved": "https://registry.npmjs.org/ssh2-streams/-/ssh2-streams-0.4.8.tgz", - "integrity": "sha512-auxXfgYySz2vYw7TMU7PK7vFI7EPvhvTH8/tZPgGaWocK4p/vwCMiV3icz9AEkb0R40kOKZtFtqYIxDJyJiytw==", + "version": "0.4.7", + "resolved": "https://registry.npmjs.org/ssh2-streams/-/ssh2-streams-0.4.7.tgz", + "integrity": "sha512-JhF8BNfeguOqVHOLhXjzLlRKlUP8roAEhiT/y+NcBQCqpRUupLNrRf2M+549OPNVGx21KgKktug4P3MY/IvTig==", "requires": { "asn1": "~0.2.0", "bcrypt-pbkdf": "^1.0.2", From 7feb7d4a8ccc6d2d50ac95551b899512dd61cd01 Mon Sep 17 00:00:00 2001 From: zFernand0 Date: Tue, 10 Dec 2019 08:30:52 -0500 Subject: [PATCH 13/16] Update package json files Signed-off-by: zFernand0 --- package-lock.json | 22 +++++++++++----------- package.json | 2 ++ 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/package-lock.json b/package-lock.json index 803de6fd1e..ceb4f1343a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "vscode-extension-for-zowe", - "version": "0.29.0", + "version": "1.0.0", "lockfileVersion": 1, "requires": true, "dependencies": { @@ -178,9 +178,9 @@ } }, "@brightside/core": { - "version": "2.34.1", - "resolved": "https://dl.bintray.com//ca/brightside/@brightside/core/-/@brightside/core-2.34.1.tgz", - "integrity": "sha1-BvuhnNr/ZeDh1uTzU3kr5FQhEzc=", + "version": "2.36.0", + "resolved": "https://dl.bintray.com//ca/brightside/@brightside/core/-/@brightside/core-2.36.0.tgz", + "integrity": "sha1-w57BIJFAI9VVSR9YdekAqcRPNoU=", "requires": { "@brightside/imperative": "2.7.4", "get-stdin": "7.0.0", @@ -7705,17 +7705,17 @@ "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=" }, "ssh2": { - "version": "0.8.6", - "resolved": "https://registry.npmjs.org/ssh2/-/ssh2-0.8.6.tgz", - "integrity": "sha512-T0cPmEtmtC8WxSupicFDjx3vVUdNXO8xu2a/D5bjt8ixOUCe387AgvxU3mJgEHpu7+Sq1ZYx4d3P2pl/yxMH+w==", + "version": "0.8.7", + "resolved": "https://registry.npmjs.org/ssh2/-/ssh2-0.8.7.tgz", + "integrity": "sha512-/u1BO12kb0lDVxJXejWB9pxyF3/ncgRqI9vPCZuPzo05pdNDzqUeQRavScwSPsfMGK+5H/VRqp1IierIx0Bcxw==", "requires": { - "ssh2-streams": "~0.4.7" + "ssh2-streams": "~0.4.8" } }, "ssh2-streams": { - "version": "0.4.7", - "resolved": "https://registry.npmjs.org/ssh2-streams/-/ssh2-streams-0.4.7.tgz", - "integrity": "sha512-JhF8BNfeguOqVHOLhXjzLlRKlUP8roAEhiT/y+NcBQCqpRUupLNrRf2M+549OPNVGx21KgKktug4P3MY/IvTig==", + "version": "0.4.8", + "resolved": "https://registry.npmjs.org/ssh2-streams/-/ssh2-streams-0.4.8.tgz", + "integrity": "sha512-auxXfgYySz2vYw7TMU7PK7vFI7EPvhvTH8/tZPgGaWocK4p/vwCMiV3icz9AEkb0R40kOKZtFtqYIxDJyJiytw==", "requires": { "asn1": "~0.2.0", "bcrypt-pbkdf": "^1.0.2", diff --git a/package.json b/package.json index e7063dd430..f838801d5a 100644 --- a/package.json +++ b/package.json @@ -4,6 +4,8 @@ "description": "%description%", "version": "1.0.0", "publisher": "Zowe", + "author": "Zowe", + "license": "EPL-2.0", "repository": { "url": "https://github.com/zowe/vscode-extension-for-zowe" }, From 555cfd3e30df07923fb1f5b8f7a9162c2d010d2b Mon Sep 17 00:00:00 2001 From: jellypuno Date: Wed, 11 Dec 2019 15:11:42 +0100 Subject: [PATCH 14/16] Fix i18n files Signed-off-by: jellypuno --- i18n/sample/src/Profiles.i18n.json | 8 ++++---- src/Profiles.ts | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/i18n/sample/src/Profiles.i18n.json b/i18n/sample/src/Profiles.i18n.json index 9fec672fc0..8a269f27fb 100644 --- a/i18n/sample/src/Profiles.i18n.json +++ b/i18n/sample/src/Profiles.i18n.json @@ -4,13 +4,13 @@ "loadNamedProfile.warn.noDefaultProfile": "Unable to locate a default profile. CLI may not be installed. ", "createNewConnection.option.prompt.url.placeholder": "https://url:port", "createNewConnection.option.prompt.url": "Enter a z/OSMF URL in the format 'https://url:port'.", - "createNewConnection.enterzosmfURL": "No valid value for z/OSMF URL. Operation Cancelled", + "createNewConnection.zosmfURL": "No valid value for z/OSMF URL. Operation Cancelled", "createNewConnection.option.prompt.userName.placeholder": "Optional: User Name", "createNewConnection.option.prompt.userName": "Enter the user name for the connection. Leave blank to not store.", - "createNewConnection.undefined.enteruserName": "Operation Cancelled", - "createNewConnection.option.prompt.passWord.placeholder": "Optional: Password", + "createNewConnection.undefined.userName": "Operation Cancelled", + "createNewConnection.option.prompt.password.placeholder": "Optional: Password", "createNewConnection.option.prompt.password": "Enter the password for the connection. Leave blank to not store.", - "createNewConnection.undefined.enterpassWord": "Operation Cancelled", + "createNewConnection.undefined.passWord": "Operation Cancelled", "createNewConnection.option.prompt.ru.placeholder": "Reject Unauthorized Connections", "createNewConnection.rejectUnauthorize": "Operation Cancelled", "createNewConnection.duplicateProfileName": "Profile name already exists. Please create a profile using a different name", diff --git a/src/Profiles.ts b/src/Profiles.ts index 7a0b592032..f085af49be 100644 --- a/src/Profiles.ts +++ b/src/Profiles.ts @@ -155,7 +155,7 @@ export class Profiles { // Processing stops if there are no profiles detected }); if (!zosmfURL) { - vscode.window.showInformationMessage(localize("createNewConnection.enterzosmfURL", + vscode.window.showInformationMessage(localize("createNewConnection.zosmfURL", "No valid value for z/OSMF URL. Operation Cancelled")); return; } @@ -170,7 +170,7 @@ export class Profiles { // Processing stops if there are no profiles detected userName = await vscode.window.showInputBox(options); if (userName === undefined) { - vscode.window.showInformationMessage(localize("createNewConnection.undefined.enteruserName", + vscode.window.showInformationMessage(localize("createNewConnection.undefined.userName", "Operation Cancelled")); return; } @@ -184,7 +184,7 @@ export class Profiles { // Processing stops if there are no profiles detected passWord = await vscode.window.showInputBox(options); if (passWord === undefined) { - vscode.window.showInformationMessage(localize("createNewConnection.undefined.enterpassWord", + vscode.window.showInformationMessage(localize("createNewConnection.undefined.passWord", "Operation Cancelled")); return; } From f18650e33abaccf9d426d7341408237f9a43b3d5 Mon Sep 17 00:00:00 2001 From: jellypuno Date: Wed, 11 Dec 2019 15:23:35 +0100 Subject: [PATCH 15/16] change i18n files for consistency Signed-off-by: jellypuno --- i18n/sample/src/Profiles.i18n.json | 14 +++++++------- src/Profiles.ts | 10 +++++----- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/i18n/sample/src/Profiles.i18n.json b/i18n/sample/src/Profiles.i18n.json index 8a269f27fb..6923ea8ecc 100644 --- a/i18n/sample/src/Profiles.i18n.json +++ b/i18n/sample/src/Profiles.i18n.json @@ -5,19 +5,19 @@ "createNewConnection.option.prompt.url.placeholder": "https://url:port", "createNewConnection.option.prompt.url": "Enter a z/OSMF URL in the format 'https://url:port'.", "createNewConnection.zosmfURL": "No valid value for z/OSMF URL. Operation Cancelled", - "createNewConnection.option.prompt.userName.placeholder": "Optional: User Name", - "createNewConnection.option.prompt.userName": "Enter the user name for the connection. Leave blank to not store.", - "createNewConnection.undefined.userName": "Operation Cancelled", + "createNewConnection.option.prompt.username.placeholder": "Optional: User Name", + "createNewConnection.option.prompt.username": "Enter the user name for the connection. Leave blank to not store.", + "createNewConnection.undefined.username": "Operation Cancelled", "createNewConnection.option.prompt.password.placeholder": "Optional: Password", "createNewConnection.option.prompt.password": "Enter the password for the connection. Leave blank to not store.", - "createNewConnection.undefined.passWord": "Operation Cancelled", + "createNewConnection.undefined.password": "Operation Cancelled", "createNewConnection.option.prompt.ru.placeholder": "Reject Unauthorized Connections", "createNewConnection.rejectUnauthorize": "Operation Cancelled", "createNewConnection.duplicateProfileName": "Profile name already exists. Please create a profile using a different name", - "promptcredentials.option.prompt.userName.placeholder": "User Name", - "promptcredentials.option.prompt.userName": "Enter the user name for the connection", + "promptcredentials.option.prompt.username.placeholder": "User Name", + "promptcredentials.option.prompt.username": "Enter the user name for the connection", "promptcredentials.invalidusername": "Please enter your z/OS username. Operation Cancelled", - "promptcredentials.option.prompt.passWord.placeholder": "Password", + "promptcredentials.option.prompt.password.placeholder": "Password", "promptcredentials.option.prompt.password": "Enter a password for the connection", "promptcredentials.invalidpassword": "Please enter your z/OS password. Operation Cancelled" } \ No newline at end of file diff --git a/src/Profiles.ts b/src/Profiles.ts index f085af49be..3379f35fb8 100644 --- a/src/Profiles.ts +++ b/src/Profiles.ts @@ -163,14 +163,14 @@ export class Profiles { // Processing stops if there are no profiles detected const zosmfUrlParsed = this.validateAndParseUrl(zosmfURL); options = { - placeHolder: localize("createNewConnection.option.prompt.userName.placeholder", "Optional: User Name"), - prompt: localize("createNewConnection.option.prompt.userName", "Enter the user name for the connection. Leave blank to not store."), + placeHolder: localize("createNewConnection.option.prompt.username.placeholder", "Optional: User Name"), + prompt: localize("createNewConnection.option.prompt.username", "Enter the user name for the connection. Leave blank to not store."), value: userName }; userName = await vscode.window.showInputBox(options); if (userName === undefined) { - vscode.window.showInformationMessage(localize("createNewConnection.undefined.userName", + vscode.window.showInformationMessage(localize("createNewConnection.undefined.username", "Operation Cancelled")); return; } @@ -252,8 +252,8 @@ export class Profiles { // Processing stops if there are no profiles detected if (!loadSession.user) { options = { - placeHolder: localize("promptcredentials.option.prompt.userName.placeholder", "User Name"), - prompt: localize("promptcredentials.option.prompt.userName", "Enter the user name for the connection"), + placeHolder: localize("promptcredentials.option.prompt.username.placeholder", "User Name"), + prompt: localize("promptcredentials.option.prompt.username", "Enter the user name for the connection"), value: userName }; userName = await vscode.window.showInputBox(options); From 592dd7b4a7528dcaa2f14155a02c746d217bb0d9 Mon Sep 17 00:00:00 2001 From: Lauren Li Date: Wed, 11 Dec 2019 09:54:15 -0500 Subject: [PATCH 16/16] Refactor getting App Name Signed-off-by: Lauren Li --- src/utils.ts | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/src/utils.ts b/src/utils.ts index a8830330da..a97d2c8ec3 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -177,11 +177,5 @@ export function concatChildNodes(nodes: ZoweNode[]) { * Determine IDE name to display based on app environment *************************************************************************************************************/ export function getAppName(isTheia: boolean) { - let appName: string; - if (isTheia === true) { - appName = "Theia"; - } else { - appName = "VS Code"; - } - return appName; + return isTheia? "Theia" : "VS Code"; }