Exclude added for small cards default list, make show just like other fields
This commit is contained in:
parent
218488eba6
commit
72df553289
@ -58,7 +58,7 @@
|
||||
<small>{{(document.storage_path$ | async)?.name ?? privateName}}</small>
|
||||
</button>
|
||||
}
|
||||
@if (displayFields.includes(DisplayField.CREATED) || displayFields.includes(DisplayField.ADDED)) {
|
||||
@if (displayFields.includes(DisplayField.CREATED)) {
|
||||
<div class="list-group-item bg-transparent p-0 border-0 d-flex flex-wrap-reverse justify-content-between">
|
||||
<ng-template #dateTooltip>
|
||||
<div class="d-flex flex-column text-light">
|
||||
@ -70,8 +70,24 @@
|
||||
<div class="ps-0 p-1" placement="top" [ngbTooltip]="dateTooltip">
|
||||
<i-bs width="1em" height="1em" class="me-2 text-muted" name="calendar-event"></i-bs>
|
||||
<small>
|
||||
@if (displayFields.includes(DisplayField.CREATED)) { {{document.created | customDate:'mediumDate'}} }
|
||||
@else { {{document.added | customDate:'mediumDate'}} }
|
||||
{{document.created | customDate:'mediumDate'}}
|
||||
</small>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
@if (displayFields.includes(DisplayField.ADDED)) {
|
||||
<div class="list-group-item bg-transparent p-0 border-0 d-flex flex-wrap-reverse justify-content-between">
|
||||
<ng-template #dateTooltip>
|
||||
<div class="d-flex flex-column text-light">
|
||||
<span i18n>Created: {{ document.created | customDate }}</span>
|
||||
<span i18n>Added: {{ document.added | customDate }}</span>
|
||||
<span i18n>Modified: {{ document.modified | customDate }}</span>
|
||||
</div>
|
||||
</ng-template>
|
||||
<div class="ps-0 p-1" placement="top" [ngbTooltip]="dateTooltip">
|
||||
<i-bs width="1em" height="1em" class="me-2 text-muted" name="calendar-event"></i-bs>
|
||||
<small>
|
||||
{{document.added | customDate:'mediumDate'}}
|
||||
</small>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -586,7 +586,9 @@ describe('DocumentListViewService', () => {
|
||||
`${environment.apiBaseUrl}documents/?page=1&page_size=50&ordering=-created&truncate_content=true`
|
||||
)
|
||||
expect(documentListViewService.displayFields).toEqual(
|
||||
DEFAULT_DISPLAY_FIELDS.map((f) => f.id)
|
||||
DEFAULT_DISPLAY_FIELDS.filter((f) => f.id !== DisplayField.ADDED).map(
|
||||
(f) => f.id
|
||||
)
|
||||
)
|
||||
})
|
||||
})
|
||||
|
@ -414,10 +414,13 @@ export class DocumentListViewService {
|
||||
}
|
||||
|
||||
get displayFields(): DisplayField[] {
|
||||
return (
|
||||
let fields =
|
||||
this.activeListViewState.displayFields ??
|
||||
DEFAULT_DISPLAY_FIELDS.map((f) => f.id)
|
||||
)
|
||||
if (!this.activeListViewState.displayFields) {
|
||||
fields = fields.filter((f) => f !== DisplayField.ADDED)
|
||||
}
|
||||
return fields
|
||||
}
|
||||
|
||||
set displayFields(fields: DisplayField[]) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user