{{toast.content}}
- + diff --git a/src-ui/src/app/components/manage/settings/settings.component.html b/src-ui/src/app/components/manage/settings/settings.component.html index 7e52db59e..002cc4eed 100644 --- a/src-ui/src/app/components/manage/settings/settings.component.html +++ b/src-ui/src/app/components/manage/settings/settings.component.html @@ -22,7 +22,7 @@ - You need to reload the page after applying a new language. + You need to reload the page after applying a new language. diff --git a/src-ui/src/app/components/manage/settings/settings.component.ts b/src-ui/src/app/components/manage/settings/settings.component.ts index d9877d281..22ecfe9bb 100644 --- a/src-ui/src/app/components/manage/settings/settings.component.ts +++ b/src-ui/src/app/components/manage/settings/settings.component.ts @@ -14,7 +14,7 @@ import { LanguageOption, SettingsService, } from 'src/app/services/settings.service' -import { ToastService } from 'src/app/services/toast.service' +import { Toast, ToastService } from 'src/app/services/toast.service' import { dirtyCheck, DirtyComponent } from '@ngneat/dirty-check-forms' import { Observable, Subscription, BehaviorSubject, first } from 'rxjs' import { SETTINGS_KEYS } from 'src/app/data/paperless-uisettings' @@ -61,6 +61,13 @@ export class SettingsComponent implements OnInit, OnDestroy, DirtyComponent { ) } + get displayLanguageIsDirty(): boolean { + return ( + this.settingsForm.get('displayLanguage').value != + this.store?.getValue()['displayLanguage'] + ) + } + constructor( public savedViewService: SavedViewService, private documentListViewService: DocumentListViewService, @@ -170,6 +177,7 @@ export class SettingsComponent implements OnInit, OnDestroy, DirtyComponent { } private saveLocalSettings() { + const reloadRequired = this.displayLanguageIsDirty // just this one, for now this.settings.set( SETTINGS_KEYS.BULK_EDIT_APPLY_ON_CLOSE, this.settingsForm.value.bulkEditApplyOnClose @@ -235,7 +243,20 @@ export class SettingsComponent implements OnInit, OnDestroy, DirtyComponent { this.store.next(this.settingsForm.value) this.documentListViewService.updatePageSize() this.settings.updateAppearanceSettings() - this.toastService.showInfo($localize`Settings saved successfully.`) + let savedToast: Toast = { + title: $localize`Settings saved`, + content: $localize`Settings were saved successfully.`, + delay: 500000, + } + if (reloadRequired) { + ;(savedToast.content = $localize`Settings were saved successfully. Reload is required to apply some changes.`), + (savedToast.actionName = $localize`Reload now`) + savedToast.action = () => { + location.reload() + } + } + + this.toastService.show(savedToast) }, error: (error) => { this.toastService.showError( diff --git a/src-ui/src/styles.scss b/src-ui/src/styles.scss index 4b78e9d21..e0934b84c 100644 --- a/src-ui/src/styles.scss +++ b/src-ui/src/styles.scss @@ -84,6 +84,10 @@ svg.logo { } } +.text-primary { + color: var(--bs-primary) !important; +} + .btn-outline-primary { border-color: var(--bs-primary) !important; color: var(--bs-primary) !important; diff --git a/src-ui/src/theme.scss b/src-ui/src/theme.scss index 732ac47d9..bf9be6662 100644 --- a/src-ui/src/theme.scss +++ b/src-ui/src/theme.scss @@ -186,7 +186,8 @@ $form-check-radio-checked-bg-image-dark: url("data:image/svg+xml,