Refactor pages_count --> page_count

This commit is contained in:
shamoon
2024-09-25 00:35:14 -07:00
parent 9b13c607db
commit 693ce6553d
21 changed files with 64 additions and 64 deletions

View File

@@ -65,7 +65,7 @@ const savedView: SavedView = {
DisplayField.CORRESPONDENT,
DisplayField.DOCUMENT_TYPE,
DisplayField.STORAGE_PATH,
DisplayField.PAGES_COUNT,
DisplayField.PAGE_COUNT,
`${DisplayField.CUSTOM_FIELD}11` as any,
`${DisplayField.CUSTOM_FIELD}15` as any,
],
@@ -345,7 +345,7 @@ describe('SavedViewWidgetComponent', () => {
expect(component.getColumnTitle(DisplayField.STORAGE_PATH)).toEqual(
'Storage path'
)
expect(component.getColumnTitle(DisplayField.PAGES_COUNT)).toEqual('Pages')
expect(component.getColumnTitle(DisplayField.PAGE_COUNT)).toEqual('Pages')
})
it('should get correct column title for custom field', () => {

View File

@@ -111,10 +111,10 @@
</div>
}
}
@if (displayFields.includes(DisplayField.PAGES_COUNT) && document.pages_count) {
@if (displayFields.includes(DisplayField.PAGE_COUNT) && document.page_count) {
<div class="list-group-item bg-light text-dark p-1 border-0 d-flex align-items-center">
<i-bs width=".9em" height=".9em" class="me-2 text-muted" name="files"></i-bs>
<small i18n>{document.pages_count, plural, =1 {1 page} other {{{document.pages_count}} pages}}</small>
<small i18n>{document.page_count, plural, =1 {1 page} other {{{document.page_count}} pages}}</small>
</div>
}
@if (displayFields.includes(DisplayField.OWNER) && document.owner && document.owner !== settingsService.currentUser.id) {

View File

@@ -31,7 +31,7 @@ const doc = {
correspondent: 8,
document_type: 10,
storage_path: null,
pages_count: 8,
page_count: 8,
notes: [
{
id: 11,

View File

@@ -88,11 +88,11 @@
</div>
</div>
}
@if (displayFields.includes(DisplayField.PAGES_COUNT) && document.pages_count) {
@if (displayFields.includes(DisplayField.PAGE_COUNT) && document.page_count) {
<div class="list-group-item bg-transparent p-0 border-0 d-flex flex-wrap-reverse justify-content-between">
<div class="ps-0 p-1" placement="top">
<i-bs width="1em" height="1em" class="me-2 text-muted" name="files"></i-bs>
<small i18n>{document.pages_count, plural, =1 {1 page} other {{{document.pages_count}} pages}}</small>
<small i18n>{document.page_count, plural, =1 {1 page} other {{{document.page_count}} pages}}</small>
</div>
</div>
}

View File

@@ -34,7 +34,7 @@ const doc = {
correspondent: 8,
document_type: 10,
storage_path: null,
pages_count: 12,
page_count: 12,
notes: [
{
id: 11,

View File

@@ -246,9 +246,9 @@
(sort)="onSort($event)"
i18n>Added</th>
}
@if (activeDisplayFields.includes(DisplayField.PAGES_COUNT)) {
@if (activeDisplayFields.includes(DisplayField.PAGE_COUNT)) {
<th class="cursor-pointer"
pngxSortable="pages_count"
pngxSortable="page_count"
title="Sort by number of pages" i18n-title
[currentSortField]="list.sortField"
[currentSortReverse]="list.sortReverse"
@@ -339,9 +339,9 @@
{{d.added | customDate}}
</td>
}
@if (activeDisplayFields.includes(DisplayField.PAGES_COUNT)) {
@if (activeDisplayFields.includes(DisplayField.PAGE_COUNT)) {
<td>
{{ d.pages_count }}
{{ d.page_count }}
</td>
}
@if (activeDisplayFields.includes(DisplayField.SHARED)) {

View File

@@ -26,7 +26,7 @@ export enum DisplayField {
OWNER = 'owner',
SHARED = 'shared',
ASN = 'asn',
PAGES_COUNT = 'pagescount',
PAGE_COUNT = 'pagecount',
}
export const DEFAULT_DISPLAY_FIELDS = [
@@ -75,7 +75,7 @@ export const DEFAULT_DISPLAY_FIELDS = [
name: $localize`ASN`,
},
{
id: DisplayField.PAGES_COUNT,
id: DisplayField.PAGE_COUNT,
name: $localize`Pages`,
},
]
@@ -99,7 +99,7 @@ export const DOCUMENT_SORT_FIELDS = [
{ field: 'modified', name: $localize`Modified` },
{ field: 'num_notes', name: $localize`Notes` },
{ field: 'owner', name: $localize`Owner` },
{ field: 'pages_count', name: $localize`Pages` },
{ field: 'page_count', name: $localize`Pages` },
]
export const DOCUMENT_SORT_FIELDS_FULLTEXT = [
@@ -171,5 +171,5 @@ export interface Document extends ObjectWithPermissions {
// write-only field
remove_inbox_tags?: boolean
pages_count?: number
page_count?: number
}

View File

@@ -345,7 +345,7 @@ export class SettingsService {
DisplayField.CREATED,
DisplayField.ADDED,
DisplayField.ASN,
DisplayField.PAGES_COUNT,
DisplayField.PAGE_COUNT,
DisplayField.SHARED,
].includes(field.id)
) {