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

Fetch settings values from sdk and use language code #3484

Merged
merged 7 commits into from
May 26, 2020
Merged

Conversation

kulmann
Copy link
Member

@kulmann kulmann commented May 20, 2020

This PR depends on owncloud/owncloud-sdk#475, so this has to stay WIP until the SDK-PR is merged and released.

Description

We have a settings service, that is supposed to be integrated in Phoenix like described in the docs

This PR uses settings values, coming from the settings service, to adapt the Phoenix UI for the authenticated user. At the moment, only the language setting is used: Changing the language in the settings frontend (has to be configured as a Phoenix app) results in having another language in Phoenix. In the future we can make use of this for a variety of customization:

  • chosen theme
  • notification preferences
  • preferences regarding the shown elements in the files list (e.g. different quick actions)
  • ...

Related Issue

owncloud/product#17

Motivation and Context

We want to provide a customized user experience for users.

How Has This Been Tested?

So far only in Chrome and Firefox. No tests implemented so far.

Screenshots (if appropriate):

English UI

Screenshot 2020-05-20 at 10 48 12

Changed language to French

Screenshot 2020-05-20 at 10 49 16

French UI (at least everything that's translated already)

Screenshot 2020-05-20 at 10 48 55

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Technical debt
  • Tests

Checklist:

  • Code changes
  • Unit tests added
  • Acceptance tests added
  • Documentation ticket raised:

Open tasks:

@update-docs
Copy link

update-docs bot commented May 20, 2020

Thanks for opening this pull request! The maintainers of this repository would appreciate it if you would create a changelog item based on your changes.

@kulmann kulmann marked this pull request as draft May 22, 2020 08:09
@PVince81
Copy link
Contributor

please update owncloud-sdk and add some error handling

@kulmann
Copy link
Member Author

kulmann commented May 24, 2020

Screenshot 2020-05-22 at 21 20 08

Added message on error

@kulmann kulmann changed the title WIP: Fetch settings values from sdk and use language code Fetch settings values from sdk and use language code May 25, 2020
@kulmann kulmann marked this pull request as ready for review May 25, 2020 11:00
@@ -0,0 +1,7 @@
Change: Make settings available in phoenix
Copy link
Contributor

Choose a reason for hiding this comment

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

"Enhancement" might be better in this case?

Copy link
Member Author

Choose a reason for hiding this comment

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

Nope, it's a change. ;-) Introduces settings to phoenix => entirely new feature.

Copy link
Contributor

Choose a reason for hiding this comment

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

Exactly, a new feature which doesn't change any existing functionality

src/Phoenix.vue Outdated Show resolved Hide resolved
@@ -29,6 +29,7 @@ const actions = {
logout(context) {
const logoutFinalizer = () => {
context.dispatch('cleanUpLoginState')
context.dispatch('loadSettingsValues')
Copy link
Contributor

Choose a reason for hiding this comment

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

Why load the settings during logout?

Copy link
Member Author

Choose a reason for hiding this comment

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

Because there will be settings that exist without user context. For example, when we provide multiple themes in the future, an admin could set a default theme in settings. That has to be available even if you don't have a user context. So as a result, all changes to the authenticated user (changing to another one or signing out) need to trigger a settings reload.

Copy link
Contributor

Choose a reason for hiding this comment

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

I see. I am just a bit afraid of relying on authentication in this case because of the public link's context.

Copy link
Contributor

@LukasHirt LukasHirt left a comment

Choose a reason for hiding this comment

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

Looks great! Settings is amazing progress 🚀

@kulmann kulmann merged commit a0de780 into master May 26, 2020
@delete-merged-branch delete-merged-branch bot deleted the feature/settings branch May 26, 2020 06:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants