-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
204 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 39 additions & 0 deletions
39
packages/ui/src/components/Visualization/Custom/UnknownNode.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
import { | ||
Alert, | ||
Card, | ||
CardBody, | ||
CardFooter, | ||
CardHeader, | ||
CardTitle, | ||
CodeBlock, | ||
CodeBlockCode, | ||
} from '@patternfly/react-core'; | ||
import { stringify } from 'yaml'; | ||
import { FunctionComponent } from 'react'; | ||
|
||
interface UnknownNodeProps { | ||
// eslint-disable-next-line @typescript-eslint/no-explicit-any | ||
model: any; | ||
} | ||
|
||
export const UnknownNode: FunctionComponent<UnknownNodeProps> = (props) => { | ||
return ( | ||
<Card> | ||
<CardHeader> | ||
<CardTitle>Node source</CardTitle> | ||
</CardHeader> | ||
<CardBody> | ||
<CodeBlock> | ||
<CodeBlockCode>{stringify(props.model)}</CodeBlockCode> | ||
</CodeBlock> | ||
</CardBody> | ||
<CardFooter> | ||
<Alert variant="warning" title="Unknow node type"> | ||
The configuration for an unknown node cannot be changed in the configuration form. Please switch to the source | ||
code and correct the node type. Another option is to replace the step in the graphical editor but in that case | ||
you will probably lose the existing configuration. | ||
</Alert> | ||
</CardFooter> | ||
</Card> | ||
); | ||
}; |