mirror of
https://gitlab.com/openstapps/openstapps.git
synced 2026-03-12 09:42:27 +00:00
refactor: replace TSLint with ESLint
This commit is contained in:
committed by
Jovan Krunić
parent
67fb4a43c9
commit
d696215d08
@@ -1,41 +1,57 @@
|
||||
<ion-card>
|
||||
<ion-card-header>{{'data.detail.address.TITLE' | translate | titlecase}}</ion-card-header>
|
||||
<ion-card-header>{{
|
||||
'data.detail.address.TITLE' | translate | titlecase
|
||||
}}</ion-card-header>
|
||||
<ion-card-content>
|
||||
<ion-grid>
|
||||
<ion-row>
|
||||
<ion-col>{{'data.detail.address.STREET' | translate | titlecase}}:</ion-col>
|
||||
<ion-col
|
||||
>{{ 'data.detail.address.STREET' | translate | titlecase }}:</ion-col
|
||||
>
|
||||
<ion-col width-60 text-right>
|
||||
{{address.streetAddress}}
|
||||
{{ address.streetAddress }}
|
||||
</ion-col>
|
||||
</ion-row>
|
||||
<ion-row>
|
||||
<ion-col>{{'data.detail.address.POSTCODE' | translate | titlecase}}:</ion-col>
|
||||
<ion-col
|
||||
>{{
|
||||
'data.detail.address.POSTCODE' | translate | titlecase
|
||||
}}:</ion-col
|
||||
>
|
||||
<ion-col width-60 text-right>
|
||||
{{address.postalCode}}
|
||||
{{ address.postalCode }}
|
||||
</ion-col>
|
||||
</ion-row>
|
||||
<ion-row>
|
||||
<ion-col>{{'data.detail.address.CITY' | translate | titlecase}}:</ion-col>
|
||||
<ion-col
|
||||
>{{ 'data.detail.address.CITY' | translate | titlecase }}:</ion-col
|
||||
>
|
||||
<ion-col width-60 text-right>
|
||||
{{address.addressLocality}}
|
||||
{{ address.addressLocality }}
|
||||
</ion-col>
|
||||
</ion-row>
|
||||
<ion-row *ngIf="address.addressRegion">
|
||||
<ion-col>{{'data.detail.address.REGION' | translate | titlecase}}:</ion-col>
|
||||
<ion-col
|
||||
>{{ 'data.detail.address.REGION' | translate | titlecase }}:</ion-col
|
||||
>
|
||||
<ion-col width-60 text-right>
|
||||
{{address.addressRegion}}
|
||||
{{ address.addressRegion }}
|
||||
</ion-col>
|
||||
</ion-row>
|
||||
<ion-row>
|
||||
<ion-col>{{'data.detail.address.COUNTRY' | translate | titlecase}}:</ion-col>
|
||||
<ion-col
|
||||
>{{ 'data.detail.address.COUNTRY' | translate | titlecase }}:</ion-col
|
||||
>
|
||||
<ion-col width-60 text-right>
|
||||
{{address.addressCountry}}
|
||||
{{ address.addressCountry }}
|
||||
</ion-col>
|
||||
</ion-row>
|
||||
<ion-row *ngIf="address.postOfficeBoxNumber">
|
||||
<ion-col>{{'data.detail.address.POST_OFFICE_BOX' | translate | titlecase}}</ion-col>
|
||||
<ion-col>{{
|
||||
'data.detail.address.POST_OFFICE_BOX' | translate | titlecase
|
||||
}}</ion-col>
|
||||
<ion-col width-60 text-right>
|
||||
{{address.postOfficeBoxNumber}}
|
||||
{{ address.postOfficeBoxNumber }}
|
||||
</ion-col>
|
||||
</ion-row>
|
||||
</ion-grid>
|
||||
|
||||
@@ -21,11 +21,12 @@ import {Component, Input} from '@angular/core';
|
||||
selector: 'stapps-long-inline-text',
|
||||
templateUrl: 'long-inline-text.html',
|
||||
})
|
||||
export class LongInlineText {
|
||||
export class LongInlineTextComponent {
|
||||
/**
|
||||
* TODO
|
||||
*/
|
||||
@Input() size: number;
|
||||
|
||||
/**
|
||||
* TODO
|
||||
*/
|
||||
|
||||
@@ -1 +1,3 @@
|
||||
<span>{{text | slice:0:size}}<span *ngIf="text.length > size">...</span></span>
|
||||
<span
|
||||
>{{ text | slice: 0:size }}<span *ngIf="text.length > size">...</span></span
|
||||
>
|
||||
|
||||
@@ -13,7 +13,10 @@
|
||||
* this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
import {Component, Input} from '@angular/core';
|
||||
import {SCAcademicPriceGroup, SCThingThatCanBeOfferedOffer} from '@openstapps/core';
|
||||
import {
|
||||
SCAcademicPriceGroup,
|
||||
SCThingThatCanBeOfferedOffer,
|
||||
} from '@openstapps/core';
|
||||
|
||||
/**
|
||||
* TODO
|
||||
@@ -27,6 +30,7 @@ export class OffersDetailComponent {
|
||||
* TODO
|
||||
*/
|
||||
objectKeys = Object.keys;
|
||||
|
||||
/**
|
||||
* TODO
|
||||
*/
|
||||
|
||||
@@ -1,19 +1,40 @@
|
||||
<ion-card>
|
||||
<ion-card-header>{{'data.detail.offers.TITLE' | translate | titlecase}}</ion-card-header>
|
||||
<ion-card-header>{{
|
||||
'data.detail.offers.TITLE' | translate | titlecase
|
||||
}}</ion-card-header>
|
||||
<ion-card-content>
|
||||
<div *ngFor="let offer of offers">
|
||||
<p *ngIf="offer.inPlace">
|
||||
<ion-icon name="location"></ion-icon>
|
||||
<a [routerLink]="['/data-detail', offer.inPlace.uid]">{{'name' | thingTranslate: offer.inPlace}}</a>,
|
||||
<span *ngIf="offer.availabilityStarts">
|
||||
<ion-icon name="calendar"></ion-icon> {{offer.availabilityStarts | amDateFormat:'ll'}}
|
||||
<a [routerLink]="['/data-detail', offer.inPlace.uid]">{{
|
||||
'name' | thingTranslate: offer.inPlace
|
||||
}}</a
|
||||
>,
|
||||
<span
|
||||
*ngIf="
|
||||
offer.availabilityRange.gt
|
||||
? offer.availabilityRange.gt
|
||||
: offer.availabilityRange.gte
|
||||
"
|
||||
>
|
||||
<ion-icon name="calendar"></ion-icon>
|
||||
{{
|
||||
(offer.availabilityRange.gt
|
||||
? offer.availabilityRange.gt
|
||||
: offer.availabilityRange.gte
|
||||
) | amDateFormat: 'll'
|
||||
}}
|
||||
</span>
|
||||
</p>
|
||||
<ion-grid *ngFor="let group of objectKeys(offer.prices)">
|
||||
<ion-row>
|
||||
<ion-col>{{group | titlecase}}</ion-col>
|
||||
<ion-col>{{ group | titlecase }}</ion-col>
|
||||
<ion-col width-20 text-right>
|
||||
<p> {{offer.prices[group] | currency:'EUR':'symbol':undefined:'de'}}</p>
|
||||
<p>
|
||||
{{
|
||||
offer.prices[group] | currency: 'EUR':'symbol':undefined:'de'
|
||||
}}
|
||||
</p>
|
||||
</ion-col>
|
||||
</ion-row>
|
||||
</ion-grid>
|
||||
|
||||
@@ -13,7 +13,10 @@
|
||||
* this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
import {Component, Input} from '@angular/core';
|
||||
import {SCAcademicPriceGroup, SCThingThatCanBeOfferedOffer} from '@openstapps/core';
|
||||
import {
|
||||
SCAcademicPriceGroup,
|
||||
SCThingThatCanBeOfferedOffer,
|
||||
} from '@openstapps/core';
|
||||
|
||||
/**
|
||||
* TODO
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
<div>
|
||||
<h2>{{offers[0].prices.default | currency:'EUR':'symbol':undefined:'de'}}</h2>
|
||||
<h2>
|
||||
{{ offers[0].prices.default | currency: 'EUR':'symbol':undefined:'de' }}
|
||||
</h2>
|
||||
<p *ngIf="offers[0].inPlace">
|
||||
<ion-icon name="location"></ion-icon>{{offers[0].inPlace.name}}<span *ngIf="offers.length > 1">...</span>
|
||||
<ion-icon name="location"></ion-icon>{{ offers[0].inPlace.name
|
||||
}}<span *ngIf="offers.length > 1">...</span>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
@@ -1,27 +1,61 @@
|
||||
<ion-card *ngIf="origin.type === 'user'">
|
||||
<ion-card-header>{{'data.types.origin.TITLE' | translate | titlecase}}: {{'data.types.origin.USER' | translate | titlecase}}</ion-card-header>
|
||||
<ion-card-header
|
||||
>{{ 'data.types.origin.TITLE' | translate | titlecase }}:
|
||||
{{ 'data.types.origin.USER' | translate | titlecase }}</ion-card-header
|
||||
>
|
||||
<ion-card-content>
|
||||
<p>{{'data.types.origin.detail.CREATED' | translate | titlecase}}: {{origin.created | amDateFormat:'ll'}}</p>
|
||||
<p *ngIf="origin.updated">{{'data.types.origin.detail.UPDATED' | translate | titlecase}}: {{origin.updated | amDateFormat:'ll'}}</p>
|
||||
<p *ngIf="origin.modified">{{'data.types.origin.detail.MODIFIED' | translate | titlecase}}: {{origin.modified | amDateFormat:'ll'}}</p>
|
||||
<p *ngIf="origin.name">{{'data.types.origin.detail.MAINTAINER' | translate }}: {{origin.name}}</p>
|
||||
<p>
|
||||
{{ 'data.types.origin.detail.CREATED' | translate | titlecase }}:
|
||||
{{ origin.created | amDateFormat: 'll' }}
|
||||
</p>
|
||||
<p *ngIf="origin.updated">
|
||||
{{ 'data.types.origin.detail.UPDATED' | translate | titlecase }}:
|
||||
{{ origin.updated | amDateFormat: 'll' }}
|
||||
</p>
|
||||
<p *ngIf="origin.modified">
|
||||
{{ 'data.types.origin.detail.MODIFIED' | translate | titlecase }}:
|
||||
{{ origin.modified | amDateFormat: 'll' }}
|
||||
</p>
|
||||
<p *ngIf="origin.name">
|
||||
{{ 'data.types.origin.detail.MAINTAINER' | translate }}: {{ origin.name }}
|
||||
</p>
|
||||
<p *ngIf="origin.maintainer">
|
||||
{{'data.types.origin.detail.MAINTAINER' | translate }}: <a [routerLink]="['/data-detail', origin.maintainer.uid]">{{origin.maintainer.name}}</a>
|
||||
{{ 'data.types.origin.detail.MAINTAINER' | translate }}:
|
||||
<a [routerLink]="['/data-detail', origin.maintainer.uid]">{{
|
||||
origin.maintainer.name
|
||||
}}</a>
|
||||
</p>
|
||||
</ion-card-content>
|
||||
</ion-card>
|
||||
|
||||
<ion-card *ngIf="origin.type === 'remote'">
|
||||
<ion-card-header>{{'data.types.origin.TITLE' | translate | titlecase}}: {{'data.types.origin.REMOTE' | translate | titlecase}}</ion-card-header>
|
||||
<ion-card-header
|
||||
>{{ 'data.types.origin.TITLE' | translate | titlecase }}:
|
||||
{{ 'data.types.origin.REMOTE' | translate | titlecase }}</ion-card-header
|
||||
>
|
||||
<ion-card-content>
|
||||
<p>{{'data.types.origin.detail.INDEXED' | translate | titlecase}}: {{origin.indexed | amDateFormat:'ll'}}</p>
|
||||
<p *ngIf="origin.modified">{{'data.types.origin.detail.MODIFIED' | translate | titlecase}}: {{origin.modified | amDateFormat:'ll'}}</p>
|
||||
<p *ngIf="origin.name">{{'data.types.origin.detail.MAINTAINER' | translate }}: {{origin.name}}</p>
|
||||
<p>
|
||||
{{ 'data.types.origin.detail.INDEXED' | translate | titlecase }}:
|
||||
{{ origin.indexed | amDateFormat: 'll' }}
|
||||
</p>
|
||||
<p *ngIf="origin.modified">
|
||||
{{ 'data.types.origin.detail.MODIFIED' | translate | titlecase }}:
|
||||
{{ origin.modified | amDateFormat: 'll' }}
|
||||
</p>
|
||||
<p *ngIf="origin.name">
|
||||
{{ 'data.types.origin.detail.MAINTAINER' | translate }}: {{ origin.name }}
|
||||
</p>
|
||||
<p *ngIf="origin.maintainer">
|
||||
{{'data.types.origin.detail.MAINTAINER' | translate | titlecase}}: <a [routerLink]="['/data-detail', origin.maintainer.uid]">{{origin.maintainer.name}}</a>
|
||||
{{ 'data.types.origin.detail.MAINTAINER' | translate | titlecase }}:
|
||||
<a [routerLink]="['/data-detail', origin.maintainer.uid]">{{
|
||||
origin.maintainer.name
|
||||
}}</a>
|
||||
</p>
|
||||
<p *ngIf="origin.responsibleEntity">
|
||||
{{'data.types.origin.detail.RESPONSIBLE' | translate | titlecase}}: <a [routerLink]="['/data-detail', origin.responsibleEntity.uid]">{{origin.responsibleEntity.name}}</a>
|
||||
{{ 'data.types.origin.detail.RESPONSIBLE' | translate | titlecase }}:
|
||||
<a [routerLink]="['/data-detail', origin.responsibleEntity.uid]">{{
|
||||
origin.responsibleEntity.name
|
||||
}}</a>
|
||||
</p>
|
||||
</ion-card-content>
|
||||
</ion-card>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<div *ngIf="origin.type === 'user'">
|
||||
<p>{{origin.created | amDateFormat:'ll'}}</p>
|
||||
<p>{{ origin.created | amDateFormat: 'll' }}</p>
|
||||
</div>
|
||||
|
||||
<div *ngIf="origin.type === 'remote'">
|
||||
<p>{{origin.indexed | amDateFormat:'ll'}}</p>
|
||||
<p>{{ origin.indexed | amDateFormat: 'll' }}</p>
|
||||
</div>
|
||||
|
||||
@@ -27,29 +27,34 @@ export class SimpleCardComponent {
|
||||
* TODO
|
||||
*/
|
||||
areThings = false;
|
||||
|
||||
/**
|
||||
* TODO
|
||||
*/
|
||||
@Input() content: string | string[] | SCThing[];
|
||||
|
||||
/**
|
||||
* TODO
|
||||
*/
|
||||
@Input() isMarkdown = false;
|
||||
|
||||
/**
|
||||
* TODO
|
||||
*/
|
||||
@Input() title: string;
|
||||
|
||||
/**
|
||||
* TODO
|
||||
*/
|
||||
// tslint:disable-next-line:prefer-function-over-method
|
||||
// eslint-disable-next-line class-methods-use-this
|
||||
isString(data: unknown): data is string {
|
||||
return typeof data === 'string';
|
||||
}
|
||||
|
||||
/**
|
||||
* TODO
|
||||
*/
|
||||
// tslint:disable-next-line:prefer-function-over-method
|
||||
// eslint-disable-next-line class-methods-use-this
|
||||
isThing(something: unknown): something is SCThing {
|
||||
return isThing(something);
|
||||
}
|
||||
|
||||
@@ -1,26 +1,29 @@
|
||||
<ion-card>
|
||||
<ion-card-header>{{title}}</ion-card-header>
|
||||
<ion-card-header>{{ title }}</ion-card-header>
|
||||
<ion-card-content>
|
||||
<ng-container *ngIf="isString(content) then text; else list">
|
||||
<ng-container *ngIf="isString(content); then text; else list">
|
||||
</ng-container>
|
||||
<ng-template #text>
|
||||
<ng-container *ngIf="isMarkdown; else plainText">
|
||||
<markdown [data]="content"></markdown>
|
||||
</ng-container>
|
||||
<ng-template #plainText>
|
||||
<p>{{content}}</p>
|
||||
<p>{{ content }}</p>
|
||||
</ng-template>
|
||||
</ng-template>
|
||||
<ng-template #list>
|
||||
<ng-container *ngIf="isThing(content[0]) then thingList; else textList">
|
||||
<ng-container *ngIf="isThing(content[0]); then thingList; else textList">
|
||||
</ng-container>
|
||||
<ng-template #thingList>
|
||||
<a [routerLink]="['/data-detail', thing.uid]" *ngFor="let thing of content">
|
||||
<p>{{'name' | thingTranslate: thing}}</p>
|
||||
<a
|
||||
[routerLink]="['/data-detail', thing.uid]"
|
||||
*ngFor="let thing of content"
|
||||
>
|
||||
<p>{{ 'name' | thingTranslate: thing }}</p>
|
||||
</a>
|
||||
</ng-template>
|
||||
<ng-template #textList>
|
||||
<p *ngFor="let text of content">{{text}}</p>
|
||||
<p *ngFor="let text of content">{{ text }}</p>
|
||||
</ng-template>
|
||||
</ng-template>
|
||||
</ion-card-content>
|
||||
|
||||
@@ -22,5 +22,4 @@ import {Component} from '@angular/core';
|
||||
templateUrl: 'skeleton-list-item.html',
|
||||
styleUrls: ['skeleton-list-item.scss'],
|
||||
})
|
||||
export class SkeletonListItem {
|
||||
}
|
||||
export class SkeletonListItemComponent {}
|
||||
|
||||
@@ -1,18 +1,18 @@
|
||||
<ion-item>
|
||||
<ion-thumbnail slot='start' class='ion-margin-end'>
|
||||
<ion-thumbnail slot="start" class="ion-margin-end">
|
||||
<ion-skeleton-text animated></ion-skeleton-text>
|
||||
</ion-thumbnail>
|
||||
<ion-grid>
|
||||
<ion-row>
|
||||
<ion-col>
|
||||
<h2 class='name'>
|
||||
<ion-skeleton-text animated style='width: 80%'></ion-skeleton-text>
|
||||
<h2 class="name">
|
||||
<ion-skeleton-text animated style="width: 80%"></ion-skeleton-text>
|
||||
</h2>
|
||||
<p>
|
||||
<ion-skeleton-text animated style='width: 80%;'></ion-skeleton-text>
|
||||
<ion-skeleton-text animated style="width: 80%"></ion-skeleton-text>
|
||||
</p>
|
||||
<ion-note>
|
||||
<ion-skeleton-text animated style='width: 20%'></ion-skeleton-text>
|
||||
<ion-skeleton-text animated style="width: 20%"></ion-skeleton-text>
|
||||
</ion-note>
|
||||
</ion-col>
|
||||
</ion-row>
|
||||
|
||||
@@ -21,5 +21,4 @@ import {Component} from '@angular/core';
|
||||
selector: 'stapps-skeleton-segment-button',
|
||||
templateUrl: 'skeleton-segment-button.html',
|
||||
})
|
||||
export class SkeletonSegment {
|
||||
}
|
||||
export class SkeletonSegmentComponent {}
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
<ion-segment-button>
|
||||
<ion-skeleton-text animated style="width: 85%;"></ion-skeleton-text>
|
||||
<ion-skeleton-text animated style="width: 85%"></ion-skeleton-text>
|
||||
</ion-segment-button>
|
||||
|
||||
|
||||
@@ -21,5 +21,4 @@ import {Component} from '@angular/core';
|
||||
selector: 'stapps-skeleton-simple-card',
|
||||
templateUrl: 'skeleton-simple-card.html',
|
||||
})
|
||||
export class SkeletonSimpleCard {
|
||||
}
|
||||
export class SkeletonSimpleCardComponent {}
|
||||
|
||||
@@ -3,6 +3,6 @@
|
||||
<ion-skeleton-text animated style="width: 15%"></ion-skeleton-text>
|
||||
</ion-card-header>
|
||||
<ion-card-content>
|
||||
<p><ion-skeleton-text animated style="width: 85%;"></ion-skeleton-text></p>
|
||||
<p><ion-skeleton-text animated style="width: 85%"></ion-skeleton-text></p>
|
||||
</ion-card-content>
|
||||
</ion-card>
|
||||
|
||||
Reference in New Issue
Block a user