Tradeshift / tradeshift-ui

The Tradeshift UI Library & Framework
https://ui.tradeshift.com
Other
33 stars 45 forks source link

[Table] Multiple buttons per table column #624

Open Josh-Spotswood opened 6 years ago

Josh-Spotswood commented 6 years ago

Tradeshift UI version affected

v9.2.0

Expected Behavior

Table component should be able to handle more than one button per column.

Actual Behavior

Table component is limited to one button per column.

Steps to reproduce

Add an array with an extra button to the table column value like so:

        table.cols([
            'Number of Suppliers',
            'Number of Invoices',
            { label: 'Actions', width: 150 }
        ]);

        table.rows(
            collections.map(collection => [
            collection.totalSupplierCount,
            collection.totalInvoices,
            [{
                item: 'Button',
                label: t('View All Invoices'),
                type: 'ts-tertiary ts-micro',
                name: 'view-details',
                value: {
                    collectionDate: collection.collectionDate
                }
            },{
                item: 'Button',
                label: t('Download Invoices'),
                type: 'ts-tertiary ts-micro',
                name: 'download-details',
                value: {
                    collectionDate: collection.collectionDate
                }
            }])
        );

Screenshots (optional)


Feature request

Description of feature

Example use cases and/or Prototype links

Designs and/or Prototype screenshots

Currently with one button: screen shot 2018-07-03 at 4 14 11 pm

Currently with a button array: screen shot 2018-07-03 at 4 15 24 pm

Using a work around: screen_shot_2018-06-22_at_2 38 33_pm

wiredearp commented 6 years ago

This is yet another often requested feature as witnessed in https://github.com/Tradeshift/tradeshift-ui/issues/537 and https://github.com/Tradeshift/tradeshift-ui/issues/570, so this issue is certainly valid even if it is a duplicate.