Skip to content

Commit

Permalink
feat: UIG-2910 - vl-table-next - introductie component
Browse files Browse the repository at this point in the history
Storybook verbeterd, cypress uitgebreid & meta-data aangepast.
  • Loading branch information
Goldflow committed Nov 7, 2024
1 parent 7d6f804 commit 209ff87
Show file tree
Hide file tree
Showing 16 changed files with 2,116 additions and 16 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
const tableNextDefaultUrl = 'http://localhost:8080/iframe.html?id=components-next-table--table-default&viewMode=story';
const tableNextJoinedRowTitlesUrl = 'http://localhost:8080/iframe.html?id=components-next-table--table-joined-row-titles&viewMode=story';
const tableNextExpandableUrl = 'http://localhost:8080/iframe.html?id=components-next-table--table-expandable&viewMode=story';
const tableNextExpandableCustomToggleDetailsColumnUrl = 'http://localhost:8080/iframe.html?id=components-next-table--table-expandable-custom-toggle-details-column&viewMode=story';


describe('story - vl-table-next - default', () => {
it('should render', () => {
cy.visit(tableNextDefaultUrl);

cy.get('vl-table-next').find('table.vl-table-next');
});
});

describe('story - vl-table-next - joined row titles', () => {
it('should render', () => {
cy.visit(tableNextJoinedRowTitlesUrl);

cy.get('vl-table-next').find('table.vl-table-next');
});
});

describe('story - vl-table-next - expandable', () => {
it('should render', () => {
cy.visit(tableNextExpandableUrl);

cy.get('vl-table-next').find('table.vl-table-next');
});
});

