Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Correcting condition to read team configuration file. #160

Merged
merged 3 commits into from
Dec 12, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading