-
-
Notifications
You must be signed in to change notification settings - Fork 184
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
refactor(SimpleTable): drop BEM, use Mantine TASK-1377 #5366
Merged
magicznyleszek
merged 19 commits into
kalvis/mantine-setup
from
leszek/task-1377-simple-table-new-(mantine-poc)
Jan 6, 2025
Merged
refactor(SimpleTable): drop BEM, use Mantine TASK-1377 #5366
magicznyleszek
merged 19 commits into
kalvis/mantine-setup
from
leszek/task-1377-simple-table-new-(mantine-poc)
Jan 6, 2025
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…e-new-(mantine-poc)
magicznyleszek
added
UI & UX
User interface problems and improvements
Front end
refactor
Internal code clanup
labels
Dec 18, 2024
…e-new-(mantine-poc)
…e-new-(mantine-poc)
Akuukis
requested changes
Dec 19, 2024
…e-new-(mantine-poc)
Akuukis
approved these changes
Jan 6, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, tested storybook, not tested app.
magicznyleszek
deleted the
leszek/task-1377-simple-table-new-(mantine-poc)
branch
January 6, 2025 13:45
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
📣 Summary
Replace
bem.SimpleTable
with Mantine-basedSimpleTable
component (a wrapper overTable
from@mantine/core
). The change for users is mainly visual.📖 Description
The tables that are affected by this are:
BulkEditSubmissionsForm
BulkEditRowForm
ProjectExportsList
SubmissionDataTable
(just responses for geopoint questions)💭 Notes
I based the looks of the
SimpleTable
on ourUniversalTable
as this is the latest design we have of "a table". This means it would look different from what we had, and it's ok.The steps I took to accomplish this Mantine based replacement:
js/components/common/SimpleTable.tsx
Table
from@mantine/core
<Table>
with some props passed to it (e.g.data
)js/components/common/SimpleTable.stories.tsx
js/theme/kobo/Table.ts
Table
from@mantine/core
export const TableThemeKobo = Table.extend({
withdefaultProps
changed andvars
changing CSS variable colorsborder-radius
to mySimpleTable
and changebackground-color
for headerTable
TableStylesNames
, and foundtable
:fanfare:js/theme/kobo/Table.ts
I've addedstyles.table
object toTableThemeKobo
and changed the style properties I wanted to change 👌border-collapse
soborder-radius
would work. Now I needed to fix the missing borders:thead
gets background colortd
gets border top stylesbem.SimpleTable
was pretty straightforward, some bumps on the road:Text
from Mantine wrapped around array items, rather than making this part ofSimpleTable
(this was my initial idea, but couldn't find a way to do it with Mantine without hacking things too much)Box
from Mantine, rather than having the optinal margins be part ofSimpleTable
(still not sure if this is the "proper" way of usingBox
)TableThemeKobo.styles
fromjs/theme/kobo/Table.ts
to CSS module injs/components/common/SimpleTable.module.scss
classNames
property on<Table>
<Box>
to apply margins, we passmt
toSimpleTable
directly. To make this work,SimpleTable
is acceptingMantineStyleProps
besides its own custom props.👀 Preview steps
Run Storybook and make sure that
SimpleTable
looks okVerify that
BulkEditSubmissionsForm
works correctlybeta
Verify that
BulkEditRowForm
works correctly8. ℹ️ follow all the above steps
9. for one of the rows click "edit" button from "Action" column
10. 🟢 notice a table with proposed existing responses appear
11. 🟢 verify it has the same functionalities as same table from
beta
Verify that
ProjectExportsList
works correctlybeta
Verify that
SubmissionDataTable
works correctly