Skip to content

Commit

Permalink
feat(redmine 1298964): add agenda page and integration of the table c…
Browse files Browse the repository at this point in the history
…omponent
  • Loading branch information
pereag committed Jun 12, 2024
1 parent 1880771 commit 6dc8c53
Show file tree
Hide file tree
Showing 6 changed files with 176 additions and 0 deletions.
Empty file.
Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import type { Meta, StoryObj } from '@storybook/react';

import { sharedMeta } from '../pages-story';

import { AgendaPage as Cmp } from './AgendaPage';

const meta = {
...sharedMeta,
args: { themePrimaryColor: 'cyan', themeSecondaryColor: 'gray' },
component: Cmp,
parameters: {
layout: 'fullscreen',
},
title: '3-custom/Pages/AgendaPage',
} satisfies Meta<typeof Cmp>;

export default meta;
type IStory = StoryObj<typeof meta>;

export const BrowsingPage: IStory = {
args: {},
};
141 changes: 141 additions & 0 deletions packages/storybook-pages/src/Pages/AgendaPage/AgendaPage.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,141 @@
'use client';

import type { ReactElement } from 'react';

import { Badge, Group } from '@mantine/core';
import { PencilSimple, Trash } from '@phosphor-icons/react';
import { Table } from '@smile/haring-react-table';

/**
* Primary UI component for user interaction
*/
export function AgendaPage(): ReactElement {
return (
<Table
actions={[
{
icon: <PencilSimple />,
id: 'edit',
label: 'Edit document',
onAction: () => {
console.log('Edit');

Check warning on line 21 in packages/storybook-pages/src/Pages/AgendaPage/AgendaPage.tsx

View workflow job for this annotation

GitHub Actions / test

Unexpected console statement
},
},
{
color: 'red',
confirmModalProps: {
children: 'Are you sure you want to delete ?',
confirmColor: 'red',
confirmLabel: 'Delete',
onCancel: () => {
console.log('Delete:cancel');

Check warning on line 31 in packages/storybook-pages/src/Pages/AgendaPage/AgendaPage.tsx

View workflow job for this annotation

GitHub Actions / test

Unexpected console statement
},
onConfirm: () => {
console.log('Delete:Confirm');

Check warning on line 34 in packages/storybook-pages/src/Pages/AgendaPage/AgendaPage.tsx

View workflow job for this annotation

GitHub Actions / test

Unexpected console statement
},
title: 'Delete ?',
},
confirmation: true,
icon: <Trash />,
id: 'delete',
isMassAction: true,
label: 'Delete',
onAction: () => {
console.log('Delete');

Check warning on line 44 in packages/storybook-pages/src/Pages/AgendaPage/AgendaPage.tsx

View workflow job for this annotation

GitHub Actions / test

Unexpected console statement
},
},
]}
columns={[
{
accessorKey: 'subject',
header: 'Sujets',
},
{
accessorKey: 'indicator',
header: 'Indicateurs',
},
{
accessorKey: 'schedules',
header: 'Horaires',
},
]}
data={[
{
indicator: (
<Group gap="5px">
<Badge color="blue">DEV</Badge>
</Group>
),
schedules: (
<div>
<p>
<strong>À 9h30</strong>
</p>
</div>
),
subject: (
<div>
<strong>Dally MFC </strong>
<br />
<p>
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do
eiusmod tempor incididunt.
</p>
</div>
),
},
{
indicator: (
<Group gap="5px">
<Badge color="blue">Dev</Badge>
<Badge>UI</Badge>
</Group>
),
schedules: (
<div>
<p>
<strong>De 11h à 12h</strong>
</p>
</div>
),
subject: (
<div>
<strong>AMF review sprint 2 </strong>
<br />
<p>
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do
eiusmod tempor incididunt.
</p>
</div>
),
},
{
indicator: (
<Group gap="5px">
<Badge color="orange">UX</Badge>
<Badge>UI</Badge>
</Group>
),
schedules: (
<div>
<p>
<strong>De 16h30 à 18h</strong>
</p>
</div>
),
subject: (
<div>
<strong>Brainstorming Maquettes TTTS </strong>
<br />
<p>
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do
eiusmod tempor incididunt.
</p>
</div>
),
},
]}
rowActionNumber={2}
/>
);
}
Empty file.
13 changes: 13 additions & 0 deletions packages/storybook-pages/src/Pages/AgendaPage/Code.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { Meta, Source } from '@storybook/blocks';

import * as AgendaPageStory from './AgendaPage.stories';

import AgendaPage from './AgendaPage?raw';

<Meta of={AgendaPageStory} />

# Code

Code of AgendaPage page

<Source code={`${AgendaPage}`} />

0 comments on commit 6dc8c53

Please sign in to comment.