[DREAM-840] Show document types in a table - #25468
Conversation
8b52a74 to
1c02b97
Compare
1c02b97 to
ca3c4de
Compare
b88903c to
5479f84
Compare
|
|
||
| def name | ||
| flex_layout(align_items: :center) do |flex| | ||
| flex.with_column(mr: 2) { drag_handle } |
There was a problem hiding this comment.
@lwassermann while this is OK for now, I'd prefer to see BorderBoxRowComponent support rendering its own drag handle.
5479f84 to
03c9532
Compare
96edc02 to
49847af
Compare
|
@opf/communicator some open questions about the responsive behaviour (see also screenshots above):
|
49847af to
3701763
Compare
|
Warning Flaky specs
🤖 Ask Copilot to investigateCopy the prompt below into a new comment on this PR to delegate the investigation to GitHub Copilot. It will look into the flakiness and open a separate pull request with you as reviewer. |
HDinger
left a comment
There was a problem hiding this comment.
Lgtm 👍
Regarding the open questions:
Tablet (544 to 767px) loses the Documents count. Accept, or add it to mobile_columns so it stacks under the name everywhere?
I'd vote for not showing the count on mobile but maybe @opf/communicator have a different opinion here? This is however not a blocker for me.
Merge order with #25581. Wait for the phone overflow fix and rebase, or merge #25468 first and accept the window where long names push the row menu off screen on phones?
The other has been approved, so this issue will be fixed once both are merged. The order is not too important imho.
Truncated long names on desktop. Ellipsis with no tooltip or title. Accept, or add a hover title on the name link?
We usually do not show a tooltip in these cases. The full name will be displayed once you click on it. But I'd leave the final decision to the communicators. In any case, this is also not a blocker for me.
The document type list composed its own grid on top of a plain border box, so its columns carried no table semantics and the sortable wiring sat on markup this screen alone defined. The shared table supplies both and lets the bespoke grid and its stylesheet go. https://community.openproject.org/wp/DREAM-840
The table changes the drag topology: the row is its own preview and the rows container is selected explicitly, while the list and item elements are morphed by the response to every move. A second drag after a completed morph is what proves the re-registration still holds. https://community.openproject.org/wp/DREAM-840
Replaces the EnumerationAdminHelpers mixin with a page object, Pages::Admin::EnumerationList, that priorities, time entry activities and document types subclass with their path, list selector, row selector and action button label. The specs stop redefining helper methods per file, and the drag helper lives in one place. https://community.openproject.org/wp/DREAM-840
3701763 to
2c29378
Compare
|
Warning Flaky specs
🤖 Ask Copilot to investigateCopy the prompt below into a new comment on this PR to delegate the investigation to GitHub Copilot. It will look into the flakiness and open a separate pull request with you as reviewer. |
Deploying openproject with ⚡ PullPreview
|
akabiru
left a comment
There was a problem hiding this comment.
Thanks for making the changes, Alex! They look good to me and I agree that we can leave out the documents count on mobile. Some refinement notes for your consideration. 👍🏾
|
|
||
| def item_component_class | ||
| ::Documents::Admin::DocumentTypes::ItemComponent | ||
| def wrapper_data_attributes |
There was a problem hiding this comment.
🍊 This root wiring and the move URL template are now a copy of Admin::Enumerations::IndexComponent, comment included, so a new outlet or renamed value has to land in both. Worth a small shared module that both include, with each defining its own move_url_template? Fine as a follow-up.
Brings back the documents-count test selector the old template had, so the feature spec no longer finds the count through its column index and keeps working when columns are added or reordered. The row component spec locates the cell by its column class for the same reason. https://community.openproject.org/wp/DREAM-840
Gives the blank state the alert icon the statuses table and the enumeration lists show, and drops the comment on the rows container selector, which the statuses and roles tables set without one. https://community.openproject.org/wp/DREAM-840
Adds with_move_submenu to SortableLists::MoveMenu beside with_move_items, so the submenu's label, icon, select variant and moveMenu target are stated once. Document types, enumerations and roles call it in place of their own copies; the rendered markup is unchanged. Menus that render the directions flat, such as text transform actions, keep calling with_move_items.
Drops five examples that repeat what the shared sortable-lists examples assert or that only prove deleted markup stays deleted. The per-row example stays, reduced to the row id and the preview target, which the shared examples do not cover. Renames the action button example, whose label is the same on every row, and shortens the page object comment to its purpose. https://community.openproject.org/wp/DREAM-840
Locates the drag handle, the labels and the menu items of the document type row by role and accessible name instead of CSS and test selectors, and resolves the Move submenu through the item that controls it. https://community.openproject.org/wp/DREAM-840
|
@akabiru thanks for the helpful feedback! I've tried to incorporate most of the suggestions you provided. |
Note
This PR is stacked on/depends on PR #25467 (DREAM-789); merge that first.
Ticket
https://community.openproject.org/wp/DREAM-840 (part of DREAM-837)
What are you trying to accomplish?
Replace the bespoke grid in document-type administration with the shared
OpPrimer::BorderBoxTableComponent, providing table semantics, column headers, and an accessible table name while retaining drag-and-drop and move-menu reordering.What approach did you choose and why?
Pages::Admin::EnumerationListpage object, subclassed per list, instead of a helper mixin.The Documents count column now hides below the shared table’s
mdbreakpoint (768px), rather than the old grid’ssmbreakpoint (544px).This PR covers document-type table presentation. Shared sortable-table integration is tracked separately in DREAM-838.
Follow-ups
dev); fixed there, this PR inherits it.aria-rowindex/aria-rowcounton Border Box Table rows. Once it lands, the feature spec's localposition:filter on the:rowselector (spec/support/capybara/additional_accessible_selectors.rb) andPages::Admin::EnumerationList#expect_orderswitch to the stockrowindex:filter.Screenshots
Same fixtures in both columns: a long default type name, a type with 12 documents, a plain type. Left = old bespoke grid (base branch), right = shared Border Box Table (this PR).
Desktop, 1280 px. The old grid clipped the Default label next to a long name; the table truncates the name and keeps the label.
Desktop with the row action menu open, 1280 px.
Tablet, 700 px. The old grid cut the long name and overlapped it with the count; the table shows the full name and label but hides the Documents column below the
mdbreakpoint (768 px), where the old grid hid it only belowsm(544 px).Phone, 400 px.
AI involvement
Collaborative – AI generated a substantial part of the code; I reviewed and understand every line.
Merge checklist