Skip to content

Commit

Permalink
feat: Template Card got new requirements
Browse files Browse the repository at this point in the history
  • Loading branch information
vik378 committed Jun 27, 2024
1 parent ee97ffc commit 5a79b5d
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 2 deletions.
28 changes: 28 additions & 0 deletions frontend/src/stories/TemplateCard.docs.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{/*
SPDX-FileCopyrightText: Copyright DB InfraGO AG and contributors
SPDX-License-Identifier: Apache-2.0
*/}

import * as Component from './TemplateCard.stories.js'
import { Meta, Title, Story, Canvas, Unstyled } from '@storybook/blocks'

<Meta of={Component} />

<Title />

TemplateCard shall introduce the template to the user and provide some basic insights:
<ul>
<li>is this a template of a model element or a document</li>
<li>is it a stable template or an experimental thing / not for production</li>
<li>how many object / document instances this template applies to</li>
<li>indicate if the template is broken / cant enumerate objects / other issues </li>
<li>maybe indicate modeling rules compliance score</li>
</ul>

Normal users can see a few buttons:

<Story of={Component.Demo} />

Administrators can see more buttons:

<Story of={Component.Demo} />
27 changes: 25 additions & 2 deletions frontend/src/stories/TemplateCard.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,38 @@ export default {
component: TemplateCard,
// This component will have an automatically generated Autodocs entry:
// https://storybook.js.org/docs/writing-docs/autodocs
tags: ['autodocs'],
parameters: {
// More on how to position stories at:
// https://storybook.js.org/docs/configure/story-layout
layout: 'fullscreen'
}
};

export const Demo = {
export const Normal = {
args: {
template: {
name: 'System Capability',
description: `Specifies what the system should be capable of
and how it needs to interact with external actors.`,
idx: 'THE IDENTIFIER'
},
onClickCallback: (idx) => alert(idx)
}
};

export const Draft = {
args: {
template: {
name: 'System Capability',
description: `Specifies what the system should be capable of
and how it needs to interact with external actors.`,
idx: 'THE IDENTIFIER'
},
onClickCallback: (idx) => alert(idx)
}
};

export const Broken = {
args: {
template: {
name: 'System Capability',
Expand Down

0 comments on commit 5a79b5d

Please sign in to comment.