refactor: pre release cleanup all over the place

This commit is contained in:
Rainer Killinger
2022-10-21 16:01:44 +00:00
parent c3130a392a
commit acdd93eb99
20 changed files with 215 additions and 139 deletions

View File

@@ -94,19 +94,21 @@ export class AppComponent implements AfterContentInit {
});
this.platform.ready().then(async () => {
if (Capacitor.isNativePlatform()) {
await StatusBar.setBackgroundColor({
color: getComputedStyle(document.documentElement)
.getPropertyValue('--ion-color-primary')
.trim(),
});
await StatusBar.setStyle({style: Style.Dark});
await StatusBar.setOverlaysWebView({overlay: false});
await NavigationBar.setColor({
color: getComputedStyle(document.documentElement)
.getPropertyValue('--ion-background-color')
.trim(),
darkButtons: true,
});
if (Capacitor.getPlatform() === 'android') {
await StatusBar.setBackgroundColor({
color: getComputedStyle(document.documentElement)
.getPropertyValue('--ion-color-primary')
.trim(),
});
await StatusBar.setOverlaysWebView({overlay: false});
await NavigationBar.setColor({
color: getComputedStyle(document.documentElement)
.getPropertyValue('--ion-background-color')
.trim(),
darkButtons: true,
});
}
}
await this.authNotificationsInit();
@@ -120,7 +122,7 @@ export class AppComponent implements AfterContentInit {
});
window.addEventListener('touchmove', this.touchMoveEvent, true);
if (Capacitor.isNativePlatform()) {
if (Capacitor.getPlatform() === 'ios') {
Keyboard.setResizeMode({mode: KeyboardResize.None});
}
}

View File

@@ -46,6 +46,11 @@ export class AddEventActionChipComponent implements OnDestroy {
*/
associatedDateSeries: Promise<SCDateSeries[]>;
/**
* Color
*/
color: string;
/**
* Disabled
*/
@@ -56,6 +61,9 @@ export class AddEventActionChipComponent implements OnDestroy {
*/
icon: string;
/**
* Current state of icon fill
*/
iconFill: boolean;
/**
@@ -98,11 +106,12 @@ export class AddEventActionChipComponent implements OnDestroy {
*/
applyState(state: AddEventStates) {
this.state = state;
const {label, icon, disabled, fill} = this.states[state];
const {label, icon, disabled, fill, color} = this.states[state];
this.label = label;
this.icon = icon;
this.iconFill = fill;
this.disabled = disabled;
this.color = color;
}
/**

View File

@@ -28,23 +28,27 @@ export const AddEventStatesMap = {
fill: true,
label: 'data.chips.add_events.ADDED_ALL',
disabled: false,
color: 'success',
},
[AddEventStates.ADDED_SOME]: {
icon: SCIcon`event`,
fill: true,
label: 'data.chips.add_events.ADDED_SOME',
disabled: false,
color: 'success',
},
[AddEventStates.REMOVED_ALL]: {
icon: SCIcon`calendar_today`,
fill: false,
label: 'data.chips.add_events.REMOVED_ALL',
disabled: false,
color: 'primary',
},
[AddEventStates.UNAVAILABLE]: {
icon: SCIcon`event_busy`,
fill: false,
label: 'data.chips.add_events.UNAVAILABLE',
disabled: true,
color: 'dark',
},
};

View File

@@ -19,6 +19,8 @@
@chipTransition
[disabled]="disabled"
(click)="$event.stopPropagation(); editModal.present()"
[color]="color"
[outline]="true"
>
<ion-icon [name]="icon" [fill]="iconFill"></ion-icon>
<ion-label>{{ label | translate }}</ion-label>

View File

@@ -19,32 +19,38 @@
}}</ion-card-header>
<ion-card-content>
<div *ngFor="let offer of offers">
<p *ngIf="offer.inPlace">
<ion-icon name="pin_drop"></ion-icon>
<a [routerLink]="['/data-detail', offer.inPlace.uid]">{{
'name' | thingTranslate: offer.inPlace
}}</a
>,&nbsp;
<span
*ngIf="
offer.availabilityRange.gt
? offer.availabilityRange.gt
: offer.availabilityRange.gte
"
>
<ion-icon name="calendar_today"></ion-icon>
{{
(offer.availabilityRange.gt
? offer.availabilityRange.gt
: offer.availabilityRange.gte
) | amDateFormat: 'll'
}}
</span>
</p>
<ion-grid>
<ion-row>
<ion-col>
<ion-icon name="pin_drop"></ion-icon>
<a [routerLink]="['/data-detail', offer.inPlace.uid]">
{{ 'name' | thingTranslate: offer.inPlace }}
</a>
</ion-col>
<ion-col>
<span
*ngIf="
offer.availabilityRange.gt
? offer.availabilityRange.gt
: offer.availabilityRange.gte
"
>
{{
(offer.availabilityRange.gt
? offer.availabilityRange.gt
: offer.availabilityRange.gte
) | amDateFormat: 'll'
}}
</span>
</ion-col>
</ion-row>
</ion-grid>
<ion-grid *ngIf="offer.prices">
<ion-row *ngFor="let group of objectKeys(offer.prices)">
<ion-col>{{ group | titlecase }}</ion-col>
<ion-col width-20 text-right>
<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'

View File

@@ -19,6 +19,8 @@ ion-item {
@include border-radius-in-parallax(var(--border-radius-default));
overflow: hidden;
--inner-padding-end: 0;
--padding-start: var(--spacing-sm);
margin: var(--spacing-sm);
ion-thumbnail {
--ion-margin: var(--spacing-xs);

View File

@@ -20,6 +20,7 @@ import {
AnimationBuilder,
AnimationController,
} from '@ionic/angular';
import {Capacitor} from '@capacitor/core';
import {
SCFacet,
SCFeatureConfiguration,
@@ -250,7 +251,9 @@ export class SearchPageComponent implements OnInit, OnDestroy {
* Hides keyboard in native app environments
*/
hideKeyboard() {
Keyboard.hide();
if (Capacitor.isNativePlatform()) {
Keyboard.hide();
}
}
/**

View File

@@ -8,15 +8,15 @@
</ion-col>
<ion-col>
<ion-card *ngIf="item.characteristics">
<ion-card-header>{{
'characteristics' | propertyNameTranslate: item | titlecase
<ion-card-header class="no-padding-inline-start">{{
'data.types.dish.CHARACTERISTICS' | translate
}}</ion-card-header>
<ion-card-content
*ngFor="
let characteristic of 'characteristics' | thingTranslate: item
"
>
<p>
<ion-card-content class="no-padding-inline-start">
<p
*ngFor="
let characteristic of 'characteristics' | thingTranslate: item
"
>
<img
*ngIf="characteristic.image"
[src]="characteristic.image"
@@ -33,12 +33,6 @@
*ngIf="item.offers"
[offers]="item.offers"
></stapps-offers-detail>
<stapps-simple-card
*ngIf="item.additives"
[title]="'additives' | propertyNameTranslate: item | titlecase"
[content]="'additives' | thingTranslate: item | join: ', '"
>
</stapps-simple-card>
<ion-card *ngIf="item.nutrition">
<ion-card-header>{{
'data.types.dish.detail.AVG_NUTRITION_INFO' | translate
@@ -88,3 +82,9 @@
</ion-grid>
</ion-card-content>
</ion-card>
<stapps-simple-card
*ngIf="item.additives"
[title]="'additives' | propertyNameTranslate: item | titlecase"
[content]="'additives' | thingTranslate: item | join: ', '"
>
</stapps-simple-card>

View File

@@ -6,7 +6,9 @@
<p class="title-sub ion-hide-sm-down">
{{ 'description' | thingTranslate: item }}
</p>
<p>{{ 'categories' | thingTranslate: item | join: ', ' }}</p>
<ion-note>{{
'categories' | thingTranslate: item | join: ', '
}}</ion-note>
</div>
</ion-col>
<ion-col width-10 text-right>

View File

@@ -13,22 +13,43 @@
~ this program. If not, see <https://www.gnu.org/licenses/>.
-->
<ion-card>
<ion-card-content>
<stapps-add-event-action-chip
*ngIf="item.type === 'academic event'"
[item]="item"
>
</stapps-add-event-action-chip>
</ion-card-content>
</ion-card>
<ion-grid>
<ion-row>
<ion-col>
<stapps-simple-card
*ngIf="item.type === 'academic event' && item.categories"
[title]="'categories' | propertyNameTranslate: item | titlecase"
[content]="'categories' | thingTranslate: item"
>
</stapps-simple-card>
</ion-col>
<ion-col>
<ion-card>
<stapps-add-event-action-chip
*ngIf="item.type === 'academic event'"
[item]="item"
>
</stapps-add-event-action-chip>
</ion-card>
</ion-col>
</ion-row>
</ion-grid>
<stapps-simple-card
*ngIf="item.type === 'academic event' && item.categories"
[title]="'categories' | propertyNameTranslate: item"
[content]="'categories' | thingTranslate: item"
>
</stapps-simple-card>
*ngIf="item.performers"
[title]="'performers' | propertyNameTranslate: item | titlecase"
[content]="item.performers"
></stapps-simple-card>
<stapps-simple-card
*ngIf="item.organizers"
[title]="'organizers' | propertyNameTranslate: item | titlecase"
[content]="item.organizers"
></stapps-simple-card>
<stapps-simple-card
*ngIf="item.type === 'academic event' && item.majors | titlecase"
[title]="'majors' | propertyNameTranslate: item"
[content]="item.majors"
></stapps-simple-card>
<ion-card *ngIf="item.catalogs">
<ion-card-header>{{
$any('superCatalogs' | propertyNameTranslate: 'catalog') | titlecase
@@ -45,18 +66,3 @@
</event-route-path>
</ion-card-content>
</ion-card>
<stapps-simple-card
*ngIf="item.performers"
[title]="'performers' | propertyNameTranslate: item"
[content]="item.performers"
></stapps-simple-card>
<stapps-simple-card
*ngIf="item.organizers"
[title]="'organizers' | propertyNameTranslate: item"
[content]="item.organizers"
></stapps-simple-card>
<stapps-simple-card
*ngIf="item.type === 'academic event' && item.majors"
[title]="'majors' | propertyNameTranslate: item"
[content]="item.majors"
></stapps-simple-card>

View File

@@ -2,23 +2,32 @@
<ion-row *ngIf="item.type === 'academic event'">
<ion-col>
<div class="ion-text-wrap">
<ion-label class="title">{{ item.name }}</ion-label>
<p *ngIf="item.description" class="title-sub">{{ item.description }}</p>
<p *ngIf="item.academicTerms" class="title-sub">
{{ item.academicTerms[0].name }}
<ion-label class="title">{{ 'name' | thingTranslate: item }}</ion-label>
<p *ngIf="item.description" class="title-sub">
{{ 'description' | thingTranslate: item }}
</p>
<ion-note>{{ item.type }} ({{ item.categories.join(', ') }})</ion-note>
<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">
{{ 'categories' | thingTranslate: item | join: ', ' }}
</ion-note>
</div>
</ion-col>
</ion-row>
<ion-row *ngIf="item.type === 'sport course'">
<ion-col>
<ion-label class="title">{{ item.name }}</ion-label>
<p *ngIf="item.description" class="title-sub">{{ item.description }}</p>
<p *ngIf="item.academicTerms" class="title-sub">
{{ item.academicTerms[0].name }}
<ion-label class="title">{{ 'name' | thingTranslate: item }}</ion-label>
<p *ngIf="item.description" class="title-sub">
{{ 'description' | thingTranslate: item }}
</p>
<ion-note>{{ item.type }}</ion-note>
<p *ngIf="item.academicTerms" class="title-sub">
{{ 'name' | thingTranslate: item.academicTerms[0] }}
</p>
<ion-note>{{ 'type' | thingTranslate: item }}</ion-note>
</ion-col>
</ion-row>
</ion-grid>

View File

@@ -1,31 +1,33 @@
<ng-container>
<div *ngIf="dishes | async as dishes; else loading">
<ion-segment [(ngModel)]="selectedDay" mode="md">
<ion-segment-button
*ngFor="let day of dishes | keyvalue"
[value]="day.key"
>
<ion-label class="ion-hide-sm-down">{{
day.key | dateFormat: 'weekday:long,month:numeric,day:numeric'
}}</ion-label>
<ion-label class="ion-hide-sm-up">{{
day.key | dateFormat: 'weekday:short,month:numeric,day:numeric'
}}</ion-label>
</ion-segment-button>
</ion-segment>
<div [ngSwitch]="selectedDay">
<div *ngFor="let date of dishes | keyvalue">
<ion-list *ngSwitchCase="date.key">
<ng-container *ngFor="let dish of date.value; index as i">
<stapps-data-list-item
[item]="dish"
[hideThumbnail]="true"
></stapps-data-list-item>
</ng-container>
</ion-list>
</div>
</div>
</div>
<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-label class="ion-hide-sm-down">{{
day.key | dateFormat: 'weekday:long,month:numeric,day:numeric'
}}</ion-label>
<ion-label class="ion-hide-sm-up">{{
day.key | dateFormat: 'weekday:short,month:numeric,day:numeric'
}}</ion-label>
</ion-segment-button>
</ion-segment>
<ng-container [ngSwitch]="selectedDay">
<ng-container *ngFor="let date of dishes | keyvalue">
<ion-list *ngSwitchCase="date.key">
<ng-container *ngFor="let dish of date.value; index as i">
<stapps-data-list-item
[item]="dish"
[hideThumbnail]="true"
></stapps-data-list-item>
</ng-container>
</ion-list>
</ng-container>
</ng-container>
</ng-container>
</ng-container>
<ng-template #loading>
<ion-segment>
<stapps-skeleton-segment-button
@@ -38,4 +40,13 @@
></stapps-skeleton-list-item>
</ion-list>
</ng-template>
<ng-template #empty>
<ion-card>
<ion-card-header>
<ion-label class="title">
{{ 'data.types.dish.EMPTY_DISHES' | translate }}
</ion-label>
</ion-card-header>
</ion-card>
</ng-template>
</ng-container>

View File

@@ -289,7 +289,9 @@ export class MapPageComponent {
* Hides keyboard in native app environments
*/
hideKeyboard() {
Keyboard.hide();
if (Capacitor.isNativePlatform()) {
Keyboard.hide();
}
}
/**

View File

@@ -46,6 +46,7 @@
width: 100%;
padding-right: 0;
}
margin-bottom: var(--spacing-md);
}
ion-button.hidden {

View File

@@ -33,6 +33,7 @@
margin-bottom: var(--spacing-md);
}
.user-card-wrapper {
margin-bottom: 0;
.user-card {
border-radius: var(--border-radius-default);
position: relative;

View File

@@ -59,7 +59,7 @@ export interface SCSection extends SCThing {
export const profilePageSections: SCSection[] = [
{
name: 'Your StApps',
name: '',
links: [
{
name: 'Favorites',
@@ -89,7 +89,7 @@ export const profilePageSections: SCSection[] = [
link: ['/catalog'],
translations: {
de: {
name: 'Vorlesungs Verzeichnis',
name: 'Vorlesungs-verzeichnis',
},
},
...SCSectionLinkConstantValues,
@@ -117,12 +117,12 @@ export const profilePageSections: SCSection[] = [
...SCSectionLinkConstantValues,
},
{
name: 'About StApps',
name: 'About Open StApps',
icon: SCIcon`info`,
link: ['/about'],
translations: {
de: {
name: 'Über StApps',
name: 'Über Open StApps',
},
},
...SCSectionLinkConstantValues,
@@ -130,7 +130,7 @@ export const profilePageSections: SCSection[] = [
],
translations: {
de: {
name: 'Dein StApps',
name: '',
},
},
...SCSectionConstantValues,
@@ -164,12 +164,12 @@ export const profilePageSections: SCSection[] = [
authProvider: 'paia',
links: [
{
name: 'Library Search',
name: 'Library Catalog',
icon: SCIcon`local_library`,
link: ['/hebis-search'],
translations: {
de: {
name: 'Bibliotheks Suche',
name: 'Bibliotheks-katalog',
},
},
...SCSectionLinkConstantValues,
@@ -181,7 +181,7 @@ export const profilePageSections: SCSection[] = [
link: ['/library-account/profile'],
translations: {
de: {
name: 'Bibliotheks Konto',
name: 'Bibliotheks-konto',
},
},
...SCSectionLinkConstantValues,

View File

@@ -66,7 +66,7 @@
}}</ion-label>
</ion-item>
-->
<ion-item>
<ion-item *ngIf="!isWeb">
<ion-button
[disabled]="isWeb || !syncEnabled"
fill="clear"
@@ -77,10 +77,10 @@
</ion-button>
</ion-item>
<ion-item *ngIf="isWeb">
<ion-label color="medium"
><i>{{
<ion-label color="medium" class="ion-text-wrap"
><b>{{
'settings.calendar.sync.unavailableWeb' | translate
}}</i></ion-label
}}</b></ion-label
>
</ion-item>
</ion-item-group>