Add default view setting #2306
No reviewers
Labels
No Label
dependencies
duplicate
help wanted
invalid
kind/bug
kind/feature
needs reproduction
question
security
wontfix
No Milestone
No Assignees
3 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: vikunja/vikunja#2306
Loading…
Reference in New Issue
No description provided.
Delete Branch "Elscrux/vikunja:feature/default-view-setting"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
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!
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!
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",
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) {
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 inauthStore.settings.frontendSettings.defaultView
. If that's not available (use the.find
function, then the result here isundefined
), use the first view, in the same way as it was checked previously.