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

(WIP) Make DS properties menu spawn with sequential datasets #181

Open
wants to merge 3 commits into
base: v2.x/staging
Choose a base branch
from

Conversation

DivergentEuropeans
Copy link
Member

@DivergentEuropeans DivergentEuropeans commented Nov 17, 2022

image

Signed-off-by: Leanid Astrakou [email protected]

Copy link
Contributor

@Martin-Zeithaml Martin-Zeithaml left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

formatSummary would be IMO more readable, if the "if reclen > 0 summary with length else summary without length" will be simple separate function:

formatSummaryReclen(org: string, reclen: number): string {
  if (reclen > 0) {
    return org + reclen;
  } else {
    return org;
  }
}

 formatSummary(org: string, recfm: string, reclen: number): string {
    let summary = "N/A";
    if (org.substring(0, 2) == "PS") {
      if (recfm && recfm != "N/A") {
        if (recfm[0] == 'F') {
          summary = formatSummaryReclen("FB", reclen);
        } else if (recfm[0] == 'V') {
	  summary = formatSummaryReclen("VB", reclen);
        }
      } else {
        summary = formatSummaryReclen("S", reclen);
      }
    } else if (org.substring(0, 2) == "PO") {
      if (this.datasetIsPDS.length == 0) { //PDS is false
        summary = formatSummaryReclen("HFS", reclen);
      } else if (this.datasetIsPDS.length == 1) { //PDS is true
        summary = formatSummaryReclen("PDS", reclen);
      } else { // PDS/E is true
        summary = formatSummaryReclen("PDSE", reclen);
      }
    } else if (org.substring(0, 2) == "VS") {
      summary = formatSummaryReclen("VSAM", reclen);
    } else if (org.substring(0, 2) == "DA") {
      summary = formatSummaryReclen("DA", reclen);
    }
    return summary;
  }

Anyway, with or without suggested change, looks good.

@DivergentEuropeans DivergentEuropeans changed the title Make DS properties menu spawn with sequential datasets (WIP) Make DS properties menu spawn with sequential datasets Nov 26, 2022
@DivergentEuropeans
Copy link
Member Author

DivergentEuropeans commented Nov 26, 2022

@Martin-Zeithaml Thanks for the review! The problem appears to be with this PR, I may have been using an invalid dataset, as sequential datasets work in the DS properties view, but not this one which has an undefined record format. If that's true, then we'd want UX to show the DS was invalid though I'm not 100% certain the test DS I was using is an invalid one, changed title to "WIP"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants