Skip to content
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

Expose dashboard layout and statuses API #42973

Merged
merged 5 commits into from
May 10, 2024

Conversation

provokateurin
Copy link
Member

Summary

I cleaned up the format that was used by the API, migrated the existing endpoints to OCS (the LayoutApiController never had a route so it was not possible to update the layout or statuses before) and added endpoints to get the current layout and statuses.

Checklist

* 200: Statuses updated successfully
*/
public function updateLayout(array $layout): DataResponse {
$this->config->setUserValue($this->userId, 'dashboard', 'layout', implode(',', $layout));

Check notice

Code scanning / Psalm

PossiblyNullArgument Note

Argument 1 of OCP\IConfig::setUserValue cannot be null, possibly null value provided
* 200: Statuses updated successfully
*/
public function updateStatuses(array $statuses): DataResponse {
$this->config->setUserValue($this->userId, 'dashboard', 'statuses', implode(',', $statuses));

Check notice

Code scanning / Psalm

PossiblyNullArgument Note

Argument 1 of OCP\IConfig::setUserValue cannot be null, possibly null value provided
* @return list<string>
*/
public function getLayout(): array {
$systemDefault = $this->config->getAppValue('dashboard', 'layout', 'recommendations,spreed,mail,calendar');

Check notice

Code scanning / Psalm

DeprecatedMethod Note

The method OCP\IConfig::getAppValue has been marked as deprecated
@provokateurin provokateurin force-pushed the feat/dashboard/expose-layout-statuses-apis branch from 2806714 to 072b239 Compare January 19, 2024 22:32
@provokateurin provokateurin force-pushed the feat/dashboard/expose-layout-statuses-apis branch from 072b239 to f49618c Compare February 20, 2024 13:39
@provokateurin provokateurin force-pushed the feat/dashboard/expose-layout-statuses-apis branch from f49618c to 571ce41 Compare February 27, 2024 17:47
This was referenced Mar 12, 2024
This was referenced Mar 20, 2024
Copy link
Member

@julien-nc julien-nc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. A few minor change suggestions.

apps/dashboard/appinfo/routes.php Outdated Show resolved Hide resolved
apps/dashboard/src/DashboardApp.vue Outdated Show resolved Hide resolved
apps/dashboard/src/DashboardApp.vue Outdated Show resolved Hide resolved
@provokateurin provokateurin force-pushed the feat/dashboard/expose-layout-statuses-apis branch from 571ce41 to 823e801 Compare May 5, 2024 06:29
@provokateurin provokateurin requested a review from julien-nc May 5, 2024 06:29
Copy link
Member

@julien-nc julien-nc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Copy link
Member

@st3iny st3iny left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested and works.

Nit: I would prefer the new routes to be /api/v1/... as they are the first versions of the respective APIs.

@provokateurin
Copy link
Member Author

Yeah I first had them as v1, but I'm not sure what makes most sense here. To me it would feel a bit weird that older versions support v2 but not all of the updated v1, so I went with v3 instead 🤷‍♀️

Signed-off-by: provokateurin <kate@provokateurin.de>
Signed-off-by: provokateurin <kate@provokateurin.de>
…r format

Signed-off-by: provokateurin <kate@provokateurin.de>
Signed-off-by: provokateurin <kate@provokateurin.de>
Signed-off-by: provokateurin <kate@provokateurin.de>
@provokateurin provokateurin force-pushed the feat/dashboard/expose-layout-statuses-apis branch from 823e801 to 395bf7c Compare May 10, 2024 07:44
@provokateurin
Copy link
Member Author

Just a rebase to fix CI

@provokateurin provokateurin enabled auto-merge May 10, 2024 07:45
@st3iny st3iny added 4. to release Ready to be released and/or waiting for tests to finish and removed 3. to review Waiting for reviews labels May 10, 2024
@provokateurin provokateurin merged commit 0b175b4 into master May 10, 2024
157 checks passed
@provokateurin provokateurin deleted the feat/dashboard/expose-layout-statuses-apis branch May 10, 2024 08:21
@blizzz blizzz mentioned this pull request Jul 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
4. to release Ready to be released and/or waiting for tests to finish enhancement feature: dashboard
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants