Skip to content

Commit afa61c0

Browse files
authored
Merge pull request #839 from University-of-Potsdam-MM/feature/837-info-banner-setzen
PULS login notice (#837) and the redesign of the cafeteria page
2 parents d23607f + 0dd3d53 commit afa61c0

18 files changed

+238
-328
lines changed

.gitlab-ci.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
# * SSH_KNOWN_HOSTS (hosts keys of the servers to which the artifacts should be deployed; `ssh-keyscan hostname`)
77
# except SSH_DEPLOY_HOSTS and SSH_DEPLOY_KEY all variables can be set in the Group
88

9-
image: node:18
9+
image: node:18-bullseye
1010

1111
stages:
1212
- prepare

android/app/build.gradle

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ android {
88
applicationId "de.floriangoessler.upapp"
99
minSdkVersion rootProject.ext.minSdkVersion
1010
targetSdkVersion rootProject.ext.targetSdkVersion
11-
versionCode 20230100
12-
versionName "2023.1"
11+
versionCode 20230400
12+
versionName "2023.4"
1313
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
1414
aaptOptions {
1515
// Files and dirs to omit from the packaged assets dir, modified to accommodate modern web apps.

android/app/release/output-metadata.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111
"type": "SINGLE",
1212
"filters": [],
1313
"attributes": [],
14-
"versionCode": 20220500,
15-
"versionName": "2022.5",
14+
"versionCode": 20230400,
15+
"versionName": "2023.4",
1616
"outputFile": "app-release.apk"
1717
}
1818
],

ios/App/App.xcodeproj/project.pbxproj

+4-4
Original file line numberDiff line numberDiff line change
@@ -367,15 +367,15 @@
367367
CODE_SIGN_ENTITLEMENTS = App/App.entitlements;
368368
CODE_SIGN_IDENTITY = "Apple Development";
369369
CODE_SIGN_STYLE = Automatic;
370-
CURRENT_PROJECT_VERSION = 202309071700;
370+
CURRENT_PROJECT_VERSION = 202310261000;
371371
DEVELOPMENT_TEAM = 6JUZ3X22P6;
372372
INFOPLIST_FILE = App/Info.plist;
373373
INFOPLIST_KEY_CFBundleDisplayName = Mobile.UP;
374374
INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.education";
375375
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
376376
"IPHONEOS_DEPLOYMENT_TARGET[sdk=macosx*]" = 14.2;
377377
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
378-
MARKETING_VERSION = 2023.1;
378+
MARKETING_VERSION = 2023.4;
379379
OTHER_SWIFT_FLAGS = "$(inherited) \"-D\" \"COCOAPODS\" \"-DDEBUG\"";
380380
PRODUCT_BUNDLE_IDENTIFIER = "com.floriangoessler.Uni-Potsdam";
381381
PRODUCT_NAME = "$(TARGET_NAME)";
@@ -396,15 +396,15 @@
396396
CODE_SIGN_ENTITLEMENTS = App/App.entitlements;
397397
CODE_SIGN_IDENTITY = "Apple Development";
398398
CODE_SIGN_STYLE = Automatic;
399-
CURRENT_PROJECT_VERSION = 202309071700;
399+
CURRENT_PROJECT_VERSION = 202310261000;
400400
DEVELOPMENT_TEAM = 6JUZ3X22P6;
401401
INFOPLIST_FILE = App/Info.plist;
402402
INFOPLIST_KEY_CFBundleDisplayName = Mobile.UP;
403403
INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.education";
404404
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
405405
"IPHONEOS_DEPLOYMENT_TARGET[sdk=macosx*]" = 14.2;
406406
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
407-
MARKETING_VERSION = 2023.1;
407+
MARKETING_VERSION = 2023.4;
408408
PRODUCT_BUNDLE_IDENTIFIER = "com.floriangoessler.Uni-Potsdam";
409409
PRODUCT_NAME = "$(TARGET_NAME)";
410410
PROVISIONING_PROFILE_SPECIFIER = "";

package-lock.json

+3-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "Mobile.UP",
3-
"version": "2023.1.0",
3+
"version": "2023.4.0",
44
"author": "Universität Potsdam",
55
"homepage": "https://uni-potsdam.de/mobileup",
66
"scripts": {

src/app/components/components.module.ts

+3
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ import { HintBoxComponent } from './hint-box/hint-box.component';
2222
import { LectureListComponent } from './lecture-list/lecture-list.component';
2323
import { MensaMealComponent } from './mensa-meal/mensa-meal.component';
2424
import { ModulesGridComponent } from './modules-grid/modules-grid.component';
25+
import { InfoBannerComponent } from './info-banner/info-banner.component';
2526

2627
@NgModule({
2728
declarations: [
@@ -40,6 +41,7 @@ import { ModulesGridComponent } from './modules-grid/modules-grid.component';
4041
CampusReorderModalPage,
4142
DatePickerComponent,
4243
ModulesGridComponent,
44+
InfoBannerComponent,
4345
],
4446
imports: [
4547
IonicModule,
@@ -70,6 +72,7 @@ import { ModulesGridComponent } from './modules-grid/modules-grid.component';
7072
CourseDataComponent,
7173
DatePickerComponent,
7274
ModulesGridComponent,
75+
InfoBannerComponent,
7376
],
7477
})
7578
export class ComponentsModule {}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<div id="info-banner-card" class="card">
2+
<ion-card>
3+
<ion-card-header>
4+
<ion-card-title>{{ "info-banner.title" | translate }}</ion-card-title>
5+
<ion-card-subtitle>{{
6+
"info-banner.subtitle" | translate
7+
}}</ion-card-subtitle>
8+
</ion-card-header>
9+
<ion-card-content>
10+
{{ "info-banner.description" | translate }}
11+
</ion-card-content>
12+
<div style="display: block; margin: auto; width: fit-content">
13+
<ion-button fill="clear" (click)="closeCard()">
14+
{{ "info-banner.ack-text" | translate }}
15+
</ion-button>
16+
</div>
17+
</ion-card>
18+
</div>

src/app/components/info-banner/info-banner.component.scss

Whitespace-only changes.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
2+
import { IonicModule } from '@ionic/angular';
3+
4+
import { InfoBannerComponent } from './info-banner.component';
5+
6+
describe('InfoBannerComponent', () => {
7+
let component: InfoBannerComponent;
8+
let fixture: ComponentFixture<InfoBannerComponent>;
9+
10+
beforeEach(waitForAsync(() => {
11+
TestBed.configureTestingModule({
12+
declarations: [InfoBannerComponent],
13+
imports: [IonicModule.forRoot()],
14+
}).compileComponents();
15+
16+
fixture = TestBed.createComponent(InfoBannerComponent);
17+
component = fixture.componentInstance;
18+
fixture.detectChanges();
19+
}));
20+
21+
it('should create', () => {
22+
expect(component).toBeTruthy();
23+
});
24+
});
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
import { Component, OnInit } from '@angular/core';
2+
import { Preferences } from '@capacitor/preferences';
3+
4+
const prefKey = 'MobileUP_DontShowBanner';
5+
6+
@Component({
7+
selector: 'app-info-banner',
8+
templateUrl: './info-banner.component.html',
9+
styleUrls: ['./info-banner.component.scss'],
10+
})
11+
export class InfoBannerComponent implements OnInit {
12+
constructor() {}
13+
14+
ngOnInit() {
15+
this.checkPref().then((prefValue) => {
16+
console.log('render info banner: ' + prefValue);
17+
if (prefValue === true) {
18+
this.closeCard();
19+
}
20+
});
21+
}
22+
23+
closeCard(): void {
24+
document.querySelector('#info-banner-card').innerHTML = '';
25+
this.setPref(true);
26+
}
27+
28+
setPref = async (v: boolean) => {
29+
await Preferences.set({
30+
key: prefKey,
31+
value: String(v),
32+
});
33+
};
34+
35+
checkPref = async (): Promise<boolean> => {
36+
const { value } = await Preferences.get({ key: prefKey });
37+
console.log(`Pref is ${value}!`);
38+
return value === 'true';
39+
};
40+
41+
removePref = async () => {
42+
await Preferences.remove({ key: prefKey });
43+
};
44+
}

src/app/pages/home/home.page.html

+2
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@
3434
</div>
3535
</ng-template>
3636

37+
<app-info-banner> </app-info-banner>
38+
3739
<app-hint-box
3840
*ngIf="displaySystemStatusWarning"
3941
[hintTypeAsString]="systemStatusWarning.title"

src/app/pages/mensa/README.md

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
Ersetzt die alte Mensa Page (leider haben wir keinen Zugriff mehr auf den Speiseplan der SWP Mensen).
2+
Enthält zwei Tabs: einen Link auf die neue Mensaseite (https://swp.webspeiseplan.de/).
3+
Erhalten bleibt nur eine Übersicht von Speisen und Getränken in Ulfs Kaffee.

src/app/pages/mensa/mensa.page.html

+36-75
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
<ion-header mode="ios">
1+
<ion-header>
22
<ion-toolbar>
33
<ion-back-button mode="md" slot="start"></ion-back-button>
44
<ion-button
55
mode="md"
6-
*ngIf="!(platform.is('ios') || platform.is('android'))"
7-
(click)="loadCampusMenu(true)"
6+
*ngIf="ulfSelected && !(platform.is('ios') || platform.is('android'))"
7+
(click)="loadMenu(true)"
88
slot="end"
99
fill="clear"
1010
>
@@ -13,10 +13,19 @@
1313
<ion-menu-button slot="end"></ion-menu-button>
1414
<ion-title>{{ "page.mensa.title" | translate }}</ion-title>
1515
</ion-toolbar>
16+
1617
<ion-toolbar mode="md">
17-
<app-campus-tab (campusChanged)="changeCampus($event)"></app-campus-tab>
18+
<ion-segment value="mensen">
19+
<ion-segment-button (click)="selectTab('mensen')" value="mensen">
20+
<ion-label>{{ "page.mensa.mensen" | translate }}</ion-label>
21+
</ion-segment-button>
22+
<ion-segment-button (click)="selectTab('ulfscoffee')" value="ulfscoffee">
23+
<ion-label>{{ "page.mensa.ulfscafe" | translate }}</ion-label>
24+
</ion-segment-button>
25+
</ion-segment>
1826
</ion-toolbar>
19-
<ion-toolbar *ngIf="isLoaded && !noMensaForLocation && !networkError">
27+
28+
<ion-toolbar *ngIf="ulfSelected && isLoaded && !networkError">
2029
<ion-grid>
2130
<ion-row>
2231
<ion-col size="6">
@@ -48,59 +57,24 @@
4857
</ion-header>
4958

5059
<ion-content class="ion-no-padding">
51-
<ion-refresher
52-
*ngIf="platform.is('ios') || platform.is('android')"
53-
slot="fixed"
54-
(ionRefresh)="loadCampusMenu($event)"
55-
>
56-
<ion-refresher-content
57-
pullingIcon="refresh"
58-
refreshingSpinner="dots"
59-
></ion-refresher-content>
60-
</ion-refresher>
60+
<div *ngIf="ulfSelected && isLoaded && !networkError">
61+
<ion-refresher
62+
*ngIf="platform.is('ios') || platform.is('android')"
63+
slot="fixed"
64+
(ionRefresh)="loadMenu($event)"
65+
>
66+
<ion-refresher-content
67+
pullingIcon="refresh"
68+
refreshingSpinner="dots"
69+
></ion-refresher-content>
70+
</ion-refresher>
6171

62-
<div align="center" *ngIf="!isLoaded" class="ion-padding">
63-
<ion-spinner name="dots"></ion-spinner>
72+
<div align="center" *ngIf="!isLoaded" class="ion-padding">
73+
<ion-spinner name="dots"></ion-spinner>
74+
</div>
6475
</div>
6576

66-
<app-hint-box
67-
*ngIf="isLoaded && !mensaIsOpen && !networkError && !noMensaForLocation && !foodhopperIsOpen"
68-
hintTypeI18nKey="hints.type.hint"
69-
hintTextI18nKey="page.mensa.mensaClosed"
70-
></app-hint-box>
71-
<app-hint-box
72-
*ngIf="isLoaded && !mensaIsOpen && !networkError && !noMensaForLocation && foodhopperIsOpen"
73-
hintTypeI18nKey="hints.type.hint"
74-
hintTextI18nKey="page.mensa.mensaClosed"
75-
secondHintTextI18nKey="page.mensa.foodhopperGriebnitzsee"
76-
></app-hint-box>
77-
<app-hint-box
78-
*ngIf="isLoaded && mensaIsOpen && !networkError && !noMensaForLocation && foodhopperIsOpen"
79-
hintTypeI18nKey="hints.type.hint"
80-
hintTextI18nKey="page.mensa.foodhopperGriebnitzsee"
81-
></app-hint-box>
82-
<app-hint-box
83-
*ngIf="noMensaForLocation"
84-
hintTypeI18nKey="hints.type.hint"
85-
hintTextI18nKey="hints.text.functionNotAvailable"
86-
></app-hint-box>
87-
88-
<div *ngIf="isLoaded && !noMensaForLocation && !networkError">
89-
<app-mensa-meal
90-
*ngIf="!noMealsForDate"
91-
[meals]="displayedMeals"
92-
[mealForDate]="mealForDate"
93-
[iconMapping]="iconMapping"
94-
></app-mensa-meal>
95-
96-
<ion-item-divider
97-
mode="md"
98-
*ngIf="ulfMeals && !noUlfMealsForDate"
99-
color="light"
100-
>
101-
<ion-label>Ulf's Café</ion-label>
102-
</ion-item-divider>
103-
77+
<div *ngIf="ulfSelected && isLoaded && !networkError">
10478
<app-mensa-meal
10579
*ngIf="ulfMeals && !noUlfMealsForDate"
10680
[meals]="displayedUlfMeals"
@@ -109,25 +83,12 @@
10983
></app-mensa-meal>
11084
</div>
11185

112-
<div
113-
*ngIf="isLoaded && noMealsForDate && noUlfMealsForDate && !networkError && mensaIsOpen && !noMensaForLocation"
114-
>
115-
<app-hint-box
116-
hintTypeI18nKey="hints.type.hint"
117-
hintTextI18nKey="hints.text.mensa-nomeals-hint"
118-
></app-hint-box>
86+
<div *ngIf="mensenSelected && !networkError">
87+
<p style="text-align: center; font-size: 24px">
88+
{{ "page.mensa.mensaAPINotAvailable" | translate }}
89+
<a href="https://swp.webspeiseplan.de/"
90+
>{{"page.mensa.mensaLinktext" | translate}}</a
91+
>
92+
</p>
11993
</div>
120-
<app-hint-box
121-
*ngIf="isLoaded && networkError && !noMensaForLocation"
122-
hintTypeI18nKey="hints.type.hint"
123-
hintTextI18nKey="alert.httpErrorStatus.generic"
124-
></app-hint-box>
12594
</ion-content>
126-
127-
<ion-footer>
128-
<ion-toolbar>
129-
<app-footer-disclaimer
130-
disclaimerReference="page.mensa.disclaimer"
131-
></app-footer-disclaimer>
132-
</ion-toolbar>
133-
</ion-footer>

0 commit comments

Comments
 (0)