Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable custom configuration settings for the data table manager #2851

Merged
merged 40 commits into from
Aug 7, 2024

Conversation

ddouglasz
Copy link
Contributor

@ddouglasz ddouglasz commented Jul 8, 2024

Summary

Enable custom configuration settings for data table amanager

Description

We want to be able to allow users to create their desired table configurations using the data table manager. This will allow granular configurations for the users as they can now create more settings, beyond the currently existing columns settings and display settings.

Reference: #2687 (comment)

2024-07-08 21 29 36

Copy link

vercel bot commented Jul 8, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
ui-kit ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 7, 2024 11:17am
ui-kit-storybook-v2 ❌ Failed (Inspect) Aug 7, 2024 11:17am
ui-kit-storybook-v8 ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 7, 2024 11:17am

Copy link

changeset-bot bot commented Jul 8, 2024

🦋 Changeset detected

Latest commit: 1e74e48

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 96 packages
Name Type
@commercetools-uikit/data-table-manager Minor
@commercetools-uikit/data-table Minor
@commercetools-frontend/ui-kit Minor
@commercetools-uikit/design-system Minor
@commercetools-uikit/calendar-time-utils Minor
@commercetools-uikit/calendar-utils Minor
@commercetools-uikit/hooks Minor
@commercetools-uikit/i18n Minor
@commercetools-uikit/localized-utils Minor
@commercetools-uikit/utils Minor
@commercetools-uikit/accessible-hidden Minor
@commercetools-uikit/avatar Minor
@commercetools-uikit/card Minor
@commercetools-uikit/collapsible-motion Minor
@commercetools-uikit/collapsible-panel Minor
@commercetools-uikit/collapsible Minor
@commercetools-uikit/constraints Minor
@commercetools-uikit/field-errors Minor
@commercetools-uikit/field-label Minor
@commercetools-uikit/field-warnings Minor
@commercetools-uikit/grid Minor
@commercetools-uikit/icons Minor
@commercetools-uikit/label Minor
@commercetools-uikit/link Minor
@commercetools-uikit/loading-spinner Minor
@commercetools-uikit/messages Minor
@commercetools-uikit/notifications Minor
@commercetools-uikit/pagination Minor
@commercetools-uikit/primary-action-dropdown Minor
@commercetools-uikit/progress-bar Minor
@commercetools-uikit/stamp Minor
@commercetools-uikit/tag Minor
@commercetools-uikit/text Minor
@commercetools-uikit/tooltip Minor
@commercetools-uikit/view-switcher Minor
@commercetools-uikit/accessible-button Minor
@commercetools-uikit/flat-button Minor
@commercetools-uikit/icon-button Minor
@commercetools-uikit/link-button Minor
@commercetools-uikit/primary-button Minor
@commercetools-uikit/secondary-button Minor
@commercetools-uikit/secondary-icon-button Minor
@commercetools-uikit/dropdown-menu Minor
@commercetools-uikit/async-creatable-select-field Minor
@commercetools-uikit/async-select-field Minor
@commercetools-uikit/creatable-select-field Minor
@commercetools-uikit/date-field Minor
@commercetools-uikit/date-range-field Minor
@commercetools-uikit/date-time-field Minor
@commercetools-uikit/localized-multiline-text-field Minor
@commercetools-uikit/localized-text-field Minor
@commercetools-uikit/money-field Minor
@commercetools-uikit/multiline-text-field Minor
@commercetools-uikit/number-field Minor
@commercetools-uikit/password-field Minor
@commercetools-uikit/radio-field Minor
@commercetools-uikit/search-select-field Minor
@commercetools-uikit/select-field Minor
@commercetools-uikit/text-field Minor
@commercetools-uikit/time-field Minor
@commercetools-uikit/async-creatable-select-input Minor
@commercetools-uikit/async-select-input Minor
@commercetools-uikit/checkbox-input Minor
@commercetools-uikit/creatable-select-input Minor
@commercetools-uikit/date-input Minor
@commercetools-uikit/date-range-input Minor
@commercetools-uikit/date-time-input Minor
@commercetools-uikit/input-utils Minor
@commercetools-uikit/localized-money-input Minor
@commercetools-uikit/localized-multiline-text-input Minor
@commercetools-uikit/localized-rich-text-input Minor
@commercetools-uikit/localized-text-input Minor
@commercetools-uikit/money-input Minor
@commercetools-uikit/multiline-text-input Minor
@commercetools-uikit/number-input Minor
@commercetools-uikit/password-input Minor
@commercetools-uikit/radio-input Minor
@commercetools-uikit/rich-text-input Minor
@commercetools-uikit/rich-text-utils Minor
@commercetools-uikit/search-select-input Minor
@commercetools-uikit/search-text-input Minor
@commercetools-uikit/select-input Minor
@commercetools-uikit/select-utils Minor
@commercetools-uikit/selectable-search-input Minor
@commercetools-uikit/text-input Minor
@commercetools-uikit/time-input Minor
@commercetools-uikit/toggle-input Minor
@commercetools-uikit/spacings-inline Minor
@commercetools-uikit/spacings-inset-squish Minor
@commercetools-uikit/spacings-inset Minor
@commercetools-uikit/spacings-stack Minor
@commercetools-uikit/buttons Minor
@commercetools-uikit/fields Minor
@commercetools-uikit/inputs Minor
@commercetools-uikit/spacings Minor
visual-testing-app Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@ddouglasz ddouglasz marked this pull request as ready for review July 9, 2024 11:42
@ddouglasz ddouglasz requested a review from a team July 9, 2024 11:42
@ddouglasz ddouglasz added the 🚧 Status: WIP Work in progress label Jul 9, 2024
Copy link

