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

Improve pipeline validation #2698

Merged
merged 7 commits into from
May 25, 2022
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
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,8 @@
"placement": "on_panel"
},
"data": {
"placeholder": "/mount/path=pvc-name"
"placeholder": "/mount/path=pvc-name",
"keyValueEntries": true
}
}
],
Expand Down
3 changes: 2 additions & 1 deletion elyra/tests/pipeline/resources/properties.json
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,8 @@
"placement": "on_panel"
},
"data": {
"placeholder": "/mount/path=pvc-name"
"placeholder": "/mount/path=pvc-name",
"keyValueEntries": true
}
}
],
Expand Down
4 changes: 2 additions & 2 deletions packages/pipeline-editor/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@
},
"dependencies": {
"@elyra/metadata-common": "3.9.0-dev",
"@elyra/pipeline-editor": "~1.8.0",
"@elyra/pipeline-services": "~1.8.0",
"@elyra/pipeline-editor": "~1.9.0",
"@elyra/pipeline-services": "~1.9.0",
"@elyra/services": "3.9.0-dev",
"@elyra/ui-components": "3.9.0-dev",
"@jupyterlab/application": "^3.4.0",
Expand Down
17 changes: 9 additions & 8 deletions packages/pipeline-editor/src/PipelineEditorWidget.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -584,12 +584,13 @@ const PipelineWrapper: React.FC<IProps> = ({
// Check that all nodes are valid
const errorMessages = validate(
JSON.stringify(pipelineJson),
getAllPaletteNodes(palette)
getAllPaletteNodes(palette),
palette.properties
);
if (errorMessages && errorMessages.length > 0) {
let errorMessage = '';
for (const error of errorMessages) {
errorMessage += error.message;
errorMessage += (errorMessage ? '\n' : '') + error.message;
}
setAlert(`Failed ${actionType}: ${errorMessage}`);
return;
Expand Down Expand Up @@ -1020,10 +1021,6 @@ const PipelineWrapper: React.FC<IProps> = ({
}, [addFileToPipelineSignal, handleAddFileToPipeline]);

const handleClose = (event?: React.SyntheticEvent, reason?: string): void => {
if (reason === 'clickaway') {
return;
}

setAlert('');
};

Expand All @@ -1043,10 +1040,14 @@ const PipelineWrapper: React.FC<IProps> = ({
<ThemeProvider theme={theme}>
<Snackbar
open={alert !== ''}
autoHideDuration={6000}
autoHideDuration={30000}
onClose={handleClose}
>
<Alert severity={'error'} onClose={handleClose}>
<Alert
severity={'error'}
onClose={handleClose}
className={'elyra-PipelineEditor-Alert'}
>
{alert}
</Alert>
</Snackbar>
Expand Down
4 changes: 4 additions & 0 deletions packages/pipeline-editor/style/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -790,6 +790,10 @@ input.elyra-Dialog-checkbox.jp-mod-styled {
font-size: var(--jp-content-font-size2);
}

.elyra-PipelineEditor-Alert {
white-space: pre-line;
}

/* fix font ligatures */
.lsp-completer-theme-vscode {
letter-spacing: normal;
Expand Down
18 changes: 9 additions & 9 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1406,13 +1406,13 @@
seedrandom "^3.0.5"
uuid "^8.3.0"

"@elyra/pipeline-editor@~1.8.0":
version "1.8.0"
resolved "https://registry.yarnpkg.com/@elyra/pipeline-editor/-/pipeline-editor-1.8.0.tgz#efb9994fae9cff2edcf044f40d45b49bbe7a7b3b"
integrity sha512-p9jDNNbweyb5TVYJCAnEsdTzBrc8/TMTGkbyDbKk2I48PTO3Q/aZf+rf2eaOOfV/xPx5kDnTj/QljDzBDm9xwQ==
"@elyra/pipeline-editor@~1.9.0":
version "1.9.0"
resolved "https://registry.yarnpkg.com/@elyra/pipeline-editor/-/pipeline-editor-1.9.0.tgz#da3ce85a6c4b1d1f9c509bbf19176322271f81f8"
integrity sha512-eT0ozcpDLEBCnkYijMF7QiO9L3E2E0ZWHi8XFUDnn/fQGl9tvEoa50jxAFk+F8wN8ObdpE/a5Y3YCl/Z4xUI+Q==
dependencies:
"@elyra/canvas" "^12.11.2"
"@elyra/pipeline-services" "^1.8.0"
"@elyra/pipeline-services" "^1.9.0"
carbon-components "^10.43.0"
carbon-components-react "^7.48.0"
carbon-icons "7.0.7"
Expand All @@ -1430,10 +1430,10 @@
resolved "https://registry.yarnpkg.com/@elyra/pipeline-schemas/-/pipeline-schemas-3.0.55.tgz#495fe6c6945b710dd88451f87ceae86831ce09c6"
integrity sha512-lkTx0Zmf7IUu+01161ES5kzmXs6xjN4wYfS9ggxDd+TZzw9NAM3851gSlNM5mq186KdF9KxFWRSYPdwSlzFNOw==

"@elyra/pipeline-services@^1.8.0", "@elyra/pipeline-services@~1.8.0":
version "1.8.0"
resolved "https://registry.yarnpkg.com/@elyra/pipeline-services/-/pipeline-services-1.8.0.tgz#4d159444f99af79e978df08f4336463f3d6bd520"
integrity sha512-7hhhX3eZMJnmntkVGadQ7tUEB/7Xb96JhqtkfTiKS4kXDYsaGWJcSh2Ns+SmkyitfL+lM5DIVbzGMp5L8DomhA==
"@elyra/pipeline-services@^1.9.0", "@elyra/pipeline-services@~1.9.0":
version "1.9.0"
resolved "https://registry.yarnpkg.com/@elyra/pipeline-services/-/pipeline-services-1.9.0.tgz#9de40dda50a3885a628357b53324cc27c41d1135"
integrity sha512-ULVbNCn2sJm/7eq95dH+ufSy9OV/eHMzvpKDHM2c86ZlxWJl1pF+Z2rqdqMxF9N2pwZFGtQ/YAql9eVY56WOUg==
dependencies:
immer "^9.0.7"
jsonc-parser "^3.0.0"
Expand Down