├── .prettierrc
├── cypress
├── fixtures
│ └── example.json
├── tsconfig.json
├── support
│ └── index.ts
├── .eslintrc.js
├── plugins
│ └── index.js
└── integration
│ └── no-toolbar.ts
├── cypress.json
├── .storybook
├── preview.js
└── main.js
├── lerna.json
├── .codesandbox
└── ci.json
├── stories
├── Introduction.stories.mdx
└── PipelineEditor.stories.js
├── examples
├── create-react-app-with-typescript
│ ├── tsconfig.json
│ ├── src
│ │ ├── node.svg
│ │ ├── index.tsx
│ │ ├── react-app-env.d.ts
│ │ └── App.tsx
│ ├── .gitignore
│ ├── package.json
│ ├── README.md
│ └── public
│ │ └── index.html
└── create-react-app
│ ├── src
│ ├── node.svg
│ ├── index.js
│ └── App.js
│ ├── package.json
│ ├── .gitignore
│ ├── README.md
│ └── public
│ └── index.html
├── .vscode
├── settings.json
└── launch.json
├── packages
├── pipeline-services
│ ├── tsconfig.json
│ ├── src
│ │ ├── index.ts
│ │ ├── migration
│ │ │ ├── errors
│ │ │ │ └── index.ts
│ │ │ ├── migrateV3
│ │ │ │ ├── index.ts
│ │ │ │ └── index.test.ts
│ │ │ ├── migrateV4
│ │ │ │ ├── index.ts
│ │ │ │ └── index.test.ts
│ │ │ ├── migrateV2
│ │ │ │ ├── index.ts
│ │ │ │ └── index.test.ts
│ │ │ ├── migrateV5
│ │ │ │ ├── index.ts
│ │ │ │ └── index.test.ts
│ │ │ ├── migrateV1
│ │ │ │ ├── index.ts
│ │ │ │ └── index.test.ts
│ │ │ ├── index.ts
│ │ │ ├── migrateV7
│ │ │ │ ├── index.test.ts
│ │ │ │ └── index.ts
│ │ │ ├── migrateV8
│ │ │ │ └── index.ts
│ │ │ └── migrateV6
│ │ │ │ └── index.ts
│ │ └── validation
│ │ │ ├── validators
│ │ │ ├── index.ts
│ │ │ ├── enum-validators.ts
│ │ │ ├── nested-enum-validators.ts
│ │ │ ├── string-array-validators.ts
│ │ │ ├── string-validators.ts
│ │ │ └── number-validators.ts
│ │ │ ├── utils.ts
│ │ │ ├── types.ts
│ │ │ ├── check-circular-references
│ │ │ └── index.ts
│ │ │ └── utils.test.ts
│ ├── jest.config.js
│ └── package.json
└── pipeline-editor
│ ├── tsconfig.json
│ ├── src
│ ├── css.d.ts
│ ├── properties-panels
│ │ ├── index.ts
│ │ ├── PipelineProperties.tsx
│ │ ├── useActiveFormItemShim.ts
│ │ ├── index.test.tsx
│ │ └── PropertiesPanel.tsx
│ ├── styled.d.ts
│ ├── CustomFormControls
│ │ ├── index.ts
│ │ ├── test-utils.ts
│ │ ├── ErrorMessage.tsx
│ │ ├── FileWidget.tsx
│ │ ├── CustomFieldTemplate.tsx
│ │ ├── components.ts
│ │ ├── CustomOneOf.tsx
│ │ └── CustomArray.tsx
│ ├── index.ts
│ ├── PipelineController
│ │ ├── utils.test.ts
│ │ └── utils.ts
│ ├── errors
│ │ └── index.ts
│ ├── IconButton
│ │ └── index.tsx
│ ├── ThemeProvider
│ │ ├── utils.ts
│ │ ├── useSystemInfo.ts
│ │ ├── utils.test.ts
│ │ └── index.tsx
│ ├── NodeTooltip
│ │ ├── utils.ts
│ │ ├── index.tsx
│ │ ├── index.test.tsx
│ │ └── utils.test.ts
│ ├── PalettePanel
│ │ ├── index.test.tsx
│ │ └── index.tsx
│ ├── PipelineEditor
│ │ ├── useBlockEvents.ts
│ │ └── index.test.tsx
│ ├── types.ts
│ ├── SplitPanelLayout
│ │ └── index.test.tsx
│ └── TabbedPanelLayout
│ │ └── index.tsx
│ ├── jest.config.js
│ ├── jest.setup.js
│ └── package.json
├── .gitignore
├── tsconfig.base.json
├── jest.config.base.js
├── jest.config.js
├── Makefile
├── .github
├── PULL_REQUEST_TEMPLATE
└── workflows
│ └── build.yaml
├── README.md
├── package.json
├── CONTRIBUTING.md
├── .eslintrc.js
└── images
└── banner.svg
/.prettierrc:
--------------------------------------------------------------------------------
1 | {}
2 |
--------------------------------------------------------------------------------
/cypress/fixtures/example.json:
--------------------------------------------------------------------------------
1 | {}
2 |
--------------------------------------------------------------------------------
/cypress.json:
--------------------------------------------------------------------------------
1 | {
2 | "baseUrl": "http://localhost:6006",
3 | "video": false
4 | }
5 |
--------------------------------------------------------------------------------
/.storybook/preview.js:
--------------------------------------------------------------------------------
1 | export const parameters = {
2 | actions: { argTypesRegex: "^on[A-Z].*" },
3 | };
4 |
--------------------------------------------------------------------------------
/lerna.json:
--------------------------------------------------------------------------------
1 | {
2 | "packages": ["packages/*"],
3 | "npmClient": "yarn",
4 | "useWorkspaces": true,
5 | "version": "1.12.1"
6 | }
7 |
--------------------------------------------------------------------------------
/.codesandbox/ci.json:
--------------------------------------------------------------------------------
1 | {
2 | "sandboxes": [
3 | "/examples/create-react-app",
4 | "/examples/create-react-app-with-typescript"
5 | ],
6 | "silent": true,
7 | "node": "16"
8 | }
9 |
--------------------------------------------------------------------------------
/stories/Introduction.stories.mdx:
--------------------------------------------------------------------------------
1 | import { Meta } from '@storybook/addon-docs/blocks';
2 |
3 |
4 |
5 | # Welcome to Storybook
6 |
7 | This Storybook is only used for Cypress testing.
8 |
--------------------------------------------------------------------------------
/.storybook/main.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | stories: [
3 | "../stories/**/*.stories.mdx",
4 | "../stories/**/*.stories.@(js|jsx|ts|tsx)",
5 | ],
6 | addons: ["@storybook/addon-links", "@storybook/addon-essentials"],
7 | };
8 |
--------------------------------------------------------------------------------
/examples/create-react-app-with-typescript/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "include": ["./src/**/*"],
3 | "compilerOptions": {
4 | "strict": true,
5 | "esModuleInterop": true,
6 | "lib": ["dom", "es2015"],
7 | "jsx": "react-jsx"
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/cypress/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../tsconfig.base.json",
3 | "compilerOptions": {
4 | "isolatedModules": false,
5 | "target": "es5",
6 | "lib": ["es5", "dom"],
7 | "types": ["cypress", "@testing-library/cypress"]
8 | },
9 | "include": ["**/*.ts"]
10 | }
11 |
--------------------------------------------------------------------------------
/.vscode/settings.json:
--------------------------------------------------------------------------------
1 | {
2 | "workbench.editor.labelFormat": "short",
3 | "[typescript]": {
4 | "editor.codeActionsOnSave": {
5 | "source.fixAll.eslint": true
6 | }
7 | },
8 | "[typescriptreact]": {
9 | "editor.codeActionsOnSave": {
10 | "source.fixAll.eslint": true
11 | }
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/packages/pipeline-services/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.base.json",
3 | "compilerOptions": {
4 | "target": "es5",
5 | "lib": ["esnext"],
6 | "module": "commonjs",
7 | "outDir": "dist",
8 | "declaration": true,
9 | "downlevelIteration": true,
10 | "sourceMap": true
11 | },
12 | "include": ["src"]
13 | }
14 |
--------------------------------------------------------------------------------
/.vscode/launch.json:
--------------------------------------------------------------------------------
1 | {
2 | "version": "0.2.0",
3 | "configurations": [
4 | {
5 | "name": "Chrome",
6 | "type": "chrome",
7 | "request": "launch",
8 | "url": "http://localhost:3000",
9 | "webRoot": "${workspaceFolder}/packages/demo/src",
10 | "sourceMapPathOverrides": {
11 | "webpack:///src/*": "${webRoot}/*"
12 | }
13 | }
14 | ]
15 | }
16 |
--------------------------------------------------------------------------------
/examples/create-react-app/src/node.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/packages/pipeline-editor/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.base.json",
3 | "compilerOptions": {
4 | "target": "es5",
5 | "lib": ["dom", "dom.iterable", "esnext"],
6 | "module": "esnext",
7 | "outDir": "dist",
8 | "jsx": "react-jsx",
9 | "jsxFactory": "",
10 | "jsxFragmentFactory": "",
11 | "declaration": true,
12 | "downlevelIteration": true,
13 | "sourceMap": true
14 | },
15 | "include": ["src"]
16 | }
17 |
--------------------------------------------------------------------------------
/examples/create-react-app-with-typescript/src/node.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/examples/create-react-app/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "create-react-app",
3 | "version": "0.0.0",
4 | "private": true,
5 | "dependencies": {
6 | "@elyra/pipeline-editor": "latest",
7 | "react": "latest",
8 | "react-dom": "latest",
9 | "react-scripts": "latest"
10 | },
11 | "scripts": {
12 | "start": "react-scripts start",
13 | "build": "react-scripts build",
14 | "test": "react-scripts test --env=jsdom",
15 | "eject": "react-scripts eject"
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | cypress/videos
2 | cypress/screenshots
3 |
4 | # production
5 | dist
6 | build
7 |
8 | # dependencies
9 | node_modules
10 | /.pnp
11 | .pnp.js
12 |
13 | # testing
14 | coverage
15 |
16 | # production
17 | /build
18 |
19 | # misc
20 | .DS_Store
21 | .env.local
22 | .env.development.local
23 | .env.test.local
24 | .env.production.local
25 |
26 | npm-debug.log*
27 | yarn-debug.log*
28 | yarn-error.log*
29 |
30 | # Optional eslint cache
31 | .eslintcache
32 |
33 | # PyCharm
34 | .idea/
35 | *.iml
36 |
37 |
--------------------------------------------------------------------------------
/examples/create-react-app/.gitignore:
--------------------------------------------------------------------------------
1 | # See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2 |
3 | # dependencies
4 | /node_modules
5 | /.pnp
6 | .pnp.js
7 |
8 | # testing
9 | /coverage
10 |
11 | # production
12 | /build
13 |
14 | # IDEs and editors
15 | /.idea
16 | /.vscode
17 |
18 | # misc
19 | .DS_Store
20 | .env.local
21 | .env.development.local
22 | .env.test.local
23 | .env.production.local
24 |
25 | npm-debug.log*
26 | yarn-debug.log*
27 | yarn-error.log*
28 | yarn.lock
29 | package-lock.json
--------------------------------------------------------------------------------
/examples/create-react-app-with-typescript/.gitignore:
--------------------------------------------------------------------------------
1 | # See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2 |
3 | # dependencies
4 | /node_modules
5 | /.pnp
6 | .pnp.js
7 |
8 | # testing
9 | /coverage
10 |
11 | # production
12 | /build
13 |
14 | # IDEs and editors
15 | /.idea
16 | /.vscode
17 |
18 | # misc
19 | .DS_Store
20 | .env.local
21 | .env.development.local
22 | .env.test.local
23 | .env.production.local
24 |
25 | npm-debug.log*
26 | yarn-debug.log*
27 | yarn-error.log*
28 | yarn.lock
29 | package-lock.json
--------------------------------------------------------------------------------
/examples/create-react-app-with-typescript/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "create-react-app-with-typescript",
3 | "version": "0.0.0",
4 | "private": true,
5 | "dependencies": {
6 | "@elyra/pipeline-editor": "latest",
7 | "react": "latest",
8 | "react-dom": "latest",
9 | "react-scripts": "latest"
10 | },
11 | "devDependencies": {
12 | "@types/react": "latest",
13 | "@types/react-dom": "latest",
14 | "typescript": "latest"
15 | },
16 | "scripts": {
17 | "start": "react-scripts start",
18 | "build": "react-scripts build",
19 | "test": "react-scripts test --env=jsdom",
20 | "eject": "react-scripts eject"
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/packages/pipeline-editor/src/css.d.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2018-2023 Elyra Authors
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | declare module "*.css";
18 |
--------------------------------------------------------------------------------
/cypress/support/index.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2018-2023 Elyra Authors
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | import "@testing-library/cypress/add-commands";
18 |
--------------------------------------------------------------------------------
/packages/pipeline-services/src/index.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2018-2023 Elyra Authors
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | export * from "./migration";
18 | export * from "./validation";
19 |
--------------------------------------------------------------------------------
/cypress/.eslintrc.js:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2018-2023 Elyra Authors
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | module.exports = {
18 | plugins: ["cypress"],
19 | env: {
20 | "cypress/globals": true,
21 | },
22 | };
23 |
--------------------------------------------------------------------------------
/examples/create-react-app/README.md:
--------------------------------------------------------------------------------
1 |
18 |
19 | This example demonstrates how you can use `@elyra/pipeline-editor` in a Create React App project.
20 |
--------------------------------------------------------------------------------
/examples/create-react-app-with-typescript/README.md:
--------------------------------------------------------------------------------
1 |
18 |
19 | This example demonstrates how you can use `@elyra/pipeline-editor` in a Create React App project with TypeScript support.
20 |
--------------------------------------------------------------------------------
/cypress/plugins/index.js:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2018-2023 Elyra Authors
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | module.exports = (_on, _config) => {
18 | // `on` is used to hook into various events Cypress emits
19 | // `config` is the resolved Cypress config
20 | };
21 |
--------------------------------------------------------------------------------
/packages/pipeline-services/jest.config.js:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2018-2023 Elyra Authors
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | const baseConfig = require("../../jest.config.base");
18 |
19 | module.exports = {
20 | ...baseConfig,
21 | roots: ["/src"],
22 | };
23 |
--------------------------------------------------------------------------------
/packages/pipeline-editor/src/properties-panels/index.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2018-2023 Elyra Authors
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | export { default as NodeProperties } from "./NodeProperties";
18 | export { default as PipelineProperties } from "./PipelineProperties";
19 |
--------------------------------------------------------------------------------
/packages/pipeline-editor/src/styled.d.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2018-2023 Elyra Authors
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | import "styled-components";
18 | import { Theme } from "./types";
19 |
20 | declare module "styled-components" {
21 | export interface DefaultTheme extends Theme {}
22 | }
23 |
--------------------------------------------------------------------------------
/packages/pipeline-services/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@elyra/pipeline-services",
3 | "version": "1.12.1",
4 | "main": "dist/index.js",
5 | "homepage": "https://github.com/elyra-ai/pipeline-editor",
6 | "bugs": {
7 | "url": "https://github.com/elyra-ai/pipeline-editor/issues"
8 | },
9 | "repository": {
10 | "type": "git",
11 | "url": "https://github.com/elyra-ai/pipeline-editor"
12 | },
13 | "license": "Apache-2.0",
14 | "files": [
15 | "dist"
16 | ],
17 | "scripts": {
18 | "clean": "rm -rf node_modules; rm -rf dist; yarn unlink || true",
19 | "build": "tsc",
20 | "watch": "tsc -w --preserveWatchOutput",
21 | "test": "jest",
22 | "link": "yarn link"
23 | },
24 | "dependencies": {
25 | "immer": "^9.0.7",
26 | "jsonc-parser": "^3.0.0"
27 | },
28 | "publishConfig": {
29 | "access": "public"
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/examples/create-react-app-with-typescript/src/index.tsx:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2018-2023 Elyra Authors
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | import { render } from "react-dom";
18 |
19 | import App from "./App";
20 |
21 | const rootElement = document.getElementById("root");
22 | render(, rootElement);
23 |
--------------------------------------------------------------------------------
/packages/pipeline-editor/src/CustomFormControls/index.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2018-2023 Elyra Authors
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | /* istanbul ignore file */
18 |
19 | export * from "./FileWidget";
20 | export * from "./CustomFieldTemplate";
21 | export * from "./CustomArray";
22 | export * from "./CustomOneOf";
23 |
--------------------------------------------------------------------------------
/tsconfig.base.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "allowJs": true,
4 | "skipLibCheck": true,
5 |
6 | /* Strict Type-Checking Options */
7 | "strict": true,
8 | "strictNullChecks": true,
9 | "strictFunctionTypes": true,
10 | "strictBindCallApply": true,
11 | "strictPropertyInitialization": true,
12 | "noImplicitThis": true,
13 | "alwaysStrict": true,
14 |
15 | /* Additional Checks */
16 | // "noUnusedLocals": true,
17 | // "noUnusedParameters": true,
18 | "noImplicitReturns": true,
19 | "noFallthroughCasesInSwitch": true,
20 | "forceConsistentCasingInFileNames": true,
21 | "isolatedModules": true,
22 |
23 | /* Module Resolution Options */
24 | "moduleResolution": "node",
25 | "allowSyntheticDefaultImports": true,
26 | "esModuleInterop": true,
27 |
28 | /* Advanced Options */
29 | "resolveJsonModule": true
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/jest.config.base.js:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2018-2023 Elyra Authors
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | module.exports = {
18 | preset: "ts-jest",
19 | testEnvironment: "node",
20 | testMatch: [
21 | // Match all typescript tests.
22 | "**/*.test.{ts,tsx}",
23 | // Ignore snapshot tests.
24 | "!**/*.snap.test.{ts,tsx}",
25 | ],
26 | };
27 |
--------------------------------------------------------------------------------
/packages/pipeline-editor/src/index.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2018-2023 Elyra Authors
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | export * from "./errors";
18 | export { default as ThemeProvider, createTheme } from "./ThemeProvider";
19 | export { default as PipelineEditor } from "./PipelineEditor";
20 | export { PIPELINE_CURRENT_VERSION } from "./PipelineController";
21 |
--------------------------------------------------------------------------------
/cypress/integration/no-toolbar.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2018-2023 Elyra Authors
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | describe("no toolbar", () => {
18 | before(() => {
19 | cy.visit("/iframe.html?id=example-pipelineeditor--no-toolbar");
20 | });
21 |
22 | it("renders empty pipeline message", () => {
23 | cy.findByText(/your flow is empty/i).should("exist");
24 | });
25 | });
26 |
--------------------------------------------------------------------------------
/packages/pipeline-services/src/migration/errors/index.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2018-2023 Elyra Authors
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | export class ComponentNotFoundError extends Error {
18 | constructor() {
19 | /* istanbul ignore next */
20 | super("Component not found in any catalogue");
21 | Object.setPrototypeOf(this, ComponentNotFoundError.prototype);
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/examples/create-react-app/src/index.js:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2018-2023 Elyra Authors
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | import { StrictMode } from "react";
18 | import ReactDOM from "react-dom";
19 |
20 | import App from "./App";
21 |
22 | const rootElement = document.getElementById("root");
23 | ReactDOM.render(
24 |
25 |
26 | ,
27 | rootElement
28 | );
29 |
--------------------------------------------------------------------------------
/packages/pipeline-editor/jest.config.js:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2018-2023 Elyra Authors
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | const baseConfig = require("../../jest.config.base");
18 |
19 | module.exports = {
20 | ...baseConfig,
21 | testEnvironment: "jest-environment-jsdom",
22 | setupFilesAfterEnv: [
23 | "@testing-library/jest-dom/extend-expect",
24 | "./jest.setup.js",
25 | ],
26 | roots: ["/src"],
27 | };
28 |
--------------------------------------------------------------------------------
/stories/PipelineEditor.stories.js:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2018-2023 Elyra Authors
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | import React from "react";
18 |
19 | import { PipelineEditor } from "../packages/pipeline-editor";
20 |
21 | export default {
22 | title: "Example/PipelineEditor",
23 | component: PipelineEditor,
24 | };
25 |
26 | const Template = (args) => ;
27 |
28 | export const NoToolbar = Template.bind({});
29 | NoToolbar.args = {};
30 |
--------------------------------------------------------------------------------
/packages/pipeline-editor/src/CustomFormControls/test-utils.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2018-2023 Elyra Authors
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | import { createStore } from "redux";
18 |
19 | export function createPropertiesStore({ name }: { name: string }, value: any) {
20 | const initialState = {
21 | propertiesReducer: {
22 | [name]: value,
23 | },
24 | };
25 |
26 | function reducer(state: any) {
27 | return state;
28 | }
29 |
30 | return createStore(reducer, initialState);
31 | }
32 |
--------------------------------------------------------------------------------
/packages/pipeline-editor/src/properties-panels/PipelineProperties.tsx:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2018-2023 Elyra Authors
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | import { Message } from "./PropertiesPanel";
18 |
19 | interface Props {
20 | pipelineFlow: any;
21 | propertiesSchema?: any;
22 | onChange?: (data: any) => any;
23 | }
24 |
25 | function PipelineProperties(props: Props) {
26 | if (props.propertiesSchema === undefined) {
27 | return No pipeline properties defined.;
28 | }
29 |
30 | return ;
31 | }
32 |
33 | export default PipelineProperties;
34 |
--------------------------------------------------------------------------------
/packages/pipeline-editor/src/PipelineController/utils.test.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2018-2023 Elyra Authors
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | import { getFileName } from "./utils";
18 |
19 | it("strips extension when withExtension is false", () => {
20 | const name = getFileName("an/example/file.ipynb", {
21 | withExtension: false,
22 | });
23 | expect(name).toBe("file");
24 | });
25 |
26 | it("keeps extension when withExtension is true", () => {
27 | const name = getFileName("an/example/file.ipynb", {
28 | withExtension: true,
29 | });
30 | expect(name).toBe("file.ipynb");
31 | });
32 |
--------------------------------------------------------------------------------
/packages/pipeline-editor/jest.setup.js:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2018-2023 Elyra Authors
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | jest.mock("@elyra/canvas/dist/styles/common-canvas.min.css", () => "", {
18 | virtual: true,
19 | });
20 |
21 | global.crypto = {
22 | getRandomValues: () => {
23 | return new Uint8Array(256);
24 | },
25 | };
26 |
27 | window.matchMedia = () => {
28 | return {
29 | matches: true,
30 | addEventListener: () => {},
31 | };
32 | };
33 |
34 | window.scrollTo = () => {
35 | return;
36 | };
37 |
38 | window.Element.prototype.getComputedTextLength = () => {
39 | return 200;
40 | };
41 |
--------------------------------------------------------------------------------
/packages/pipeline-services/src/migration/migrateV3/index.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2018-2023 Elyra Authors
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | // NOTE: technically a pipeline can have a missing app_data field however, if
18 | // this is really an Elyra v2 pipeline, it should be guaranteed to have app_data
19 | // otherwise we wouldn't know this is a v2 pipeline.
20 | function migrate(pipeline: any) {
21 | // No-Op this is to disable old versions of Elyra
22 | // to see a pipeline with Python Script nodes
23 | pipeline.pipelines[0].app_data.version = 3;
24 |
25 | return pipeline;
26 | }
27 |
28 | export default migrate;
29 |
--------------------------------------------------------------------------------
/jest.config.js:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2018-2023 Elyra Authors
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | module.exports = {
18 | collectCoverageFrom: [
19 | // Collect coverage for all typescript files.
20 | "**/*.{ts,tsx}",
21 | // Ignore `src/index.ts`, because it should only be exports.
22 | "!**/src/index.ts",
23 | // Ignore any typescript declaration files.
24 | "!**/*.d.ts",
25 | // Ignore any test utils.
26 | "!**/test-utils.{ts,tsx}",
27 | // ignore tests and snapshot tests.
28 | "!**/*.test.{ts,tsx}",
29 | ],
30 | coverageReporters: ["lcov", "text"],
31 | projects: ["/packages/*"],
32 | };
33 |
--------------------------------------------------------------------------------
/packages/pipeline-services/src/validation/validators/index.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2018-2023 Elyra Authors
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | export interface Validator {
18 | enabled: boolean;
19 | isValid: (value: T) => boolean;
20 | message?: string;
21 | }
22 |
23 | export function getErrorMessages(value: T, validators: Validator[]) {
24 | return validators
25 | .filter((v) => v.enabled && !v.isValid(value))
26 | .map((v) => v.message);
27 | }
28 |
29 | export * from "./string-validators";
30 | export * from "./number-validators";
31 | export * from "./string-array-validators";
32 | export * from "./enum-validators";
33 | export * from "./nested-enum-validators";
34 |
--------------------------------------------------------------------------------
/packages/pipeline-editor/src/CustomFormControls/ErrorMessage.tsx:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2018-2023 Elyra Authors
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | import styled from "styled-components";
18 |
19 | export const ErrorMessage = styled.div.attrs({
20 | className: "elyra-errorMessage",
21 | })`
22 | position: absolute;
23 | left: 0;
24 | right: 0;
25 | padding: 5px;
26 | box-sizing: border-box;
27 | z-index: 1;
28 | border-style: solid;
29 | border-width: 1px;
30 | border-color: ${({ theme }) => theme.palette.errorMessage.errorBorder};
31 | background-color: ${({ theme }) => theme.palette.errorMessage.main};
32 | color: ${({ theme }) => theme.palette.errorMessage.contrastText};
33 | `;
34 |
--------------------------------------------------------------------------------
/packages/pipeline-services/src/validation/validators/enum-validators.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2018-2023 Elyra Authors
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | import { Validator } from ".";
18 |
19 | export interface EnumValidatorOptions {
20 | required?: boolean;
21 | pipeline_default?: boolean;
22 | }
23 |
24 | export function getEnumValidators({
25 | required,
26 | pipeline_default,
27 | }: EnumValidatorOptions) {
28 | const validators: Validator[] = [
29 | {
30 | enabled: required === true,
31 | isValid: (value: T) => {
32 | return value !== undefined || !!pipeline_default;
33 | },
34 | },
35 | ];
36 |
37 | return validators;
38 | }
39 |
--------------------------------------------------------------------------------
/packages/pipeline-editor/src/errors/index.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2018-2023 Elyra Authors
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | export class ElyraOutOfDateError extends Error {
18 | constructor() {
19 | /* istanbul ignore next */
20 | super(
21 | "Pipeline was last edited in a newer version of Elyra. Update Elyra to use this pipeline."
22 | );
23 | }
24 | }
25 |
26 | export class PipelineOutOfDateError extends Error {
27 | constructor() {
28 | /* istanbul ignore next */
29 | super("Pipeline is out of date.");
30 | }
31 | }
32 |
33 | export class InvalidPipelineError extends Error {
34 | constructor() {
35 | /* istanbul ignore next */
36 | super("Pipeline is invalid.");
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/Makefile:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright 2018-2023 Elyra Authors
3 | #
4 | # Licensed under the Apache License, Version 2.0 (the "License");
5 | # you may not use this file except in compliance with the License.
6 | # You may obtain a copy of the License at
7 | #
8 | # http://www.apache.org/licenses/LICENSE-2.0
9 | #
10 | # Unless required by applicable law or agreed to in writing, software
11 | # distributed under the License is distributed on an "AS IS" BASIS,
12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | # See the License for the specific language governing permissions and
14 | # limitations under the License.
15 | #
16 |
17 | .PHONY: help clean install dev-link watch
18 |
19 | help:
20 | # http://marmelab.com/blog/2016/02/29/auto-documented-makefile.html
21 | @grep -E '^[a-zA-Z0-9_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
22 |
23 | clean: ## Make a clean source tree and unlink packages
24 | - yarn clean
25 |
26 | lint: ## Run linters
27 | yarn lint
28 | yarn format
29 |
30 | install: ## Install dependencies and build packages
31 | yarn install && yarn build
32 |
33 | dev-link: ## Link packages
34 | yarn link-all
35 |
36 | watch: ## Watch packages. For use alongside jupyter lab --watch
37 | yarn watch
38 |
--------------------------------------------------------------------------------
/packages/pipeline-editor/src/IconButton/index.tsx:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2018-2023 Elyra Authors
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | import styled from "styled-components";
18 |
19 | const Container = styled.div`
20 | cursor: pointer;
21 | user-select: none;
22 | display: inline-block;
23 | transition: transform 50ms ease;
24 | position: relative;
25 |
26 | &:active {
27 | transform: scale(1.272019649);
28 | }
29 | `;
30 |
31 | const Icon = styled.div`
32 | color: ${({ theme }) => theme.palette.text.primary};
33 | `;
34 |
35 | function IconButton(props: React.HTMLAttributes) {
36 | return (
37 |
38 |
39 |
40 | );
41 | }
42 |
43 | export default IconButton;
44 |
--------------------------------------------------------------------------------
/packages/pipeline-services/src/migration/migrateV4/index.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2018-2023 Elyra Authors
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | function migrate(pipelineFlow: any) {
18 | for (const pipeline of pipelineFlow.pipelines) {
19 | for (const node of pipeline.nodes) {
20 | if (node.type === "execution_node") {
21 | node.app_data = {
22 | label: node.app_data.ui_data?.label ?? "",
23 | component_parameters: node.app_data,
24 | ui_data: node.app_data.ui_data ?? {},
25 | };
26 | delete node.app_data.component_parameters.ui_data;
27 | }
28 | }
29 | }
30 |
31 | pipelineFlow.pipelines[0].app_data.version = 4;
32 |
33 | return pipelineFlow;
34 | }
35 |
36 | export default migrate;
37 |
--------------------------------------------------------------------------------
/.github/PULL_REQUEST_TEMPLATE:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Developer's Certificate of Origin 1.1
5 |
6 | By making a contribution to this project, I certify that:
7 |
8 | (a) The contribution was created in whole or in part by me and I
9 | have the right to submit it under the Apache License 2.0; or
10 |
11 | (b) The contribution is based upon previous work that, to the best
12 | of my knowledge, is covered under an appropriate open source
13 | license and I have the right under that license to submit that
14 | work with modifications, whether created in whole or in part
15 | by me, under the same open source license (unless I am
16 | permitted to submit under a different license), as indicated
17 | in the file; or
18 |
19 | (c) The contribution was provided directly to me by some other
20 | person who certified (a), (b) or (c) and I have not modified
21 | it.
22 |
23 | (d) I understand and agree that this project and the contribution
24 | are public and that a record of the contribution (including all
25 | personal information I submit with it, including my sign-off) is
26 | maintained indefinitely and may be redistributed consistent with
27 | this project or the open source license(s) involved.
28 |
29 |
--------------------------------------------------------------------------------
/packages/pipeline-services/src/migration/migrateV3/index.test.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2018-2023 Elyra Authors
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | import produce from "immer";
18 |
19 | import rawMigrate from "./";
20 |
21 | // wrap migrate functions in immer
22 | const migrate = produce((d: any) => rawMigrate(d));
23 |
24 | it("should only bump version", () => {
25 | const v2 = {
26 | pipelines: [
27 | {
28 | app_data: {
29 | name: "name",
30 | version: 2,
31 | },
32 | nodes: [],
33 | },
34 | ],
35 | };
36 | const expected = {
37 | pipelines: [
38 | {
39 | app_data: {
40 | name: "name",
41 | version: 3,
42 | },
43 | nodes: [],
44 | },
45 | ],
46 | };
47 | const actual = migrate(v2);
48 | expect(actual).toEqual(expected);
49 | });
50 |
--------------------------------------------------------------------------------
/packages/pipeline-editor/src/ThemeProvider/utils.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2018-2023 Elyra Authors
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | import { DeepPartial } from "redux";
18 |
19 | function isPlainObject(item: any) {
20 | return item && typeof item === "object" && item.constructor === Object;
21 | }
22 |
23 | export function deepmerge(target: T, source: DeepPartial) {
24 | const output = { ...target };
25 |
26 | if (isPlainObject(target) && isPlainObject(source)) {
27 | for (let _key of Object.keys(source)) {
28 | const key = _key as keyof DeepPartial;
29 |
30 | const tVal = target[key];
31 | const sVal = source[key] as DeepPartial;
32 |
33 | if (sVal !== undefined) {
34 | if (isPlainObject(sVal) && tVal !== undefined) {
35 | output[key] = deepmerge(tVal, sVal);
36 | } else {
37 | output[key] = sVal as T[keyof T];
38 | }
39 | }
40 | }
41 | }
42 |
43 | return output;
44 | }
45 |
--------------------------------------------------------------------------------
/packages/pipeline-editor/src/properties-panels/useActiveFormItemShim.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2018-2023 Elyra Authors
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | import { useEffect } from "react";
18 |
19 | function useActiveFormItemShim() {
20 | // Inject a `selected` class into common properties.
21 | useEffect(() => {
22 | function handleClick(e: MouseEvent) {
23 | const els = document.querySelectorAll(
24 | ".properties-control-panel > .properties-control-panel > .properties-ctrl-wrapper"
25 | );
26 |
27 | for (const el of els) {
28 | if (el.contains(e.target as Node)) {
29 | el.classList.add("selected");
30 | } else {
31 | el.classList.remove("selected");
32 | }
33 | }
34 | }
35 |
36 | document.addEventListener("mousedown", handleClick, {
37 | capture: true, // prevent children from blocking
38 | });
39 | return () => {
40 | document.removeEventListener("mousedown", handleClick);
41 | };
42 | }, []);
43 | }
44 |
45 | export default useActiveFormItemShim;
46 |
--------------------------------------------------------------------------------
/packages/pipeline-editor/src/NodeTooltip/utils.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2018-2023 Elyra Authors
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | export function toPrettyString(o: any) {
18 | function toString(o: any) {
19 | if (typeof o === "boolean") {
20 | return o ? "Yes" : "No";
21 | }
22 |
23 | if (o === undefined) {
24 | return "undefined";
25 | }
26 |
27 | if (o === null) {
28 | return "null";
29 | }
30 |
31 | return o.toString();
32 | }
33 |
34 | if (Array.isArray(o)) {
35 | return o.map((v) => toString(v)).join("\n");
36 | }
37 |
38 | if (!!o && o.constructor === Object) {
39 | return Object.entries(o)
40 | .map(([key, value]) => `${key}: ${toString(value)}`)
41 | .join("\n");
42 | }
43 |
44 | return toString(o);
45 | }
46 |
47 | export function hasValue(o: any) {
48 | if (o === undefined || o === null) {
49 | return false;
50 | }
51 |
52 | if (Array.isArray(o)) {
53 | return o.length > 0;
54 | }
55 |
56 | if (typeof o === "boolean") {
57 | return true;
58 | }
59 |
60 | return o !== "";
61 | }
62 |
--------------------------------------------------------------------------------
/packages/pipeline-services/src/migration/migrateV2/index.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2018-2023 Elyra Authors
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | import path from "path";
18 |
19 | // NOTE: technically a pipeline can have a missing app_data field however, if
20 | // this is really an Elyra v1 pipeline, it should be guaranteed to have app_data
21 | // otherwise we wouldn't know this is a v1 pipeline.
22 | function migrate(
23 | pipeline: any,
24 | setNodePathsRelativeToPipelineV2?: (pipeline: any) => any
25 | ) {
26 | if (setNodePathsRelativeToPipelineV2) {
27 | pipeline.pipelines[0] = setNodePathsRelativeToPipelineV2(
28 | pipeline.pipelines[0]
29 | );
30 | } else {
31 | for (const node of pipeline.pipelines[0].nodes) {
32 | if (node.app_data) {
33 | // If setNodePathsRelativeToPipeline is not given then just set
34 | // filename to the basename and the user will have to update the correct
35 | // path in node properties
36 | node.app_data.filename = path.basename(node.app_data.filename);
37 | }
38 | }
39 | }
40 |
41 | pipeline.pipelines[0].app_data.version = 2;
42 |
43 | return pipeline;
44 | }
45 |
46 | export default migrate;
47 |
--------------------------------------------------------------------------------
/examples/create-react-app/public/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
9 |
10 |
14 |
15 |
16 |
25 | React App
26 |
27 |
28 |
29 |
30 |
31 |
41 |
42 |
43 |
--------------------------------------------------------------------------------
/packages/pipeline-editor/src/PalettePanel/index.test.tsx:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2018-2023 Elyra Authors
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | import { fireEvent, render, screen } from "../test-utils";
18 | import PalettePanel, { Node } from "./";
19 |
20 | describe("Node", () => {
21 | it("renders", () => {
22 | render();
23 | expect(screen.getByText("example label")).toBeInTheDocument();
24 | });
25 | });
26 |
27 | it("can drag node", () => {
28 | render(
29 |
42 | );
43 |
44 | const setDragImage = jest.fn();
45 | const setData = jest.fn();
46 | fireEvent.dragStart(screen.getByText("example label"), {
47 | dataTransfer: {
48 | setDragImage,
49 | setData,
50 | },
51 | });
52 |
53 | expect(setDragImage).toHaveBeenCalledTimes(1);
54 | expect(setData).toHaveBeenCalledTimes(1);
55 | expect(setData).toHaveBeenCalledWith("text", expect.any(String));
56 | });
57 |
--------------------------------------------------------------------------------
/examples/create-react-app-with-typescript/public/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
9 |
10 |
14 |
15 |
16 |
25 | React App
26 |
27 |
28 |
29 |
30 |
31 |
41 |
42 |
43 |
--------------------------------------------------------------------------------
/packages/pipeline-services/src/validation/validators/nested-enum-validators.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2018-2023 Elyra Authors
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | import { Validator } from ".";
18 | import {
19 | NestedEnumData as Data,
20 | NestedEnumFlatData as FlatData,
21 | } from "../types";
22 |
23 | export interface NestedEnumValidatorOptions {
24 | data: Data[];
25 | allownooptions?: boolean;
26 | required?: boolean;
27 | }
28 |
29 | export function getNestedEnumValidators({
30 | data,
31 | allownooptions,
32 | required,
33 | }: NestedEnumValidatorOptions) {
34 | const validators: Validator[] = [
35 | {
36 | enabled: required === true,
37 | isValid: (value: T) => value !== undefined,
38 | },
39 | {
40 | enabled: data !== undefined,
41 | isValid: (value: T) => {
42 | const selected = data.find((item: Data) => item.value === value?.value);
43 | const option = selected?.options?.find(
44 | (item: Data) => item.value === value?.option
45 | );
46 | return !!selected && (allownooptions || !!option);
47 | },
48 | message: `Value must be a valid option`,
49 | },
50 | ];
51 |
52 | return validators;
53 | }
54 |
--------------------------------------------------------------------------------
/packages/pipeline-services/src/migration/migrateV5/index.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2018-2023 Elyra Authors
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | const opMap: { [key: string]: string } = {
18 | "run-notebook-using-papermill":
19 | "run_notebook_using_papermill_Runnotebookusingpapermill",
20 | "filter-text": "filter_text_using_shell_and_grep_Filtertext",
21 | "bash-operator_BashOperator": "bash_operator_BashOperator",
22 | "email-operator_EmailOperator": "email_operator_EmailOperator",
23 | "http-operator_SimpleHttpOperator": "http_operator_SimpleHttpOperator",
24 | "spark-sql-operator_SparkSqlOperator": "spark_sql_operator_SparkSqlOperator",
25 | "spark-submit-operator_SparkSubmitOperator":
26 | "spark_submit_operator_SparkSubmitOperator",
27 | "slack-operator_SlackAPIPostOperator": "slack_operator_SlackAPIPostOperator",
28 | };
29 |
30 | function migrate(pipelineFlow: any) {
31 | for (const pipeline of pipelineFlow.pipelines) {
32 | for (const node of pipeline.nodes) {
33 | const newOp = opMap[node.op];
34 | if (newOp) {
35 | node.op = newOp;
36 | }
37 | }
38 | }
39 |
40 | pipelineFlow.pipelines[0].app_data.version = 5;
41 |
42 | return pipelineFlow;
43 | }
44 |
45 | export default migrate;
46 |
--------------------------------------------------------------------------------
/packages/pipeline-editor/src/CustomFormControls/FileWidget.tsx:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2018-2023 Elyra Authors
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | import { useCallback } from "react";
18 |
19 | import { Widget } from "@rjsf/core";
20 |
21 | // TODO: Make the file clearable
22 | export const FileWidget: Widget = (props) => {
23 | const handleChooseFile = useCallback(async () => {
24 | props.formContext.onFileRequested({
25 | canSelectMany: false,
26 | defaultUri: props.value,
27 | filters: { File: props.uiSchema.extensions },
28 | propertyID: props.id.replace("root_component_parameters_", ""),
29 | parentID: props.uiSchema?.parentID,
30 | });
31 | }, [props]);
32 |
33 | return (
34 |
134 | );
135 | };
136 |
--------------------------------------------------------------------------------
/packages/pipeline-editor/src/CustomFormControls/CustomArray.tsx:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2018-2023 Elyra Authors
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | import { useCallback } from "react";
18 |
19 | import { ArrayFieldTemplateProps } from "@rjsf/core";
20 |
21 | const renderDefaults = (
22 | items: any[],
23 | props: any
24 | ): React.ReactElement | undefined => {
25 | const allRendered = [];
26 | if (items.length === 0) {
27 | return undefined;
28 | } else if (props.schema.items?.type === "object") {
29 | for (const item of items) {
30 | const itemRendered = [];
31 | for (const key in props.schema.items.properties ?? {}) {
32 | const propertySchema = props.schema.items.properties[key];
33 | if (propertySchema.type === "boolean") {
34 | itemRendered.push(
35 |