From 72e02479fa2787e5f29d9a95a6e6d3dadaad9ee2 Mon Sep 17 00:00:00 2001 From: BenJ Date: Sun, 15 Mar 2020 22:33:25 +0100 Subject: [PATCH 1/6] MainFiles --- package.json | 9 ++++++--- src/app/app.component.ts | 1 - src/app/app.module.ts | 2 -- src/index.html | 19 +++++-------------- src/manifest.json | 15 --------------- src/service-worker.js | 30 ------------------------------ tsconfig.json | 1 + 7 files changed, 12 insertions(+), 65 deletions(-) delete mode 100755 src/manifest.json delete mode 100755 src/service-worker.js diff --git a/package.json b/package.json index dc36ca9..4822a51 100755 --- a/package.json +++ b/package.json @@ -28,6 +28,7 @@ "@ionic-native/device": "^5.0.0", "@ionic-native/geolocation": "^5.0.0", "@ionic-native/google-maps": "^5.0.0", + "@ionic-native/http": "^5.22.0", "@ionic-native/in-app-browser": "^5.0.0", "@ionic-native/market": "^5.0.0", "@ionic-native/network": "^5.0.0", @@ -40,9 +41,11 @@ "@types/node": "^12.12.27", "cordova": "^9.0.0", "cordova-android": "^8.1.0", + "cordova-plugin-advanced-http": "^2.4.1", "cordova-plugin-appavailability": "^0.4.2", "cordova-plugin-calendar": "~5.1.5", "cordova-plugin-device": "^2.0.3", + "cordova-plugin-file": "^6.0.2", "cordova-plugin-googlemaps": "git+https://github.com/mapsplugin/cordova-plugin-googlemaps.git#multiple_maps", "cordova-plugin-googlemaps-sdk": "git+https://github.com/mapsplugin/cordova-plugin-googlemaps-sdk.git", "cordova-plugin-market": "^1.2.0", @@ -55,7 +58,6 @@ "ionic-cache": "^4.1.0", "ionicons": "^5.0.1", "rxjs": "^6.5.4", - "sw-toolbox": "^3.6.0", "timers": "^0.1.1", "zone.js": "^0.10.2" }, @@ -75,7 +77,7 @@ "karma-spec-reporter": "0.0.32", "node-sass": "^4.13.1", "protractor": "^5.4.3", - "typescript": "~3.4.5", + "typescript": "^3.5.3", "webpack": "^4.42.0" }, "description": "Stud.UCLouvain : an app for UCLouvain students made by UCLouvain students", @@ -97,7 +99,8 @@ "cordova-support-google-services": {}, "cordova-plugin-statusbar": {}, "cordova-plugin-calendar": {}, - "cordova-plugin-network-information": {} + "cordova-plugin-network-information": {}, + "cordova-plugin-advanced-http": {} }, "platforms": [ "android" diff --git a/src/app/app.component.ts b/src/app/app.component.ts index e3792c3..90e7590 100755 --- a/src/app/app.component.ts +++ b/src/app/app.component.ts @@ -81,7 +81,6 @@ export class MyApp { this.initializeApp(); this.getPages(); platform.ready().then(() => { - this.wso2Service.getToken(); translateService.setDefaultLang('fr'); this.user.storage.get('lan').then(data => { translateService.use(data !== null ? data : 'fr'); diff --git a/src/app/app.module.ts b/src/app/app.module.ts index 63f9044..2e716bf 100755 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -59,7 +59,6 @@ import { SettingsProvider } from "../services/utils-services/settings-service"; import { HomePage } from "../pages/home/home"; import { TutoPage } from "../pages/tuto/tuto"; import { FormsModule } from "@angular/forms"; -import { CommonModule } from "@angular/common"; import { AppRoutingModule } from "./app-routing.module"; import { ServiceWorkerModule } from '@angular/service-worker'; @@ -79,7 +78,6 @@ export function HttpLoaderFactory(http: HttpClient) { IonicStorageModule.forRoot(), HttpClientModule, AppRoutingModule, - CommonModule, FormsModule, TranslateModule.forRoot({ loader: { diff --git a/src/index.html b/src/index.html index 38e7962..055610a 100755 --- a/src/index.html +++ b/src/index.html @@ -11,22 +11,13 @@ - + - - - - + @@ -47,8 +38,8 @@ - + + + diff --git a/src/manifest.json b/src/manifest.json deleted file mode 100755 index fd4c1b2..0000000 --- a/src/manifest.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "name": "Ionic", - "short_name": "Ionic", - "start_url": "index.html", - "display": "standalone", - "icons": [ - { - "src": "assets/imgs/logo.png", - "sizes": "512x512", - "type": "image/png" - } - ], - "background_color": "#4e8ef7", - "theme_color": "#4e8ef7" -} diff --git a/src/service-worker.js b/src/service-worker.js deleted file mode 100755 index ed2d400..0000000 --- a/src/service-worker.js +++ /dev/null @@ -1,30 +0,0 @@ -/** - * Check out https://googlechrome.github.io/sw-toolbox/ for - * more info on how to use sw-toolbox to custom configure your service worker. - */ - - -'use strict'; -importScripts('./build/sw-toolbox.js'); - -self.toolbox.options.cache = { - name: 'ionic-cache' -}; - -// pre-cache our key assets -self.toolbox.precache( - [ - './build/main.js', - './build/main.css', - './build/polyfills.js', - 'index.html', - 'manifest.json' - ] -); - -// dynamically cache any other local assets -self.toolbox.router.any('/*', self.toolbox.cacheFirst); - -// for any other requests go to the network, cache, -// and then only use that cached resource if your user goes offline -self.toolbox.router.default = self.toolbox.networkFirst; diff --git a/tsconfig.json b/tsconfig.json index 2db38ce..aeb77e8 100755 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,5 +1,6 @@ { "compilerOptions": { + "baseUrl": "./", "declaration": false, "emitDecoratorMetadata": true, "experimentalDecorators": true, From 87b85a18cb3647123fa4187cb1f1950fd549e46a Mon Sep 17 00:00:00 2001 From: BenJ Date: Sun, 15 Mar 2020 22:34:08 +0100 Subject: [PATCH 2/6] providers files --- src/services/utils-services/settings-service.ts | 4 +++- src/services/utils-services/user-service.ts | 4 +++- src/services/utils-services/utils-service.ts | 4 +++- src/services/wso2-services/wso2-service.ts | 8 +++++--- 4 files changed, 14 insertions(+), 6 deletions(-) diff --git a/src/services/utils-services/settings-service.ts b/src/services/utils-services/settings-service.ts index cf3ed83..ba11740 100644 --- a/src/services/utils-services/settings-service.ts +++ b/src/services/utils-services/settings-service.ts @@ -2,7 +2,9 @@ import { Injectable } from '@angular/core'; import { BehaviorSubject } from 'rxjs'; -@Injectable() +@Injectable({ + providedIn: 'root' +}) export class SettingsProvider { private theme: BehaviorSubject; diff --git a/src/services/utils-services/user-service.ts b/src/services/utils-services/user-service.ts index 424bc4c..875298f 100644 --- a/src/services/utils-services/user-service.ts +++ b/src/services/utils-services/user-service.ts @@ -22,7 +22,9 @@ import { Injectable } from '@angular/core'; import { Storage } from '@ionic/storage'; -@Injectable() +@Injectable({ + providedIn: 'root' +}) export class UserService { favorites: string[] = []; diff --git a/src/services/utils-services/utils-service.ts b/src/services/utils-services/utils-service.ts index 14612ff..70a42e3 100644 --- a/src/services/utils-services/utils-service.ts +++ b/src/services/utils-services/utils-service.ts @@ -39,7 +39,9 @@ import { Page } from "../../app/entity/page"; import { NavigationExtras } from "@angular/router"; import * as xml2js from 'xml2js'; -@Injectable() +@Injectable({ + providedIn: 'root' +}) export class UtilsService { loading: any; shownGroup = null; diff --git a/src/services/wso2-services/wso2-service.ts b/src/services/wso2-services/wso2-service.ts index 8019c09..4ce04a2 100644 --- a/src/services/wso2-services/wso2-service.ts +++ b/src/services/wso2-services/wso2-service.ts @@ -13,7 +13,9 @@ import { wso2HeaderStudent } from '../../app/variables-config'; See https://angular.io/docs/ts/latest/guide/dependency-injection.html for more info on services and Angular 2 DI. */ -@Injectable() +@Injectable({ + providedIn: 'root' +}) export class Wso2Service { wso2ServiceBaseUrl = 'https://api.sgsi.ucl.ac.be:8243/'; @@ -44,14 +46,14 @@ export class Wso2Service { // this.optionsToken = new RequestOptions({headers: headers}); const finalUrl = this.wso2ServiceBaseUrl + 'token'; - this.http.post(finalUrl, body, {headers: headers}).pipe( + return this.http.post(finalUrl, body, {headers: headers}).pipe( map(res => { this.token = 'Bearer ' + res['access_token']; })).subscribe(res => { return 'OK'; }, error => { console.log('Token error'); - error; + return error; }); } From 3eba3fe372323bcebff19048929f7db26f637e36 Mon Sep 17 00:00:00 2001 From: BenJ Date: Sun, 15 Mar 2020 22:34:24 +0100 Subject: [PATCH 3/6] page files --- src/pages/events/events.html | 2 +- src/pages/home/home.html | 1 - src/pages/home/home.ts | 2 ++ src/pages/sports/sports.html | 2 +- src/pages/studies/studies.html | 4 ---- src/pages/tuto/tuto.scss | 29 ++++++++++++++++++++--------- 6 files changed, 24 insertions(+), 16 deletions(-) diff --git a/src/pages/events/events.html b/src/pages/events/events.html index 67450bd..52b4875 100644 --- a/src/pages/events/events.html +++ b/src/pages/events/events.html @@ -83,7 +83,7 @@

{{event.title}}

- + - diff --git a/src/pages/home/home.ts b/src/pages/home/home.ts index d94bc9a..75a0d1a 100644 --- a/src/pages/home/home.ts +++ b/src/pages/home/home.ts @@ -66,8 +66,10 @@ export class HomePage { private utilsService: UtilsService, private settings: SettingsProvider ) { + console.log("start home constructor", this.selectedTheme); this.settings.getActiveTheme().subscribe(val => this.selectedTheme = val); document.title = this.title; + console.log("end home constructor", this.selectedTheme); // this.userS.addCampus(''); } diff --git a/src/pages/sports/sports.html b/src/pages/sports/sports.html index 9965434..d42bf8a 100644 --- a/src/pages/sports/sports.html +++ b/src/pages/sports/sports.html @@ -82,7 +82,7 @@

{{sport.sport}} {{sport.sexe}} {{sport.type}}

- + diff --git a/src/pages/studies/studies.html b/src/pages/studies/studies.html index f58bbc6..75552f8 100755 --- a/src/pages/studies/studies.html +++ b/src/pages/studies/studies.html @@ -114,7 +114,6 @@

{{prog}}

{{activity.sigle}} - @@ -125,10 +124,7 @@

{{prog}}

{{'STUDY.NO' | translate}}

- - - diff --git a/src/pages/tuto/tuto.scss b/src/pages/tuto/tuto.scss index 7b00919..cdc26f7 100644 --- a/src/pages/tuto/tuto.scss +++ b/src/pages/tuto/tuto.scss @@ -18,16 +18,27 @@ You should have received a copy of the GNU General Public License along with UCLCampus. If not, see . */ - -#slides { +ion-slides { background: var(--ion-color-uclouvain) !important; -} + height: 100%; -ion-slide img { - height: 50vh !important; -} + ion-slide { + height: 100%; -ion-slide p { - color: white; -} + ion-row { + justify-content: center; + p { + color: white; + } + + img { + height: 70vh; + } + + .descr p { + height: 20vh; + } + } + } +} From 232aa755b87165c63395e0f84cd06e57cf10df55 Mon Sep 17 00:00:00 2001 From: BenJ Date: Sun, 15 Mar 2020 22:42:05 +0100 Subject: [PATCH 4/6] travis --- .travis.yml | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/.travis.yml b/.travis.yml index e6e96c2..9cd1519 100644 --- a/.travis.yml +++ b/.travis.yml @@ -35,13 +35,8 @@ jobs: language: node_js node_js: "12.14.1" - services: - - xvfb - addons: - chrome: stable - install: - - npm install -g ionic firebase-tools + - npm install -g ionic - npm install - ionic info From 555d842e1097835533d155e25c46408d20551205 Mon Sep 17 00:00:00 2001 From: BenJ Date: Sun, 15 Mar 2020 22:45:23 +0100 Subject: [PATCH 5/6] edit dep --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 4822a51..3ee176d 100755 --- a/package.json +++ b/package.json @@ -77,7 +77,7 @@ "karma-spec-reporter": "0.0.32", "node-sass": "^4.13.1", "protractor": "^5.4.3", - "typescript": "^3.5.3", + "typescript": "~3.5.3", "webpack": "^4.42.0" }, "description": "Stud.UCLouvain : an app for UCLouvain students made by UCLouvain students", From 71de4cbc424f17243ec609afbbfca67d8b3acbd5 Mon Sep 17 00:00:00 2001 From: BenJ Date: Sun, 15 Mar 2020 22:48:55 +0100 Subject: [PATCH 6/6] remove node-sass from devdep --- package.json | 1 - 1 file changed, 1 deletion(-) diff --git a/package.json b/package.json index 3ee176d..e0bda52 100755 --- a/package.json +++ b/package.json @@ -75,7 +75,6 @@ "karma-jasmine": "^2.0.1", "karma-jasmine-html-reporter": "^1.5.2", "karma-spec-reporter": "0.0.32", - "node-sass": "^4.13.1", "protractor": "^5.4.3", "typescript": "~3.5.3", "webpack": "^4.42.0"