Skip to content

Commit

Permalink
fix: story config remove some sys fields
Browse files Browse the repository at this point in the history
  • Loading branch information
atanasster committed May 9, 2020
1 parent 6f69648 commit 3184ae5
Showing 1 changed file with 17 additions and 4 deletions.
21 changes: 17 additions & 4 deletions ui/blocks/src/StoryConfig/StoryConfig.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,16 +41,29 @@ export const StoryConfig: FC<StoryConfigProps> = props => {
onClick: onShowFileSource,
});
}
const { loc, renderFn, source, arguments: storyArgs, ...other } =
story || {};
return Object.keys(other).length ? (
const {
loc,
renderFn,
source,
//@ts-ignore
moduleId,
arguments: storyArgs,
parameters,
...restStory
} = story || {};
const { storySource, ...restParameters } = parameters || {};
if (restParameters && Object.keys(restParameters).length) {
//@ts-ignore
restStory.parameters = restParameters;
}
return Object.keys(restStory).length ? (
<Source
dark={dark}
language="json"
{...sourceProps}
actions={allActions}
>
{JSON.stringify(other, null, 2)}
{JSON.stringify(restStory, null, 2)}
</Source>
) : null;
}}
Expand Down

0 comments on commit 3184ae5

Please sign in to comment.