describe('story - vl-table-next - expandable custom toggle details column', () => {
it('should render', () => {
cy.visit(tableNextExpandableCustomToggleDetailsColumnUrl);

cy.get('vl-table-next').find('table.vl-table-next');
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ const selectPage = (pageNumber: number) => {
cy.get('vl-rich-data-table').find('vl-pager').shadow().find(`[data-vl-pager-page=${pageNumber}]`).click();
};

describe('story vl-rich-data-table default', () => {
describe('story vl-rich-table default', () => {
it('should set data in the table', () => {
cy.visit(richDataTableUrl);

Expand All @@ -151,7 +151,7 @@ describe('story vl-rich-data-table default', () => {
});
});

describe('story vl-rich-data-table - sorting', () => {
describe('story vl-rich-table - sorting', () => {
beforeEach(() => cy.visit(`${richDataTableSortingUrl}`));

const { data: rowData } = {
Expand Down Expand Up @@ -199,7 +199,7 @@ describe('story vl-rich-data-table - sorting', () => {
});
});

describe('story vl-rich-data-table - filter', () => {
describe('story vl-rich-table - filter', () => {
beforeEach(() => cy.visit(`${richDataTableFilterUrl}`));
const data = rowsForFiltering;
const filterField = 'name';
Expand All @@ -225,7 +225,7 @@ describe('story vl-rich-data-table - filter', () => {
});
});

describe('story vl-rich-data-table - paging', () => {
describe('story vl-rich-table - paging', () => {
beforeEach(() => cy.visit(`${richDataTablePagingUrl}`));

const data = rowsForPagination;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,23 @@ const dataTableExpandableUrl =
const dataTableExpandableWithCustomToggleUrl =
'http://localhost:8080/iframe.html?args=&id=elements-data-table--data-table-expandable-custom-toggle-details-column&viewMode=story';

describe('story - vl-data-table - default', () => {
describe('story - vl-table - default', () => {
it('should render', () => {
cy.visit(dataTableDefaultUrl);

cy.get('[is="vl-data-table"]').should('have.class', 'vl-data-table');
});
});

describe('story - vl-data-table - expandable', () => {
describe('story - vl-table - expandable', () => {
it('should render', () => {
cy.visit(dataTableExpandableUrl);

cy.get('[is="vl-data-table"]').should('have.class', 'vl-data-table');
});
});

describe('story - vl-data-table - expandable with custom toggle', () => {
describe('story - vl-table - expandable with custom toggle', () => {
it('should render', () => {
cy.visit(dataTableExpandableWithCustomToggleUrl);

Expand Down
9 changes: 8 additions & 1 deletion apps/storybook/.storybook/vlux-meta-data/vlux-meta-data.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,17 @@
"planningInfo": "[v1 naar v2 - beschikbaar](/docs/planning-2024-van-v1-naar-v2-beschikbaar--documentatie#checkbox)"
},
"elements-data-table": {
"vStatus": "v1-todo",
"vStatus": "v1-replace",
"legacyText": "vl-data-table",
"nextText": "[vl-table-next](/docs/components-next-table--documentatie)",
"planningInfo": "[v1 naar v2 - planning](/docs/planning-2024-van-v1-naar-v2-planning--documentatie)"
},
"components-next-table": {
"vStatus": "v2-next",
"legacyText": "[vl-data-table](/docs/elements-data-table--documentatie)",
"nextText": "vl-table-next",
"planningInfo": "[v1 naar v2 - beschikbaar](/docs/planning-2024-van-v1-naar-v2-beschikbaar--documentatie#data-table)"
},
"components-datepicker": {
"vStatus": "v1-replace",
"legacyText": "vl-datepicker",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,36 @@ De `Button [next]` vervangt de `Button [legacy]`, de `Icon Button [legacy]` en d
</table>


### Data Table

<table style={{width: 100 + '%'}}>
<tr>
<th>Naam</th>
<th>Toestand</th>
<th>v1 - Artifact</th>
<th>v1 - Gebruik</th>
<th>v2 - Artifact</th>
<th>v2 - Gebruik</th>
</tr>
<tr>
<td>[Data Table [legacy]](/docs/elements-data-table--documentatie)</td>
<td>deprecated</td>
<td>elements</td>
<td><code>{`<table is="vl-data-table">`}</code></td>
<td>-</td>
<td>-</td>
</tr>
<tr>
<td>[Table [next]](/docs/components-next-table--documentatie)</td>
<td>release v1.42.0</td>
<td>components/next</td>
<td><code>{`<vl-table-next>`}</code></td>
<td>components</td>
<td><code>{`<vl-table>`}</code></td>
</tr>
</table>


### Doormat

<table style={{width: 100 + '%'}}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import * as VlSearchFilterStories from './vl-search-filter.stories';
<VluxAlert type="info">
{`
In de v2 versie van deze component gebruik je hem via de custom-tag, de interne implementatie is voor de rest gelijk gebleven aan deze van de v1 versie.
In v3 zal deze component grondig herwerkt worden; in de context van een herwerking van de vl-data-table.
In v3 zal deze component grondig herwerkt worden; in de context van een herwerking van de vl-table.
`}
</VluxAlert>

Expand Down
90 changes: 90 additions & 0 deletions libs/components/src/next/table/stories/vl-table.stories-arg.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
import { CATEGORIES, TYPES } from '@domg-wc/common-storybook';
import { ArgTypes } from '@storybook/web-components';
import { tableDefaults } from '../vl-table.defaults';

export const tableArgs = {
...tableDefaults,
};

export const tableArgTypes: ArgTypes<typeof tableArgs> = {
hover: {
name: 'hover',
description:
'Attribuut wordt gebruikt om een rij te highlighten wanneer de gebruiker erover hovert met muiscursor.',
table: {
category: CATEGORIES.ATTRIBUTES,
type: { summary: TYPES.BOOLEAN },
defaultValue: { summary: tableArgs.hover },
},
},
matrix: {
name: 'matrix',
description:
'Attribuut wordt gebruikt om data in 2 dimensies te tonen. Zowel de rijen als de kolommen krijgen een titel. Deze titels worden gescheiden door een dikke lijn.',
table: {
category: CATEGORIES.ATTRIBUTES,
type: { summary: TYPES.BOOLEAN },
defaultValue: { summary: tableArgs.matrix },
},
},
grid: {
name: 'grid',
description: 'Variant met een lijn tussen elke rij en kolom.',
table: {
category: CATEGORIES.ATTRIBUTES,
type: { summary: TYPES.BOOLEAN },
defaultValue: { summary: tableArgs.grid },
},
},
zebra: {
name: 'zebra',
description:
'Variant waarin de rijen afwisselend een andere achtergrondkleur krijgen. Dit maakt de tabel makkelijker leesbaar. ' +
'Deze zebra werkt niet voor tabellen met detail rijen, gebruik hiervoor uig-zebra.',
table: {
category: CATEGORIES.ATTRIBUTES,
type: { summary: TYPES.BOOLEAN },
defaultValue: { summary: tableArgs.zebra },
},
},
uigZebra: {
name: 'uig-zebra',
description:
'Variant waarin de rijen afwisselend een andere achtergrondkleur krijgen. Dit maakt de tabel makkelijker leesbaar. Deze zebra werkt voor tabellen met en zonder detail rijen.',
table: {
category: CATEGORIES.ATTRIBUTES,
type: { summary: TYPES.BOOLEAN },
defaultValue: { summary: tableArgs.uigZebra },
},
},
collapsedM: {
name: 'collapsed-m',
description:
'Vanaf een medium schermgrootte zullen de cellen van elke rij onder elkaar ipv naast elkaar getoond worden.',
table: {
category: CATEGORIES.ATTRIBUTES,
type: { summary: TYPES.BOOLEAN },
defaultValue: { summary: tableArgs.collapsedM },
},
},
collapsedS: {
name: 'collapsed-s',
description:
'Vanaf een small schermgrootte zullen de cellen van elke rij onder elkaar ipv naast elkaar getoond worden.',
table: {
category: CATEGORIES.ATTRIBUTES,
type: { summary: TYPES.BOOLEAN },
defaultValue: { summary: tableArgs.collapsedS },
},
},
collapsedXS: {
name: 'collapsed-xs',
description:
'Vanaf een extra small schermgrootte zullen de cellen van elke rij onder elkaar ipv naast elkaar getoond worden.',
table: {
category: CATEGORIES.ATTRIBUTES,
type: { summary: TYPES.BOOLEAN },
defaultValue: { summary: tableArgs.collapsedXS },
},
},
};
Loading

0 comments on commit 209ff87

Please sign in to comment.