gitstream-cm bot commented Jul 9, 2024

This PR is missing a Jira ticket reference in the title or description.
Please add a Jira ticket reference to the title or description of this PR.


const customSettings = [
{
id: 'customSettings1',
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The payload can take as much settings as the user wants to access in the nested rows.

@@ -350,6 +477,8 @@ storiesOf('Components|DataTable', module)
'showColumnManagerConfirmationButtons',
false
);
// TODO - remove when nexted rows are implemented
const debug = boolean('logCustomSettings', false);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is solely for storybook and testing purpose. Will be helpful when implementing the nested rows. It is currently a toggle in storybook to help see the data passed in the customSettingsPayload

@jaikumar-tj jaikumar-tj requested a review from a team July 11, 2024 12:17
@jaikumar-tj
Copy link
Contributor

@ddouglasz Thanks for doing this. I took a quick glance at the code and noticed a couple of things that might be crucical for adapting in MC products app. Please let me know your thoughts or any alternative suggestion to resolve this.

  1. The customSettings are appended as the last options inside getDropdownOptions function. Would it be possible to inject the customSettings based on desired position ? For instance, we want to keep product columns and variant column right next to each other.
  2. We would like to provide custom label for the existing option column manager in order to achieve our desired outcome as shown in the screenshot. Do you think this would be possible? Otherwise the wording might looks odd if one option is column manager and another is variant columns
Screenshot 2024-07-11 at 14 21 54

Comment on lines 153 to 155
| `customSettings['key'].customComponent` | `ReactNode` | | | A component added to the settings interface to provide additional configuration for the data table setting |
| `customColumnManager.disableColumnManager` | `bool` | | `true` | Set this to `false` to show the column settings panel option. |
| `customColumnManager.visibleColumnKeys` | Array of `string` | | | The keys of the visible columns. |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ddouglasz Could you also describe the prop customColumnManager ?

I understand that the propcustomSettings is used to display customized options under the table settings dropdown and it also takes in customSettings['key'].customComponent which renders a react component when user selects the corresponding option.

When do we have to use customColumnManager? I checked the storybook from the preview link and I can't find where the component is rendered (for eg: I see this line columnManagerLabel: 'Custom Column Manager', but not sure where it is displayed in the UI

Copy link
Contributor Author

@ddouglasz ddouglasz Jul 31, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @jaikumar-tj ,
Nice catch! I have updated the readme here to describe it's use.
I missed the proper cleanup of the property. It is only meant for the already existing data table managers. Remember from our last feedback, we also want to have the option of overriding the default manager labels. When this value is provided, it overrides the label of the default manager labels.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ddouglasz
Thanks for updating readme. Here is my overall understanding and let me know if it is correct

`columnManager.columnManagerLabel` Screenshot 2024-08-01 at 08 58 03
`customSettings['key']. customPanelTitle` Screenshot 2024-08-01 at 08 57 22
`customSettings['key'].customComponent` Screenshot 2024-08-01 at 08 57 50
`customColumnManager`
  • customColumnManager.hideableColumns
  • customColumnManager.visibleColumnKeys
  • customColumnManager.disableColumnManager ... etc
  • ???

    What about customColumnManager? When do we have to use that? You mentioned that "It is only meant for the already existing data table managers" but I'm not sure if you are referring to this prop or the one about overriding label.

    Copy link
    Contributor

    Choose a reason for hiding this comment

    The reason will be displayed to describe this comment to others. Learn more.

    @ddouglasz Feel free to merge the PR. I think my doubts might be clarified once we start implementing this new changes in the product list.

    Copy link
    Contributor Author

    @ddouglasz ddouglasz Aug 7, 2024

    Choose a reason for hiding this comment

    The reason will be displayed to describe this comment to others. Learn more.

    Sure! I pushed the change from our meeting yesterday. Thanks for the review. Will be happy to align with you at any point, if you have more questions.
    6af7dcf

    Thank you.

    @vercel vercel bot temporarily deployed to Preview – ui-kit-storybook-v8 August 7, 2024 11:17 Inactive
    @ddouglasz ddouglasz merged commit d9d60a8 into main Aug 7, 2024
    8 checks passed
    @ddouglasz ddouglasz deleted the SHIELD-1333-data-table-manager-multiple-settings branch August 7, 2024 11:25
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    None yet
    Projects
    None yet
    Development

    Successfully merging this pull request may close these issues.

    6 participants