mirror of
https://gitlab.com/openstapps/openstapps.git
synced 2026-01-21 00:52:55 +00:00
refactor: change meta class structure to include types.
Introduce requiredness of translations via implemented interface.
This commit is contained in:
committed by
Karl-Philipp Wulfert
parent
90e3d22399
commit
62975b9ded
@@ -15,6 +15,7 @@
|
||||
import * as jsonpatch from 'json-patch';
|
||||
import {SCThingsWithoutDiff} from '../Classes';
|
||||
import {SCThing, SCThingMeta, SCThingType} from '../Thing';
|
||||
import {SCMetaTranslations} from '../types/i18n';
|
||||
import {SCISO8601Date} from '../types/Time';
|
||||
|
||||
/**
|
||||
@@ -60,15 +61,40 @@ export interface SCDiff extends SCDiffWithoutReferences {
|
||||
}
|
||||
|
||||
/**
|
||||
* Diff meta data
|
||||
* Meta information about a diff
|
||||
*/
|
||||
export class SCDiffMeta extends SCThingMeta {
|
||||
static fieldTranslations = {
|
||||
...SCThingMeta.fieldTranslations,
|
||||
export class SCDiffMeta extends SCThingMeta implements SCMetaTranslations<SCDiff> {
|
||||
/**
|
||||
* Set type definiton for singleton instance
|
||||
*/
|
||||
protected static _instance: SCThingMeta;
|
||||
|
||||
/**
|
||||
* Translations of fields
|
||||
*/
|
||||
fieldTranslations = {
|
||||
de: {
|
||||
... SCThingMeta.getInstance().fieldTranslations.de,
|
||||
action: 'Aktion',
|
||||
changes: 'Änderungen',
|
||||
dateCreated: 'Erstellungsdatum',
|
||||
},
|
||||
en: {
|
||||
... SCThingMeta.getInstance().fieldTranslations.en,
|
||||
},
|
||||
};
|
||||
|
||||
/**
|
||||
* Translations of values of fields
|
||||
*/
|
||||
fieldValueTranslations = {
|
||||
de: {
|
||||
... SCThingMeta.getInstance().fieldValueTranslations.de,
|
||||
type: 'Unterschied',
|
||||
},
|
||||
en: {
|
||||
... SCThingMeta.getInstance().fieldValueTranslations.en,
|
||||
type: SCThingType.Diff,
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user