mirror of
https://gitlab.com/openstapps/openstapps.git
synced 2026-01-21 09:03:02 +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
@@ -13,9 +13,9 @@
|
||||
* this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
import {Feature, FeatureCollection, GeometryObject, LineString} from 'geojson';
|
||||
import {SCThingInPlace} from '../base/ThingInPlace';
|
||||
import {SCThingInPlace, SCThingInPlaceMeta} from '../base/ThingInPlace';
|
||||
import {SCThing, SCThingMeta, SCThingTranslatableProperties, SCThingType} from '../Thing';
|
||||
import {SCTranslations} from '../types/i18n';
|
||||
import {SCMetaTranslations, SCTranslations} from '../types/i18n';
|
||||
import {SCPointOfInterestWithoutReferences} from './PointOfInterest';
|
||||
import {SCRoomWithoutReferences} from './Room';
|
||||
|
||||
@@ -61,12 +61,6 @@ export interface SCFloor extends SCFloorWithoutReferences, SCThingInPlace {
|
||||
type: SCThingType.Floor;
|
||||
}
|
||||
|
||||
/**
|
||||
* Meta information about a floor
|
||||
*/
|
||||
export class SCFloorMeta extends SCThingMeta {
|
||||
}
|
||||
|
||||
/**
|
||||
* A feature collection
|
||||
*/
|
||||
@@ -98,3 +92,34 @@ export interface SCFloorTranslatableProperties extends SCThingTranslatableProper
|
||||
*/
|
||||
floorName?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* Meta information about floors
|
||||
*/
|
||||
export class SCFloorMeta extends SCThingMeta implements SCMetaTranslations<SCFloor> {
|
||||
/**
|
||||
* Translations of fields
|
||||
*/
|
||||
fieldTranslations = {
|
||||
de: {
|
||||
... SCThingInPlaceMeta.getInstance().fieldTranslations.de,
|
||||
},
|
||||
en: {
|
||||
... SCThingInPlaceMeta.getInstance().fieldTranslations.en,
|
||||
},
|
||||
};
|
||||
|
||||
/**
|
||||
* Translations of values of fields
|
||||
*/
|
||||
fieldValueTranslations = {
|
||||
de: {
|
||||
... SCThingInPlaceMeta.getInstance().fieldValueTranslations.de,
|
||||
type: 'Etage',
|
||||
},
|
||||
en: {
|
||||
... SCThingInPlaceMeta.getInstance().fieldValueTranslations.en,
|
||||
type: SCThingType.Floor,
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user