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
@@ -12,8 +12,12 @@
|
||||
* You should have received a copy of the GNU General Public License along with
|
||||
* this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
import {SCThingWithCategoriesSpecificValues, SCThingWithCategoriesWithoutReferences} from '../base/ThingWithCategories';
|
||||
import {
|
||||
SCThingWithCategoriesSpecificValues,
|
||||
SCThingWithCategoriesWithoutReferences,
|
||||
SCThingWithCategoriesWithoutReferencesMeta} from '../base/ThingWithCategories';
|
||||
import {SCThingMeta, SCThingType} from '../Thing';
|
||||
import {SCMetaTranslations} from '../types/i18n';
|
||||
import {SCISO8601Date} from '../types/Time';
|
||||
|
||||
/**
|
||||
@@ -60,7 +64,36 @@ export enum SCToDoPriority {
|
||||
}
|
||||
|
||||
/**
|
||||
* "To do" meta data
|
||||
* Meta information about todo
|
||||
*/
|
||||
export class SCToDoMeta extends SCThingMeta {
|
||||
export class SCToDoMeta extends SCThingMeta implements SCMetaTranslations<SCToDo> {
|
||||
/**
|
||||
* Translations of fields
|
||||
*/
|
||||
fieldTranslations = {
|
||||
de: {
|
||||
... SCThingWithCategoriesWithoutReferencesMeta.getInstance<string,
|
||||
SCThingWithCategoriesSpecificValues>().fieldTranslations.de,
|
||||
},
|
||||
en: {
|
||||
... SCThingWithCategoriesWithoutReferencesMeta.getInstance<string,
|
||||
SCThingWithCategoriesSpecificValues>().fieldTranslations.en,
|
||||
},
|
||||
};
|
||||
|
||||
/**
|
||||
* Translations of values of fields
|
||||
*/
|
||||
fieldValueTranslations = {
|
||||
de: {
|
||||
... SCThingWithCategoriesWithoutReferencesMeta.getInstance<string,
|
||||
SCThingWithCategoriesSpecificValues>().fieldValueTranslations.de,
|
||||
type: 'ToDo',
|
||||
},
|
||||
en: {
|
||||
... SCThingWithCategoriesWithoutReferencesMeta.getInstance<string,
|
||||
SCThingWithCategoriesSpecificValues>().fieldValueTranslations.en,
|
||||
type: SCThingType.ToDo,
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user