feat: separate prettier from eslint

This commit is contained in:
Rainer Killinger
2023-01-11 13:25:18 +01:00
committed by Thea Schöbl
parent 939fb6ef0f
commit a88d000ccd
381 changed files with 17952 additions and 38411 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2021 StApps
* Copyright (C) 2022 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.
@@ -41,8 +41,7 @@ export class ActionChipListComponent {
locate: false, // TODO: reimplement this at a later date
event:
item.type === SCThingType.AcademicEvent ||
(item.type === SCThingType.DateSeries &&
(item as SCDateSeries).dates.length > 0),
(item.type === SCThingType.DateSeries && (item as SCDateSeries).dates.length > 0),
};
}

View File

@@ -1,11 +1,20 @@
<!--
~ Copyright (C) 2022 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.
~
~ This program is distributed in the hope that it will be useful, but WITHOUT
~ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
~ FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
~ more details.
~
~ You should have received a copy of the GNU General Public License along with
~ this program. If not, see <https://www.gnu.org/licenses/>.
-->
<div>
<stapps-locate-action-chip
*ngIf="applicable.locate"
[item]="item"
></stapps-locate-action-chip>
<stapps-locate-action-chip *ngIf="applicable.locate" [item]="item"></stapps-locate-action-chip>
<!-- Add Event Chip needs to load data and should be the last -->
<stapps-add-event-action-chip
*ngIf="applicable.event"
[item]="item"
></stapps-add-event-action-chip>
<stapps-add-event-action-chip *ngIf="applicable.event" [item]="item"></stapps-add-event-action-chip>
</div>

View File

@@ -24,10 +24,7 @@ import {
chipSkeletonTransition,
chipTransition,
} from '../../../../animation/skeleton-transitions/chip-loading-transition';
import {
AddEventStates,
AddEventStatesMap,
} from './add-event-action-chip.config';
import {AddEventStates, AddEventStatesMap} from './add-event-action-chip.config';
import {EditEventSelectionComponent} from '../edit-event-selection.component';
import {AddEventReviewModalComponent} from '../../../calendar/add-event-review-modal.component';
@@ -183,31 +180,25 @@ export class AddEventActionChipComponent implements OnDestroy {
})
.then(it => it.data as SCDateSeries[]);
this.uuidSubscription = this.scheduleProvider.uuids$.subscribe(
async result => {
this.uuids = result;
const associatedDateSeries = await this.associatedDateSeries;
if (associatedDateSeries.length === 0) {
this.applyState(AddEventStates.UNAVAILABLE);
this.uuidSubscription = this.scheduleProvider.uuids$.subscribe(async result => {
this.uuids = result;
const associatedDateSeries = await this.associatedDateSeries;
if (associatedDateSeries.length === 0) {
this.applyState(AddEventStates.UNAVAILABLE);
return;
}
switch (
associatedDateSeries
.map(it => it.uid)
.filter(it => !this.uuids.includes(it)).length
) {
case 0:
this.applyState(AddEventStates.ADDED_ALL);
break;
case associatedDateSeries.length:
this.applyState(AddEventStates.REMOVED_ALL);
break;
default:
this.applyState(AddEventStates.ADDED_SOME);
break;
}
},
);
return;
}
switch (associatedDateSeries.map(it => it.uid).filter(it => !this.uuids.includes(it)).length) {
case 0:
this.applyState(AddEventStates.ADDED_ALL);
break;
case associatedDateSeries.length:
this.applyState(AddEventStates.REMOVED_ALL);
break;
default:
this.applyState(AddEventStates.ADDED_SOME);
break;
}
});
}
}

View File

@@ -41,18 +41,9 @@
slot="end"
fill="clear"
(click)="export()"
[disabled]="
!(
selection.selection.indeterminate ||
selection.selection.checked
)
"
[disabled]="!(selection.selection.indeterminate || selection.selection.checked)"
>
{{
'schedule.toCalendar.reviewModal.DOWNLOAD'
| translate
| titlecase
}}
{{ 'schedule.toCalendar.reviewModal.DOWNLOAD' | translate | titlecase }}
<ion-icon slot="end" name="download"></ion-icon>
</ion-button>
</ion-toolbar>

View File

@@ -12,7 +12,7 @@
* 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 "src/theme/common/ion-content-parallax";
@import 'src/theme/common/ion-content-parallax';
:host {
display: block;
@@ -38,7 +38,7 @@
--background: var(--ion-color-primary);
--color: var(--ion-color-primary-contrast);
@include ion-content-parallax($content-size: 160px)
@include ion-content-parallax($content-size: 160px);
}
ion-footer > ion-toolbar {

View File

@@ -12,14 +12,7 @@
* 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 {
ChangeDetectorRef,
Component,
EventEmitter,
Input,
OnInit,
Output,
} from '@angular/core';
import {ChangeDetectorRef, Component, EventEmitter, Input, OnInit, Output} from '@angular/core';
import {ModalController, PopoverController} from '@ionic/angular';
import {SCDateSeries} from '@openstapps/core';
import {
@@ -96,10 +89,7 @@ export class EditEventSelectionComponent implements OnInit {
const {selected, unselected} = this.getSelection();
return uniqBy(
[
...differenceBy(this.partialDateSeries, unselected, it => it.uid),
...selected,
],
[...differenceBy(this.partialDateSeries, unselected, it => it.uid), ...selected],
it => it.uid,
);
}

View File

@@ -13,57 +13,32 @@
~ this program. If not, see <https://www.gnu.org/licenses/>.
-->
<ion-item
(click)="modified.emit(); selection.click()"
class="list-header"
lines="none"
>
<ion-item (click)="modified.emit(); selection.click()" class="list-header" lines="none">
<ion-list-header>
<ion-label>{{ 'data.chips.add_events.popover.ALL' | translate }}</ion-label>
</ion-list-header>
<ion-checkbox
slot="end"
[checked]="selection.checked"
[indeterminate]="selection.indeterminate"
>
<ion-checkbox slot="end" [checked]="selection.checked" [indeterminate]="selection.indeterminate">
</ion-checkbox>
</ion-item>
<ng-container *ngFor="let frequency of selection.children">
<ion-list inset="true" lines="full">
<ion-item
lines="none"
(click)="modified.emit(); frequency.click()"
class="list-header"
>
<ion-item lines="none" (click)="modified.emit(); frequency.click()" class="list-header">
<ion-list-header>
<ion-label>{{
frequency.children[0].item.repeatFrequency
? (frequency.children[0].item.repeatFrequency
| durationLocalized: true
| sentencecase)
? (frequency.children[0].item.repeatFrequency | durationLocalized: true | sentencecase)
: ('data.chips.add_events.popover.SINGLE' | translate | titlecase)
}}</ion-label>
<ion-button></ion-button>
</ion-list-header>
<ion-checkbox
slot="end"
[checked]="frequency.checked"
[indeterminate]="frequency.indeterminate"
>
<ion-checkbox slot="end" [checked]="frequency.checked" [indeterminate]="frequency.indeterminate">
</ion-checkbox>
</ion-item>
<ion-item
*ngFor="let date of frequency.children"
(click)="
modified.emit();
date.selected = !date.selected;
frequency.notifyChildChanged()
"
(click)="modified.emit(); date.selected = !date.selected; frequency.notifyChildChanged()"
>
<ion-label
*ngIf="date.item.dates.length > 1; else single_event"
class="ion-text-wrap"
>
<ion-label *ngIf="date.item.dates.length > 1; else single_event" class="ion-text-wrap">
{{ date.item.duration | amDuration: 'hours' }}
{{ 'data.chips.add_events.popover.AT' | translate }}
{{ date.item.dates[0] | amDateFormat: 'HH:mm ddd' }}
@@ -74,10 +49,7 @@
<ion-label class="ion-text-wrap">
{{ date.item.duration | amDuration: 'hours' }}
{{ 'data.chips.add_events.popover.AT' | translate }}
{{
date.item.dates[date.item.dates.length - 1]
| amDateFormat: 'll, HH:mm'
}}
{{ date.item.dates[date.item.dates.length - 1] | amDateFormat: 'll, HH:mm' }}
</ion-label>
</ng-template>
<ion-checkbox slot="end" [checked]="date.selected"> </ion-checkbox>

View File

@@ -17,7 +17,6 @@ ion-item-divider.ios > ion-checkbox {
margin-right: 8px;
}
.list-header {
--padding-start: 0;
--background: var(--ion-color-primary-shade);
@@ -32,7 +31,7 @@ ion-item-divider.ios > ion-checkbox {
--border-color: rgba(var(--ion-color-primary-contrast-rgb), 0.77);
--background-checked: var(--ion-color-primary-contrast);
--border-color-checked: var(--ion-color-primary-contrast);
--checkmark-color: var(--ion-color-primary)
--checkmark-color: var(--ion-color-primary);
}
}

View File

@@ -14,11 +14,6 @@
-->
<ion-chip [class.active]="active" (click)="emitToggle(value)">
<ion-icon
class="ion-color"
name="check_circle"
fill="true"
*ngIf="active"
></ion-icon>
<ion-icon class="ion-color" name="check_circle" fill="true" *ngIf="active"></ion-icon>
<ion-label>{{ displayValue }}</ion-label>
</ion-chip>

View File

@@ -66,9 +66,7 @@ export class TreeNode<T extends TreeNode<any> | SelectionValue> {
);
this.checked = selections.every(it => it === Selection.ON);
this.indeterminate = this.checked
? false
: selections.some(it => it > Selection.OFF);
this.indeterminate = this.checked ? false : selections.some(it => it > Selection.OFF);
}
/**

View File

@@ -1,16 +1,16 @@
/*
* Copyright (C) 2022 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.
* 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.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License along with
* this program. If not, see <https://www.gnu.org/licenses/>.
* 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 {SCSearchRequest, SCSearchResponse} from '@openstapps/core';
import {Injectable} from '@angular/core';
@@ -61,10 +61,7 @@ export class CoordinatedSearchProvider {
* 1. If the queue is full, dispatches all immediately
* 2. If not, waits a set amount of time for other requests to come in
*/
async coordinatedSearch(
query: SCSearchRequest,
latencyMs = 50,
): Promise<SCSearchResponse> {
async coordinatedSearch(query: SCSearchRequest, latencyMs = 50): Promise<SCSearchResponse> {
const ongoingQuery: OngoingQuery = {request: query};
this.queue.push(ongoingQuery);
@@ -82,9 +79,7 @@ export class CoordinatedSearchProvider {
);
for (const [index, request] of this.queue.entries()) {
request.response = new Promise(resolve =>
responses.then(it => resolve(it[index])),
);
request.response = new Promise(resolve => responses.then(it => resolve(it[index])));
}
this.queue = [];

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2018, 2019 StApps
* Copyright (C) 2022 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.
@@ -94,27 +94,19 @@ describe('DataProvider', () => {
});
it('should convert buckets to buckets map', () => {
expect(dataFacetsProvider.bucketsToMap(sampleBuckets)).toEqual(
sampleBucketsMap,
);
expect(dataFacetsProvider.bucketsToMap(sampleBuckets)).toEqual(sampleBucketsMap);
});
it('should convert buckets map into buckets', () => {
expect(dataFacetsProvider.mapToBuckets(sampleBucketsMap)).toEqual(
sampleBuckets,
);
expect(dataFacetsProvider.mapToBuckets(sampleBucketsMap)).toEqual(sampleBuckets);
});
it('should convert facets into a facets map', () => {
expect(dataFacetsProvider.facetsToMap(sampleFacets)).toEqual(
sampleFacetsMap,
);
expect(dataFacetsProvider.facetsToMap(sampleFacets)).toEqual(sampleFacetsMap);
});
it('should convert facets map into facets', () => {
expect(dataFacetsProvider.mapToFacets(sampleFacetsMap)).toEqual(
sampleFacets,
);
expect(dataFacetsProvider.mapToFacets(sampleFacetsMap)).toEqual(sampleFacets);
});
it('should extract facets (and append them if needed) from the data', () => {
@@ -158,11 +150,7 @@ describe('DataProvider', () => {
}
};
checkEqual(
dataFacetsProvider.extractFacets(
sampleItems,
sampleAggregations,
sampleFacets,
),
dataFacetsProvider.extractFacets(sampleItems, sampleAggregations, sampleFacets),
sampleCombinedFacets,
);
});

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2018, 2019 StApps
* Copyright (C) 2022 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.
@@ -13,12 +13,7 @@
* this program. If not, see <https://www.gnu.org/licenses/>.
*/
import {Injectable} from '@angular/core';
import {
SCBackendAggregationConfiguration,
SCFacet,
SCFacetBucket,
SCThing,
} from '@openstapps/core';
import {SCBackendAggregationConfiguration, SCFacet, SCFacetBucket, SCThing} from '@openstapps/core';
/**
* TODO
@@ -37,10 +32,7 @@ export class DataFacetsProvider {
* @param fields A field that should be added to buckets (its map)
*/
// eslint-disable-next-line class-methods-use-this
addBuckets(
bucketsMap: {[key: string]: number},
fields: string[],
): {[key: string]: number} {
addBuckets(bucketsMap: {[key: string]: number}, fields: string[]): {[key: string]: number} {
for (const field of fields) {
if (typeof bucketsMap[field] !== 'undefined') {
bucketsMap[field] = bucketsMap[field] + 1;
@@ -86,14 +78,10 @@ export class DataFacetsProvider {
return facets;
}
const combinedFacetsMap: {[key: string]: {[key: string]: number}} =
this.facetsToMap(facets);
const combinedFacetsMap: {[key: string]: {[key: string]: number}} = this.facetsToMap(facets);
for (const item of items) {
for (const aggregation of aggregations) {
let fieldValues = item[aggregation.fieldName as keyof SCThing] as
| string
| string[]
| undefined;
let fieldValues = item[aggregation.fieldName as keyof SCThing] as string | string[] | undefined;
if (typeof fieldValues === 'undefined') {
continue;
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2018-2021 StApps
* Copyright (C) 2022 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.
@@ -139,30 +139,28 @@ describe('DataProvider', () => {
};
dataProvider.backendQueriesLimit = 2;
spyOn(Client.prototype as any, 'multiSearch').and.callFake(
(request_: SCMultiSearchRequest) => ({
then: (callback: any) => {
let i = 0;
for (const key in request_) {
if (request_.hasOwnProperty(key)) {
i++;
spyOn(Client.prototype as any, 'multiSearch').and.callFake((request_: SCMultiSearchRequest) => ({
then: (callback: any) => {
let i = 0;
for (const key in request_) {
if (request_.hasOwnProperty(key)) {
i++;
expect(requestCheck[key]).not.toBeNull();
expect(requestCheck[key]).toEqual(request_[key]);
expect(requestCheck[key]).not.toBeNull();
expect(requestCheck[key]).toEqual(request_[key]);
// @ts-expect-error is not null
// eslint-disable-next-line unicorn/no-null
requestCheck[key] = null;
// @ts-expect-error is a string for test purposes
request_[key] = request_[key].toUpperCase();
}
// @ts-expect-error is not null
// eslint-disable-next-line unicorn/no-null
requestCheck[key] = null;
// @ts-expect-error is a string for test purposes
request_[key] = request_[key].toUpperCase();
}
expect(i).toBeLessThanOrEqual(dataProvider.backendQueriesLimit);
}
expect(i).toBeLessThanOrEqual(dataProvider.backendQueriesLimit);
return callback(request_);
},
}),
);
return callback(request_);
},
}));
const response = await dataProvider.multiSearch(request);
// @ts-expect-error same type
@@ -171,12 +169,10 @@ describe('DataProvider', () => {
it('should put an data item into the local database (storage)', async () => {
let providedThing: SCSaveableThing;
spyOn(storageProvider, 'put' as any).and.callFake(
(_id: any, thing: any) => {
providedThing = thing;
providedThing.origin.created = sampleSavable.origin.created;
},
);
spyOn(storageProvider, 'put' as any).and.callFake((_id: any, thing: any) => {
providedThing = thing;
providedThing.origin.created = sampleSavable.origin.created;
});
expect(storageProvider.put).not.toHaveBeenCalled();
expect(providedThing!).not.toBeDefined();
@@ -188,20 +184,13 @@ describe('DataProvider', () => {
});
it('should correctly set and get single data item from the local database (storage)', async () => {
spyOn(storageProvider, 'get').and.returnValue(
(async () => sampleSavable)(),
);
spyOn(storageProvider, 'get').and.returnValue((async () => sampleSavable)());
expect(storageProvider.get).not.toHaveBeenCalled();
const providedThing = await dataProvider.get(
sampleThing.uid,
DataScope.Local,
);
const providedThing = await dataProvider.get(sampleThing.uid, DataScope.Local);
expect(storageProvider.get).toHaveBeenCalledWith(
dataProvider.getDataKey(sampleThing.uid),
);
expect(storageProvider.get).toHaveBeenCalledWith(dataProvider.getDataKey(sampleThing.uid));
expect(providedThing).toEqual(sampleSavable);
});
@@ -217,9 +206,7 @@ describe('DataProvider', () => {
const result = await dataProvider.getAll();
expect([...result.keys()].sort()).toEqual([...fakeStorage.keys()].sort());
expect([...result.values()].sort()).toEqual(
[...fakeStorage.values()].sort(),
);
expect([...result.values()].sort()).toEqual([...fakeStorage.values()].sort());
});
it('should provide single data from the backend', async () => {
@@ -233,10 +220,7 @@ describe('DataProvider', () => {
expect(Client.prototype.getThing).not.toHaveBeenCalled();
const providedThing = await dataProvider.get(
sampleThing.uid,
DataScope.Remote,
);
const providedThing = await dataProvider.get(sampleThing.uid, DataScope.Remote);
expect(Client.prototype.getThing).toHaveBeenCalledWith(sampleThing.uid);
expect(providedThing).toBe(sampleThing);
@@ -268,9 +252,7 @@ describe('DataProvider', () => {
await dataProvider.delete(sampleThing.uid);
expect(storageProvider.delete).toHaveBeenCalledWith(
dataProvider.getDataKey(sampleThing.uid),
);
expect(storageProvider.delete).toHaveBeenCalledWith(dataProvider.getDataKey(sampleThing.uid));
});
it('should properly delete all the data items from the local database (storage)', async () => {

View File

@@ -1,16 +1,16 @@
/*
* Copyright (C) 2022 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.
* 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.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License along with
* this program. If not, see <https://www.gnu.org/licenses/>.
* 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 {Injectable} from '@angular/core';
import {Client} from '@openstapps/api/lib/client';
@@ -111,10 +111,7 @@ export class DataProvider {
* @param field Database field for apply the filter to
* @param value Value to match with
*/
static createValueFilter(
field: SCThingsField,
value: string,
): SCSearchValueFilter {
static createValueFilter(field: SCThingsField, value: string): SCSearchValueFilter {
return {
type: 'value',
arguments: {
@@ -136,9 +133,7 @@ export class DataProvider {
for (const item of items) {
const value =
typeof bucketMap.get(item.type) === 'undefined'
? 1
: (bucketMap.get(item.type) as number) + 1;
typeof bucketMap.get(item.type) === 'undefined' ? 1 : (bucketMap.get(item.type) as number) + 1;
bucketMap.set(item.type, value);
}
@@ -155,15 +150,8 @@ export class DataProvider {
* @param stAppsWebHttpClient TODO
* @param storageProvider TODO
*/
constructor(
stAppsWebHttpClient: StAppsWebHttpClient,
storageProvider: StorageProvider,
) {
this.client = new Client(
stAppsWebHttpClient,
this.backendUrl,
this.appVersion,
);
constructor(stAppsWebHttpClient: StAppsWebHttpClient, storageProvider: StorageProvider) {
this.client = new Client(stAppsWebHttpClient, this.backendUrl, this.appVersion);
this.storageProvider = storageProvider;
}
@@ -173,10 +161,7 @@ export class DataProvider {
* @param item An indexable to create savable thing from
* @param type The type (falls back to the type of the indexable thing)
*/
static createSaveable(
item: SCIndexableThings,
type?: SCThingType,
): SCSaveableThing {
static createSaveable(item: SCIndexableThings, type?: SCThingType): SCSaveableThing {
return {
data: item,
name: item.name,
@@ -214,10 +199,7 @@ export class DataProvider {
/**
* Provides a thing from the backend
*/
async get(
uid: string,
scope: DataScope.Remote,
): Promise<SCThings | SCSaveableThing>;
async get(uid: string, scope: DataScope.Remote): Promise<SCThings | SCSaveableThing>;
/**
* Provides a thing from both local database and backend
*/
@@ -232,9 +214,7 @@ export class DataProvider {
async get(
uid: string,
scope?: DataScope,
): Promise<
SCThings | SCSaveableThing | Map<DataScope, SCThings | SCSaveableThing>
> {
): Promise<SCThings | SCSaveableThing | Map<DataScope, SCThings | SCSaveableThing>> {
if (scope === DataScope.Local) {
return this.storageProvider.get<SCSaveableThing>(this.getDataKey(uid));
}
@@ -288,9 +268,7 @@ export class DataProvider {
*
* @param query - query to send to the backend (auto-splits according to the backend limit)
*/
async multiSearch(
query: SCMultiSearchRequest,
): Promise<SCMultiSearchResponse> {
async multiSearch(query: SCMultiSearchRequest): Promise<SCMultiSearchResponse> {
// partition object into chunks, process those requests in parallel, then merge their responses again
return Object.assign(
{},
@@ -320,11 +298,7 @@ export class DataProvider {
* @param feedback Feedback message to be sent to the backend
*/
async sendFeedback(feedback: SCFeedbackRequest) {
return this.client.invokePlugin<SCFeedbackResponse>(
'feedback',
undefined,
feedback,
);
return this.client.invokePlugin<SCFeedbackResponse>('feedback', undefined, feedback);
}
/**

View File

@@ -1,36 +1,29 @@
<!--
~ Copyright (C) 2022 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.
~ 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.
~
~ This program is distributed in the hope that it will be useful, but WITHOUT
~ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
~ FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
~ more details.
~ This program is distributed in the hope that it will be useful, but WITHOUT
~ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
~ FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
~ more details.
~
~ You should have received a copy of the GNU General Public License along with
~ this program. If not, see <https://www.gnu.org/licenses/>.
~ You should have received a copy of the GNU General Public License along with
~ this program. If not, see <https://www.gnu.org/licenses/>.
-->
<ion-header *ngIf="showModalHeader" translucent>
<ion-toolbar color="primary" mode="ios">
<ion-title>{{ 'name' | thingTranslate: item }}</ion-title>
<ion-buttons slot="end">
<ion-button (click)="modalController.dismiss()">{{
'app.ui.CLOSE' | translate
}}</ion-button>
<ion-button (click)="modalController.dismiss()">{{ 'app.ui.CLOSE' | translate }}</ion-button>
</ion-buttons>
</ion-toolbar>
</ion-header>
<stapps-title-card *ngIf="!showModalHeader" [item]="item"> </stapps-title-card>
<ng-container
*ngTemplateOutlet="
contentTemplateRef || defaultContent;
context: {$implicit: item}
"
>
<ng-container *ngTemplateOutlet="contentTemplateRef || defaultContent; context: {$implicit: item}">
</ng-container>
<stapps-origin-detail [origin]="item.origin"></stapps-origin-detail>
@@ -48,10 +41,7 @@
[item]="$any(item)"
*ngSwitchCase="'date series'"
></stapps-date-series-detail-content>
<stapps-dish-detail-content
[item]="$any(item)"
*ngSwitchCase="'dish'"
></stapps-dish-detail-content>
<stapps-dish-detail-content [item]="$any(item)" *ngSwitchCase="'dish'"></stapps-dish-detail-content>
<stapps-event-detail-content
[item]="$any(item)"
*ngSwitchCase="'academic event'"
@@ -68,18 +58,9 @@
[item]="$any(item)"
*ngSwitchCase="'message'"
></stapps-message-detail-content>
<stapps-person-detail-content
[item]="$any(item)"
*ngSwitchCase="'person'"
></stapps-person-detail-content>
<stapps-place-detail-content
[item]="$any(item)"
*ngSwitchCase="'building'"
></stapps-place-detail-content>
<stapps-place-detail-content
[item]="$any(item)"
*ngSwitchCase="'floor'"
></stapps-place-detail-content>
<stapps-person-detail-content [item]="$any(item)" *ngSwitchCase="'person'"></stapps-person-detail-content>
<stapps-place-detail-content [item]="$any(item)" *ngSwitchCase="'building'"></stapps-place-detail-content>
<stapps-place-detail-content [item]="$any(item)" *ngSwitchCase="'floor'"></stapps-place-detail-content>
<stapps-place-detail-content
[item]="$any(item)"
*ngSwitchCase="'point of interest'"
@@ -93,10 +74,7 @@
[item]="$any(item)"
*ngSwitchCase="'semester'"
></stapps-semester-detail-content>
<stapps-video-detail-content
[item]="$any(item)"
*ngSwitchCase="'video'"
></stapps-video-detail-content>
<stapps-video-detail-content [item]="$any(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">

View File

@@ -12,7 +12,7 @@
* 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 "src/theme/util/_mixins.scss";
@import 'src/theme/util/_mixins.scss';
:host ::ng-deep {
ion-slides.work-locations {
@@ -36,13 +36,15 @@
padding-bottom: 4px;
font-weight: bold;
}
ion-grid, ion-col {
ion-grid,
ion-col {
padding-inline-start: 0;
padding-top: 0;
padding-bottom: 0;
}
}
ion-grid, ion-col {
ion-grid,
ion-col {
padding-inline-start: 0;
padding-top: 0;
padding-bottom: 0;

View File

@@ -1,16 +1,16 @@
/*
* Copyright (C) 2022 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.
* 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.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License along with
* this program. If not, see <https://www.gnu.org/licenses/>.
* You should have received a copy of the GNU General Public License along with
* this program. If not, see <https://www.gnu.org/licenses/>.
*/
/* eslint-disable @typescript-eslint/no-non-null-assertion,@typescript-eslint/no-explicit-any */
@@ -18,11 +18,7 @@ import {CUSTOM_ELEMENTS_SCHEMA, DebugElement} from '@angular/core';
import {ComponentFixture, TestBed} from '@angular/core/testing';
import {ActivatedRoute, RouterModule} from '@angular/router';
import {IonTitle} from '@ionic/angular';
import {
TranslateLoader,
TranslateModule,
TranslateService,
} from '@ngx-translate/core';
import {TranslateLoader, TranslateModule, TranslateService} from '@ngx-translate/core';
import {sampleThingsMap} from '../../../_helpers/data/sample-things';
import {DataRoutingModule} from '../data-routing.module';
import {DataModule} from '../data.module';
@@ -63,13 +59,7 @@ describe('DataDetailComponent', () => {
},
};
const storageProviderSpy = jasmine.createSpyObj('StorageProvider', [
'init',
'get',
'has',
'put',
'search',
]);
const storageProviderSpy = jasmine.createSpyObj('StorageProvider', ['init', 'get', 'has', 'put', 'search']);
beforeEach(() => {
TestBed.configureTestingModule({
@@ -98,9 +88,7 @@ describe('DataDetailComponent', () => {
beforeEach(() => {
dataProvider = TestBed.inject(DataProvider);
translateService = TestBed.inject(TranslateService);
spyOn(dataProvider, 'get' as any).and.returnValue(
Promise.resolve(sampleThing),
);
spyOn(dataProvider, 'get' as any).and.returnValue(Promise.resolve(sampleThing));
spyOn(DataDetailComponent.prototype, 'getItem').and.callThrough();
fixture = TestBed.createComponent(DataDetailComponent);
comp = fixture.componentInstance;
@@ -118,17 +106,11 @@ describe('DataDetailComponent', () => {
it('should get a data item', () => {
comp.getItem(sampleThing.uid, false);
expect(DataDetailComponent.prototype.getItem).toHaveBeenCalledWith(
sampleThing.uid,
false,
);
expect(DataDetailComponent.prototype.getItem).toHaveBeenCalledWith(sampleThing.uid, false);
});
it('should get a data item when the view is entered', () => {
comp.ionViewWillEnter();
expect(DataDetailComponent.prototype.getItem).toHaveBeenCalledWith(
sampleThing.uid,
false,
);
expect(DataDetailComponent.prototype.getItem).toHaveBeenCalledWith(sampleThing.uid, false);
});
});

View File

@@ -1,34 +1,22 @@
/*
* Copyright (C) 2022 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.
* 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.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License along with
* this program. If not, see <https://www.gnu.org/licenses/>.
* 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 {
Component,
ContentChild,
EventEmitter,
Input,
Output,
TemplateRef,
} from '@angular/core';
import {Component, ContentChild, EventEmitter, Input, Output, TemplateRef} from '@angular/core';
import {ActivatedRoute} from '@angular/router';
import {ViewWillEnter, ModalController} from '@ionic/angular';
import {LangChangeEvent, TranslateService} from '@ngx-translate/core';
import {
SCLanguageCode,
SCSaveableThing,
SCThings,
SCUuid,
} from '@openstapps/core';
import {SCLanguageCode, SCSaveableThing, SCThings, SCUuid} from '@openstapps/core';
import {DataProvider, DataScope} from '../data.provider';
import {FavoritesService} from '../../favorites/favorites.service';
import {take} from 'rxjs/operators';
@@ -73,9 +61,7 @@ export class DataDetailComponent implements ViewWillEnter {
*/
isDisconnected: Promise<boolean>;
@ContentChild(TemplateRef) contentTemplateRef: TemplateRef<
DataListContext<SCThings>
>;
@ContentChild(TemplateRef) contentTemplateRef: TemplateRef<DataListContext<SCThings>>;
@Input() externalData = false;
@@ -89,15 +75,12 @@ export class DataDetailComponent implements ViewWillEnter {
*/
@Input() defaultHeader = true;
@Output() loadItem: EventEmitter<ExternalDataLoadEvent> =
new EventEmitter<ExternalDataLoadEvent>();
@Output() loadItem: EventEmitter<ExternalDataLoadEvent> = new EventEmitter<ExternalDataLoadEvent>();
/**
* Type guard for SCSavableThing
*/
static isSCSavableThing(
thing: SCThings | SCSaveableThing,
): thing is SCSaveableThing {
static isSCSavableThing(thing: SCThings | SCSaveableThing): thing is SCSaveableThing {
return typeof (thing as SCSaveableThing).data !== 'undefined';
}

View File

@@ -20,10 +20,7 @@
</ion-buttons>
<ion-title>{{ 'data.detail.TITLE' | translate }}</ion-title>
<ion-buttons [slot]="isModal ? 'start' : 'primary'">
<stapps-favorite-button
*ngIf="item"
[item]="$any(item)"
></stapps-favorite-button>
<stapps-favorite-button *ngIf="item" [item]="$any(item)"></stapps-favorite-button>
</ion-buttons>
<ion-buttons slot="end" *ngIf="isModal">
<ion-button fill="clear" (click)="modalController.dismiss()">
@@ -56,10 +53,7 @@
<stapps-skeleton-simple-card></stapps-skeleton-simple-card>
</ng-container>
<ng-container *ngSwitchDefault>
<stapps-data-path
[item]="item"
[autoRouting]="autoRouteDataPath"
></stapps-data-path>
<stapps-data-path [item]="item" [autoRouting]="autoRouteDataPath"></stapps-data-path>
<stapps-data-detail-content
[item]="item"
[contentTemplateRef]="contentTemplateRef"

View File

@@ -1,25 +1,20 @@
/*
* Copyright (C) 2022 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.
* 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.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License along with
* this program. If not, see <https://www.gnu.org/licenses/>.
* 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 {Component, Input, OnDestroy, OnInit} from '@angular/core';
import {RoutingStackService} from '../../../util/routing-stack.service';
import {
SCCatalog,
SCThings,
SCThingType,
SCThingWithoutReferences,
} from '@openstapps/core';
import {SCCatalog, SCThings, SCThingType, SCThingWithoutReferences} from '@openstapps/core';
import {DataProvider, DataScope} from '../data.provider';
import {fromEvent, Observable, Subscription} from 'rxjs';
import {map, startWith} from 'rxjs/operators';
@@ -60,10 +55,7 @@ export class DataPathComponent implements OnInit, OnDestroy {
const catalogWithoutReferences = item.catalogs[0];
const catalogPromise = (
item.catalogs.length === 1
? this.dataProvider.get(
catalogWithoutReferences.uid,
DataScope.Remote,
)
? this.dataProvider.get(catalogWithoutReferences.uid, DataScope.Remote)
: this.routeStack.lastDataDetail
) as Promise<SCCatalog>;

View File

@@ -44,9 +44,7 @@
<ion-item
button
*ngFor="let fragment of stack"
(click)="
dataRoutingService.emitPathEvent(fragment); popover.dismiss()
"
(click)="dataRoutingService.emitPathEvent(fragment); popover.dismiss()"
>{{ 'name' | thingTranslate: $any(fragment) }}</ion-item
>
</ion-list>

View File

@@ -1,55 +1,54 @@
<!--
~ Copyright (C) 2022 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.
~
~ This program is distributed in the hope that it will be useful, but WITHOUT
~ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
~ FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
~ more details.
~
~ You should have received a copy of the GNU General Public License along with
~ this program. If not, see <https://www.gnu.org/licenses/>.
-->
<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 }}
</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 }}
</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 }}
</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 }}
</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 }}
</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 }}
</ion-col>

View File

@@ -12,6 +12,4 @@
~ You should have received a copy of the GNU General Public License along with
~ this program. If not, see <https://www.gnu.org/licenses/>.
-->
<a (click)="onLinkClick(link)"
>{{ text }}<ion-icon name="open_in_browser"></ion-icon>
</a>
<a (click)="onLinkClick(link)">{{ text }}<ion-icon name="open_in_browser"></ion-icon> </a>

View File

@@ -1,16 +1,16 @@
/*!
* Copyright (C) 2022 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.
* 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.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License along with
* this program. If not, see <https://www.gnu.org/licenses/>.
* You should have received a copy of the GNU General Public License along with
* this program. If not, see <https://www.gnu.org/licenses/>.
*/
:host {
@@ -27,6 +27,6 @@
}
.selected {
color: #FBC02D;
color: #fbc02d;
}
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2021 StApps
* Copyright (C) 2022 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.
@@ -68,9 +68,7 @@ export class FavoriteButtonComponent {
event.stopPropagation();
this.isFavorite$.pipe(take(1)).subscribe(enabled => {
enabled
? this.favoritesService.delete(this.item)
: this.favoritesService.put(this.item);
enabled ? this.favoritesService.delete(this.item) : this.favoritesService.put(this.item);
});
}
}

View File

@@ -1,12 +1,25 @@
<!--
~ Copyright (C) 2022 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.
~
~ This program is distributed in the hope that it will be useful, but WITHOUT
~ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
~ FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
~ more details.
~
~ You should have received a copy of the GNU General Public License along with
~ this program. If not, see <https://www.gnu.org/licenses/>.
-->
<span class="ion-hide-sm-up">
{{ text | slice: 0:size }}
<span *ngIf="text.length > size" class="ion-hide-sm-up"></span>
</span>
<span class="ion-hide-sm-down ion-hide-md-up">
{{ text | slice: 0:size * 2 }}
<span *ngIf="text.length > size * 2" class="ion-hide-sm-down ion-hide-md-up">
</span>
<span *ngIf="text.length > size * 2" class="ion-hide-sm-down ion-hide-md-up"></span>
</span>
<span class="ion-hide-md-down">
{{ text | slice: 0:size * 3 }}

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2019 StApps
* Copyright (C) 2022 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.
@@ -13,10 +13,7 @@
* 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

View File

@@ -1,22 +1,20 @@
<!--
~ Copyright (C) 2022 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.
~ Copyright (C) 2023 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.
~
~ This program is distributed in the hope that it will be useful, but WITHOUT
~ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
~ FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
~ more details.
~ This program is distributed in the hope that it will be useful, but WITHOUT
~ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
~ FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
~ more details.
~
~ You should have received a copy of the GNU General Public License along with
~ this program. If not, see <https://www.gnu.org/licenses/>.
~ You should have received a copy of the GNU General Public License along with
~ this program. If not, see <https://www.gnu.org/licenses/>.
-->
<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">
<ion-grid>
@@ -29,17 +27,11 @@
</ion-col>
<ion-col>
<span
*ngIf="
offer.availabilityRange.gt
? offer.availabilityRange.gt
: offer.availabilityRange.gte
"
*ngIf="offer.availabilityRange.gt ? offer.availabilityRange.gt : offer.availabilityRange.gte"
>
{{
(offer.availabilityRange.gt
? offer.availabilityRange.gt
: offer.availabilityRange.gte
) | amDateFormat: 'll'
(offer.availabilityRange.gt ? offer.availabilityRange.gt : offer.availabilityRange.gte)
| amDateFormat: 'll'
}}
</span>
</ion-col>
@@ -47,14 +39,10 @@
</ion-grid>
<ion-grid *ngIf="offer.prices && offer.availability !== 'out of stock'">
<ion-row *ngFor="let group of objectKeys(offer.prices)">
<ion-col *ngIf="group !== 'default'"
>{{ 'data.detail.offers.' + group | translate }}
</ion-col>
<ion-col *ngIf="group !== 'default'">{{ 'data.detail.offers.' + group | translate }} </ion-col>
<ion-col *ngIf="group !== 'default'" width-20 text-right>
<p>
{{
offer.prices[group] | currency: 'EUR':'symbol':undefined:'de'
}}
{{ offer.prices[group] | currency: 'EUR':'symbol':undefined:'de' }}
</p>
</ion-col>
</ion-row>

View File

@@ -1,22 +1,19 @@
/*
* Copyright (C) 2022 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.
* Copyright (C) 2023 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.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License along with
* this program. If not, see <https://www.gnu.org/licenses/>.
* 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 {Component, Input} from '@angular/core';
import {
SCAcademicPriceGroup,
SCThingThatCanBeOfferedOffer,
} from '@openstapps/core';
import {SCAcademicPriceGroup, SCThingThatCanBeOfferedOffer} from '@openstapps/core';
import {SettingsProvider} from '../../settings/settings.provider';
/**
@@ -30,19 +27,15 @@ export class OffersInListComponent {
/**
* TODO
*/
@Input() set offers(
it: Array<SCThingThatCanBeOfferedOffer<SCAcademicPriceGroup>>,
) {
@Input() set offers(it: Array<SCThingThatCanBeOfferedOffer<SCAcademicPriceGroup>>) {
this._offers = it;
this.price = it[0].prices?.default;
this.settingsProvider.getSetting('profile', 'group').then(group => {
this.price =
it[0].prices?.[(group.value as string).replace(/s$/, '') as never];
this.price = it[0].prices?.[(group.value as string).replace(/s$/, '') as never];
});
const availabilities = new Set(it.map(offer => offer.availability));
this.soldOut =
availabilities.has('out of stock') && availabilities.size === 1;
this.soldOut = availabilities.has('out of stock') && availabilities.size === 1;
}
price?: number;

View File

@@ -1,3 +1,18 @@
<!--
~ Copyright (C) 2022 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.
~
~ This program is distributed in the hope that it will be useful, but WITHOUT
~ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
~ FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
~ more details.
~
~ You should have received a copy of the GNU General Public License along with
~ this program. If not, see <https://www.gnu.org/licenses/>.
-->
<ion-card *ngIf="origin.type === 'user'">
<ion-card-header
>{{ 'data.types.origin.TITLE' | translate | titlecase }}:
@@ -16,14 +31,10 @@
{{ '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.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>
<a [routerLink]="['/data-detail', origin.maintainer.uid]">{{ origin.maintainer.name }}</a>
</p>
</ion-card-content>
</ion-card>
@@ -42,20 +53,14 @@
{{ '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.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>
<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>
<a [routerLink]="['/data-detail', origin.responsibleEntity.uid]">{{ origin.responsibleEntity.name }}</a>
</p>
</ion-card-content>
</ion-card>

View File

@@ -1,8 +1,22 @@
<!--
~ Copyright (C) 2022 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.
~
~ This program is distributed in the hope that it will be useful, but WITHOUT
~ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
~ FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
~ more details.
~
~ You should have received a copy of the GNU General Public License along with
~ this program. If not, see <https://www.gnu.org/licenses/>.
-->
<ion-card>
<ion-card-header>{{ title }}</ion-card-header>
<ion-card-content>
<ng-container *ngIf="isString(content); then text; else list">
</ng-container>
<ng-container *ngIf="isString(content); then text; else list"> </ng-container>
<ng-template #text>
<ng-container *ngIf="isMarkdown; else plainText">
<markdown [data]="content"></markdown>
@@ -12,13 +26,9 @@
</ng-template>
</ng-template>
<ng-template #list>
<ng-container *ngIf="isThing(content[0]); then thingList; else textList">
</ng-container>
<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"
>
<a [routerLink]="['/data-detail', thing.uid]" *ngFor="let thing of content">
<p>{{ 'name' | thingTranslate: thing }}</p>
</a>
</ng-template>

View File

@@ -1,5 +1,5 @@
<!--
~ Copyright (C) 2021 StApps
~ Copyright (C) 2023 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.
@@ -28,16 +28,10 @@
</ion-card-header>
<ion-card-content>
<div *ngIf="$any(item).openingHours" class="openingHours">
<stapps-opening-hours
[openingHours]="item.openingHours"
></stapps-opening-hours>
<stapps-opening-hours [openingHours]="item.openingHours"></stapps-opening-hours>
</div>
<div *ngIf="item.description" class="description">
<div
class="text-accordion"
[style.-webkit-line-clamp]="descriptionLinesToDisplay"
#accordionTextArea
>
<div class="text-accordion" [style.-webkit-line-clamp]="descriptionLinesToDisplay" #accordionTextArea>
{{ 'description' | thingTranslate: item }}
</div>
</div>

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2021 StApps
/*!
* Copyright (C) 2023 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.
@@ -20,7 +20,6 @@
-webkit-box-orient: vertical;
}
ion-card {
border-radius: 0;
--background: var(--ion-color-primary);
@@ -35,14 +34,14 @@ ion-card {
margin: var(--spacing-sm) 0 var(--spacing-sm) 0;
}
}
ion-card-content {
padding: 0 0 var(--header-spacing-bottom);
.description * {
color: var(--ion-color-light);
}
.openingHours {
.openingHours {
color: var(--ion-color-light);
}
}

View File

@@ -1,27 +1,19 @@
/*
* Copyright (C) 2022 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.
* 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.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License along with
* this program. If not, see <https://www.gnu.org/licenses/>.
* 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 {
Component,
ElementRef,
HostListener,
Input,
OnChanges,
OnInit,
ViewChild,
} from '@angular/core';
import {Component, ElementRef, HostListener, Input, OnChanges, OnInit, ViewChild} from '@angular/core';
import {SCThings} from '@openstapps/core';
import {SCIcon} from '../../../util/ion-icon/icon';
@@ -73,9 +65,7 @@ export class TitleCardComponent implements OnInit, OnChanges {
}
const element = this.accordionTextArea.nativeElement as HTMLElement;
const lineHeight = Number.parseInt(
getComputedStyle(element).getPropertyValue('line-height'),
);
const lineHeight = Number.parseInt(getComputedStyle(element).getPropertyValue('line-height'));
this.descriptionLinesTotal = element?.scrollHeight / lineHeight;
this.descriptionLinesShown = element?.offsetHeight / lineHeight;
if (this.buttonState === AccordionButtonState.expanded) {

View File

@@ -1,16 +1,16 @@
/*
* Copyright (C) 2022 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.
* 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.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License along with
* this program. If not, see <https://www.gnu.org/licenses/>.
* 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 {Component, ContentChild, Input, TemplateRef} from '@angular/core';
import {SCThings} from '@openstapps/core';
@@ -40,9 +40,7 @@ export class DataListItemComponent {
@Input() lines = 'inset';
@ContentChild(TemplateRef) contentTemplateRef: TemplateRef<
DataListContext<SCThings>
>;
@ContentChild(TemplateRef) contentTemplateRef: TemplateRef<DataListContext<SCThings>>;
constructor(private readonly dataRoutingService: DataRoutingService) {}

View File

@@ -1,16 +1,16 @@
<!--
~ Copyright (C) 2022 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.
~ Copyright (C) 2023 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.
~
~ This program is distributed in the hope that it will be useful, but WITHOUT
~ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
~ FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
~ more details.
~ This program is distributed in the hope that it will be useful, but WITHOUT
~ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
~ FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
~ more details.
~
~ You should have received a copy of the GNU General Public License along with
~ this program. If not, see <https://www.gnu.org/licenses/>.
~ You should have received a copy of the GNU General Public License along with
~ this program. If not, see <https://www.gnu.org/licenses/>.
-->
<ion-item
@@ -27,17 +27,12 @@
<ng-container *ngIf="contentTemplateRef; else defaultContent">
<ion-label class="ion-text-wrap" [ngSwitch]="true">
<div>
<ng-container
*ngTemplateOutlet="contentTemplateRef; context: {$implicit: item}"
></ng-container>
<ng-container *ngTemplateOutlet="contentTemplateRef; context: {$implicit: item}"></ng-container>
</div>
</ion-label>
</ng-container>
<stapps-favorite-button
*ngIf="favoriteButton"
[item]="$any(item)"
></stapps-favorite-button>
<stapps-favorite-button *ngIf="favoriteButton" [item]="$any(item)"></stapps-favorite-button>
</ion-item>
<ng-template #defaultContent>
@@ -51,10 +46,7 @@
[item]="$any(item)"
*ngSwitchCase="item.type === 'date series'"
></stapps-date-series-list-item>
<stapps-dish-list-item
[item]="$any(item)"
*ngSwitchCase="item.type === 'dish'"
></stapps-dish-list-item>
<stapps-dish-list-item [item]="$any(item)" *ngSwitchCase="item.type === 'dish'"></stapps-dish-list-item>
<stapps-event-list-item
[item]="$any(item)"
*ngSwitchCase="item.type === 'academic event'"
@@ -103,18 +95,12 @@
[item]="$any(item)"
*ngSwitchCase="item.type === 'video'"
></stapps-video-list-item>
<stapps-book-list-item
[item]="$any(item)"
*ngSwitchCase="item.type === 'book'"
></stapps-book-list-item>
<stapps-book-list-item [item]="$any(item)" *ngSwitchCase="item.type === 'book'"></stapps-book-list-item>
<stapps-periodical-list-item
[item]="$any(item)"
*ngSwitchCase="item.type === 'periodical'"
></stapps-periodical-list-item>
<stapps-article-item
[item]="$any(item)"
*ngSwitchCase="item.type === 'article'"
></stapps-article-item>
<stapps-article-item [item]="$any(item)" *ngSwitchCase="item.type === 'article'"></stapps-article-item>
<div *ngSwitchDefault>
<h2>
{{ 'name' | thingTranslate: item }}
@@ -126,10 +112,7 @@
></stapps-long-inline-text>
</p>
</div>
<stapps-action-chip-list
slot="end"
[item]="item"
></stapps-action-chip-list>
<stapps-action-chip-list slot="end" [item]="item"></stapps-action-chip-list>
</div>
</ion-label>
</ng-template>

View File

@@ -1,5 +1,5 @@
/*!
* Copyright (C) 2022 StApps
* Copyright (C) 2023 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.
@@ -12,8 +12,8 @@
* 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 "src/theme/util/_mixins.scss";
@import "src/theme/common/_helper.scss";
@import 'src/theme/util/_mixins.scss';
@import 'src/theme/common/_helper.scss';
ion-item {
--border-color: transparent;

View File

@@ -1,16 +1,16 @@
/*
* Copyright (C) 2022 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.
* 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.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License along with
* this program. If not, see <https://www.gnu.org/licenses/>.
* 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 {CdkVirtualScrollViewport} from '@angular/cdk/scrolling';
import {
@@ -53,9 +53,7 @@ export class DataListComponent implements OnChanges, OnInit, OnDestroy {
*/
@Input() items?: SCThings[];
@ContentChild(TemplateRef) listItemTemplateRef: TemplateRef<
DataListContext<SCThings>
>;
@ContentChild(TemplateRef) listItemTemplateRef: TemplateRef<DataListContext<SCThings>>;
/**
* Stream of SCThings for virtual scroll to consume

View File

@@ -1,3 +1,18 @@
<!--
~ Copyright (C) 2022 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.
~
~ This program is distributed in the hope that it will be useful, but WITHOUT
~ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
~ FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
~ more details.
~
~ You should have received a copy of the GNU General Public License along with
~ this program. If not, see <https://www.gnu.org/licenses/>.
-->
<ng-container *ngIf="itemStream | async as items">
<cdk-virtual-scroll-viewport
itemSize="80"
@@ -10,18 +25,13 @@
<ion-list>
<ng-container *cdkVirtualFor="let item of items; trackBy: identifyItem">
<ng-container
*ngTemplateOutlet="
listItemTemplateRef || defaultListItem;
context: {$implicit: item}
"
*ngTemplateOutlet="listItemTemplateRef || defaultListItem; context: {$implicit: item}"
></ng-container>
</ng-container>
</ion-list>
</cdk-virtual-scroll-viewport>
</ng-container>
<div
[style.display]="!loading && items && items.length === 0 ? 'block' : 'none'"
>
<div [style.display]="!loading && items && items.length === 0 ? 'block' : 'none'">
<ion-label class="centeredMessageContainer">
{{ 'search.nothing_found' | translate | titlecase }}
</ion-label>
@@ -34,8 +44,5 @@
</ion-list>
<ng-template let-item #defaultListItem>
<stapps-data-list-item
[item]="item"
[hideThumbnail]="singleType"
></stapps-data-list-item>
<stapps-data-list-item [item]="item" [hideThumbnail]="singleType"></stapps-data-list-item>
</ng-template>

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2018-2021 StApps
* Copyright (C) 2022 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.
@@ -85,10 +85,7 @@ export class FoodDataListComponent extends SearchPageComponent {
order: 'asc',
arguments: {
field: 'geo',
position: [
this.positionService.position.longitude,
this.positionService.position.latitude,
],
position: [this.positionService.position.longitude, this.positionService.position.latitude],
},
},
];

View File

@@ -20,9 +20,7 @@ import type {AnimationOptions} from '@ionic/angular/providers/nav-controller';
/**
*
*/
export function searchPageSwitchAnimation(
animationController: AnimationController,
): AnimationBuilder {
export function searchPageSwitchAnimation(animationController: AnimationController): AnimationBuilder {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
return (_baseElement: HTMLElement, options: AnimationOptions | any) => {
const rootTransition = animationController
@@ -44,11 +42,7 @@ export function searchPageSwitchAnimation(
.fromTo('transform', 'translateX(600px)', 'translateX(0px)')
.addElement(options.enteringEl.querySelector('stapps-data-list'));
rootTransition.addAnimation([
enterTransition,
exitTransition,
contentSlide,
]);
rootTransition.addAnimation([enterTransition, exitTransition, contentSlide]);
return rootTransition;
};
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2022 StApps
* Copyright (C) 2023 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.
@@ -15,11 +15,7 @@
import {Component, Input, OnDestroy, OnInit} from '@angular/core';
import {ActivatedRoute, Router} from '@angular/router';
import {Keyboard} from '@capacitor/keyboard';
import {
AlertController,
AnimationBuilder,
AnimationController,
} from '@ionic/angular';
import {AlertController, AnimationBuilder, AnimationController} from '@ionic/angular';
import {Capacitor} from '@capacitor/core';
import {
SCFacet,
@@ -218,9 +214,7 @@ export class SearchPageComponent implements OnInit, OnDestroy {
try {
const result = await this.dataProvider.search(searchOptions);
this.singleTypeResponse =
result.facets.find(facet => facet.field === 'type')?.buckets.length ===
1;
this.singleTypeResponse = result.facets.find(facet => facet.field === 'type')?.buckets.length === 1;
if (append) {
let items = await this.items;
// append results
@@ -321,36 +315,26 @@ export class SearchPageComponent implements OnInit, OnDestroy {
distinctUntilChanged(),
startWith(this.queryText),
),
this.contextMenuService.filterQueryChanged$.pipe(
startWith(this.filterQuery),
),
this.contextMenuService.sortQueryChanged$.pipe(
startWith(this.sortQuery),
),
this.contextMenuService.filterQueryChanged$.pipe(startWith(this.filterQuery)),
this.contextMenuService.sortQueryChanged$.pipe(startWith(this.sortQuery)),
]).subscribe(async query => {
this.queryText = query[0];
this.filterQuery = query[1];
this.sortQuery = query[2];
this.from = 0;
if (
typeof this.filterQuery !== 'undefined' ||
this.queryText?.length > 0 ||
this.showDefaultData
) {
if (typeof this.filterQuery !== 'undefined' || this.queryText?.length > 0 || this.showDefaultData) {
await this.fetchAndUpdateItems();
this.queryChanged.next();
}
}),
this.settingsProvider.settingsActionChanged$.subscribe(
({type, payload}) => {
if (type === 'stapps.settings.changed') {
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
const {category, name, value} = payload!;
this.logger.log(`received event "settings.changed" with category:
this.settingsProvider.settingsActionChanged$.subscribe(({type, payload}) => {
if (type === 'stapps.settings.changed') {
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
const {category, name, value} = payload!;
this.logger.log(`received event "settings.changed" with category:
${category}, name: ${name}, value: ${JSON.stringify(value)}`);
}
},
),
}
}),
this.dataRoutingService.itemSelectListener().subscribe(item => {
if (this.itemRouting) {
void this.router.navigate(['/data-detail', item.uid]);
@@ -358,9 +342,7 @@ export class SearchPageComponent implements OnInit, OnDestroy {
}),
);
try {
const features = this.configProvider.getValue(
'features',
) as SCFeatureConfiguration;
const features = this.configProvider.getValue('features') as SCFeatureConfiguration;
this.isHebisAvailable = !!features.plugins?.['hebis-plugin']?.urlPath;
} catch (error) {
this.logger.error(error);

View File

@@ -39,15 +39,9 @@
</ion-menu-button>
</ion-searchbar>
</ion-toolbar>
<ion-toolbar
color="primary"
class="category-tab"
*ngIf="showNavigation && isHebisAvailable"
>
<ion-toolbar color="primary" class="category-tab" *ngIf="showNavigation && isHebisAvailable">
<ion-buttons class="ion-justify-content-between">
<ion-button class="button-active" size="large">{{
'search.type' | translate
}}</ion-button>
<ion-button class="button-active" size="large">{{ 'search.type' | translate }}</ion-button>
<ion-button
[routerLink]="['/hebis-search']"
queryParamsHandling="merge"
@@ -61,9 +55,7 @@
</ion-header>
<ion-content class="content">
<div
[style.display]="!showDefaultData && !items && !loading ? 'block' : 'none'"
>
<div [style.display]="!showDefaultData && !items && !loading ? 'block' : 'none'">
<ion-label class="centeredMessageContainer">
{{ 'search.instruction' | translate }}
</ion-label>

View File

@@ -1,25 +1,18 @@
/*
* Copyright (C) 2022 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.
* 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.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License along with
* this program. If not, see <https://www.gnu.org/licenses/>.
* 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 {
Component,
ContentChild,
Input,
OnDestroy,
OnInit,
TemplateRef,
} from '@angular/core';
import {Component, ContentChild, Input, OnDestroy, OnInit, TemplateRef} from '@angular/core';
import {SCThings} from '@openstapps/core';
import {Subscription} from 'rxjs';
import {Router} from '@angular/router';
@@ -52,9 +45,7 @@ export class SimpleDataListComponent implements OnInit, OnDestroy {
*/
@Input() listHeader?: string;
@ContentChild(TemplateRef) listItemTemplateRef: TemplateRef<
DataListContext<SCThings>
>;
@ContentChild(TemplateRef) listItemTemplateRef: TemplateRef<DataListContext<SCThings>>;
/**
* Items that display the skeleton list
@@ -66,10 +57,7 @@ export class SimpleDataListComponent implements OnInit, OnDestroy {
*/
subscriptions: Subscription[] = [];
constructor(
protected router: Router,
private readonly dataRoutingService: DataRoutingService,
) {}
constructor(protected router: Router, private readonly dataRoutingService: DataRoutingService) {}
ngOnInit(): void {
if (!this.autoRouting) return;

View File

@@ -1,16 +1,16 @@
<!--
~ Copyright (C) 2022 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.
~ 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.
~
~ This program is distributed in the hope that it will be useful, but WITHOUT
~ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
~ FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
~ more details.
~ This program is distributed in the hope that it will be useful, but WITHOUT
~ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
~ FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
~ more details.
~
~ You should have received a copy of the GNU General Public License along with
~ this program. If not, see <https://www.gnu.org/licenses/>.
~ You should have received a copy of the GNU General Public License along with
~ this program. If not, see <https://www.gnu.org/licenses/>.
-->
<ng-container *ngIf="items as items; else loading">
@@ -18,10 +18,7 @@
<ng-container *ngIf="!listHeader; else header"></ng-container>
<ng-container *ngFor="let item of items | async">
<ng-container
*ngTemplateOutlet="
listItemTemplateRef || defaultListItem;
context: {$implicit: item}
"
*ngTemplateOutlet="listItemTemplateRef || defaultListItem; context: {$implicit: item}"
></ng-container>
</ng-container>
</ion-list>
@@ -45,8 +42,5 @@
</ion-list-header>
</ng-template>
<ng-template let-item #defaultListItem>
<stapps-data-list-item
[item]="item"
[hideThumbnail]="singleType"
></stapps-data-list-item>
<stapps-data-list-item [item]="item" [hideThumbnail]="singleType"></stapps-data-list-item>
</ng-template>

View File

@@ -1,44 +1,29 @@
<!--
~ Copyright (C) 2022 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.
~ 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.
~
~ This program is distributed in the hope that it will be useful, but WITHOUT
~ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
~ FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
~ more details.
~ This program is distributed in the hope that it will be useful, but WITHOUT
~ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
~ FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
~ more details.
~
~ You should have received a copy of the GNU General Public License along with
~ this program. If not, see <https://www.gnu.org/licenses/>.
~ You should have received a copy of the GNU General Public License along with
~ this program. If not, see <https://www.gnu.org/licenses/>.
-->
<ion-accordion-group
*ngIf="entries as entries"
[readonly]="true"
[value]="entries"
[multiple]="true"
>
<ion-accordion-group *ngIf="entries as entries" [readonly]="true" [value]="entries" [multiple]="true">
<ion-accordion *ngFor="let entry of entries" [value]="entry">
<div
*ngIf="groupMap[entry[0]] as header"
slot="header"
class="tree-indicator"
>
<div *ngIf="groupMap[entry[0]] as header" slot="header" class="tree-indicator">
<ng-container
*ngTemplateOutlet="
listItemTemplateRef || defaultListItem;
context: {$implicit: header}
"
*ngTemplateOutlet="listItemTemplateRef || defaultListItem; context: {$implicit: header}"
></ng-container>
</div>
<ion-list slot="content" lines="none">
<div *ngFor="let item of entry[1]._ || []" class="tree-indicator">
<ng-container
*ngTemplateOutlet="
listItemTemplateRef || defaultListItem;
context: {$implicit: item}
"
*ngTemplateOutlet="listItemTemplateRef || defaultListItem; context: {$implicit: item}"
></ng-container>
</div>
<tree-list-fragment
@@ -52,8 +37,5 @@
</ion-accordion-group>
<ng-template let-item #defaultListItem>
<stapps-data-list-item
[item]="item"
[hideThumbnail]="singleType"
></stapps-data-list-item>
<stapps-data-list-item [item]="item" [hideThumbnail]="singleType"></stapps-data-list-item>
</ng-template>

View File

@@ -1,16 +1,16 @@
/*!
* Copyright (C) 2022 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.
* 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.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License along with
* this program. If not, see <https://www.gnu.org/licenses/>.
* You should have received a copy of the GNU General Public License along with
* this program. If not, see <https://www.gnu.org/licenses/>.
*/
ion-list {
@@ -29,7 +29,7 @@ ion-list {
ion-accordion::before,
.tree-indicator::before,
.tree-indicator::after {
content: "";
content: '';
display: block;
background-color: grey;

View File

@@ -1,16 +1,16 @@
/*
* Copyright (C) 2022 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.
* 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.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License along with
* this program. If not, see <https://www.gnu.org/licenses/>.
* 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 {Component, ContentChild, Input, TemplateRef} from '@angular/core';
import {DataListContext} from './data-list.component';
@@ -43,9 +43,7 @@ export class TreeListComponent {
@Input() singleType = false;
@ContentChild(TemplateRef) listItemTemplateRef: TemplateRef<
DataListContext<SCThings>
>;
@ContentChild(TemplateRef) listItemTemplateRef: TemplateRef<DataListContext<SCThings>>;
groupItems() {
if (!this._items || !this._groupingKey) return;
@@ -55,9 +53,7 @@ export class TreeListComponent {
this._groupItems = {};
for (const item of items) {
const path = (
item as unknown as Record<string, SCThingWithoutReferences[]>
)[this._groupingKey];
const path = (item as unknown as Record<string, SCThingWithoutReferences[]>)[this._groupingKey];
for (const pathFragment of path) {
this._groupItems[pathFragment.uid] = pathFragment;

View File

@@ -1,15 +1,14 @@
/*!
* Copyright (C) 2022 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.
* 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.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License along with
* this program. If not, see <https://www.gnu.org/licenses/>.
* You should have received a copy of the GNU General Public License along with
* this program. If not, see <https://www.gnu.org/licenses/>.
*/

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2018, 2019 StApps
* Copyright (C) 2022 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.
@@ -14,10 +14,7 @@
*/
import {HttpClient, HttpResponse} from '@angular/common/http';
import {Injectable} from '@angular/core';
import {
HttpClientInterface,
HttpClientRequest,
} from '@openstapps/api/lib/http-client-interface';
import {HttpClientInterface, HttpClientRequest} from '@openstapps/api/lib/http-client-interface';
/**
* HttpClient that is based on the Angular HttpClient (@TODO: move it to provider or independent package)
@@ -35,9 +32,7 @@ export class StAppsWebHttpClient implements HttpClientInterface {
*
* @param requestConfig Configuration of the request
*/
async request<TYPE_OF_BODY>(
requestConfig: HttpClientRequest,
): Promise<Response<TYPE_OF_BODY>> {
async request<TYPE_OF_BODY>(requestConfig: HttpClientRequest): Promise<Response<TYPE_OF_BODY>> {
const options: {
/**
* TODO
@@ -63,11 +58,7 @@ export class StAppsWebHttpClient implements HttpClientInterface {
try {
const response: HttpResponse<TYPE_OF_BODY> = await this.http
.request<TYPE_OF_BODY>(
requestConfig.method || 'GET',
requestConfig.url.toString(),
options,
)
.request<TYPE_OF_BODY>(requestConfig.method || 'GET', requestConfig.url.toString(), options)
.toPromise();
// eslint-disable-next-line prefer-object-spread

View File

@@ -1,27 +1,22 @@
<!--
~ Copyright (C) 2022 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.
~ 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.
~
~ This program is distributed in the hope that it will be useful, but WITHOUT
~ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
~ FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
~ more details.
~ This program is distributed in the hope that it will be useful, but WITHOUT
~ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
~ FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
~ more details.
~
~ You should have received a copy of the GNU General Public License along with
~ this program. If not, see <https://www.gnu.org/licenses/>.
~ You should have received a copy of the GNU General Public License along with
~ this program. If not, see <https://www.gnu.org/licenses/>.
-->
<ion-card *ngIf="item.sameAs">
<ion-card-header>{{
'hebisSearch.detail.title' | translate | sentencecase
}}</ion-card-header>
<ion-card-header>{{ 'hebisSearch.detail.title' | translate | sentencecase }}</ion-card-header>
<ion-card-content>
<stapps-external-link
[text]="'name' | thingTranslate: item"
[link]="item.sameAs"
></stapps-external-link>
<stapps-external-link [text]="'name' | thingTranslate: item" [link]="item.sameAs"></stapps-external-link>
</ion-card-content>
</ion-card>
@@ -45,13 +40,9 @@
></stapps-simple-card>
<ion-card *ngIf="item.authors && item.authors.length > 0">
<ion-card-header>{{
'authors' | propertyNameTranslate: item | sentencecase
}}</ion-card-header>
<ion-card-header>{{ 'authors' | propertyNameTranslate: item | sentencecase }}</ion-card-header>
<ion-card-content>
<ion-label *ngFor="let author of item.authors">{{
'name' | thingTranslate: author
}}</ion-label>
<ion-label *ngFor="let author of item.authors">{{ 'name' | thingTranslate: author }}</ion-label>
</ion-card-content>
</ion-card>
@@ -70,9 +61,7 @@
</stapps-simple-card>
<ion-card *ngIf="item.publications">
<ion-card-header>{{
'publications' | propertyNameTranslate: item | sentencecase
}}</ion-card-header>
<ion-card-header>{{ 'publications' | propertyNameTranslate: item | sentencecase }}</ion-card-header>
<ion-card-content>
<p *ngFor="let publication of item.publications">
{{ publication.locations | join: ', ' }}
@@ -94,9 +83,7 @@
[content]="item.isPartOf.name"
></stapps-simple-card>
<ion-card *ngIf="item.categories">
<ion-card-header>{{
'categories' | propertyNameTranslate: item | sentencecase
}}</ion-card-header>
<ion-card-header>{{ 'categories' | propertyNameTranslate: item | sentencecase }}</ion-card-header>
<ion-card-content>
<ion-chip [color]="'primary'">
<ion-icon [name]="item.type | dataIcon"></ion-icon>

View File

@@ -1,3 +1,18 @@
<!--
~ Copyright (C) 2023 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.
~
~ This program is distributed in the hope that it will be useful, but WITHOUT
~ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
~ FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
~ more details.
~
~ You should have received a copy of the GNU General Public License along with
~ this program. If not, see <https://www.gnu.org/licenses/>.
-->
<ion-grid>
<ion-row>
<ion-col>
@@ -5,15 +20,11 @@
{{ 'name' | thingTranslate: item }}
</h2>
<p>
<ng-container *ngFor="let author of item.authors">
{{ 'name' | thingTranslate: author }}</ng-container
><ng-container
*ngIf="item.authors && item.authors && item.firstPublished"
>,&nbsp;</ng-container
>
<ng-container
*ngIf="item.firstPublished && !item.lastPublished; else dateRange"
>{{ item.firstPublished }}</ng-container
<ng-container *ngFor="let author of item.authors"> {{ 'name' | thingTranslate: author }}</ng-container
><ng-container *ngIf="item.authors && item.authors && item.firstPublished">,&nbsp;</ng-container>
<ng-container *ngIf="item.firstPublished && !item.lastPublished; else dateRange">{{
item.firstPublished
}}</ng-container
><ng-template #dateRange
><ng-container *ngIf="item.firstPublished && item.lastPublished">{{
[item.firstPublished, item.lastPublished] | join: ' - '

View File

@@ -1,27 +1,22 @@
<!--
~ Copyright (C) 2022 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.
~ 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.
~
~ This program is distributed in the hope that it will be useful, but WITHOUT
~ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
~ FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
~ more details.
~ This program is distributed in the hope that it will be useful, but WITHOUT
~ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
~ FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
~ more details.
~
~ You should have received a copy of the GNU General Public License along with
~ this program. If not, see <https://www.gnu.org/licenses/>.
~ You should have received a copy of the GNU General Public License along with
~ this program. If not, see <https://www.gnu.org/licenses/>.
-->
<ion-card *ngIf="item.sameAs">
<ion-card-header>{{
'hebisSearch.detail.title' | translate | sentencecase
}}</ion-card-header>
<ion-card-header>{{ 'hebisSearch.detail.title' | translate | sentencecase }}</ion-card-header>
<ion-card-content>
<stapps-external-link
[text]="'name' | thingTranslate: item"
[link]="item.sameAs"
></stapps-external-link>
<stapps-external-link [text]="'name' | thingTranslate: item" [link]="item.sameAs"></stapps-external-link>
</ion-card-content>
</ion-card>
@@ -52,13 +47,9 @@
></stapps-simple-card>
<ion-card *ngIf="item.authors && item.authors.length > 0">
<ion-card-header>{{
'authors' | propertyNameTranslate: item | sentencecase
}}</ion-card-header>
<ion-card-header>{{ 'authors' | propertyNameTranslate: item | sentencecase }}</ion-card-header>
<ion-card-content>
<ion-label *ngFor="let author of item.authors">{{
'name' | thingTranslate: author
}}</ion-label>
<ion-label *ngFor="let author of item.authors">{{ 'name' | thingTranslate: author }}</ion-label>
</ion-card-content>
</ion-card>
@@ -81,9 +72,7 @@
>
</stapps-simple-card>
<ion-card *ngIf="item.publications">
<ion-card-header>{{
'publications' | propertyNameTranslate: item | sentencecase
}}</ion-card-header>
<ion-card-header>{{ 'publications' | propertyNameTranslate: item | sentencecase }}</ion-card-header>
<ion-card-content>
<p *ngFor="let publication of item.publications">
{{ publication.locations | join: ', ' }}
@@ -93,9 +82,7 @@
</ion-card-content>
</ion-card>
<ion-card *ngIf="item.categories">
<ion-card-header>{{
'categories' | propertyNameTranslate: item | sentencecase
}}</ion-card-header>
<ion-card-header>{{ 'categories' | propertyNameTranslate: item | sentencecase }}</ion-card-header>
<ion-card-content>
<ion-chip [color]="'primary'">
<ion-icon [name]="item.type | dataIcon"></ion-icon>

View File

@@ -1,3 +1,18 @@
<!--
~ Copyright (C) 2023 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.
~
~ This program is distributed in the hope that it will be useful, but WITHOUT
~ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
~ FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
~ more details.
~
~ You should have received a copy of the GNU General Public License along with
~ this program. If not, see <https://www.gnu.org/licenses/>.
-->
<ion-grid>
<ion-row>
<ion-col>
@@ -5,15 +20,11 @@
{{ 'name' | thingTranslate: item }}
</h2>
<p>
<ng-container *ngFor="let author of item.authors">
{{ 'name' | thingTranslate: author }}</ng-container
><ng-container
*ngIf="item.authors && item.authors && item.firstPublished"
>,&nbsp;</ng-container
>
<ng-container
*ngIf="item.firstPublished && !item.lastPublished; else dateRange"
>{{ item.firstPublished }}</ng-container
<ng-container *ngFor="let author of item.authors"> {{ 'name' | thingTranslate: author }}</ng-container
><ng-container *ngIf="item.authors && item.authors && item.firstPublished">,&nbsp;</ng-container>
<ng-container *ngIf="item.firstPublished && !item.lastPublished; else dateRange">{{
item.firstPublished
}}</ng-container
><ng-template #dateRange
><ng-container *ngIf="item.firstPublished && item.lastPublished">{{
[item.firstPublished, item.lastPublished] | join: ' - '

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2019-2021 StApps
* Copyright (C) 2022 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.
@@ -21,10 +21,7 @@ import {SearchPageComponent} from '../../list/search-page.component';
templateUrl: 'catalog-detail-content.html',
styleUrls: ['catalog-detail-content.scss'],
})
export class CatalogDetailContentComponent
extends SearchPageComponent
implements OnInit
{
export class CatalogDetailContentComponent extends SearchPageComponent implements OnInit {
/**
* SCCatalog to display
*/

View File

@@ -1,25 +1,23 @@
<!--
~ Copyright (C) 2022 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.
~ Copyright (C) 2023 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.
~
~ This program is distributed in the hope that it will be useful, but WITHOUT
~ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
~ FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
~ more details.
~ This program is distributed in the hope that it will be useful, but WITHOUT
~ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
~ FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
~ more details.
~
~ You should have received a copy of the GNU General Public License along with
~ this program. If not, see <https://www.gnu.org/licenses/>.
~ You should have received a copy of the GNU General Public License along with
~ this program. If not, see <https://www.gnu.org/licenses/>.
-->
<ion-card>
<ion-card-header>
{{ 'event' | propertyNameTranslate: item | titlecase }}
</ion-card-header>
<ion-card-content>
<a [routerLink]="['/data-detail', item.event.uid]">{{
'name' | thingTranslate: item.event
}}</a>
<a [routerLink]="['/data-detail', item.event.uid]">{{ 'name' | thingTranslate: item.event }}</a>
</ion-card-content>
</ion-card>
<ion-card *ngIf="item.inPlace">
@@ -28,9 +26,7 @@
</ion-card-header>
<ion-card-content>
<ion-icon name="pin_drop"> </ion-icon>
<a [routerLink]="['/data-detail', item.inPlace.uid]">{{
'name' | thingTranslate: item.inPlace
}}</a>
<a [routerLink]="['/data-detail', item.inPlace.uid]">{{ 'name' | thingTranslate: item.inPlace }}</a>
<stapps-address-detail
*ngIf="item.inPlace.address"
[address]="item.inPlace.address"
@@ -63,7 +59,4 @@
[title]="'performers' | propertyNameTranslate: item.performers | titlecase"
[content]="item.performers"
></stapps-simple-card>
<stapps-offers-detail
*ngIf="item.offers"
[offers]="item.offers"
></stapps-offers-detail>
<stapps-offers-detail *ngIf="item.offers" [offers]="item.offers"></stapps-offers-detail>

View File

@@ -1,16 +1,16 @@
<!--
~ Copyright (C) 2022 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.
~ 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.
~
~ This program is distributed in the hope that it will be useful, but WITHOUT
~ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
~ FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
~ more details.
~ This program is distributed in the hope that it will be useful, but WITHOUT
~ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
~ FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
~ more details.
~
~ You should have received a copy of the GNU General Public License along with
~ this program. If not, see <https://www.gnu.org/licenses/>.
~ You should have received a copy of the GNU General Public License along with
~ this program. If not, see <https://www.gnu.org/licenses/>.
-->
<ion-grid>
@@ -22,14 +22,11 @@
<ion-icon name="calendar_today"></ion-icon>
<span *ngIf="item.dates[0] && item.dates[item.dates.length - 1]">
<span *ngIf="item.repeatFrequency">
{{
item.repeatFrequency | durationLocalized: true | sentencecase
}},
{{ item.repeatFrequency | durationLocalized: true | sentencecase }},
{{ item.dates[0] | dateFormat: 'weekday:long' }}
</span>
<span>
({{ item.dates[0] | dateFormat }} -
{{ item.dates[item.dates.length - 1] | dateFormat }})
({{ item.dates[0] | dateFormat }} - {{ item.dates[item.dates.length - 1] | dateFormat }})
</span>
</span>
</p>
@@ -39,10 +36,7 @@
</div>
</ion-col>
<ion-col width-20 text-right>
<stapps-offers-in-list
*ngIf="item.offers"
[offers]="item.offers"
></stapps-offers-in-list>
<stapps-offers-in-list *ngIf="item.offers" [offers]="item.offers"></stapps-offers-in-list>
</ion-col>
</ion-row>
</ion-grid>

View File

@@ -1,3 +1,18 @@
<!--
~ Copyright (C) 2023 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.
~
~ This program is distributed in the hope that it will be useful, but WITHOUT
~ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
~ FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
~ more details.
~
~ You should have received a copy of the GNU General Public License along with
~ this program. If not, see <https://www.gnu.org/licenses/>.
-->
<ion-grid>
<ion-row>
<ion-col>
@@ -12,15 +27,8 @@
<ion-card-header class="no-padding-inline-start vertical-list">
<ul>
<li>
<ng-container
*ngFor="
let characteristic of 'characteristics' | thingTranslate: item
"
>
<img
[src]="characteristic.image"
[alt]="characteristic.name | titlecase"
/>
<ng-container *ngFor="let characteristic of 'characteristics' | thingTranslate: item">
<img [src]="characteristic.image" [alt]="characteristic.name | titlecase" />
</ng-container>
</li>
</ul>
@@ -30,10 +38,7 @@
</ion-row>
</ion-grid>
<stapps-offers-detail
*ngIf="item.offers"
[offers]="item.offers"
></stapps-offers-detail>
<stapps-offers-detail *ngIf="item.offers" [offers]="item.offers"></stapps-offers-detail>
<!-- unwanted by swffm
<ion-card *ngIf="item.nutrition">
<ion-card-header>{{

View File

@@ -1,4 +1,19 @@
@import "src/theme/common/_helper.scss";
/*!
* Copyright (C) 2023 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.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* 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 'src/theme/common/_helper.scss';
.vertical-list {
ul li img {
filter: unset;

View File

@@ -1,3 +1,18 @@
<!--
~ Copyright (C) 2023 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.
~
~ This program is distributed in the hope that it will be useful, but WITHOUT
~ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
~ FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
~ more details.
~
~ You should have received a copy of the GNU General Public License along with
~ this program. If not, see <https://www.gnu.org/licenses/>.
-->
<ion-grid>
<ion-row>
<ion-col>
@@ -12,15 +27,8 @@
{{ 'categories' | thingTranslate: item | join: ', ' | titlecase }}
</li>
<li *ngIf="item.characteristics">
<ng-container
*ngFor="
let characteristic of 'characteristics' | thingTranslate: item
"
>
<img
[src]="characteristic.image"
[alt]="characteristic.name | titlecase"
/>
<ng-container *ngFor="let characteristic of 'characteristics' | thingTranslate: item">
<img [src]="characteristic.image" [alt]="characteristic.name | titlecase" />
</ng-container>
</li>
</ul>
@@ -29,10 +37,7 @@
</ion-col>
<ion-col width-10 text-right>
<div class="ion-text-end">
<stapps-offers-in-list
*ngIf="item.offers"
[offers]="item.offers"
></stapps-offers-in-list>
<stapps-offers-in-list *ngIf="item.offers" [offers]="item.offers"></stapps-offers-in-list>
</div>
</ion-col>
</ion-row>

View File

@@ -1,25 +1,19 @@
/*
* Copyright (C) 2022 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.
* 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.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License along with
* this program. If not, see <https://www.gnu.org/licenses/>.
* 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 {Component, Input} from '@angular/core';
import {
SCAcademicEvent,
SCSportCourse,
SCThing,
SCThingTranslator,
SCTranslations,
} from '@openstapps/core';
import {SCAcademicEvent, SCSportCourse, SCThing, SCThingTranslator, SCTranslations} from '@openstapps/core';
/**
* TODO

View File

@@ -1,16 +1,16 @@
<!--
~ Copyright (C) 2022 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.
~ Copyright (C) 2023 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.
~
~ This program is distributed in the hope that it will be useful, but WITHOUT
~ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
~ FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
~ more details.
~ This program is distributed in the hope that it will be useful, but WITHOUT
~ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
~ FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
~ more details.
~
~ You should have received a copy of the GNU General Public License along with
~ this program. If not, see <https://www.gnu.org/licenses/>.
~ You should have received a copy of the GNU General Public License along with
~ this program. If not, see <https://www.gnu.org/licenses/>.
-->
<ion-grid>
@@ -25,10 +25,7 @@
</ion-col>
<ion-col>
<ion-card>
<stapps-add-event-action-chip
*ngIf="item.type === 'academic event'"
[item]="item"
>
<stapps-add-event-action-chip *ngIf="item.type === 'academic event'" [item]="item">
</stapps-add-event-action-chip>
</ion-card>
</ion-col>

View File

@@ -1,3 +1,18 @@
<!--
~ Copyright (C) 2023 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.
~
~ This program is distributed in the hope that it will be useful, but WITHOUT
~ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
~ FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
~ more details.
~
~ You should have received a copy of the GNU General Public License along with
~ this program. If not, see <https://www.gnu.org/licenses/>.
-->
<ion-grid>
<ion-row *ngIf="item.type === 'academic event'">
<ion-col>
@@ -9,9 +24,7 @@
<p *ngIf="item.academicTerms" class="title-sub">
{{ 'name' | thingTranslate: item.academicTerms[0] }}
</p>
<ion-note *ngIf="!item.categories">{{
'type' | thingTranslate: item
}}</ion-note>
<ion-note *ngIf="!item.categories">{{ 'type' | thingTranslate: item }}</ion-note>
<ion-note *ngIf="item.categories">
{{ 'categories' | thingTranslate: item | join: ', ' }}
</ion-note>

View File

@@ -1,16 +1,16 @@
<!--
~ Copyright (C) 2022 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.
~ 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.
~
~ This program is distributed in the hope that it will be useful, but WITHOUT
~ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
~ FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
~ more details.
~ This program is distributed in the hope that it will be useful, but WITHOUT
~ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
~ FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
~ more details.
~
~ You should have received a copy of the GNU General Public License along with
~ this program. If not, see <https://www.gnu.org/licenses/>.
~ You should have received a copy of the GNU General Public License along with
~ this program. If not, see <https://www.gnu.org/licenses/>.
-->
<ion-breadcrumbs
@@ -20,12 +20,9 @@
[itemsBeforeCollapse]="itemsBeforeCollapse"
>
<ion-breadcrumb *ngFor="let item of items">
<ion-label
class="crumb-label"
*ngIf="item"
[routerLink]="['/data-detail', item.uid]"
>{{ 'name' | thingTranslate: $any(item) }}</ion-label
>
<ion-label class="crumb-label" *ngIf="item" [routerLink]="['/data-detail', item.uid]">{{
'name' | thingTranslate: $any(item)
}}</ion-label>
</ion-breadcrumb>
</ion-breadcrumbs>
<ion-popover #popover>
@@ -55,11 +52,7 @@
</ion-popover>
<ng-template #popoverItem let-item="item">
<ion-item
*ngIf="item"
[routerLink]="['/data-detail', item.uid]"
(click)="popover.dismiss()"
>
<ion-item *ngIf="item" [routerLink]="['/data-detail', item.uid]" (click)="popover.dismiss()">
{{ 'name' | thingTranslate: $any(item) }}
</ion-item>
</ng-template>

View File

@@ -1,3 +1,18 @@
<!--
~ Copyright (C) 2022 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.
~
~ This program is distributed in the hope that it will be useful, but WITHOUT
~ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
~ FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
~ more details.
~
~ You should have received a copy of the GNU General Public License along with
~ this program. If not, see <https://www.gnu.org/licenses/>.
-->
<ion-grid>
<ion-row>
<ion-col>
@@ -12,11 +27,7 @@
[size]="80"
></stapps-long-inline-text>
</p>
<ion-note
>{{ 'type' | thingTranslate: item }} ({{
'type' | thingTranslate: item.data
}})</ion-note
>
<ion-note>{{ 'type' | thingTranslate: item }} ({{ 'type' | thingTranslate: item.data }})</ion-note>
</div>
</ion-col>
<ion-col width-20 text-right>

View File

@@ -59,10 +59,7 @@
{{ 'sameAs' | propertyNameTranslate: item | titlecase }}
</ion-card-header>
<ion-card-content>
<stapps-external-link
[link]="item.sameAs"
[text]="item.name"
></stapps-external-link>
<stapps-external-link [link]="item.sameAs" [text]="item.name"></stapps-external-link>
</ion-card-content>
</ion-card>
</ng-template>

View File

@@ -1,13 +1,25 @@
<!--
~ Copyright (C) 2022 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.
~
~ This program is distributed in the hope that it will be useful, but WITHOUT
~ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
~ FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
~ more details.
~
~ You should have received a copy of the GNU General Public License along with
~ this program. If not, see <https://www.gnu.org/licenses/>.
-->
<ion-grid>
<ion-row>
<ion-col>
<div class="ion-text-wrap">
<ion-label class="title">{{ 'name' | thingTranslate: item }}</ion-label>
<p *ngIf="item.messageBody">
<stapps-long-inline-text
[text]="item.messageBody"
[size]="80"
></stapps-long-inline-text>
<stapps-long-inline-text [text]="item.messageBody" [size]="80"></stapps-long-inline-text>
</p>
<ion-note>{{ 'type' | thingTranslate: item }}</ion-note>
</div>

View File

@@ -1,16 +1,16 @@
<!--
~ Copyright (C) 2022 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.
~ 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.
~
~ This program is distributed in the hope that it will be useful, but WITHOUT
~ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
~ FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
~ more details.
~ This program is distributed in the hope that it will be useful, but WITHOUT
~ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
~ FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
~ more details.
~
~ You should have received a copy of the GNU General Public License along with
~ this program. If not, see <https://www.gnu.org/licenses/>.
~ You should have received a copy of the GNU General Public License along with
~ this program. If not, see <https://www.gnu.org/licenses/>.
-->
<ion-card *ngIf="item.inPlace">
@@ -19,9 +19,7 @@
</ion-card-header>
<ion-card-content>
<ion-icon name="pin_drop"></ion-icon>
<a [routerLink]="['/data-detail', item.inPlace.uid]">{{
'name' | thingTranslate: item.inPlace
}}</a>
<a [routerLink]="['/data-detail', item.inPlace.uid]">{{ 'name' | thingTranslate: item.inPlace }}</a>
<stapps-address-detail
*ngIf="item.inPlace.address"
[address]="item.inPlace.address"

View File

@@ -1,27 +1,22 @@
<!--
~ Copyright (C) 2022 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.
~ 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.
~
~ This program is distributed in the hope that it will be useful, but WITHOUT
~ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
~ FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
~ more details.
~ This program is distributed in the hope that it will be useful, but WITHOUT
~ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
~ FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
~ more details.
~
~ You should have received a copy of the GNU General Public License along with
~ this program. If not, see <https://www.gnu.org/licenses/>.
~ You should have received a copy of the GNU General Public License along with
~ this program. If not, see <https://www.gnu.org/licenses/>.
-->
<ion-card *ngIf="item.sameAs">
<ion-card-header>{{
'hebisSearch.detail.title' | translate | sentencecase
}}</ion-card-header>
<ion-card-header>{{ 'hebisSearch.detail.title' | translate | sentencecase }}</ion-card-header>
<ion-card-content>
<stapps-external-link
[text]="'name' | thingTranslate: item"
[link]="item.sameAs"
></stapps-external-link>
<stapps-external-link [text]="'name' | thingTranslate: item" [link]="item.sameAs"></stapps-external-link>
</ion-card-content>
</ion-card>
@@ -45,13 +40,9 @@
></stapps-simple-card>
<ion-card *ngIf="item.authors && item.authors.length > 0">
<ion-card-header>{{
'authors' | propertyNameTranslate: item | sentencecase
}}</ion-card-header>
<ion-card-header>{{ 'authors' | propertyNameTranslate: item | sentencecase }}</ion-card-header>
<ion-card-content>
<ion-label *ngFor="let author of item.authors">{{
'name' | thingTranslate: author
}}</ion-label>
<ion-label *ngFor="let author of item.authors">{{ 'name' | thingTranslate: author }}</ion-label>
</ion-card-content>
</ion-card>
@@ -68,9 +59,7 @@
>
</stapps-simple-card>
<ion-card *ngIf="item.publications">
<ion-card-header>{{
'publications' | propertyNameTranslate: item | sentencecase
}}</ion-card-header>
<ion-card-header>{{ 'publications' | propertyNameTranslate: item | sentencecase }}</ion-card-header>
<ion-card-content>
<p *ngFor="let publication of item.publications">
{{ publication.locations | join: ', ' }}
@@ -80,9 +69,7 @@
</ion-card-content>
</ion-card>
<ion-card *ngIf="item.categories">
<ion-card-header>{{
'categories' | propertyNameTranslate: item | sentencecase
}}</ion-card-header>
<ion-card-header>{{ 'categories' | propertyNameTranslate: item | sentencecase }}</ion-card-header>
<ion-card-content>
<ion-chip [color]="'primary'">
<ion-icon [name]="item.type | dataIcon"></ion-icon>

View File

@@ -1,3 +1,18 @@
<!--
~ Copyright (C) 2023 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.
~
~ This program is distributed in the hope that it will be useful, but WITHOUT
~ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
~ FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
~ more details.
~
~ You should have received a copy of the GNU General Public License along with
~ this program. If not, see <https://www.gnu.org/licenses/>.
-->
<ion-grid>
<ion-row>
<ion-col>
@@ -5,15 +20,11 @@
{{ 'name' | thingTranslate: item }}
</h2>
<p>
<ng-container *ngFor="let author of item.authors">
{{ 'name' | thingTranslate: author }}</ng-container
><ng-container
*ngIf="item.authors && item.authors && item.firstPublished"
>,&nbsp;</ng-container
>
<ng-container
*ngIf="item.firstPublished && !item.lastPublished; else dateRange"
>{{ item.firstPublished }}</ng-container
<ng-container *ngFor="let author of item.authors"> {{ 'name' | thingTranslate: author }}</ng-container
><ng-container *ngIf="item.authors && item.authors && item.firstPublished">,&nbsp;</ng-container>
<ng-container *ngIf="item.firstPublished && !item.lastPublished; else dateRange">{{
item.firstPublished
}}</ng-container
><ng-template #dateRange
><ng-container *ngIf="item.firstPublished && item.lastPublished">{{
[item.firstPublished, item.lastPublished] | join: ' - '

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2019-2022 StApps
* Copyright (C) 2022 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.
@@ -50,9 +50,7 @@ export class PersonDetailContentComponent {
constructor(private readonly dataProvider: DataProvider) {}
async getContactPoints(
workLocations: SCContactPointWithoutReferences[],
): Promise<SCContactPoint[]> {
async getContactPoints(workLocations: SCContactPointWithoutReferences[]): Promise<SCContactPoint[]> {
const query: {[uid in SCUuid]: SCSearchQuery} = {};
workLocations.map(workLocation => {
query[workLocation.uid] = {
@@ -66,9 +64,9 @@ export class PersonDetailContentComponent {
};
});
const contactPoints: SCContactPoint[] = Object.values(
await this.dataProvider.multiSearch(query),
).map(result => result.data[0] as SCContactPoint);
const contactPoints: SCContactPoint[] = Object.values(await this.dataProvider.multiSearch(query)).map(
result => result.data[0] as SCContactPoint,
);
return contactPoints;
}

View File

@@ -1,3 +1,18 @@
<!--
~ Copyright (C) 2022 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.
~
~ This program is distributed in the hope that it will be useful, but WITHOUT
~ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
~ FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
~ more details.
~
~ You should have received a copy of the GNU General Public License along with
~ this program. If not, see <https://www.gnu.org/licenses/>.
-->
<ng-container *ngIf="contactPoints">
<ion-card *ngFor="let contactPoint of contactPoints; let i = index">
<ion-card-header>
@@ -7,9 +22,7 @@
<ion-card-content>
<p *ngIf="contactPoint.telephone">
{{ 'telephone' | propertyNameTranslate: contactPoint | titlecase }}:
<a [href]="'tel:' + contactPoint.telephone">{{
contactPoint.telephone
}}</a>
<a [href]="'tel:' + contactPoint.telephone">{{ contactPoint.telephone }}</a>
</p>
<p *ngIf="contactPoint.email">
{{ 'email' | propertyNameTranslate: contactPoint | titlecase }}:
@@ -29,9 +42,7 @@
</p>
<p *ngIf="contactPoint.areaServed">
{{ 'areaServed' | propertyNameTranslate: contactPoint | titlecase }}:
<a [routerLink]="['/data-detail', contactPoint.areaServed.uid]">{{
contactPoint.areaServed.name
}}</a>
<a [routerLink]="['/data-detail', contactPoint.areaServed.uid]">{{ contactPoint.areaServed.name }}</a>
</p>
</ion-card-content>
</ion-card>

View File

@@ -1,3 +1,18 @@
<!--
~ Copyright (C) 2022 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.
~
~ This program is distributed in the hope that it will be useful, but WITHOUT
~ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
~ FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
~ more details.
~
~ You should have received a copy of the GNU General Public License along with
~ this program. If not, see <https://www.gnu.org/licenses/>.
-->
<ion-grid>
<ion-row>
<ion-col>
@@ -8,12 +23,8 @@
</ion-label>
<p *ngIf="item.telephone || item.email">
<span *ngIf="item.telephone">
<ion-icon name="call"></ion-icon>&nbsp;{{
item.telephone
}}&nbsp; </span
><span *ngIf="item.email">
<ion-icon name="mail"></ion-icon>&nbsp;{{ item.email }}
</span>
<ion-icon name="call"></ion-icon>&nbsp;{{ item.telephone }}&nbsp; </span
><span *ngIf="item.email"> <ion-icon name="mail"></ion-icon>&nbsp;{{ item.email }} </span>
</p>
<stapps-long-inline-text
*ngIf="item.jobTitles"

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2019 StApps
* Copyright (C) 2022 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.
@@ -13,13 +13,7 @@
* this program. If not, see <https://www.gnu.org/licenses/>.
*/
import {Component, Input, OnInit} from '@angular/core';
import {
SCBuilding,
SCFloor,
SCPointOfInterest,
SCRoom,
SCThings,
} from '@openstapps/core';
import {SCBuilding, SCFloor, SCPointOfInterest, SCRoom, SCThings} from '@openstapps/core';
import {DataProvider} from '../../data.provider';
import {hasValidLocation, isSCFloor} from './place-types';
@@ -70,7 +64,6 @@ export class PlaceDetailContentComponent implements OnInit {
}
ngOnInit() {
this.hasValidLocation =
!isSCFloor(this.item) && hasValidLocation(this.item);
this.hasValidLocation = !isSCFloor(this.item) && hasValidLocation(this.item);
}
}

View File

@@ -1,16 +1,16 @@
<!--
~ Copyright (C) 2022 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.
~ 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.
~
~ This program is distributed in the hope that it will be useful, but WITHOUT
~ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
~ FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
~ more details.
~ This program is distributed in the hope that it will be useful, but WITHOUT
~ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
~ FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
~ more details.
~
~ You should have received a copy of the GNU General Public License along with
~ this program. If not, see <https://www.gnu.org/licenses/>.
~ You should have received a copy of the GNU General Public License along with
~ this program. If not, see <https://www.gnu.org/licenses/>.
-->
<stapps-place-mensa-detail-content
@@ -36,9 +36,7 @@
</ion-card-header>
<ion-card-content>
<ion-icon name="pin_drop"></ion-icon>
<a [routerLink]="['/data-detail', item.inPlace.uid]">{{
'name' | thingTranslate: item.inPlace
}}</a>
<a [routerLink]="['/data-detail', item.inPlace.uid]">{{ 'name' | thingTranslate: item.inPlace }}</a>
</ion-card-content>
</ion-card>
</ng-container>

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2019-2021 StApps
* Copyright (C) 2022 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.
@@ -15,12 +15,7 @@
import {Component, Input} from '@angular/core';
import {PositionService} from '../../../map/position.service';
import {Subscription, interval} from 'rxjs';
import {
hasValidLocation,
isSCFloor,
PlaceTypes,
PlaceTypesWithDistance,
} from './place-types';
import {hasValidLocation, isSCFloor, PlaceTypes, PlaceTypesWithDistance} from './place-types';
/**
* Shows a place as a list item

View File

@@ -1,16 +1,16 @@
<!--
~ Copyright (C) 2022 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.
~ Copyright (C) 2023 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.
~
~ This program is distributed in the hope that it will be useful, but WITHOUT
~ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
~ FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
~ more details.
~ This program is distributed in the hope that it will be useful, but WITHOUT
~ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
~ FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
~ more details.
~
~ You should have received a copy of the GNU General Public License along with
~ this program. If not, see <https://www.gnu.org/licenses/>.
~ You should have received a copy of the GNU General Public License along with
~ this program. If not, see <https://www.gnu.org/licenses/>.
-->
<ion-grid>
@@ -21,20 +21,14 @@
<ng-container *ngIf="item.type !== 'floor'">
<p class="title-sub" *ngIf="item.openingHours">
<span>
<stapps-opening-hours
[openingHours]="item.openingHours"
></stapps-opening-hours>
<stapps-opening-hours [openingHours]="item.openingHours"></stapps-opening-hours>
</span>
</p>
<p>
<ion-note
*ngIf="item.categories && item.type !== 'building'; else onlyType"
>
<ion-note *ngIf="item.categories && item.type !== 'building'; else onlyType">
<ul>
<li>
{{
'categories' | thingTranslate: item | join: ', ' | titlecase
}}
{{ 'categories' | thingTranslate: item | join: ', ' | titlecase }}
</li>
<li *ngIf="distance">
<ion-icon name="directions_walk"></ion-icon>
@@ -64,8 +58,7 @@
</ion-col>
<div *ngIf="item.type !== 'building'">
<ion-col width-20 text-right *ngIf="item.inPlace">
<ion-icon name="pin_drop"></ion-icon
>{{ 'name' | thingTranslate: item.inPlace }}
<ion-icon name="pin_drop"></ion-icon>{{ 'name' | thingTranslate: item.inPlace }}
</ion-col>
</div>
</ion-row>

View File

@@ -1,16 +1,16 @@
/*
* Copyright (C) 2022 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.
* Copyright (C) 2023 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.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License along with
* this program. If not, see <https://www.gnu.org/licenses/>.
* 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 moment, {Moment} from 'moment';
@@ -89,10 +89,7 @@ export class PlaceMensaDetailComponent implements AfterViewInit, OnDestroy {
);
}
const dishesByDay = this.mensaService.getAllDishes(
this.item,
this.displayRange,
);
const dishesByDay = this.mensaService.getAllDishes(this.item, this.displayRange);
dishesByDay.then(result => {
for (const [key, value] of Object.entries(result)) {
@@ -107,10 +104,7 @@ export class PlaceMensaDetailComponent implements AfterViewInit, OnDestroy {
try {
const dishesBySections: Record<string, Record<string, SCDish[]>> = {};
for (const [key, value] of Object.entries(await dishesByDay)) {
dishesBySections[key] = groupBy(
value,
x => x.menuSection?.name ?? '',
);
dishesBySections[key] = groupBy(value, x => x.menuSection?.name ?? '');
}
resolve(dishesBySections);
} catch {

View File

@@ -1,26 +1,20 @@
/*
* Copyright (C) 2022 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.
* Copyright (C) 2023 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.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License along with
* this program. If not, see <https://www.gnu.org/licenses/>.
* 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 {Injectable} from '@angular/core';
import {
SCDish,
SCISO8601Date,
SCPlace,
SCSearchQuery,
SCThingType,
} from '@openstapps/core';
import {SCDish, SCISO8601Date, SCPlace, SCSearchQuery, SCThingType} from '@openstapps/core';
import moment from 'moment';
import {DataProvider} from '../../../../data.provider';
import {mapValues} from '../../../../../../_helpers/collections/map-values';
@@ -33,28 +27,16 @@ import {SettingsProvider} from '../../../../../settings/settings.provider';
providedIn: 'root',
})
export class PlaceMensaService {
constructor(
private dataProvider: DataProvider,
readonly settingsProvider: SettingsProvider,
) {}
constructor(private dataProvider: DataProvider, readonly settingsProvider: SettingsProvider) {}
/**
* Fetches all dishes for this building
*
* Splits dishes as such that each list contains all dishes that are available at that day.
*/
async getAllDishes(
place: SCPlace,
days: number,
): Promise<Record<SCISO8601Date, SCDish[]>> {
const priceGroup = await this.settingsProvider.getSetting(
'profile',
'group',
);
const request = mapValues<
Record<SCISO8601Date, SCISO8601Date>,
SCSearchQuery
>(
async getAllDishes(place: SCPlace, days: number): Promise<Record<SCISO8601Date, SCDish[]>> {
const priceGroup = await this.settingsProvider.getSetting('profile', 'group');
const request = mapValues<Record<SCISO8601Date, SCISO8601Date>, SCSearchQuery>(
Array.from({length: days})
.map((_, i) => i)
.map(i => moment().add(i, 'days').toISOString())
@@ -96,10 +78,7 @@ export class PlaceMensaService {
sort: [
{
arguments: {
field: `offers.prices.${(priceGroup.value as string).replace(
/s$/,
'',
)}`,
field: `offers.prices.${(priceGroup.value as string).replace(/s$/, '')}`,
},
order: 'desc',
type: 'generic',
@@ -109,9 +88,9 @@ export class PlaceMensaService {
}),
);
return mapValues(
await this.dataProvider.multiSearch(request),
it => it.data,
) as Record<SCISO8601Date, SCDish[]>;
return mapValues(await this.dataProvider.multiSearch(request), it => it.data) as Record<
SCISO8601Date,
SCDish[]
>;
}
}

View File

@@ -1,11 +1,23 @@
<!--
~ Copyright (C) 2023 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.
~
~ This program is distributed in the hope that it will be useful, but WITHOUT
~ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
~ FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
~ more details.
~
~ You should have received a copy of the GNU General Public License along with
~ this program. If not, see <https://www.gnu.org/licenses/>.
-->
<ng-container>
<ng-container *ngIf="dishes | async as dishes; else loading">
<ng-container *ngIf="(dishes | json) !== '{}'; else empty">
<ion-segment [(ngModel)]="selectedDay" mode="md">
<ion-segment-button
*ngFor="let day of dishes | keyvalue"
[value]="day.key"
>
<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>
@@ -19,25 +31,16 @@
<ng-container *ngIf="(date.value | json) !== '{}'; else empty">
<ion-list *ngSwitchCase="date.key">
<ng-container *ngFor="let section of date.value | keyvalue">
<ion-list-header
*ngIf="section.value[0].menuSection"
lines="inset"
>
<ion-list-header *ngIf="section.value[0].menuSection" lines="inset">
<ion-label class="title">
{{
'data.types.dish.detail.' +
section.value[0].menuSection.name
| translate
| titlecase
'data.types.dish.detail.' + section.value[0].menuSection.name | translate | titlecase
}}
{{ section.value[0].menuSection.servingHours }}
</ion-label>
</ion-list-header>
<ng-container *ngFor="let dish of section.value; index as j">
<stapps-data-list-item
[item]="dish"
[hideThumbnail]="true"
></stapps-data-list-item>
<stapps-data-list-item [item]="dish" [hideThumbnail]="true"></stapps-data-list-item>
</ng-container>
</ng-container>
</ion-list>
@@ -48,14 +51,10 @@
</ng-container>
<ng-template #loading>
<ion-segment>
<stapps-skeleton-segment-button
*ngFor="let skeleton of [1, 2, 3]"
></stapps-skeleton-segment-button>
<stapps-skeleton-segment-button *ngFor="let skeleton of [1, 2, 3]"></stapps-skeleton-segment-button>
</ion-segment>
<ion-list>
<stapps-skeleton-list-item
*ngFor="let skeleton of [1, 2]"
></stapps-skeleton-list-item>
<stapps-skeleton-list-item *ngFor="let skeleton of [1, 2]"></stapps-skeleton-list-item>
</ion-list>
</ng-template>
<ng-template #empty>

View File

@@ -1,3 +1,18 @@
/*!
* Copyright (C) 2023 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.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License along with
* this program. If not, see <https://www.gnu.org/licenses/>.
*/
ion-segment-button {
text-transform: none;
}
@@ -8,13 +23,13 @@ ion-segment {
height: 50px;
&::-webkit-scrollbar {
width: 0;
height: 0;
display: none;
width: 0;
height: 0;
display: none;
}
ion-segment-button.segment-button {
flex: 1 0 100px;
flex: 1 0 100px;
}
}
@@ -22,4 +37,4 @@ ion-list-header {
ion-label {
color: var(--ion-color-medium-shade);
}
}
}

View File

@@ -1,3 +1,18 @@
<!--
~ Copyright (C) 2022 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.
~
~ This program is distributed in the hope that it will be useful, but WITHOUT
~ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
~ FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
~ more details.
~
~ You should have received a copy of the GNU General Public License along with
~ this program. If not, see <https://www.gnu.org/licenses/>.
-->
<stapps-simple-card
*ngIf="item.eventsStartDate && item.eventsEndDate"
[title]="
@@ -5,9 +20,5 @@
' - ' +
('eventsEndDate' | propertyNameTranslate: item | titlecase)
"
[content]="
(item.eventsStartDate | amDateFormat: 'll') +
' - ' +
(item.eventsEndDate | amDateFormat: 'll')
"
[content]="(item.eventsStartDate | amDateFormat: 'll') + ' - ' + (item.eventsEndDate | amDateFormat: 'll')"
></stapps-simple-card>

View File

@@ -1,16 +1,16 @@
<!--
~ Copyright (C) 2022 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.
~ 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.
~
~ This program is distributed in the hope that it will be useful, but WITHOUT
~ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
~ FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
~ more details.
~ This program is distributed in the hope that it will be useful, but WITHOUT
~ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
~ FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
~ more details.
~
~ You should have received a copy of the GNU General Public License along with
~ this program. If not, see <https://www.gnu.org/licenses/>.
~ You should have received a copy of the GNU General Public License along with
~ this program. If not, see <https://www.gnu.org/licenses/>.
-->
<ion-grid>
@@ -20,10 +20,7 @@
<ion-label class="title">{{ 'name' | thingTranslate: item }}</ion-label>
<p class="title-sub">
<ion-icon name="calendar_today"></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>

View File

@@ -1,3 +1,18 @@
<!--
~ Copyright (C) 2022 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.
~
~ This program is distributed in the hope that it will be useful, but WITHOUT
~ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
~ FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
~ more details.
~
~ You should have received a copy of the GNU General Public License along with
~ this program. If not, see <https://www.gnu.org/licenses/>.
-->
<stapps-simple-card
*ngIf="item.actors"
[title]="'actors' | propertyNameTranslate: item | titlecase"
@@ -14,7 +29,4 @@
[content]="item.datePublished | amDateFormat: 'll'"
>
</stapps-simple-card>
<stapps-offers-detail
*ngIf="item.offers"
[offers]="item.offers"
></stapps-offers-detail>
<stapps-offers-detail *ngIf="item.offers" [offers]="item.offers"></stapps-offers-detail>