Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .scoper-production-dependencies
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,5 @@ maennchen/zipstream-php
markbaker/complex
markbaker/matrix
psr/simple-cache
symfony/uid
symfony/polyfill-uuid
2 changes: 1 addition & 1 deletion appinfo/info.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ Share your tables and views with users and groups within your cloud.
Have a good time and manage whatever you want.
]]></description>
<version>2.2.0</version>
<version>2.2.1-dev.0</version>
<licence>AGPL-3.0-or-later</licence>
<author>Nextcloud GmbH and Nextcloud contributors</author>
<namespace>Tables</namespace>
Expand Down
5 changes: 3 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
"lint": "find . -name \\*.php -not -path './vendor/*' -not -path './build/*' -print0 | xargs -0 -n1 php -l",
"cs:check": "php-cs-fixer fix --dry-run --diff",
"cs:fix": "php-cs-fixer fix",
"psalm": "./vendor/bin/psalm.phar --show-info=false --no-cache",
"psalm": "@php ./vendor/bin/psalm.phar --show-info=false --no-cache",
"psalm:update-baseline": "./vendor/bin/psalm.phar --update-baseline",
"psalm:fix": "./vendor/bin/psalm.phar --no-cache --alter --issues=InvalidReturnType,InvalidNullableReturnType,MismatchingDocblockParamType,MismatchingDocblockReturnType,MissingParamType,InvalidFalsableReturnType",
"psalm:fix:dry": "./vendor/bin/psalm.phar --no-cache --alter --issues=InvalidReturnType,InvalidNullableReturnType,MismatchingDocblockParamType,MismatchingDocblockReturnType,MissingParamType,InvalidFalsableReturnType --dry-run",
Expand All @@ -65,6 +65,7 @@
"require": {
"phpoffice/phpspreadsheet": "^5.1",
"ext-json": "*",
"bamarni/composer-bin-plugin": "^1.9.1"
"bamarni/composer-bin-plugin": "^1.9.1",
"symfony/uid": "^6.4"
}
}
163 changes: 162 additions & 1 deletion composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 6 additions & 6 deletions lib/Analytics/AnalyticsDatasource.php
Original file line number Diff line number Diff line change
Expand Up @@ -298,9 +298,9 @@ private function formatSelectionValue(Column $column, mixed $value): mixed {
return '';
}

foreach ($column->getSelectionOptionsArray() as $option) {
if ((int)$option['id'] === (int)$value) {
return $option['label'];
foreach ($column->getSelectionOptionsCollection() as $option) {
if ($option->key() === (int)$value) {
return $option->label();
}
}

Expand All @@ -318,9 +318,9 @@ private function isMultiSelection(Column $column): bool {
private function getSelectionLabels(Column $column, array $values): array {
$labels = [];
foreach ($values as $value) {
foreach ($column->getSelectionOptionsArray() as $option) {
if ((int)$option['id'] === (int)$value) {
$labels[] = $option['label'];
foreach ($column->getSelectionOptionsCollection() as $option) {
if ($option->key() === (int)$value) {
$labels[] = $option->label();
break;
}
}
Expand Down
7 changes: 6 additions & 1 deletion lib/Controller/ApiTablesController.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
use OCA\Tables\Service\ColumnService;
use OCA\Tables\Service\TableService;
use OCA\Tables\Service\ViewService;
use OCA\Tables\Vendor\Symfony\Component\Uid\Uuid;
use OCP\App\IAppManager;
use OCP\AppFramework\Http;
use OCP\AppFramework\Http\Attribute\NoAdminRequired;
Expand Down Expand Up @@ -153,6 +154,9 @@ public function createFromScheme(string $title, string $emoji, string $descripti
$table = $this->service->create($title, 'custom', $emoji, $description);
$colMap = [];
foreach ($columns as $column) {
if (isset($column['uuid']) && !Uuid::isValid($column['uuid'])) {
throw new \InvalidArgumentException('Invalid UUID provided');
}
$col = $this->columnService->create(
$this->userId,
$table->getId(),
Expand Down Expand Up @@ -182,7 +186,8 @@ public function createFromScheme(string $title, string $emoji, string $descripti
usergroupSelectGroups: $column['usergroupSelectGroups'],
usergroupSelectTeams: $column['usergroupSelectTeams'],
showUserStatus: $column['showUserStatus'],
customSettings: empty($column['customSettings']) ? null : json_encode($column['customSettings'])
customSettings: empty($column['customSettings']) ? null : json_encode($column['customSettings']),
uuid: $column['uuid'] ?? null,
)
);
$colMap[$column['id']] = $col->getId();
Expand Down
Loading
Loading