From acdd93eb99edf441b38c618e838c034fcac46d77 Mon Sep 17 00:00:00 2001 From: Rainer Killinger Date: Fri, 21 Oct 2022 16:01:44 +0000 Subject: [PATCH] refactor: pre release cleanup all over the place --- src/app/app.component.ts | 28 ++++---- .../data/add-event-action-chip.component.ts | 11 +++- .../data/add-event-action-chip.config.ts | 4 ++ .../chips/data/add-event-action-chip.html | 2 + .../modules/data/elements/offers-detail.html | 54 ++++++++------- src/app/modules/data/list/data-list-item.scss | 2 + .../data/list/search-page.component.ts | 5 +- .../data/types/dish/dish-detail-content.html | 28 ++++---- .../data/types/dish/dish-list-item.html | 4 +- .../types/event/event-detail-content.html | 64 +++++++++--------- .../data/types/event/event-list-item.html | 29 ++++++--- .../place/special/mensa/place-mensa.html | 65 +++++++++++-------- .../modules/map/page/map-page.component.ts | 4 +- .../profile/page/profile-page-section.scss | 1 + .../modules/profile/page/profile-page.scss | 1 + src/app/modules/profile/page/sections.ts | 16 ++--- .../settings/page/calendar-sync-settings.html | 8 +-- src/assets/i18n/de.json | 12 +++- src/assets/i18n/en.json | 12 +++- src/theme/common/_helper.scss | 4 ++ 20 files changed, 215 insertions(+), 139 deletions(-) diff --git a/src/app/app.component.ts b/src/app/app.component.ts index 4125a059..5d4b5b2f 100644 --- a/src/app/app.component.ts +++ b/src/app/app.component.ts @@ -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}); } } diff --git a/src/app/modules/data/chips/data/add-event-action-chip.component.ts b/src/app/modules/data/chips/data/add-event-action-chip.component.ts index cfce4eac..e342e6e4 100644 --- a/src/app/modules/data/chips/data/add-event-action-chip.component.ts +++ b/src/app/modules/data/chips/data/add-event-action-chip.component.ts @@ -46,6 +46,11 @@ export class AddEventActionChipComponent implements OnDestroy { */ associatedDateSeries: Promise; + /** + * 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; } /** diff --git a/src/app/modules/data/chips/data/add-event-action-chip.config.ts b/src/app/modules/data/chips/data/add-event-action-chip.config.ts index 0d42f76c..8d7b0330 100644 --- a/src/app/modules/data/chips/data/add-event-action-chip.config.ts +++ b/src/app/modules/data/chips/data/add-event-action-chip.config.ts @@ -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', }, }; diff --git a/src/app/modules/data/chips/data/add-event-action-chip.html b/src/app/modules/data/chips/data/add-event-action-chip.html index b243af1e..833b1b38 100644 --- a/src/app/modules/data/chips/data/add-event-action-chip.html +++ b/src/app/modules/data/chips/data/add-event-action-chip.html @@ -19,6 +19,8 @@ @chipTransition [disabled]="disabled" (click)="$event.stopPropagation(); editModal.present()" + [color]="color" + [outline]="true" > {{ label | translate }} diff --git a/src/app/modules/data/elements/offers-detail.html b/src/app/modules/data/elements/offers-detail.html index 4283cdbb..14876c1c 100644 --- a/src/app/modules/data/elements/offers-detail.html +++ b/src/app/modules/data/elements/offers-detail.html @@ -19,32 +19,38 @@ }}
-

- - {{ - 'name' | thingTranslate: offer.inPlace - }},  - - - {{ - (offer.availabilityRange.gt - ? offer.availabilityRange.gt - : offer.availabilityRange.gte - ) | amDateFormat: 'll' - }} - -

+ + + + + + {{ 'name' | thingTranslate: offer.inPlace }} + + + + + {{ + (offer.availabilityRange.gt + ? offer.availabilityRange.gt + : offer.availabilityRange.gte + ) | amDateFormat: 'll' + }} + + + + - {{ group | titlecase }} - + {{ + 'data.detail.offers.' + group | translate + }} +

{{ offer.prices[group] | currency: 'EUR':'symbol':undefined:'de' diff --git a/src/app/modules/data/list/data-list-item.scss b/src/app/modules/data/list/data-list-item.scss index bd872da7..6e5ac408 100644 --- a/src/app/modules/data/list/data-list-item.scss +++ b/src/app/modules/data/list/data-list-item.scss @@ -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); diff --git a/src/app/modules/data/list/search-page.component.ts b/src/app/modules/data/list/search-page.component.ts index 9dda6c8f..e5682d0a 100644 --- a/src/app/modules/data/list/search-page.component.ts +++ b/src/app/modules/data/list/search-page.component.ts @@ -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(); + } } /** diff --git a/src/app/modules/data/types/dish/dish-detail-content.html b/src/app/modules/data/types/dish/dish-detail-content.html index ea747fe9..80f9e738 100644 --- a/src/app/modules/data/types/dish/dish-detail-content.html +++ b/src/app/modules/data/types/dish/dish-detail-content.html @@ -8,15 +8,15 @@ - {{ - 'characteristics' | propertyNameTranslate: item | titlecase + {{ + 'data.types.dish.CHARACTERISTICS' | translate }} - -

+ +

- - {{ 'data.types.dish.detail.AVG_NUTRITION_INFO' | translate @@ -88,3 +82,9 @@ + + diff --git a/src/app/modules/data/types/dish/dish-list-item.html b/src/app/modules/data/types/dish/dish-list-item.html index 30e19772..210967e2 100644 --- a/src/app/modules/data/types/dish/dish-list-item.html +++ b/src/app/modules/data/types/dish/dish-list-item.html @@ -6,7 +6,9 @@

{{ 'description' | thingTranslate: item }}

-

{{ 'categories' | thingTranslate: item | join: ', ' }}

+ {{ + 'categories' | thingTranslate: item | join: ', ' + }}
diff --git a/src/app/modules/data/types/event/event-detail-content.html b/src/app/modules/data/types/event/event-detail-content.html index c2edd09e..3dc0df74 100644 --- a/src/app/modules/data/types/event/event-detail-content.html +++ b/src/app/modules/data/types/event/event-detail-content.html @@ -13,22 +13,43 @@ ~ this program. If not, see . --> - - - - - - + + + + + + + + + + + + + + - + *ngIf="item.performers" + [title]="'performers' | propertyNameTranslate: item | titlecase" + [content]="item.performers" +> + + {{ $any('superCatalogs' | propertyNameTranslate: 'catalog') | titlecase @@ -45,18 +66,3 @@
- - - diff --git a/src/app/modules/data/types/event/event-list-item.html b/src/app/modules/data/types/event/event-list-item.html index a1a66915..aba48999 100644 --- a/src/app/modules/data/types/event/event-list-item.html +++ b/src/app/modules/data/types/event/event-list-item.html @@ -2,23 +2,32 @@
- {{ item.name }} -

{{ item.description }}

-

- {{ item.academicTerms[0].name }} + {{ 'name' | thingTranslate: item }} +

+ {{ 'description' | thingTranslate: item }}

- {{ item.type }} ({{ item.categories.join(', ') }}) +

+ {{ 'name' | thingTranslate: item.academicTerms[0] }} +

+ {{ + 'type' | thingTranslate: item + }} + + {{ 'categories' | thingTranslate: item | join: ', ' }} +
- {{ item.name }} -

{{ item.description }}

-

- {{ item.academicTerms[0].name }} + {{ 'name' | thingTranslate: item }} +

+ {{ 'description' | thingTranslate: item }}

- {{ item.type }} +

+ {{ 'name' | thingTranslate: item.academicTerms[0] }} +

+ {{ 'type' | thingTranslate: item }}
diff --git a/src/app/modules/data/types/place/special/mensa/place-mensa.html b/src/app/modules/data/types/place/special/mensa/place-mensa.html index 63f24052..e5a0b6bd 100644 --- a/src/app/modules/data/types/place/special/mensa/place-mensa.html +++ b/src/app/modules/data/types/place/special/mensa/place-mensa.html @@ -1,31 +1,33 @@ -
- - - {{ - day.key | dateFormat: 'weekday:long,month:numeric,day:numeric' - }} - {{ - day.key | dateFormat: 'weekday:short,month:numeric,day:numeric' - }} - - -
-
- - - - - -
-
-
+ + + + + {{ + day.key | dateFormat: 'weekday:long,month:numeric,day:numeric' + }} + {{ + day.key | dateFormat: 'weekday:short,month:numeric,day:numeric' + }} + + + + + + + + + + + + + + + + + + {{ 'data.types.dish.EMPTY_DISHES' | translate }} + + + +
diff --git a/src/app/modules/map/page/map-page.component.ts b/src/app/modules/map/page/map-page.component.ts index 6c8f0f0f..d896c727 100644 --- a/src/app/modules/map/page/map-page.component.ts +++ b/src/app/modules/map/page/map-page.component.ts @@ -289,7 +289,9 @@ export class MapPageComponent { * Hides keyboard in native app environments */ hideKeyboard() { - Keyboard.hide(); + if (Capacitor.isNativePlatform()) { + Keyboard.hide(); + } } /** diff --git a/src/app/modules/profile/page/profile-page-section.scss b/src/app/modules/profile/page/profile-page-section.scss index 4d824e8b..101ddedc 100644 --- a/src/app/modules/profile/page/profile-page-section.scss +++ b/src/app/modules/profile/page/profile-page-section.scss @@ -46,6 +46,7 @@ width: 100%; padding-right: 0; } + margin-bottom: var(--spacing-md); } ion-button.hidden { diff --git a/src/app/modules/profile/page/profile-page.scss b/src/app/modules/profile/page/profile-page.scss index 46dc5c3d..afa30476 100644 --- a/src/app/modules/profile/page/profile-page.scss +++ b/src/app/modules/profile/page/profile-page.scss @@ -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; diff --git a/src/app/modules/profile/page/sections.ts b/src/app/modules/profile/page/sections.ts index 259483c1..5f4b4a07 100644 --- a/src/app/modules/profile/page/sections.ts +++ b/src/app/modules/profile/page/sections.ts @@ -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, diff --git a/src/app/modules/settings/page/calendar-sync-settings.html b/src/app/modules/settings/page/calendar-sync-settings.html index 2346dd19..adfc7c24 100644 --- a/src/app/modules/settings/page/calendar-sync-settings.html +++ b/src/app/modules/settings/page/calendar-sync-settings.html @@ -66,7 +66,7 @@ }} --> - + - {{ + {{ 'settings.calendar.sync.unavailableWeb' | translate - }} diff --git a/src/assets/i18n/de.json b/src/assets/i18n/de.json index f70459ed..6c43af13 100644 --- a/src/assets/i18n/de.json +++ b/src/assets/i18n/de.json @@ -65,7 +65,7 @@ "title_morning": "Guten Morgen", "title_day": "Guten Tag", "title_evening": "Guten Abend", - "title_night": "Hallo" + "title_night": "Gute Nacht" }, "navigation": { "title": "Dashboard", @@ -118,7 +118,11 @@ "POST_OFFICE_BOX": "Postfach" }, "offers": { - "TITLE": "Angebote" + "TITLE": "Angebote", + "default": "Standard", + "employee": "Angestellte", + "guest": "Gäste", + "student": "Studuierende" } }, "chips": { @@ -137,6 +141,8 @@ }, "types": { "dish": { + "CHARACTERISTICS": "Zutaten", + "EMPTY_DISHES": "Keine Angebote verfügbar", "detail": { "AVG_NUTRITION_INFO": "Durchschnittliche Nährwertangaben", "CALORIES": "Brennwert", @@ -429,7 +435,7 @@ } }, "profile": { - "title": "Studium", + "title": "Meine App", "titleLogins": "Logins", "titleCourses": "Meine Kurse", "role_guest": "Gastnutzer", diff --git a/src/assets/i18n/en.json b/src/assets/i18n/en.json index 291fe7df..658030c3 100644 --- a/src/assets/i18n/en.json +++ b/src/assets/i18n/en.json @@ -65,7 +65,7 @@ "title_morning": "Good Morning", "title_day": "Good Day", "title_evening": "Good Evening", - "title_night": "Hello" + "title_night": "Good Night" }, "navigation": { "title": "Dashboard", @@ -118,7 +118,11 @@ "POST_OFFICE_BOX": "post office box" }, "offers": { - "TITLE": "offers" + "TITLE": "offers", + "default": "Default", + "employee": "Employees", + "guest": "Guests", + "student": "Students" } }, "chips": { @@ -137,6 +141,8 @@ }, "types": { "dish": { + "CHARACTERISTICS": "Ingredients", + "EMPTY_DISHES": "No Offers Available", "detail": { "AVG_NUTRITION_INFO": "Average Nutrition Facts", "CALORIES": "Calories", @@ -429,7 +435,7 @@ } }, "profile": { - "title": "Study", + "title": "My App", "titleLogins": "Logins", "titleCourses": "My Courses", "role_guest": "guest user", diff --git a/src/theme/common/_helper.scss b/src/theme/common/_helper.scss index 418e274f..4d0c6455 100644 --- a/src/theme/common/_helper.scss +++ b/src/theme/common/_helper.scss @@ -2,6 +2,10 @@ padding-right: 0 !important; } +.no-padding-inline-start { + padding-inline-start: 0 !important; +} + .display-flex { display: flex; }