-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
DataViews: centralize the view definition and rename list
to table
#56693
Conversation
export const LAYOUT_GRID = 'grid'; | ||
export const LAYOUT_SIDE_BY_SIDE = 'side-by-side'; | ||
|
||
export const VIEW_LAYOUTS = [ |
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.
This exercise has shown that there's quite a bit of expectations defined for a view, already. At some point in the following weeks, we could explore having official APIs for some things that were copied around and are now constants.
For example:
getIconForViewType( )
viewTypeSupports( 'preview' )
- etc.
Size Change: -137 B (0%) Total Size: 1.72 MB
ℹ️ View Unchanged
|
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.
I like this PR 👍 Good start. We definitely need things like getLayout( layout )
. I saw the icon used in the sidebar and it could use such API.
I also think we should start thinking about moving everything to a "dataviews" package. It could contain a store with layout registry for instance...
If 'side-by-side' is to become 'list', then renaming the current 'list' to 'table' seems reasonable. If that's the case we can restore the |
Thanks for the confirmation! I'll do that then. |
a8c9b36
to
0d2d010
Compare
ok, this is ready then:
Gravacao.do.ecra.2023-12-01.as.09.44.57.movOne thing I haven't done in this PR is renaming the view components. I'll do that separately so it's easier to review. |
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, thank you!
follow-up renaming components #56709 |
Part of #55083
What?
This PR:
list
layout totable
& updates its icon toblockTable
side-by-side
layout tolist
Gravacao.do.ecra.2023-12-01.as.09.44.57.mov
Why?
The centralization helps to visualize the emerging shape of a view object, as well as helping to maintain consistency (see for example how icons drifted due to lacking a single place to update them all: #56602).
Renaming was part of the tracking issue.
How?
Centralizes the view definition in
constants.js
.Testing Instructions
Follow-ups