
This PR adds configuration of default project view in settings, which is used when the user has not visited the project and thus last view hasn't yet been saved in projects. Updates old settings and adds "First View" option with fallback. Resolves https://kolaente.dev/vikunja/vikunja/issues/2153 Co-authored-by: Elscrux <nickposer2102@gmail.com> Reviewed-on: https://kolaente.dev/vikunja/vikunja/pulls/2306 Reviewed-by: konrad <k@knt.li> Co-authored-by: Elscrux <elscrux@gmail.com> Co-committed-by: Elscrux <elscrux@gmail.com>
30 lines
969 B
TypeScript
30 lines
969 B
TypeScript
import AbstractModel from './abstractModel'
|
|
|
|
import type {IFrontendSettings, IUserSettings} from '@/modelTypes/IUserSettings'
|
|
import {getBrowserLanguage} from '@/i18n'
|
|
import {PrefixMode} from '@/modules/parseTaskText'
|
|
import {DEFAULT_PROJECT_VIEW_SETTINGS} from '@/modelTypes/IProjectView'
|
|
|
|
export default class UserSettingsModel extends AbstractModel<IUserSettings> implements IUserSettings {
|
|
name = ''
|
|
emailRemindersEnabled = true
|
|
discoverableByName = false
|
|
discoverableByEmail = false
|
|
overdueTasksRemindersEnabled = true
|
|
overdueTasksRemindersTime = undefined
|
|
defaultProjectId = undefined
|
|
weekStart = 0 as IUserSettings['weekStart']
|
|
timezone = ''
|
|
language = getBrowserLanguage()
|
|
frontendSettings: IFrontendSettings = {
|
|
playSoundWhenDone: true,
|
|
quickAddMagicMode: PrefixMode.Default,
|
|
colorSchema: 'auto',
|
|
defaultView: DEFAULT_PROJECT_VIEW_SETTINGS.FIRST,
|
|
}
|
|
|
|
constructor(data: Partial<IUserSettings> = {}) {
|
|
super()
|
|
this.assignData(data)
|
|
}
|
|
} |