Skip to content

Commit

Permalink
Merge pull request #160 from chinmdas/team-configuration-file-check
Browse files Browse the repository at this point in the history
Correcting condition to read team configuration file.
  • Loading branch information
zFernand0 authored Dec 12, 2024
2 parents 536e233 + 4ac9823 commit d985dac
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
4 changes: 4 additions & 0 deletions packages/vsce/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ All notable changes to the "cics-extension-for-zowe" extension will be documente

- MAJOR: v3.0.0 release

## Recent Changes

- BugFix: Correcting condition to read team configuration file. [#160](https://github.com/zowe/cics-for-zowe-client/pull/160)

## `3.0.0-next.202409201904`

- Update: Final prerelease
Expand Down
12 changes: 6 additions & 6 deletions packages/vsce/src/trees/CICSTree.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,15 +86,15 @@ export class CICSTree implements TreeDataProvider<CICSSessionTree> {
const allCICSProfiles = (await ProfileManagement.getProfilesCache().getProfileInfo()).getAllProfiles("cics");
// const allCICSProfiles = await ProfileManagement.getProfilesCache().getProfiles('cics');
if (!allCICSProfiles) {
if (!configInstance.usingTeamConfig) {
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.usingTeamConfig || allCICSProfileNames.length > 0) {
if (configInstance.getTeamConfig().exists || allCICSProfileNames.length > 0) {
const profileNameToLoad = await window.showQuickPick(
[{ label: "\uFF0B Create New CICS Profile..." }].concat(
allCICSProfileNames
Expand All @@ -118,7 +118,7 @@ export class CICSTree implements TreeDataProvider<CICSSessionTree> {
if (profileNameToLoad) {
// If Create New CICS Profile option chosen
if (profileNameToLoad.label.includes("\uFF0B")) {
if (configInstance.usingTeamConfig) {
if (configInstance.getTeamConfig().exists) {
// get all profiles of all types including zosmf
const profiles = configInstance.getAllProfiles();
if (!profiles.length) {
Expand All @@ -133,7 +133,7 @@ export class CICSTree implements TreeDataProvider<CICSSessionTree> {
} else {
let profileToLoad;
// TODO: Just use loadNamedProfile once the method is configured to v2 profiles
if (configInstance.usingTeamConfig) {
if (configInstance.getTeamConfig().exists) {
profileToLoad = await ProfileManagement.getProfilesCache().getLoadedProfConfig(profileNameToLoad.label); //ProfileManagement.getProfilesCache().loadNamedProfile(profileNameToLoad.label, 'cics');
} else {
await ProfileManagement.profilesCacheRefresh();
Expand Down Expand Up @@ -184,7 +184,7 @@ export class CICSTree implements TreeDataProvider<CICSSessionTree> {
});
try {
const configInstance = await ProfileManagement.getConfigInstance();
if (configInstance.usingTeamConfig) {
if (configInstance.getTeamConfig().exists) {
let missingParamters = missingSessionParameters(profile.profile);
if (missingParamters.length) {
const userPass = ["user", "password"];
Expand Down Expand Up @@ -318,7 +318,7 @@ export class CICSTree implements TreeDataProvider<CICSSessionTree> {
if (decision === "Yes") {
const configInstance = await ProfileManagement.getConfigInstance();
let updatedProfile;
if (configInstance.usingTeamConfig) {
if (configInstance.getTeamConfig().exists) {
const upd = { profileName: profile.name, profileType: "cics" };
// const configInstance = await ProfileManagement.getConfigInstance();
// flip rejectUnauthorized to false
Expand Down

0 comments on commit d985dac

Please sign in to comment.