refactor: move to eslint

This commit is contained in:
Rainer Killinger
2022-08-17 16:02:34 +02:00
parent c1dc7b4e8f
commit f864c64efa
92 changed files with 2287 additions and 1871 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2019 StApps
* Copyright (C) 2019-2022 Open StApps
* This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
* Software Foundation, version 3.
@@ -35,7 +35,7 @@ import {
* Categories of a room
*/
export type SCRoomCategories =
'cafe'
| 'cafe'
| 'canteen'
| 'computer'
| 'education'
@@ -53,7 +53,8 @@ export type SCRoomCategories =
* A room without references
*/
export interface SCRoomWithoutReferences
extends SCPlaceWithoutReferences, SCThingThatAcceptsPaymentsWithoutReferences,
extends SCPlaceWithoutReferences,
SCThingThatAcceptsPaymentsWithoutReferences,
SCThingWithCategoriesWithoutReferences<SCRoomCategories, SCRoomSpecificValues> {
/**
* The name of the floor in which the room is in.
@@ -88,7 +89,10 @@ export interface SCRoomWithoutReferences
* @indexable
*/
export interface SCRoom
extends SCRoomWithoutReferences, SCThingInPlace, SCThingThatAcceptsPayments, SCPlace,
extends SCRoomWithoutReferences,
SCThingInPlace,
SCThingThatAcceptsPayments,
SCPlace,
SCThingWithCategories<SCRoomCategories, SCRoomSpecificValues> {
/**
* Translations of specific values of the object
@@ -106,8 +110,7 @@ export interface SCRoom
/**
* Category specific values of a room
*/
export interface SCRoomSpecificValues
extends SCThingWithCategoriesSpecificValues {
export interface SCRoomSpecificValues extends SCThingWithCategoriesSpecificValues {
/**
* Category specific opening hours of the room
*
@@ -119,32 +122,26 @@ export interface SCRoomSpecificValues
/**
* Meta information about a place
*/
export class SCRoomMeta
extends SCThingMeta
implements SCMetaTranslations<SCRoom> {
export class SCRoomMeta extends SCThingMeta implements SCMetaTranslations<SCRoom> {
/**
* Translations of fields
*/
fieldTranslations = {
de: {
...new SCPlaceWithoutReferencesMeta().fieldTranslations.de,
...new SCThingThatAcceptsPaymentsWithoutReferencesMeta()
...new SCThingThatAcceptsPaymentsWithoutReferencesMeta().fieldTranslations.de,
...new SCThingWithCategoriesWithoutReferencesMeta<SCRoomCategories, SCRoomSpecificValues>()
.fieldTranslations.de,
...new SCThingWithCategoriesWithoutReferencesMeta<SCRoomCategories,
SCRoomSpecificValues>().fieldTranslations.de,
...new SCThingInPlaceMeta().fieldTranslations
.de,
...new SCThingInPlaceMeta().fieldTranslations.de,
floorName: 'Etagenbezeichnung',
inventory: 'Bestand',
},
en: {
...new SCPlaceWithoutReferencesMeta().fieldTranslations.en,
...new SCThingThatAcceptsPaymentsWithoutReferencesMeta()
...new SCThingThatAcceptsPaymentsWithoutReferencesMeta().fieldTranslations.en,
...new SCThingWithCategoriesWithoutReferencesMeta<SCRoomCategories, SCRoomSpecificValues>()
.fieldTranslations.en,
...new SCThingWithCategoriesWithoutReferencesMeta<SCRoomCategories,
SCRoomSpecificValues>().fieldTranslations.en,
...new SCThingInPlaceMeta().fieldTranslations
.en,
...new SCThingInPlaceMeta().fieldTranslations.en,
floorName: 'floor name',
inventory: 'inventory',
},
@@ -156,12 +153,10 @@ export class SCRoomMeta
fieldValueTranslations = {
de: {
...new SCPlaceWithoutReferencesMeta().fieldValueTranslations.de,
...new SCThingThatAcceptsPaymentsWithoutReferencesMeta()
.fieldValueTranslations.de,
...new SCThingWithCategoriesWithoutReferencesMeta<SCRoomCategories,
SCRoomSpecificValues>().fieldValueTranslations.de,
...new SCThingInPlaceMeta()
...new SCThingThatAcceptsPaymentsWithoutReferencesMeta().fieldValueTranslations.de,
...new SCThingWithCategoriesWithoutReferencesMeta<SCRoomCategories, SCRoomSpecificValues>()
.fieldValueTranslations.de,
...new SCThingInPlaceMeta().fieldValueTranslations.de,
categories: {
'cafe': 'Café',
'canteen': 'Kantine',
@@ -181,12 +176,10 @@ export class SCRoomMeta
},
en: {
...new SCPlaceWithoutReferencesMeta().fieldValueTranslations.en,
...new SCThingThatAcceptsPaymentsWithoutReferencesMeta()
.fieldValueTranslations.en,
...new SCThingWithCategoriesWithoutReferencesMeta<SCRoomCategories,
SCRoomSpecificValues>().fieldValueTranslations.en,
...new SCThingInPlaceMeta()
...new SCThingThatAcceptsPaymentsWithoutReferencesMeta().fieldValueTranslations.en,
...new SCThingWithCategoriesWithoutReferencesMeta<SCRoomCategories, SCRoomSpecificValues>()
.fieldValueTranslations.en,
...new SCThingInPlaceMeta().fieldValueTranslations.en,
type: SCThingType.Room,
},
};