🔢 Reorder and sort table columns#2481
Conversation
6d172fa to
8b814f8
Compare
beb8965 to
57fb13d
Compare
AI-assistant: GitHub Copilot v0.43.0 (Claude Sonnet 4.6) Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
AI-assistant: GitHub Copilot v0.43.0 (Claude Sonnet 4.6) Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
AI-assistant: GitHub Copilot v0.43.0 (Claude Sonnet 4.6) Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
…able entity AI-assistant: GitHub Copilot v0.43.0 (Claude Sonnet 4.6) Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
99efeb0 to
2c6d286
Compare
…table entity AI-assistant: GitHub Copilot v0.43.0, Claude Code v2.1.109 (Claude Sonnet 4.6) Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
8f572d9 to
f48f67b
Compare
There was a problem hiding this comment.
Looks very nice! 2 things:
- Wording detail: Heading should be "Default sorting" instead of "Default sort"
- The default sorting can be deleted via the trash icon on the right. In Tables right now the default is new additions on the bottom, something we could also include there? That way it would be more obvious than being an "empty" state.
There was a problem hiding this comment.
Nice one!
One comment about the info text of default sorting: I wonder if there's a way to make this explanation a bit more clear, I don't understand it 😅
Another minor improvement would be moving it to right after the heading instead of after the add rule button.
Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
…ly if at least 2 sorting items are present AI-assistant: Claude Code v2.1.109 (Claude Sonnet 4.6) Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
|
Implemented @jancborchardt first comment and @marcoambrosini's feedback |
marcoambrosini
left a comment
There was a problem hiding this comment.
Thanks for the addition :)
…rent year for SPDX header Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
| */ | ||
| #[NoAdminRequired] | ||
| public function createFromScheme(string $title, string $emoji, string $description, array $columns, array $views): DataResponse { | ||
| public function createFromScheme(string $title, string $emoji, string $description, array $columns, array $views, array $columnOrder = [], array $sort = []): DataResponse { |
There was a problem hiding this comment.
did not check further down the code, but $columnOrder and $sort are not tested or sanitized for expected input format.
| #[NoAdminRequired] | ||
| #[RequirePermission(permission: Application::PERMISSION_MANAGE, type: Application::NODE_TYPE_TABLE, idParam: 'id')] | ||
| public function update(int $id, ?string $title = null, ?string $emoji = null, ?string $description = null, ?bool $archived = null): DataResponse { | ||
| public function update(int $id, ?string $title = null, ?string $emoji = null, ?string $description = null, ?bool $archived = null, null|array|string $columnSettings = null, null|array|string $sort = null): DataResponse { |
| public function update(int $id, ?string $title = null, ?string $emoji = null, ?bool $archived = null): DataResponse { | ||
| return $this->handleError(function () use ($id, $title, $emoji, $archived) { | ||
| return $this->service->update($id, $title, $emoji, null, $archived, $this->userId); | ||
| public function update(int $id, ?string $title = null, ?string $emoji = null, ?bool $archived = null, null|array|string $columnSettings = null, null|array|string $sort = null): DataResponse { |
| (int)$data[self::KEY_ID], | ||
| (int)$data[self::KEY_ORDER], | ||
| (bool)($data[self::KEY_READONLY] ?? false), | ||
| (bool)($data[self::KEY_MANDATORY] ?? false), |
There was a problem hiding this comment.
please revert this changes as well. It used to throw a PHP Error on construction, but now it silently succeeds with potentially flawed data.
| } | ||
|
|
||
| /** | ||
| * @psalm-suppress MismatchingDocblockReturnType |
| } | ||
|
|
||
| /** | ||
| * @psalm-suppress MismatchingDocblockReturnType |
There was a problem hiding this comment.
I am also not entirely confident about the code generated here, but it is a bit vague gut feeling yet.
Resolves #607 implementing the same mechanism views already offer, but for tables
column_ordertotables_tables(DB migration), extended theTableentity,TableService, and controllers to persist and apply it, and exposed a drag-and-dropColumnOrderList.vuein the "Edit table" modal.sorttotables_tables, wired it through theTableentity,TableService, and controllers, and added aDefaultSortRules.vuecomponent to the modal.JSON Export
See last section for order/sorting block (like for views)