mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-04-09 09:58:20 -05:00
confirmation messages
This commit is contained in:
parent
889fe5890d
commit
de87efc291
@ -84,15 +84,17 @@ export class DocumentListComponent implements OnInit {
|
|||||||
saveViewConfigAs() {
|
saveViewConfigAs() {
|
||||||
let modal = this.modalService.open(SaveViewConfigDialogComponent, {backdrop: 'static'})
|
let modal = this.modalService.open(SaveViewConfigDialogComponent, {backdrop: 'static'})
|
||||||
modal.componentInstance.saveClicked.subscribe(formValue => {
|
modal.componentInstance.saveClicked.subscribe(formValue => {
|
||||||
this.savedViewService.create({
|
let savedView = {
|
||||||
name: formValue.name,
|
name: formValue.name,
|
||||||
show_on_dashboard: formValue.showOnDashboard,
|
show_on_dashboard: formValue.showOnDashboard,
|
||||||
show_in_sidebar: formValue.showInSideBar,
|
show_in_sidebar: formValue.showInSideBar,
|
||||||
filter_rules: this.list.filterRules,
|
filter_rules: this.list.filterRules,
|
||||||
sort_reverse: this.list.sortReverse,
|
sort_reverse: this.list.sortReverse,
|
||||||
sort_field: this.list.sortField
|
sort_field: this.list.sortField
|
||||||
}).subscribe(() => {
|
}
|
||||||
|
this.savedViewService.create(savedView).subscribe(() => {
|
||||||
modal.close()
|
modal.close()
|
||||||
|
this.toastService.showToast(Toast.make("Information", `View "${savedView.name}" created successfully.`))
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
@ -4,6 +4,7 @@ import { PaperlessSavedView } from 'src/app/data/paperless-saved-view';
|
|||||||
import { GENERAL_SETTINGS } from 'src/app/data/storage-keys';
|
import { GENERAL_SETTINGS } from 'src/app/data/storage-keys';
|
||||||
import { DocumentListViewService } from 'src/app/services/document-list-view.service';
|
import { DocumentListViewService } from 'src/app/services/document-list-view.service';
|
||||||
import { SavedViewService } from 'src/app/services/rest/saved-view.service';
|
import { SavedViewService } from 'src/app/services/rest/saved-view.service';
|
||||||
|
import { Toast, ToastService } from 'src/app/services/toast.service';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-settings',
|
selector: 'app-settings',
|
||||||
@ -18,11 +19,14 @@ export class SettingsComponent {
|
|||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
public savedViewService: SavedViewService,
|
public savedViewService: SavedViewService,
|
||||||
private documentListViewService: DocumentListViewService
|
private documentListViewService: DocumentListViewService,
|
||||||
|
private toastService: ToastService
|
||||||
) { }
|
) { }
|
||||||
|
|
||||||
deleteSavedView(savedView: PaperlessSavedView) {
|
deleteSavedView(savedView: PaperlessSavedView) {
|
||||||
this.savedViewService.delete(savedView).subscribe(() => {})
|
this.savedViewService.delete(savedView).subscribe(() => {
|
||||||
|
this.toastService.showToast(Toast.make("Information", `Saved view "${savedView.name} deleted.`))
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
saveSettings() {
|
saveSettings() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user