mirror of
https://gitlab.com/openstapps/openstapps.git
synced 2026-01-20 00:23:03 +00:00
refactor: apply new eslint rules
This commit is contained in:
@@ -1,19 +1,64 @@
|
||||
<div [ngSwitch]="item.type">
|
||||
<stapps-article-detail-content [item]="item" *ngSwitchCase="'article'"></stapps-article-detail-content>
|
||||
<stapps-catalog-detail-content [item]="item" *ngSwitchCase="'catalog'"></stapps-catalog-detail-content>
|
||||
<stapps-date-series-detail-content [item]="item" *ngSwitchCase="'date series'"></stapps-date-series-detail-content>
|
||||
<stapps-dish-detail-content [item]="item" *ngSwitchCase="'dish'"></stapps-dish-detail-content>
|
||||
<stapps-event-detail-content [item]="item" *ngSwitchCase="'academic event'"></stapps-event-detail-content>
|
||||
<stapps-event-detail-content [item]="item" *ngSwitchCase="'sport course'"></stapps-event-detail-content>
|
||||
<stapps-favorite-detail-content [item]="item" *ngSwitchCase="'favorite'"></stapps-favorite-detail-content>
|
||||
<stapps-message-detail-content [item]="item" *ngSwitchCase="'message'"></stapps-message-detail-content>
|
||||
<stapps-person-detail-content [item]="item" *ngSwitchCase="'person'"></stapps-person-detail-content>
|
||||
<stapps-place-detail-content [item]="item" *ngSwitchCase="'building'"></stapps-place-detail-content>
|
||||
<stapps-place-detail-content [item]="item" *ngSwitchCase="'floor'"></stapps-place-detail-content>
|
||||
<stapps-place-detail-content [item]="item" *ngSwitchCase="'point of interest'"></stapps-place-detail-content>
|
||||
<stapps-place-detail-content [item]="item" *ngSwitchCase="'room'"></stapps-place-detail-content>
|
||||
<stapps-semester-detail-content [item]="item" *ngSwitchCase="'semester'"></stapps-semester-detail-content>
|
||||
<stapps-video-detail-content [item]="item" *ngSwitchCase="'video'"></stapps-video-detail-content>
|
||||
<stapps-article-detail-content
|
||||
[item]="item"
|
||||
*ngSwitchCase="'article'"
|
||||
></stapps-article-detail-content>
|
||||
<stapps-catalog-detail-content
|
||||
[item]="item"
|
||||
*ngSwitchCase="'catalog'"
|
||||
></stapps-catalog-detail-content>
|
||||
<stapps-date-series-detail-content
|
||||
[item]="item"
|
||||
*ngSwitchCase="'date series'"
|
||||
></stapps-date-series-detail-content>
|
||||
<stapps-dish-detail-content
|
||||
[item]="item"
|
||||
*ngSwitchCase="'dish'"
|
||||
></stapps-dish-detail-content>
|
||||
<stapps-event-detail-content
|
||||
[item]="item"
|
||||
*ngSwitchCase="'academic event'"
|
||||
></stapps-event-detail-content>
|
||||
<stapps-event-detail-content
|
||||
[item]="item"
|
||||
*ngSwitchCase="'sport course'"
|
||||
></stapps-event-detail-content>
|
||||
<stapps-favorite-detail-content
|
||||
[item]="item"
|
||||
*ngSwitchCase="'favorite'"
|
||||
></stapps-favorite-detail-content>
|
||||
<stapps-message-detail-content
|
||||
[item]="item"
|
||||
*ngSwitchCase="'message'"
|
||||
></stapps-message-detail-content>
|
||||
<stapps-person-detail-content
|
||||
[item]="item"
|
||||
*ngSwitchCase="'person'"
|
||||
></stapps-person-detail-content>
|
||||
<stapps-place-detail-content
|
||||
[item]="item"
|
||||
*ngSwitchCase="'building'"
|
||||
></stapps-place-detail-content>
|
||||
<stapps-place-detail-content
|
||||
[item]="item"
|
||||
*ngSwitchCase="'floor'"
|
||||
></stapps-place-detail-content>
|
||||
<stapps-place-detail-content
|
||||
[item]="item"
|
||||
*ngSwitchCase="'point of interest'"
|
||||
></stapps-place-detail-content>
|
||||
<stapps-place-detail-content
|
||||
[item]="item"
|
||||
*ngSwitchCase="'room'"
|
||||
></stapps-place-detail-content>
|
||||
<stapps-semester-detail-content
|
||||
[item]="item"
|
||||
*ngSwitchCase="'semester'"
|
||||
></stapps-semester-detail-content>
|
||||
<stapps-video-detail-content
|
||||
[item]="item"
|
||||
*ngSwitchCase="'video'"
|
||||
></stapps-video-detail-content>
|
||||
<ng-container *ngSwitchDefault>
|
||||
<ion-item class="ion-text-wrap" lines="inset">
|
||||
<ion-thumbnail slot="start" class="ion-margin-end">
|
||||
@@ -23,14 +68,18 @@
|
||||
<ion-row>
|
||||
<ion-col>
|
||||
<div class="ion-text-wrap">
|
||||
<h2 class="name">{{item.name}}</h2>
|
||||
<ion-note>{{item.type}}</ion-note>
|
||||
<h2 class="name">{{ item.name }}</h2>
|
||||
<ion-note>{{ item.type }}</ion-note>
|
||||
</div>
|
||||
</ion-col>
|
||||
</ion-row>
|
||||
</ion-grid>
|
||||
</ion-item>
|
||||
<stapps-simple-card *ngIf="item.description" [title]="'description' | propertyNameTranslate: item | titlecase" [content]="'description' | thingTranslate: item"></stapps-simple-card>
|
||||
<stapps-simple-card
|
||||
*ngIf="item.description"
|
||||
[title]="'description' | propertyNameTranslate: item | titlecase"
|
||||
[content]="'description' | thingTranslate: item"
|
||||
></stapps-simple-card>
|
||||
</ng-container>
|
||||
</div>
|
||||
<stapps-origin-detail [origin]="item.origin" ></stapps-origin-detail>
|
||||
<stapps-origin-detail [origin]="item.origin"></stapps-origin-detail>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<div *ngIf="origin.type === 'user'">
|
||||
<p>{{origin.created | dateFormat}}</p>
|
||||
<p>{{ origin.created | dateFormat }}</p>
|
||||
</div>
|
||||
|
||||
<div *ngIf="origin.type === 'remote'">
|
||||
<p>{{origin.indexed | dateFormat}}</p>
|
||||
<p>{{ origin.indexed | dateFormat }}</p>
|
||||
</div>
|
||||
|
||||
@@ -42,9 +42,7 @@ export class PlaceDetailContentComponent {
|
||||
*
|
||||
* @param item TODO
|
||||
*/
|
||||
// tslint:disable-next-line:completed-docs prefer-function-over-method
|
||||
hasCategories(item: SCThings): item is SCThings & {categories: string[]} {
|
||||
// tslint:disable-next-line:completed-docs
|
||||
return typeof (item as {categories: string[]}).categories !== 'undefined';
|
||||
}
|
||||
|
||||
|
||||
@@ -2,26 +2,28 @@
|
||||
<ion-row>
|
||||
<ion-col>
|
||||
<div class="ion-text-wrap">
|
||||
<ion-label>{{'name' | thingTranslate: item}}</ion-label>
|
||||
<ion-label>{{ 'name' | thingTranslate: item }}</ion-label>
|
||||
<ng-container *ngIf="item.type !== 'floor'">
|
||||
<p>
|
||||
<ion-note *ngIf="item.openingHours">
|
||||
{{item.openingHours | openingHours}}
|
||||
{{ item.openingHours | openingHours }}
|
||||
</ion-note>
|
||||
</p>
|
||||
<p>
|
||||
<ion-note *ngIf="item.categories && item.type !== 'building'; else onlyType">
|
||||
{{'categories' | thingTranslate: item | join:', ' | titlecase }}
|
||||
<ion-note
|
||||
*ngIf="item.categories && item.type !== 'building'; else onlyType"
|
||||
>
|
||||
{{ 'categories' | thingTranslate: item | join: ', ' | titlecase }}
|
||||
</ion-note>
|
||||
</p>
|
||||
<ng-template #onlyType>
|
||||
<ion-note>
|
||||
{{'type' | thingTranslate: item}}
|
||||
{{ 'type' | thingTranslate: item }}
|
||||
</ion-note>
|
||||
</ng-template>
|
||||
</ng-container>
|
||||
<p *ngIf="item.description">
|
||||
{{'description' | thingTranslate: item}}
|
||||
{{ 'description' | thingTranslate: item }}
|
||||
</p>
|
||||
<ion-note>
|
||||
<ul>
|
||||
@@ -36,7 +38,8 @@
|
||||
</ion-col>
|
||||
<div *ngIf="item.type !== 'building'">
|
||||
<ion-col width-20 text-right *ngIf="item.inPlace">
|
||||
<ion-icon name="location"></ion-icon>{{'name' | thingTranslate: item.inPlace}}
|
||||
<ion-icon name="location"></ion-icon
|
||||
>{{ 'name' | thingTranslate: item.inPlace }}
|
||||
</ion-col>
|
||||
</div>
|
||||
</ion-row>
|
||||
|
||||
@@ -57,8 +57,7 @@ export class PlaceMensaDetailComponent implements AfterViewInit {
|
||||
startingDay: Moment;
|
||||
|
||||
constructor(private readonly mensaService: PlaceMensaService) {
|
||||
this.startingDay = moment()
|
||||
.startOf('day');
|
||||
this.startingDay = moment().startOf('day');
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -66,7 +65,7 @@ export class PlaceMensaDetailComponent implements AfterViewInit {
|
||||
*/
|
||||
ngAfterViewInit() {
|
||||
this.dishes = this.mensaService.getAllDishes(this.item, this.displayRange);
|
||||
this.dishes.then((result) => {
|
||||
this.dishes.then(result => {
|
||||
for (const [key, value] of Object.entries(result)) {
|
||||
if (value.length === 0) {
|
||||
delete result[key];
|
||||
|
||||
@@ -1,9 +1,16 @@
|
||||
<ng-container>
|
||||
<div *ngIf="dishes | async as dishes; else loading">
|
||||
<ion-segment [(ngModel)]="selectedDay" mode="md">
|
||||
<ion-segment-button *ngFor="let day of dishes | keyvalue" [value]="day.key">
|
||||
<ion-label class="ion-hide-sm-down">{{day.key | dateFormat:'weekday:long,month:numeric,day:numeric'}}</ion-label>
|
||||
<ion-label class="ion-hide-sm-up">{{day.key | dateFormat:'weekday:short,month:numeric,day:numeric' }}</ion-label>
|
||||
<ion-segment-button
|
||||
*ngFor="let day of dishes | keyvalue"
|
||||
[value]="day.key"
|
||||
>
|
||||
<ion-label class="ion-hide-sm-down">{{
|
||||
day.key | dateFormat: 'weekday:long,month:numeric,day:numeric'
|
||||
}}</ion-label>
|
||||
<ion-label class="ion-hide-sm-up">{{
|
||||
day.key | dateFormat: 'weekday:short,month:numeric,day:numeric'
|
||||
}}</ion-label>
|
||||
</ion-segment-button>
|
||||
</ion-segment>
|
||||
<div [ngSwitch]="selectedDay">
|
||||
|
||||
@@ -5,7 +5,10 @@
|
||||
<h2 class="name">{{ 'name' | thingTranslate: item }}</h2>
|
||||
<p>
|
||||
<ion-icon name="calendar"></ion-icon>
|
||||
<span>{{item.startDate | dateFormat}} - {{item.endDate | dateFormat}}</span>
|
||||
<span
|
||||
>{{ item.startDate | dateFormat }} -
|
||||
{{ item.endDate | dateFormat }}</span
|
||||
>
|
||||
</p>
|
||||
<ion-note>{{ 'type' | thingTranslate: item }}</ion-note>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user