Refactoring names
This commit is contained in:
@@ -354,16 +354,16 @@
|
||||
@if (savedViewGroup.get(view.id.toString()).get('show_on_dashboard').value) {
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<pngx-input-number i18n-title title="Widget list limit" [showAdd]="false" formControlName="dashboard_view_limit"></pngx-input-number>
|
||||
<pngx-input-number i18n-title title="Widget list limit" [showAdd]="false" formControlName="page_size"></pngx-input-number>
|
||||
</div>
|
||||
<div class="col">
|
||||
<label class="form-label" for="dashboard_view_mode_{{view.id}}" i18n>Widget display</label>
|
||||
<select class="form-select" formControlName="dashboard_view_mode">
|
||||
<label class="form-label" for="display_mode_{{view.id}}" i18n>Widget display</label>
|
||||
<select class="form-select" formControlName="display_mode">
|
||||
<option [ngValue]="DashboardViewMode.TABLE" i18n>Table</option>
|
||||
<option [ngValue]="DashboardViewMode.SMALL_CARDS" i18n>Cards</option>
|
||||
</select>
|
||||
</div>
|
||||
@if (savedViewGroup.get(view.id.toString()).get('dashboard_view_mode').value === DashboardViewMode.TABLE && documentDisplayFields) {
|
||||
@if (savedViewGroup.get(view.id.toString()).get('display_mode').value === DashboardViewMode.TABLE && documentDisplayFields) {
|
||||
<pngx-input-drag-drop-select i18n-title title="Show" [items]="documentDisplayFields" formControlName="document_display_fields"></pngx-input-drag-drop-select>
|
||||
}
|
||||
</div>
|
||||
|
||||
@@ -28,7 +28,7 @@ import {
|
||||
import { Group } from 'src/app/data/group'
|
||||
import {
|
||||
DOCUMENT_DISPLAY_FIELDS,
|
||||
DashboardViewMode,
|
||||
DisplayMode,
|
||||
DocumentDisplayField,
|
||||
SavedView,
|
||||
} from 'src/app/data/saved-view'
|
||||
@@ -80,7 +80,7 @@ export class SettingsComponent
|
||||
implements OnInit, AfterViewInit, OnDestroy, DirtyComponent
|
||||
{
|
||||
activeNavID: number
|
||||
DashboardViewMode = DashboardViewMode
|
||||
DashboardViewMode = DisplayMode
|
||||
|
||||
savedViewGroup = new FormGroup({})
|
||||
|
||||
@@ -367,8 +367,8 @@ export class SettingsComponent
|
||||
name: view.name,
|
||||
show_on_dashboard: view.show_on_dashboard,
|
||||
show_in_sidebar: view.show_in_sidebar,
|
||||
dashboard_view_limit: view.dashboard_view_limit,
|
||||
dashboard_view_mode: view.dashboard_view_mode,
|
||||
page_size: view.page_size,
|
||||
display_mode: view.display_mode,
|
||||
document_display_fields: view.document_display_fields,
|
||||
}
|
||||
this.savedViewGroup.addControl(
|
||||
@@ -378,8 +378,8 @@ export class SettingsComponent
|
||||
name: new FormControl(null),
|
||||
show_on_dashboard: new FormControl(null),
|
||||
show_in_sidebar: new FormControl(null),
|
||||
dashboard_view_limit: new FormControl(null),
|
||||
dashboard_view_mode: new FormControl(null),
|
||||
page_size: new FormControl(null),
|
||||
display_mode: new FormControl(null),
|
||||
document_display_fields: new FormControl([]),
|
||||
})
|
||||
)
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
<a class="btn-link text-decoration-none" header-buttons [routerLink]="[]" (click)="showAll()" i18n>Show all</a>
|
||||
}
|
||||
|
||||
@if (documents.length && savedView.dashboard_view_mode === DashboardViewMode.TABLE) {
|
||||
@if (documents.length && savedView.display_mode === DashboardViewMode.TABLE) {
|
||||
<table content class="table table-hover mb-0 mt-n2 align-middle">
|
||||
<thead>
|
||||
<tr>
|
||||
@@ -111,7 +111,7 @@
|
||||
}
|
||||
</tbody>
|
||||
</table>
|
||||
} @else if (documents.length && savedView.dashboard_view_mode === DashboardViewMode.SMALL_CARDS) {
|
||||
} @else if (documents.length && savedView.display_mode === DashboardViewMode.SMALL_CARDS) {
|
||||
<div class="row row-cols-paperless-cards my-n2">
|
||||
@for (d of documents; track d.id) {
|
||||
<pngx-document-card-small class="p-0" (dblClickDocument)="openDocumentDetail(d)" [document]="d" (clickTag)="clickTag($event)" (clickCorrespondent)="clickCorrespondent($event)" (clickStoragePath)="clickStoragePath($event)" (clickDocumentType)="clickDocumentType($event)"></pngx-document-card-small>
|
||||
|
||||
@@ -18,7 +18,7 @@ import {
|
||||
FILTER_STORAGE_PATH,
|
||||
} from 'src/app/data/filter-rule-type'
|
||||
import {
|
||||
DashboardViewMode,
|
||||
DisplayMode,
|
||||
DocumentDisplayField,
|
||||
SavedView,
|
||||
} from 'src/app/data/saved-view'
|
||||
@@ -56,8 +56,8 @@ const savedView: SavedView = {
|
||||
value: '1,2',
|
||||
},
|
||||
],
|
||||
dashboard_view_limit: 20,
|
||||
dashboard_view_mode: DashboardViewMode.TABLE,
|
||||
page_size: 20,
|
||||
display_mode: DisplayMode.TABLE,
|
||||
document_display_fields: [
|
||||
DocumentDisplayField.CREATED,
|
||||
DocumentDisplayField.TITLE,
|
||||
|
||||
@@ -11,7 +11,7 @@ import { Subject, takeUntil } from 'rxjs'
|
||||
import { Document } from 'src/app/data/document'
|
||||
import {
|
||||
DocumentDisplayField,
|
||||
DashboardViewMode,
|
||||
DisplayMode,
|
||||
SavedView,
|
||||
DOCUMENT_DISPLAY_FIELDS,
|
||||
} from 'src/app/data/saved-view'
|
||||
@@ -45,7 +45,7 @@ export class SavedViewWidgetComponent
|
||||
extends ComponentWithPermissions
|
||||
implements OnInit, OnDestroy
|
||||
{
|
||||
public DashboardViewMode = DashboardViewMode
|
||||
public DashboardViewMode = DisplayMode
|
||||
public DashboardViewTableColumn = DocumentDisplayField
|
||||
public CustomFieldDataType = CustomFieldDataType
|
||||
|
||||
@@ -136,7 +136,7 @@ export class SavedViewWidgetComponent
|
||||
this.documentService
|
||||
.listFiltered(
|
||||
1,
|
||||
this.savedView.dashboard_view_limit,
|
||||
this.savedView.page_size,
|
||||
this.savedView.sort_field,
|
||||
this.savedView.sort_reverse,
|
||||
this.savedView.filter_rules,
|
||||
|
||||
@@ -16,7 +16,7 @@ import {
|
||||
} from 'src/app/utils/filter-rules'
|
||||
import { FILTER_FULLTEXT_MORELIKE } from 'src/app/data/filter-rule-type'
|
||||
import { Document } from 'src/app/data/document'
|
||||
import { SavedView } from 'src/app/data/saved-view'
|
||||
import { DisplayMode, SavedView } from 'src/app/data/saved-view'
|
||||
import { SETTINGS_KEYS } from 'src/app/data/ui-settings'
|
||||
import {
|
||||
SortableDirective,
|
||||
@@ -66,7 +66,7 @@ export class DocumentListComponent
|
||||
|
||||
@ViewChildren(SortableDirective) headers: QueryList<SortableDirective>
|
||||
|
||||
displayMode = 'smallCards' // largeCards, smallCards, details
|
||||
displayMode: string = DisplayMode.SMALL_CARDS // largeCards, smallCards, details
|
||||
|
||||
unmodifiedFilterRules: FilterRule[] = []
|
||||
private unmodifiedSavedView: SavedView
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import { FilterRule } from './filter-rule'
|
||||
import { ObjectWithPermissions } from './object-with-permissions'
|
||||
|
||||
export enum DashboardViewMode {
|
||||
export enum DisplayMode {
|
||||
TABLE = 'table',
|
||||
SMALL_CARDS = 'small_cards',
|
||||
SMALL_CARDS = 'smallCards',
|
||||
}
|
||||
|
||||
export enum DocumentDisplayField {
|
||||
@@ -61,9 +61,9 @@ export interface SavedView extends ObjectWithPermissions {
|
||||
|
||||
filter_rules: FilterRule[]
|
||||
|
||||
dashboard_view_limit?: number
|
||||
page_size?: number
|
||||
|
||||
dashboard_view_mode?: DashboardViewMode
|
||||
display_mode?: DisplayMode
|
||||
|
||||
document_display_fields?: DocumentDisplayField[]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user