Add default view setting #2306

Open
Elscrux wants to merge 1 commits from Elscrux/vikunja:feature/default-view-setting into main
Contributor

We mostly just use the Kanban view and this is an essential QoL feature so you don't have to switch the view mode all the time.
I was not really able to test it as locally it always throws an error about projectStore.projects[__props.projectId].views[getDefaultView()] is undefined (the views are just never loaded locally).
I also didn't include all translation for the setting name, not sure how things are handled here for that. I just included the English and German translations. If you'd like me to do this using a translator and/or based on existing translations, let me know!

We mostly just use the Kanban view and this is an essential QoL feature so you don't have to switch the view mode all the time. I was not really able to test it as locally it always throws an error about `projectStore.projects[__props.projectId].views[getDefaultView()] is undefined` (the views are just never loaded locally). I also didn't include all translation for the setting name, not sure how things are handled here for that. I just included the English and German translations. If you'd like me to do this using a translator and/or based on existing translations, let me know!
Elscrux added 1 commit 2024-04-26 20:50:43 +00:00
continuous-integration/drone/pr Build is failing Details
94a7bf2539
Add default view setting
Elscrux requested review from konrad 2024-04-26 20:53:06 +00:00
Member

Hi Elscrux!

Thank you for creating a PR!

I've deployed the frontend changes of this PR on a preview environment under this URL: https://2306-feature-default-view-setting--vikunja-frontend-preview.netlify.app

You can use this url to view the changes live and test them out.
You will need to manually connect this to an api running somewhere. The easiest to use is https://try.vikunja.io/.

This preview does not contain any changes made to the api, only the frontend.

Have a nice day!

Beep boop, I'm a bot.

Hi Elscrux! Thank you for creating a PR! I've deployed the frontend changes of this PR on a preview environment under this URL: https://2306-feature-default-view-setting--vikunja-frontend-preview.netlify.app You can use this url to view the changes live and test them out. You will need to manually connect this to an api running somewhere. The easiest to use is https://try.vikunja.io/. This preview does not contain any changes made to the api, only the frontend. Have a nice day! > Beep boop, I'm a bot.
konrad requested changes 2024-05-05 13:55:34 +00:00
konrad left a comment
Owner

Thanks for the PR! There are a few things I'd like you to change, please take a look. Please rebase and check the CI failure as well.

Thanks for the PR! There are a few things I'd like you to change, please take a look. Please rebase and check the CI failure as well.
@ -95,6 +95,7 @@
"weekStartMonday": "Montag",
"language": "Sprache",
"defaultProject": "Standard-Projekt",
"defaultView": "Standard-Ansicht",
Owner

Please don't include translations here, as they will be overridden from Crowdin. Only the English base strings should be edited in the repo. Check out https://vikunja.io/docs/translations/ for more information.

Please don't include translations here, as they will be overridden from Crowdin. Only the English base strings should be edited in the repo. Check out https://vikunja.io/docs/translations/ for more information.
@ -33,2 +40,2 @@
const firstViewId = projectStore.projects[projectId]?.views[0].id
if (firstViewId) {
const defaultViewId = projectStore.projects[projectId]?.views[getDefaultView()].id
if (defaultViewId) {
Owner

This won't work. What if I rearrange the views or delete a view so that, for example, the kanban view is at the first position? Then this will crash.

Please loop over projectStore.projects[projectId]?.views until you find the first view of the kind that's saved in authStore.settings.frontendSettings.defaultView. If that's not available (use the .find function, then the result here is undefined), use the first view, in the same way as it was checked previously.

This won't work. What if I rearrange the views or delete a view so that, for example, the kanban view is at the first position? Then this will crash. Please loop over `projectStore.projects[projectId]?.views` until you find the first view of the kind that's saved in `authStore.settings.frontendSettings.defaultView`. If that's not available (use the `.find` function, then the result here is `undefined`), use the first view, in the same way as it was checked previously.
Some checks failed
continuous-integration/drone/pr Build is failing
Required
Details
This pull request doesn't have enough approvals yet. 0 of 1 approvals granted.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
Sign in to join this conversation.
No reviewers
No Milestone
No Assignees
3 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: vikunja/vikunja#2306
No description provided.