Skip to content

Commit

Permalink
Initializing new Team Configuration File
Browse files Browse the repository at this point in the history
Initializing new Team Configuration File and remove the obsolete web page,

Signed-off-by: Chinmay Das <[email protected]>
  • Loading branch information
chinmdas authored Dec 12, 2024
1 parent 935de5d commit b6da31d
Showing 1 changed file with 3 additions and 34 deletions.
37 changes: 3 additions & 34 deletions packages/vsce/src/trees/CICSTree.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,18 +85,11 @@ export class CICSTree implements TreeDataProvider<CICSSessionTree> {
const configInstance = await ProfileManagement.getConfigInstance();
const allCICSProfiles = (await ProfileManagement.getProfilesCache().getProfileInfo()).getAllProfiles("cics");
// const allCICSProfiles = await ProfileManagement.getProfilesCache().getProfiles('cics');
if (!allCICSProfiles) {
if (!configInstance.getTeamConfig().exists) {
window.showErrorMessage(`Could not find any CICS profiles`);
return;
}
window.showInformationMessage(`Could not find any CICS profiles`);
}
const allCICSProfileNames: string[] = allCICSProfiles ? (allCICSProfiles.map((profile) => profile.profName) as unknown as [string]) : [];
// No cics profiles needed beforhand for team config method
if (configInstance.getTeamConfig().exists || allCICSProfileNames.length > 0) {
const profileNameToLoad = await window.showQuickPick(
[{ label: "\uFF0B Create New CICS Profile..." }].concat(
[{ label: "\uFF0B Edit CICS Profile..." }].concat(
allCICSProfileNames
.filter((name) => {
for (const loadedProfile of this.loadedProfiles) {
Expand All @@ -118,7 +111,6 @@ export class CICSTree implements TreeDataProvider<CICSSessionTree> {
if (profileNameToLoad) {
// If Create New CICS Profile option chosen
if (profileNameToLoad.label.includes("\uFF0B")) {
if (configInstance.getTeamConfig().exists) {
// get all profiles of all types including zosmf

Check failure on line 114 in packages/vsce/src/trees/CICSTree.ts

View workflow job for this annotation

GitHub Actions / lint

Expected indentation of 12 spaces but found 14
const profiles = configInstance.getAllProfiles();

Check failure on line 115 in packages/vsce/src/trees/CICSTree.ts

View workflow job for this annotation

GitHub Actions / lint

Expected indentation of 12 spaces but found 14
if (!profiles.length) {

Check failure on line 116 in packages/vsce/src/trees/CICSTree.ts

View workflow job for this annotation

GitHub Actions / lint

Expected indentation of 12 spaces but found 14
Expand All @@ -127,9 +119,6 @@ export class CICSTree implements TreeDataProvider<CICSSessionTree> {
const currentProfile = await ProfileManagement.getProfilesCache().getProfileFromConfig(profiles[0].profName);

Check failure on line 119 in packages/vsce/src/trees/CICSTree.ts

View workflow job for this annotation

GitHub Actions / lint

Expected indentation of 12 spaces but found 14
const filePath = currentProfile?.profLoc.osLoc?.[0] ?? "";

Check failure on line 120 in packages/vsce/src/trees/CICSTree.ts

View workflow job for this annotation

GitHub Actions / lint

Expected indentation of 12 spaces but found 14
await openConfigFile(filePath);

Check failure on line 121 in packages/vsce/src/trees/CICSTree.ts

View workflow job for this annotation

GitHub Actions / lint

Expected indentation of 12 spaces but found 14
} else {
await this.createNewProfile();
}
} else {
let profileToLoad;
// TODO: Just use loadNamedProfile once the method is configured to v2 profiles
Expand Down Expand Up @@ -491,28 +480,8 @@ export class CICSTree implements TreeDataProvider<CICSSessionTree> {
window.showErrorMessage(error);
}
} else {
const column = window.activeTextEditor ? window.activeTextEditor.viewColumn : undefined;
const panel: WebviewPanel = window.createWebviewPanel("zowe", `Create CICS Profile`, column || 1, { enableScripts: true });
panel.webview.html = addProfileHtml();
panel.webview.onDidReceiveMessage(async (message) => {
try {
panel.dispose();
const allCICSProfileNames = (await ProfileManagement.getProfilesCache().getProfileInfo())
.getAllProfiles("cics")
.map((profile) => profile.profName); //await ProfileManagement.getProfilesCache().getNamesForType('cics');
if (allCICSProfileNames.includes(message.name)) {
window.showErrorMessage(`Profile "${message.name}" already exists`);
return;
}
await ProfileManagement.createNewProfile(message);
await ProfileManagement.profilesCacheRefresh();
await this.loadProfile(ProfileManagement.getProfilesCache().loadNamedProfile(message.name, "cics"));
} catch (error) {
console.log(error);
// @ts-ignore
window.showErrorMessage(error);
}
});
// Initialize new team configuration file

Check failure on line 483 in packages/vsce/src/trees/CICSTree.ts

View workflow job for this annotation

GitHub Actions / lint

Expected indentation of 6 spaces but found 8
commands.executeCommand("zowe.all.config.init");

Check failure on line 484 in packages/vsce/src/trees/CICSTree.ts

View workflow job for this annotation

GitHub Actions / lint

Expected indentation of 6 spaces but found 8
}
}

Expand Down

0 comments on commit b6da31d

Please sign in to comment.