Skip to content

Commit

Permalink
fix: Rename api parameter and bump api version to 2.1
Browse files Browse the repository at this point in the history
Signed-off-by: Julius Härtl <[email protected]>
  • Loading branch information
juliusknorr committed Jul 31, 2024
1 parent 5432853 commit f86ed84
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 19 deletions.
3 changes: 2 additions & 1 deletion lib/Capabilities.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,8 @@ public function getCapabilities(): array {
'version' => $this->appManager->getAppVersion('tables'),
'apiVersions' => [
'1.0',
'2.0'
'2.0',
'2.1',
],
'features' => [
'favorite',
Expand Down
18 changes: 9 additions & 9 deletions lib/Controller/Api1Controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -765,7 +765,7 @@ public function indexViewColumns(int $viewId): DataResponse {
* @param bool|null $usergroupMultipleItems Can select multiple users or/and groups, if column is usergroup
* @param bool|null $usergroupSelectUsers Can select users, if column type is usergroup
* @param bool|null $usergroupSelectGroups Can select groups, if column type is usergroup
* @param bool|null $showUserStatus Whether to show the user's status, if column type is usergroup
* @param bool|null $usergroupShowUserStatus Whether to show the user's status, if column type is usergroup
* @param int[]|null $selectedViewIds View IDs where this column should be added to be presented
*
* @return DataResponse<Http::STATUS_OK, TablesColumn, array{}>|DataResponse<Http::STATUS_FORBIDDEN|Http::STATUS_INTERNAL_SERVER_ERROR|Http::STATUS_NOT_FOUND, array{message: string}, array{}>
Expand Down Expand Up @@ -802,7 +802,7 @@ public function createColumn(
?bool $usergroupMultipleItems = null,
?bool $usergroupSelectUsers = null,
?bool $usergroupSelectGroups = null,
?bool $showUserStatus = null,
?bool $usergroupShowUserStatus = null,

?array $selectedViewIds = []
): DataResponse {
Expand Down Expand Up @@ -837,7 +837,7 @@ public function createColumn(
$usergroupMultipleItems,
$usergroupSelectUsers,
$usergroupSelectGroups,
$showUserStatus,
$usergroupShowUserStatus,

$selectedViewIds
)->jsonSerialize());
Expand Down Expand Up @@ -884,7 +884,7 @@ public function createColumn(
* @param bool|null $usergroupMultipleItems Can select multiple users or/and groups, if column is usergroup
* @param bool|null $usergroupSelectUsers Can select users, if column type is usergroup
* @param bool|null $usergroupSelectGroups Can select groups, if column type is usergroup
* @param bool|null $showUserStatus Whether to show the user's status, if column type is usergroup
* @param bool|null $usergroupShowUserStatus Whether to show the user's status, if column type is usergroup
*
* @return DataResponse<Http::STATUS_OK, TablesColumn, array{}>|DataResponse<Http::STATUS_INTERNAL_SERVER_ERROR, array{message: string}, array{}>
*
Expand Down Expand Up @@ -917,7 +917,7 @@ public function updateColumn(
?bool $usergroupMultipleItems,
?bool $usergroupSelectUsers,
?bool $usergroupSelectGroups,
?bool $showUserStatus,
?bool $usergroupShowUserStatus,

): DataResponse {
try {
Expand Down Expand Up @@ -950,7 +950,7 @@ public function updateColumn(
$usergroupMultipleItems,
$usergroupSelectUsers,
$usergroupSelectGroups,
$showUserStatus,
$usergroupShowUserStatus,
);
return new DataResponse($item->jsonSerialize());
} catch (InternalError $e) {
Expand Down Expand Up @@ -1483,7 +1483,7 @@ public function createTableShare(int $tableId, string $receiver, string $receive
* @param bool|null $usergroupMultipleItems Can select multiple users or/and groups, if column is usergroup
* @param bool|null $usergroupSelectUsers Can select users, if column type is usergroup
* @param bool|null $usergroupSelectGroups Can select groups, if column type is usergroup
* @param bool|null $showUserStatus Whether to show the user's status, if column type is usergroup
* @param bool|null $usergroupShowUserStatus Whether to show the user's status, if column type is usergroup
* @param int[]|null $selectedViewIds View IDs where this column should be added to be presented
*
* @return DataResponse<Http::STATUS_OK, TablesColumn, array{}>|DataResponse<Http::STATUS_FORBIDDEN|Http::STATUS_INTERNAL_SERVER_ERROR|Http::STATUS_NOT_FOUND, array{message: string}, array{}>
Expand Down Expand Up @@ -1520,7 +1520,7 @@ public function createTableColumn(
?bool $usergroupMultipleItems = null,
?bool $usergroupSelectUsers = null,
?bool $usergroupSelectGroups = null,
?bool $showUserStatus = null,
?bool $usergroupShowUserStatus = null,
?array $selectedViewIds = []
): DataResponse {
try {
Expand Down Expand Up @@ -1554,7 +1554,7 @@ public function createTableColumn(
$usergroupMultipleItems,
$usergroupSelectUsers,
$usergroupSelectGroups,
$showUserStatus,
$usergroupShowUserStatus,

$selectedViewIds
);
Expand Down
6 changes: 3 additions & 3 deletions lib/Migration/Version000800Date20240712000000.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ public function changeSchema(IOutput $output, Closure $schemaClosure, array $opt
/** @var ISchemaWrapper $schema */
$schema = $schemaClosure();

$hasChanges = $this->createUserGroupTable($schema, 'usergroup', Types::TEXT);
$hasChanges = $this->haveUserGroupColumnDefinitionFields($schema) ?? $hasChanges;
$changes = $this->createUserGroupTable($schema, 'usergroup', Types::TEXT);
$changes = $this->haveUserGroupColumnDefinitionFields($schema) ?? $changes;

return $hasChanges;
return $changes;
}

private function createUserGroupTable(ISchemaWrapper $schema, string $name, string $type): ?ISchemaWrapper {
Expand Down
6 changes: 3 additions & 3 deletions openapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -2986,7 +2986,7 @@
"nullable": true,
"description": "Can select groups, if column type is usergroup"
},
"showUserStatus": {
"usergroupShowUserStatus": {
"type": "boolean",
"nullable": true,
"description": "Whether to show the user's status, if column type is usergroup"
Expand Down Expand Up @@ -3335,7 +3335,7 @@
"nullable": true,
"description": "Can select groups, if column type is usergroup"
},
"showUserStatus": {
"usergroupShowUserStatus": {
"type": "boolean",
"nullable": true,
"description": "Whether to show the user's status, if column type is usergroup"
Expand Down Expand Up @@ -3549,7 +3549,7 @@
"nullable": true,
"description": "Can select groups, if column type is usergroup"
},
"showUserStatus": {
"usergroupShowUserStatus": {
"type": "boolean",
"nullable": true,
"description": "Whether to show the user's status, if column type is usergroup"
Expand Down
6 changes: 3 additions & 3 deletions src/types/openapi/openapi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2209,7 +2209,7 @@ export interface operations {
/** @description Can select groups, if column type is usergroup */
readonly usergroupSelectGroups?: boolean | null;
/** @description Whether to show the user's status, if column type is usergroup */
readonly showUserStatus?: boolean | null;
readonly usergroupShowUserStatus?: boolean | null;
/**
* @description View IDs where this column should be added to be presented
* @default []
Expand Down Expand Up @@ -2410,7 +2410,7 @@ export interface operations {
/** @description Can select groups, if column type is usergroup */
readonly usergroupSelectGroups?: boolean | null;
/** @description Whether to show the user's status, if column type is usergroup */
readonly showUserStatus?: boolean | null;
readonly usergroupShowUserStatus?: boolean | null;
/**
* @description View IDs where this column should be added to be presented
* @default []
Expand Down Expand Up @@ -2587,7 +2587,7 @@ export interface operations {
/** @description Can select groups, if column type is usergroup */
readonly usergroupSelectGroups?: boolean | null;
/** @description Whether to show the user's status, if column type is usergroup */
readonly showUserStatus?: boolean | null;
readonly usergroupShowUserStatus?: boolean | null;
};
};
};
Expand Down

0 comments on commit f86ed84

Please sign in to comment.