add dossier template status column

This commit is contained in:
Dan Percic 2022-01-27 11:44:56 +02:00
parent 99ec008781
commit cf4b84c47d
16 changed files with 52 additions and 19 deletions

View File

@ -3,7 +3,7 @@
*ngIf="root || !!dossierTemplatesService.activeDossierTemplate" *ngIf="root || !!dossierTemplatesService.activeDossierTemplate"
[routerLink]="'/main/admin/dossier-templates'" [routerLink]="'/main/admin/dossier-templates'"
class="breadcrumb" class="breadcrumb"
translate="dossier-templates" translate="dossier-templates.label"
></a> ></a>
<mat-icon svgIcon="iqser:arrow-right"></mat-icon> <mat-icon svgIcon="iqser:arrow-right"></mat-icon>

View File

@ -40,6 +40,7 @@ export class DossierTemplatesListingScreenComponent extends ListingComponent<Dos
{ label: _('dossier-templates-listing.table-col-names.created-by'), class: 'user-column' }, { label: _('dossier-templates-listing.table-col-names.created-by'), class: 'user-column' },
{ label: _('dossier-templates-listing.table-col-names.created-on'), sortByKey: 'dateAdded' }, { label: _('dossier-templates-listing.table-col-names.created-on'), sortByKey: 'dateAdded' },
{ label: _('dossier-templates-listing.table-col-names.modified-on'), sortByKey: 'dateModified' }, { label: _('dossier-templates-listing.table-col-names.modified-on'), sortByKey: 'dateModified' },
{ label: _('dossier-templates-listing.table-col-names.status'), sortByKey: 'dossierTemplateStatus' },
]; ];
constructor( constructor(

View File

@ -11,6 +11,5 @@ const routes = [{ path: '', component: DossierTemplatesListingScreenComponent }]
@NgModule({ @NgModule({
declarations: [TableItemComponent, DossierTemplatesListingScreenComponent], declarations: [TableItemComponent, DossierTemplatesListingScreenComponent],
imports: [RouterModule.forChild(routes), CommonModule, SharedModule, SharedAdminModule], imports: [RouterModule.forChild(routes), CommonModule, SharedModule, SharedAdminModule],
providers: [],
}) })
export class DossierTemplatesListingModule {} export class DossierTemplatesListingModule {}

View File

@ -28,6 +28,12 @@
<div class="small-label"> <div class="small-label">
{{ dossierTemplate.dateModified | date: 'd MMM. yyyy' }} {{ dossierTemplate.dateModified | date: 'd MMM. yyyy' }}
</div> </div>
</div>
<div class="cell">
<div class="small-label">
{{ translations[dossierTemplate.dossierTemplateStatus] | translate }}
</div>
<redaction-dossier-template-actions <redaction-dossier-template-actions
[dossierTemplateId]="dossierTemplate.dossierTemplateId" [dossierTemplateId]="dossierTemplate.dossierTemplateId"
class="actions-container" class="actions-container"

View File

@ -3,6 +3,7 @@ import { DossierTemplate, DossierTemplateStats } from '@red/domain';
import { BehaviorSubject, Observable } from 'rxjs'; import { BehaviorSubject, Observable } from 'rxjs';
import { DossierTemplateStatsService } from '@services/entity-services/dossier-template-stats.service'; import { DossierTemplateStatsService } from '@services/entity-services/dossier-template-stats.service';
import { switchMap } from 'rxjs/operators'; import { switchMap } from 'rxjs/operators';
import { dossierTemplateStatusTranslations } from '../../../translations/dossier-template-status-translations';
@Component({ @Component({
selector: 'redaction-table-item [dossierTemplate]', selector: 'redaction-table-item [dossierTemplate]',
@ -13,6 +14,7 @@ import { switchMap } from 'rxjs/operators';
export class TableItemComponent implements OnChanges { export class TableItemComponent implements OnChanges {
@Input() dossierTemplate!: DossierTemplate; @Input() dossierTemplate!: DossierTemplate;
readonly translations = dossierTemplateStatusTranslations;
readonly stats$: Observable<DossierTemplateStats>; readonly stats$: Observable<DossierTemplateStats>;
private readonly _ngOnChanges$ = new BehaviorSubject<string>(undefined); private readonly _ngOnChanges$ = new BehaviorSubject<string>(undefined);

View File

@ -3,4 +3,4 @@ import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker';
export const adminSideNavTranslations = { export const adminSideNavTranslations = {
settings: _('admin-side-nav.settings'), settings: _('admin-side-nav.settings'),
dossierTemplates: _('admin-side-nav.dossier-templates'), dossierTemplates: _('admin-side-nav.dossier-templates'),
}; } as const;

View File

@ -1,6 +1,6 @@
import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker'; import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker';
export const auditCategoriesTranslations: { [key: string]: string } = { export const auditCategoriesTranslations = {
allCategories: _('audit-screen.categories.all-categories'), allCategories: _('audit-screen.categories.all-categories'),
LICENSE: _('audit-screen.categories.license'), LICENSE: _('audit-screen.categories.license'),
DOWNLOAD: _('audit-screen.categories.download'), DOWNLOAD: _('audit-screen.categories.download'),
@ -13,4 +13,4 @@ export const auditCategoriesTranslations: { [key: string]: string } = {
DOCUMENT: _('audit-screen.categories.document'), DOCUMENT: _('audit-screen.categories.document'),
AUDIT: _('audit-screen.categories.audit'), AUDIT: _('audit-screen.categories.audit'),
DOSSIER_TEMPLATE: _('audit-screen.categories.dossier-template'), DOSSIER_TEMPLATE: _('audit-screen.categories.dossier-template'),
}; } as const;

View File

@ -1,7 +1,7 @@
import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker'; import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker';
import { DefaultColorType } from '@red/domain'; import { DefaultColorType } from '@red/domain';
export const defaultColorsTranslations: { [key in DefaultColorType]: string } = { export const defaultColorsTranslations: { readonly [key in DefaultColorType]: string } = {
analysisColor: _('default-colors-screen.types.analysisColor'), analysisColor: _('default-colors-screen.types.analysisColor'),
defaultColor: _('default-colors-screen.types.defaultColor'), defaultColor: _('default-colors-screen.types.defaultColor'),
dictionaryRequestColor: _('default-colors-screen.types.dictionaryRequestColor'), dictionaryRequestColor: _('default-colors-screen.types.dictionaryRequestColor'),
@ -12,4 +12,4 @@ export const defaultColorsTranslations: { [key in DefaultColorType]: string } =
requestRemove: _('default-colors-screen.types.requestRemove'), requestRemove: _('default-colors-screen.types.requestRemove'),
updatedColor: _('default-colors-screen.types.updatedColor'), updatedColor: _('default-colors-screen.types.updatedColor'),
ignoredHintColor: _('default-colors-screen.types.ignoredHintColor'), ignoredHintColor: _('default-colors-screen.types.ignoredHintColor'),
}; } as const;

View File

@ -1,9 +1,9 @@
import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker'; import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker';
import { DossierAttributeConfigType } from '@red/domain'; import { DossierAttributeConfigType } from '@red/domain';
export const dossierAttributeTypesTranslations: { [key in DossierAttributeConfigType]: string } = { export const dossierAttributeTypesTranslations: { readonly [key in DossierAttributeConfigType]: string } = {
TEXT: _('dossier-attribute-types.text'), TEXT: _('dossier-attribute-types.text'),
NUMBER: _('dossier-attribute-types.number'), NUMBER: _('dossier-attribute-types.number'),
DATE: _('dossier-attribute-types.date'), DATE: _('dossier-attribute-types.date'),
IMAGE: _('dossier-attribute-types.image'), IMAGE: _('dossier-attribute-types.image'),
}; } as const;

View File

@ -0,0 +1,6 @@
import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker';
export const dossierTemplateStatusTranslations = {
ACTIVE: _('dossier-templates.status.active'),
INCOMPLETE: _('dossier-templates.status.incomplete'),
} as const;

View File

@ -1,8 +1,8 @@
import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker'; import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker';
import { FileAttributeConfigType } from '@red/domain'; import { FileAttributeConfigType } from '@red/domain';
export const fileAttributeTypesTranslations: { [key in FileAttributeConfigType]: string } = { export const fileAttributeTypesTranslations: { readonly [key in FileAttributeConfigType]: string } = {
TEXT: _('file-attribute-types.text'), TEXT: _('file-attribute-types.text'),
NUMBER: _('file-attribute-types.number'), NUMBER: _('file-attribute-types.number'),
DATE: _('file-attribute-types.date'), DATE: _('file-attribute-types.date'),
}; } as const;

View File

@ -1,11 +1,11 @@
import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker'; import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker';
export const placeholdersDescriptionsTranslations: { [key: string]: string } = { export const placeholdersDescriptionsTranslations = {
dossierAttributePlaceholders: _('reports-screen.descriptions.dossier-attributes'), dossierAttributePlaceholders: _('reports-screen.descriptions.dossier-attributes'),
fileAttributePlaceholders: _('reports-screen.descriptions.file-attributes'), fileAttributePlaceholders: _('reports-screen.descriptions.file-attributes'),
}; } as const;
export const generalPlaceholdersDescriptionsTranslations: { [key: string]: string } = { export const generalPlaceholdersDescriptionsTranslations = {
'file.name': _('reports-screen.descriptions.general.file.name'), 'file.name': _('reports-screen.descriptions.general.file.name'),
'redaction.page': _('reports-screen.descriptions.general.redaction.page'), 'redaction.page': _('reports-screen.descriptions.general.redaction.page'),
'redaction.paragraph': _('reports-screen.descriptions.general.redaction.paragraph'), 'redaction.paragraph': _('reports-screen.descriptions.general.redaction.paragraph'),
@ -18,4 +18,4 @@ export const generalPlaceholdersDescriptionsTranslations: { [key: string]: strin
'date.MM/dd/yyyy': _('reports-screen.descriptions.general.date.m-d-y'), 'date.MM/dd/yyyy': _('reports-screen.descriptions.general.date.m-d-y'),
'time.HH:mm': _('reports-screen.descriptions.general.time.h-m'), 'time.HH:mm': _('reports-screen.descriptions.general.time.h-m'),
'dossier.name': _('reports-screen.descriptions.general.dossier.name'), 'dossier.name': _('reports-screen.descriptions.general.dossier.name'),
}; } as const;

View File

@ -785,7 +785,14 @@
"under-review": "In Review", "under-review": "In Review",
"upload-files": "Sie können Dateien überall per Drag and Drop platzieren..." "upload-files": "Sie können Dateien überall per Drag and Drop platzieren..."
}, },
"dossier-templates": "Dossier-Vorlagen", "dossier-templates": {
"label": "Dossier-Vorlagen",
"status": {
"label": "",
"active": "",
"incomplete": ""
}
},
"dossier-templates-listing": { "dossier-templates-listing": {
"action": { "action": {
"delete": "Dossier-Vorlage", "delete": "Dossier-Vorlage",
@ -811,7 +818,8 @@
"created-by": "Erstellt von", "created-by": "Erstellt von",
"created-on": "Erstellt am", "created-on": "Erstellt am",
"modified-on": "Geändert am", "modified-on": "Geändert am",
"name": "Name" "name": "Name",
"status": ""
}, },
"table-header": { "table-header": {
"title": "{length} {length, plural, one{Dossier-Vorlage} other{Dossier-Vorlagen}}" "title": "{length} {length, plural, one{Dossier-Vorlage} other{Dossier-Vorlagen}}"

View File

@ -801,7 +801,14 @@
"entries": "{count} {count, plural, one{entry} other{entries}}", "entries": "{count} {count, plural, one{entry} other{entries}}",
"modified-on": "Modified on: {date}" "modified-on": "Modified on: {date}"
}, },
"dossier-templates": "Dossier Templates", "dossier-templates": {
"label": "Dossier Templates",
"status": {
"label": "Status",
"active": "Active",
"incomplete": "Incomplete"
}
},
"dossier-templates-listing": { "dossier-templates-listing": {
"action": { "action": {
"delete": "Delete Template", "delete": "Delete Template",
@ -827,7 +834,8 @@
"created-by": "Created by", "created-by": "Created by",
"created-on": "Created on", "created-on": "Created on",
"modified-on": "Modified on", "modified-on": "Modified on",
"name": "Name" "name": "Name",
"status": "Status"
}, },
"table-header": { "table-header": {
"title": "{length} dossier {length, plural, one{template} other{templates}}" "title": "{length} dossier {length, plural, one{template} other{templates}}"

View File

@ -14,6 +14,7 @@ export class DossierTemplate implements IDossierTemplate, IListable {
readonly reportTemplateIds?: List; readonly reportTemplateIds?: List;
readonly validFrom?: string; readonly validFrom?: string;
readonly validTo?: string; readonly validTo?: string;
readonly dossierTemplateStatus: string;
constructor(dossierTemplate: IDossierTemplate) { constructor(dossierTemplate: IDossierTemplate) {
this.createdBy = dossierTemplate.createdBy; this.createdBy = dossierTemplate.createdBy;
@ -27,6 +28,7 @@ export class DossierTemplate implements IDossierTemplate, IListable {
this.reportTemplateIds = dossierTemplate.reportTemplateIds; this.reportTemplateIds = dossierTemplate.reportTemplateIds;
this.validFrom = dossierTemplate.validFrom; this.validFrom = dossierTemplate.validFrom;
this.validTo = dossierTemplate.validTo; this.validTo = dossierTemplate.validTo;
this.dossierTemplateStatus = dossierTemplate.dossierTemplateStatus;
} }
get id(): string { get id(): string {

View File

@ -46,4 +46,5 @@ export interface IDossierTemplate {
* Validity of end this dossierTemplate. * Validity of end this dossierTemplate.
*/ */
readonly validTo?: string; readonly validTo?: string;
readonly dossierTemplateStatus: string;
} }