-
Notifications
You must be signed in to change notification settings - Fork 43
🖼️ Add persistent per-view layout modes (table / tiles / gallery) #2407
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
Draft
Rello
wants to merge
35
commits into
main
Choose a base branch
from
codex/implement-persistent-layout-modes-in-nextcloud-tables
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
35 commits
Select commit
Hold shift + click to select a range
01d9619
Add persistent per-view layouts
Rello 19fa7e5
Fix layout review feedback
Rello 23edbaf
Refactor value assignment for JsonSerializable
Rello aea4c66
Refactor layout options to use a table format
Rello 0cb66de
Add dynamic class binding for card layout
Rello 38accd4
Refactor CustomTable layout and URL generation
Rello 7a8eec8
Update styles for custom table in NcTable.vue
Rello 76a0cdb
Merge branch 'main' into codex/implement-persistent-layout-modes-in-n…
Rello 28fbeed
Delete tests/unit/Db/ViewLayoutTest.php
Rello 76fc76d
Delete cypress/e2e/view.cy.js
Rello eb8dc8d
Merge branch 'main' into codex/implement-persistent-layout-modes-in-n…
Rello 966c79f
update doc
Rello 99e0bc7
Add layout property with enum options to openapi.ts
Rello 8bb97f0
Add 'layout' property to OpenAPI schema
Rello e962941
Change layout type to string or null
Rello de58e69
Add files via upload
Rello 8df9e93
Enhance layout property documentation
Rello 97f12ed
Add files via upload
Rello 24339c8
Add files via upload
Rello 5c9000d
Add files via upload
Rello 3ec1e87
Add files via upload
Rello 4887356
Add files via upload
Rello 9403893
Add files via upload
Rello 0ccebd1
Add files via upload
Rello 2ad4739
Add files via upload
Rello d57edf7
Add files via upload
Rello 55ed950
Add files via upload
Rello 0bf453d
Add files via upload
Rello c079712
Add files via upload
Rello 539a382
Merge origin/main into feature branch, resolve conflicts
Copilot 8f93610
Filter card source options to view-accessible columns; add backend va…
Copilot 556b61b
feat(layout): change to dynamic settings column
Rello d71645e
Merge branch 'main' into codex/implement-persistent-layout-modes-in-n…
Rello 821a173
feat(layout): add playwright test
Rello 14ff143
feat(layout): add playwright test
Rello File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,45 @@ | ||
| <?php | ||
|
|
||
| declare(strict_types=1); | ||
|
|
||
| /** | ||
| * SPDX-FileCopyrightText: 2026 Nextcloud GmbH and Nextcloud contributors | ||
| * SPDX-License-Identifier: AGPL-3.0-or-later | ||
| */ | ||
|
|
||
| namespace OCA\Tables\Migration; | ||
|
|
||
| use Closure; | ||
| use OCP\DB\ISchemaWrapper; | ||
| use OCP\DB\Types; | ||
| use OCP\Migration\IOutput; | ||
| use OCP\Migration\SimpleMigrationStep; | ||
| use Override; | ||
|
|
||
| class Version1000Date20260318000000 extends SimpleMigrationStep { | ||
|
|
||
| #[Override] | ||
| public function changeSchema(IOutput $output, Closure $schemaClosure, array $options): ?ISchemaWrapper { | ||
| /** @var ISchemaWrapper $schema */ | ||
| $schema = $schemaClosure(); | ||
| $tableName = 'tables_views'; | ||
| if (!$schema->hasTable($tableName)) { | ||
| return null; | ||
| } | ||
|
|
||
| $table = $schema->getTable($tableName); | ||
| if (!$table->hasColumn('layout')) { | ||
| $table->addColumn('layout', Types::STRING, [ | ||
| 'notnull' => false, | ||
| 'length' => 16, | ||
| ]); | ||
| } | ||
| if (!$table->hasColumn('view_settings')) { | ||
| $table->addColumn('view_settings', \Doctrine\DBAL\Types\Types::JSON, [ | ||
| 'notnull' => false, | ||
| ]); | ||
| } | ||
|
|
||
| return $schema; | ||
| } | ||
| } | ||
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,61 @@ | ||
| <?php | ||
|
|
||
| declare(strict_types=1); | ||
|
|
||
| /** | ||
| * SPDX-FileCopyrightText: 2026 Nextcloud GmbH and Nextcloud contributors | ||
| * SPDX-License-Identifier: AGPL-3.0-or-later | ||
| */ | ||
|
|
||
| namespace OCA\Tables\Model; | ||
|
|
||
| use InvalidArgumentException; | ||
| use JsonSerializable; | ||
|
|
||
| class ViewSettings implements JsonSerializable { | ||
| public function __construct( | ||
| protected readonly ?int $cardBackgroundSource = null, | ||
| protected readonly ?int $cardTitleSource = null, | ||
| ) { | ||
| } | ||
|
|
||
| /** | ||
| * @param array{cardBackgroundSource?: int|null, cardTitleSource?: int|null} $data | ||
| */ | ||
| public static function createFromInputArray(array $data): self { | ||
| return new self( | ||
| cardBackgroundSource: self::nullableIntFromArray($data, 'cardBackgroundSource'), | ||
| cardTitleSource: self::nullableIntFromArray($data, 'cardTitleSource'), | ||
| ); | ||
| } | ||
|
|
||
| public function getCardBackgroundSource(): ?int { | ||
| return $this->cardBackgroundSource; | ||
| } | ||
|
|
||
| public function getCardTitleSource(): ?int { | ||
| return $this->cardTitleSource; | ||
| } | ||
|
|
||
| /** | ||
| * @return array{cardBackgroundSource: int|null, cardTitleSource: int|null} | ||
| */ | ||
| public function jsonSerialize(): array { | ||
| return [ | ||
| 'cardBackgroundSource' => $this->cardBackgroundSource, | ||
| 'cardTitleSource' => $this->cardTitleSource, | ||
| ]; | ||
| } | ||
|
|
||
| private static function nullableIntFromArray(array $data, string $key): ?int { | ||
| if (!array_key_exists($key, $data) || $data[$key] === null) { | ||
| return null; | ||
| } | ||
|
|
||
| if (!is_int($data[$key])) { | ||
| throw new InvalidArgumentException('Invalid ' . $key . ' value.'); | ||
| } | ||
|
|
||
| return $data[$key]; | ||
| } | ||
| } |
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.