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

Fix code issues v1 #123

Merged
merged 3 commits into from
May 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
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
10 changes: 6 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions packages/vsce/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

All notable changes to the "cics-extension-for-zowe" extension will be documented in this file.

## Recent Changes

- BugFix: Fixed several identified problems with possible null values in the tree and web views. [#123](https://github.com/zowe/cics-for-zowe-client/issues/123)

## `1.3.7`

- BugFix: Fixed icons not displaying.[#112](https://github.com/zowe/cics-for-zowe-client/issues/112)
Expand Down
1 change: 1 addition & 0 deletions packages/vsce/src/trees/CICSCombinedLocalFileTree.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ export class CICSCombinedLocalFileTree extends TreeItem {
public addLocalFilesUtil(newChildren: (CICSLocalFileTreeItem | ViewMore)[], allLocalFiles: any, count: number | undefined) {
for (const localfile of allLocalFiles) {
const regionsContainer = this.parentPlex.children.filter((child) => child instanceof CICSRegionsContainer)?.[0];
if (regionsContainer == null) { continue; }
const parentRegion = regionsContainer
.getChildren()
.filter((child) => child instanceof CICSRegionTree && child.getRegionName() === localfile.eyu_cicsname)?.[0];
Expand Down
1 change: 1 addition & 0 deletions packages/vsce/src/trees/CICSCombinedProgramTree.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ export class CICSCombinedProgramTree extends TreeItem {
for (const program of allPrograms) {
// Regions container must exist if all programs tree exists
const regionsContainer = this.parentPlex.children.filter((child) => child instanceof CICSRegionsContainer)?.[0];
if (regionsContainer == null) { continue; }
const parentRegion = regionsContainer
.getChildren()
.filter((child) => child instanceof CICSRegionTree && child.getRegionName() === program.eyu_cicsname)?.[0];
Expand Down
1 change: 1 addition & 0 deletions packages/vsce/src/trees/CICSCombinedTransactionTree.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ export class CICSCombinedTransactionsTree extends TreeItem {
public addLocalTransactionsUtil(newChildren: (CICSTransactionTreeItem | ViewMore)[], allLocalTransactions: any, count: number | undefined) {
for (const transaction of allLocalTransactions) {
const regionsContainer = this.parentPlex.children.filter((child) => child instanceof CICSRegionsContainer)?.[0];
if (regionsContainer == null) { continue; }
const parentRegion = regionsContainer
.getChildren()
.filter((child) => child instanceof CICSRegionTree && child.getRegionName() === transaction.eyu_cicsname)?.[0];
Expand Down
24 changes: 12 additions & 12 deletions packages/vsce/src/utils/webviewHTML.ts
Original file line number Diff line number Diff line change
Expand Up @@ -124,10 +124,10 @@ export const addProfileHtml = (message?: IUpdateProfile) => {
<label for="protocol-select" class="bx--label">Protocol</label>
<div class="bx--select-input__wrapper">
<select id="protocol-select" class="bx--select-input" onload="renderRU()" onchange="renderRU()">
<option class="bx--select-option" value="http" ${message?.profile.protocol === "http" ? `selected="selected"` : ""}>
<option class="bx--select-option" value="http" ${message?.profile?.protocol === "http" ? `selected="selected"` : ""}>
HTTP
</option>
<option class="bx--select-option" value="https" ${message?.profile.protocol === "https" ? `selected="selected"` : ""}>
<option class="bx--select-option" value="https" ${message?.profile?.protocol === "https" ? `selected="selected"` : ""}>
HTTPS
</option>
</select>
Expand Down Expand Up @@ -157,7 +157,7 @@ export const addProfileHtml = (message?: IUpdateProfile) => {
class="bx--text-input"
placeholder="example.cics.host.com"
oninput="handleHostInputName()"
${message?.profile.host ? `value =${message.profile.host}` : undefined}
${message?.profile?.host ? `value =${message.profile.host}` : undefined}
/>
</div>
</div>
Expand All @@ -170,7 +170,7 @@ export const addProfileHtml = (message?: IUpdateProfile) => {
type="text"
class="bx--text-input"
placeholder="12345"
${message?.profile.port ? `value =${message.profile.port}` : undefined}
${message?.profile?.port ? `value =${message.profile.port}` : undefined}
/>
</div>
</div>
Expand All @@ -187,7 +187,7 @@ export const addProfileHtml = (message?: IUpdateProfile) => {
<div class="bx--radio-button-group ">
<div class="bx--radio-button-wrapper">
<input id="radio-button-true" class="bx--radio-button" type="radio" value="true" name="radio-button" tabindex="0" ${
message?.profile.rejectUnauthorized ? `checked="checked"` : ""
message?.profile?.rejectUnauthorized ? `checked="checked"` : ""
}>
<label for="radio-button-true" class="bx--radio-button__label">
<span class="bx--radio-button__appearance" style="background-color:white"></span>
Expand All @@ -197,7 +197,7 @@ export const addProfileHtml = (message?: IUpdateProfile) => {

<div class="bx--radio-button-wrapper">
<input id="radio-button-false" class="bx--radio-button" type="radio" value="false" name="radio-button" tabindex="0" ${
!message?.profile.rejectUnauthorized ? `checked="checked""` : ""
!message?.profile?.rejectUnauthorized ? `checked="checked""` : ""
}>
<label for="radio-button-false" class="bx--radio-button__label">
<span class="bx--radio-button__appearance" style="background-color:white"></span>
Expand Down Expand Up @@ -238,7 +238,7 @@ export const addProfileHtml = (message?: IUpdateProfile) => {
type="text"
class="bx--text-input"
placeholder=""
${message?.profile.user ? `value =${message.profile.user}` : undefined}
${message?.profile?.user ? `value =${message.profile.user}` : undefined}
/>
</div>
</div>
Expand All @@ -251,7 +251,7 @@ export const addProfileHtml = (message?: IUpdateProfile) => {
type="password"
class="bx--text-input"
placeholder=""
${message?.profile.password ? `value =${message.profile.password}` : undefined}
${message?.profile?.password ? `value =${message.profile.password}` : undefined}
/>
</div>
</div>
Expand All @@ -269,7 +269,7 @@ export const addProfileHtml = (message?: IUpdateProfile) => {
type="text"
class="bx--text-input"
placeholder=""
${message?.profile.regionName ? `value =${message.profile.regionName}` : undefined}
${message?.profile?.regionName ? `value =${message.profile.regionName}` : undefined}
/>
</div>
</div>
Expand All @@ -282,7 +282,7 @@ export const addProfileHtml = (message?: IUpdateProfile) => {
type="text"
class="bx--text-input"
placeholder=""
${message?.profile.cicsPlex ? `value =${message.profile.cicsPlex}` : undefined}
${message?.profile?.cicsPlex ? `value =${message.profile.cicsPlex}` : undefined}
/>
</div>
</div>
Expand Down Expand Up @@ -331,9 +331,9 @@ export const addProfileHtml = (message?: IUpdateProfile) => {
}

function onLoadRenderRU() {
if (${message?.profile.protocol === "https"}) {
if (${message?.profile?.protocol === "https"}) {
setContentsEnabled("ru-selection-container");
} else if (${message?.profile.protocol === "http"}) {
} else if (${message?.profile?.protocol === "http"}) {
setContentsDisabled("ru-selection-container");
}
}
Expand Down
Loading