src/dataset/actions.ts
changed.
Other files ignored by Codecov
598 | 598 | let label = ""; |
|
599 | 599 | let fav = false; |
|
600 | 600 | try { |
|
601 | - | switch (node.getParent().contextValue) { |
|
602 | - | case (globals.FAVORITE_CONTEXT): |
|
603 | - | label = node.label.substring(node.label.indexOf(":") + 1).trim(); |
|
604 | - | fav = true; |
|
605 | - | break; |
|
606 | - | case (globals.DS_PDS_CONTEXT + globals.FAV_SUFFIX): |
|
607 | - | label = node.getParent().getLabel().substring(node.getParent().getLabel().indexOf(":") + 1).trim() + "(" + node.getLabel()+ ")"; |
|
608 | - | fav = true; |
|
609 | - | break; |
|
610 | - | case (globals.DS_SESSION_CONTEXT): |
|
611 | - | label = node.getLabel(); |
|
612 | - | break; |
|
613 | - | case (globals.DS_PDS_CONTEXT): |
|
614 | - | label = node.getParent().getLabel()+ "(" + node.getLabel()+ ")"; |
|
615 | - | break; |
|
616 | - | default: |
|
617 | - | throw Error(localize("deleteDataSet.invalidNode.error", "deleteDataSet() called from invalid node.")); |
|
601 | + | if (node.getParent().contextValue.includes(globals.FAVORITE_CONTEXT)) { |
|
602 | + | label = node.label.substring(node.label.indexOf(":") + 1).trim(); |
|
603 | + | fav = true; |
|
604 | + | } else if (node.getParent().contextValue.includes(globals.DS_PDS_CONTEXT + globals.FAV_SUFFIX)) { |
|
605 | + | label = node.getParent().getLabel().substring(node.getParent().getLabel().indexOf(":") + 1).trim() + "(" + node.getLabel() + ")"; |
|
606 | + | fav = true; |
|
607 | + | } else if (node.getParent().contextValue.includes(globals.DS_SESSION_CONTEXT)) { |
|
608 | + | label = node.getLabel(); |
|
609 | + | } else if (node.getParent().contextValue.includes(globals.DS_PDS_CONTEXT)) { |
|
610 | + | label = node.getParent().getLabel() + "(" + node.getLabel() + ")"; |
|
611 | + | } else { |
|
612 | + | throw Error(localize("deleteDataSet.invalidNode.error", "deleteDataSet() called from invalid node.")); |
|
618 | 613 | } |
|
619 | 614 | await datasetProvider.checkCurrentProfile(node); |
|
620 | 615 | if (Profiles.getInstance().validProfile === ValidProfileEnum.VALID) { |
Files | Coverage |
---|---|
src | 89.20% |
Project Totals (50 files) | 89.20% |
NODE= OS=Windows_NT