mirror of
https://gitlab.com/openstapps/openstapps.git
synced 2026-01-20 08:33:11 +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,9 @@
|
||||
* 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 {SCEvent, SCEventWithoutReferences} from '../base/Event';
|
||||
import {SCEvent, SCEventMeta, SCEventWithoutReferences} from '../base/Event';
|
||||
import {SCThingMeta, SCThingType} from '../Thing';
|
||||
import {SCMetaTranslations} from '../types/i18n';
|
||||
|
||||
/**
|
||||
* A sport course without references
|
||||
@@ -38,13 +39,36 @@ export interface SCSportCourse extends SCEvent, SCSportCourseWithoutReferences {
|
||||
}
|
||||
|
||||
/**
|
||||
* Sport course meta data
|
||||
* Meta information about a sport course
|
||||
*/
|
||||
export class SCSportCourseMeta extends SCThingMeta {
|
||||
static fieldValueTranslations = {
|
||||
...SCThingMeta.fieldValueTranslations,
|
||||
export class SCSportCourseMeta extends SCThingMeta implements SCMetaTranslations<SCSportCourse> {
|
||||
/**
|
||||
* Translations of fields
|
||||
*/
|
||||
fieldTranslations = {
|
||||
de: {
|
||||
... SCThingMeta.getInstance().fieldTranslations.de,
|
||||
... SCEventMeta.getInstance().fieldTranslations.de,
|
||||
},
|
||||
en: {
|
||||
... SCThingMeta.getInstance().fieldTranslations.en,
|
||||
... SCEventMeta.getInstance().fieldTranslations.en,
|
||||
},
|
||||
};
|
||||
|
||||
/**
|
||||
* Translations of values of fields
|
||||
*/
|
||||
fieldValueTranslations = {
|
||||
de: {
|
||||
... SCThingMeta.getInstance().fieldValueTranslations.de,
|
||||
... SCEventMeta.getInstance().fieldValueTranslations.de,
|
||||
type: 'Sportkurs',
|
||||
},
|
||||
en: {
|
||||
... SCThingMeta.getInstance().fieldValueTranslations.en,
|
||||
... SCEventMeta.getInstance().fieldValueTranslations.en,
|
||||
type: SCThingType.SportCourse,
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user