Skip to content

Commit

Permalink
chore: fix
Browse files Browse the repository at this point in the history
Signed-off-by: Carina Ursu <[email protected]>
  • Loading branch information
ursucarina committed May 5, 2022
1 parent 4099b52 commit 14bb53b
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export const NoDataIsAvailable = () => {
};

/** Renders a LiteralMap as a formatted object */
export const LiteralMapViewer: React.FC<{
export const DeprecatedLiteralMapViewer: React.FC<{
className?: string;
map: LiteralMap | null;
showBrackets?: boolean;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import * as React from 'react';
import { Card, CardContent } from '@material-ui/core';
import { LiteralMapViewer } from '../LiteralMapViewer';
import { DeprecatedLiteralMapViewer } from '../DeprecatedLiteralMapViewer';
import { CardDecorator } from './CardDecorator';
import {
binaryLiterals,
blobLiterals,
Expand All @@ -15,7 +14,6 @@ import {
} from './literalValues';

const stories = storiesOf('Literals/Collection', module);
stories.addDecorator(CardDecorator);

function renderCollection(label: string, collection: LiteralCollection) {
const map = { literals: { [label]: { collection, value: 'collection' } } };
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import { storiesOf } from '@storybook/react';
import { LiteralMap } from 'models/Common/types';
import * as React from 'react';
import { Card, CardContent } from '@material-ui/core';
import { CardDecorator } from './CardDecorator';
import {
binaryLiterals,
blobLiterals,
Expand All @@ -15,7 +14,6 @@ import { LiteralMapViewer } from '../LiteralMapViewer';
import { DeprecatedLiteralMapViewer } from '../DeprecatedLiteralMapViewer';

const stories = storiesOf('Literals/Map', module);
stories.addDecorator(CardDecorator);

function renderMap(label: string, map: LiteralMap) {
const fullMap = { literals: { [label]: { map, value: 'map' } } };
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,12 @@ import { storiesOf } from '@storybook/react';
import { ProtobufListValue, ProtobufStruct } from 'models/Common/types';
import * as React from 'react';
import { Card, CardContent } from '@material-ui/core';
import { CardDecorator } from './CardDecorator';
import { protobufValues } from './protobufValues';
import { LiteralMapViewer } from '../LiteralMapViewer';

import { DeprecatedLiteralMapViewer } from '../DeprecatedLiteralMapViewer';

const stories = storiesOf('Literals/ProtobufStruct', module);
stories.addDecorator(CardDecorator);

function renderStruct(label: string, struct: ProtobufStruct) {
const map = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@ import { storiesOf } from '@storybook/react';
import { Scalar } from 'models/Common/types';
import * as React from 'react';
import { Card, CardContent } from '@material-ui/core';
import { ScalarValue } from '../Scalar/ScalarValue';
import { LiteralMapViewer } from '../LiteralMapViewer';
import { CardDecorator } from './CardDecorator';
import {
binaryScalars,
blobScalars,
Expand All @@ -16,7 +14,6 @@ import {
import { DeprecatedLiteralMapViewer } from '../DeprecatedLiteralMapViewer';

const stories = storiesOf('Literals/Scalar', module);
stories.addDecorator(CardDecorator);

var renderScalars = (scalars: Dictionary<Scalar>) => {
const literals = {};
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
import { storiesOf } from '@storybook/react';
import { Scalar } from 'models/Common/types';
import { Card, CardContent } from '@material-ui/core';
import * as React from 'react';
import { Core } from 'flyteidl';
import { LiteralMapViewer } from '../LiteralMapViewer';
import { CardDecorator } from './CardDecorator';
import { blobScalars } from './scalarValues';
import { extractSimpleTypes, extractSchemaTypes, extractBlobTypes } from './helpers/typeGenerators';

const stories = storiesOf('Literals/StructuredDataSet', module);
stories.addDecorator(CardDecorator);

function generateStructuredDataset(label: string, literalType: Core.ILiteralType) {
return {
Expand Down Expand Up @@ -156,13 +155,17 @@ function generateEnumTypes() {
}

const renderScalars = (scalars: Dictionary<Scalar>) => {
return Object.entries(scalars).map(([label, value]) => {
const items = Object.entries(scalars).map(([_label, value]) => {
return (
<>
<LiteralMapViewer map={value} />
</>
<Card style={{ margin: '16px 0', width: '430px' }}>
<CardContent>
<LiteralMapViewer map={value} />
</CardContent>
</Card>
);
});

return <div style={{ display: 'flex', flexDirection: 'column' }}>{items}</div>;
};

stories.add('Simple types', () => <>{renderScalars(generateSimpleTypes())}</>);
Expand Down

0 comments on commit 14bb53b

Please sign in to comment.