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

✨ #11 - feat: add datagrid component #18

Merged
merged 8 commits into from
Feb 6, 2024
Merged

Conversation

svenvandescheur
Copy link
Collaborator

@svenvandescheur svenvandescheur commented Jan 29, 2024

Ready for review

@svenvandescheur svenvandescheur marked this pull request as ready for review January 30, 2024 10:53
@svenvandescheur svenvandescheur requested a review from Xaohs January 30, 2024 10:53
@svenvandescheur svenvandescheur force-pushed the feature/#11-grid branch 2 times, most recently from bfff84e to e64b0b6 Compare January 30, 2024 12:54
Copy link
Contributor

@Xaohs Xaohs left a comment

Choose a reason for hiding this comment

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

I have done some code checks, visually:

  • We are missing checkboxes to select each datagrid, and the button to do something with the selected ones. Are we leaving this aside for now?
  • The table headers are not aligned correctly according to the design.
  • Could you take another look at the mobile design, the aligning of the values seems a bit unnatural to me.
  • Upon closer inspection, the borders on the pagination buttons are always lit up (blueish), but in the design they should be more greyed out. Any thoughts on this?

&__row {
background-color: var(
--typography-color-background
); //border-radius: var(--border-radus-m);
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we remove this comment?

*/
const renderCell = (rowData: RowData, field: string, index: number) => {
const fieldIndex = renderableFields.indexOf(field);
const urlField = urlFields.find((f) => String(rowData[f]).match(REGEX_URL));
Copy link
Contributor

Choose a reason for hiding this comment

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

Is it possible to make a re-usable function in libs for this?

Copy link
Collaborator Author

@svenvandescheur svenvandescheur Feb 2, 2024

Choose a reason for hiding this comment

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

I moved field2caption to libs, extracting the urlField seems to be very specific logic to me. I don't think we should move that to libs for now.

Update: isLink created in libs

: isImplicitLink
? String(rowUrl)
: "";

Copy link
Contributor

Choose a reason for hiding this comment

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

I understand why we are using the ternaries here, but it is very unreadable. Could we slightly refactor this for readability?

/**
* FIXME: This effectively still uses index as keys which might lead to issues.
* @see {@link https://react.dev/learn/rendering-lists#rules-of-keys|Rules of keys}
*/
Copy link
Contributor

Choose a reason for hiding this comment

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

Could we apply the FIXME? 😄

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Will do so in a future PR containing the sorting functionality.

* Converts "field_name" to "FIELD NAME".
* @param field
*/
const field2Caption = (field: string): string =>
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we make a function in lib for this?

@svenvandescheur
Copy link
Collaborator Author

svenvandescheur commented Feb 2, 2024

I have done some code checks, visually:

  • We are missing checkboxes to select each datagrid, and the button to do something with the selected ones. Are we leaving this aside for now?

Yes, they might be added in the future but we postponed that feature for now.

  • The table headers are not aligned correctly according to the design.
  • Fix the design alignment and sizing of columns as close as possible.
  • Could you take another look at the mobile design, the aligning of the values seems a bit unnatural to me.
  • Attempt to improve mobile design
  • Upon closer inspection, the borders on the pagination buttons are always lit up (blueish), but in the design they should be more greyed out. Any thoughts on this?
  • Inspect color usage of pagination

  • Rebase main

@svenvandescheur svenvandescheur force-pushed the feature/#11-grid branch 2 times, most recently from 789c488 to f0bd585 Compare February 5, 2024 10:54
@svenvandescheur
Copy link
Collaborator Author

@Xaohs merging to unblock, additional review is still appreciated.

@svenvandescheur svenvandescheur merged commit 1dc92ce into main Feb 6, 2024
6 checks passed
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.

2 participants