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

Implement Cell Render for the OnyxDataGrid #2370

Open
14 tasks
JoCa96 opened this issue Dec 18, 2024 · 0 comments
Open
14 tasks

Implement Cell Render for the OnyxDataGrid #2370

JoCa96 opened this issue Dec 18, 2024 · 0 comments
Assignees
Labels
dev Requires technical expertise
Milestone

Comments

@JoCa96
Copy link
Collaborator

JoCa96 commented Dec 18, 2024

Why?

As a user, I want to see different kind of data visualizations for different kind of columns.

Design

Figma

Acceptance criteria

  • The OnyxDataGrid is able to display numbers differently from strings, when configured so via the columns
  • For type number
  • options/props for the type are generically made available to the feature user

Implementation details

  • The column property of the OnyxDataGridProps is extended to support a type property. For now, it will support the types "string" | "number". Default is "string".
  • The createRendererRows function must be adapted. Based on the column type the cells component render function is switched. Make sure that the same render function is used.
  • features should be able to register their own types with the respective render functions via the DataGridFeature API

ColumnConfig API types:

/**
 * Normalized config for internal usage
 */
export type NormalizedColumnConfig<TEntry extends DataGridEntry> = {
  key: keyof TEntry;
  label?: string;
  type?: PropertyKey;
};

/**
 * ColumnConfig for the enduser
 */
export type ColumnConfig<TEntry extends DataGridEntry> =
  | keyof TEntry
  | NormalizedColumnConfig<TEntry>;

Feature API types:

  /**
   * Defines a renderer for a type.
   */
  typeRenderer?: Record<PropertyKey, DataGridRendererCellComponent<TEntry>>;

  /**
   * Allows modifying of the column configuration. E.g. adding or modifying columns. 
   */
  modifyColumns?: {
    func: (columns: Readonly<NormalizedColumnConfig<TEntry>[]>) => NormalizedColumnConfig<TEntry>[];
  };

Definition of Done

  • Should be covered by tests:

    • functional tests (Playwright or unit test)
    • visual tests (Playwright screenshots)
  • Make sure, that

    • follow-up tickets were created if necessary
    • updated version + documentation is deployed
    • Storybook can show the feature
    • Storybook code snippet of new/changed examples are checked that they are generated correctly
    • Namings are aligned with Figma

Approval

Storybook
Documentation

  • Checked and approved by
    • designer
    • dev
@JoCa96 JoCa96 added the dev Requires technical expertise label Dec 18, 2024
@JoCa96 JoCa96 added this to onyx Dec 18, 2024
@github-project-automation github-project-automation bot moved this to New in onyx Dec 18, 2024
@JoCa96 JoCa96 self-assigned this Dec 18, 2024
@JoCa96 JoCa96 added this to the Tables milestone Dec 18, 2024
@JoCa96 JoCa96 moved this from New to Backlog in onyx Jan 22, 2025
@mj-hof mj-hof added the 0-refinement All issues that can or need to be estimated in our next refinement label Jan 22, 2025
@JoCa96 JoCa96 removed the 0-refinement All issues that can or need to be estimated in our next refinement label Jan 22, 2025
@JoCa96 JoCa96 removed their assignment Jan 22, 2025
@mj-hof mj-hof moved this from Backlog to Ready in onyx Jan 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dev Requires technical expertise
Projects
Status: Ready
Development

No branches or pull requests

3 participants