-
Notifications
You must be signed in to change notification settings - Fork 59
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
minor: add support for StructuredDataSet Input/Output type (#445)
* chore: support for StructuredDataSet Input/Output type Signed-off-by: Carina Ursu <[email protected]> * chore: add tests Signed-off-by: Carina Ursu <[email protected]> * chore: add package Signed-off-by: Carina Ursu <[email protected]> * chore: resolving local package issue Signed-off-by: Carina Ursu <[email protected]> * chore: yarn lock Signed-off-by: Carina Ursu <[email protected]> * chore: stories Signed-off-by: Carina Ursu <[email protected]> * chore: fix associative arrays in copy functionality Signed-off-by: Carina Ursu <[email protected]> * chore: fix scalar stories Signed-off-by: Carina Ursu <[email protected]> * chore: oops Signed-off-by: Carina Ursu <[email protected]> * chore: cleanup Signed-off-by: Carina Ursu <[email protected]> * chore: revert old viewer to original Signed-off-by: Carina Ursu <[email protected]> * chore: fix Signed-off-by: Carina Ursu <[email protected]> * chore: remove non-null assertion Signed-off-by: Carina Ursu <[email protected]> * chore: fix types Signed-off-by: Carina Ursu <[email protected]> * chore: cleanup Signed-off-by: Carina Ursu <[email protected]> * chore: fix tests Signed-off-by: Carina Ursu <[email protected]> * chore: fix test types Signed-off-by: Carina Ursu <[email protected]> * chore: cleanup Signed-off-by: Carina Ursu <[email protected]> * chore: cleanup Signed-off-by: Carina Ursu <[email protected]> * chore: cleanup Signed-off-by: Carina Ursu <[email protected]> * chore: cleanup Signed-off-by: Carina Ursu <[email protected]> Co-authored-by: Carina Ursu <[email protected]>
- Loading branch information
Showing
30 changed files
with
1,810 additions
and
68 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
50 changes: 50 additions & 0 deletions
50
packages/zapp/console/src/components/Literals/DeprecatedLiteralMapViewer.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,50 @@ | ||
import classnames from 'classnames'; | ||
import { sortedObjectEntries } from 'common/utils'; | ||
import { useCommonStyles } from 'components/common/styles'; | ||
import { Literal, LiteralMap } from 'models/Common/types'; | ||
import * as React from 'react'; | ||
import { htmlEntities } from './constants'; | ||
import { LiteralValue } from './LiteralValue'; | ||
import { NoneTypeValue } from './Scalar/NoneTypeValue'; | ||
|
||
export const NoDataIsAvailable = () => { | ||
return ( | ||
<p> | ||
<em>No data is available.</em> | ||
</p> | ||
); | ||
}; | ||
|
||
/** Renders a LiteralMap as a formatted object */ | ||
export const DeprecatedLiteralMapViewer: React.FC<{ | ||
className?: string; | ||
map: LiteralMap | null; | ||
showBrackets?: boolean; | ||
}> = ({ className, map, showBrackets = false }) => { | ||
if (!map) { | ||
return <NoDataIsAvailable />; | ||
} | ||
|
||
const commonStyles = useCommonStyles(); | ||
const { literals } = map; | ||
const mapContent = Object.keys(literals).length ? ( | ||
<ul className={classnames(className, commonStyles.textMonospace, commonStyles.listUnstyled)}> | ||
{sortedObjectEntries(literals).map(([key, value]) => ( | ||
<li key={key}> | ||
<LiteralValue label={key} literal={value as Literal} /> | ||
</li> | ||
))} | ||
</ul> | ||
) : ( | ||
<div className={commonStyles.flexCenter}> | ||
<NoneTypeValue /> | ||
</div> | ||
); | ||
return ( | ||
<> | ||
{showBrackets && <span>{htmlEntities.leftCurlyBrace}</span>} | ||
{mapContent} | ||
{showBrackets && <span>{htmlEntities.rightCurlyBrace}</span>} | ||
</> | ||
); | ||
}; |
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
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
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
Oops, something went wrong.