From 1e1975e1ca1131df77ba0534df57bb44b90903d2 Mon Sep 17 00:00:00 2001 From: Adrien Navratil Date: Sun, 1 Dec 2019 00:32:33 +0100 Subject: [PATCH] Fixed marks for new period system, updated dependencies, version increment --- config.xml | 4 +-- ionic.config.json | 3 +- package-lock.json | 43 +++++++++++++++++------- package.json | 2 +- src/app/main.ts | 6 ++-- src/pages/about/about.html | 2 +- src/pages/marks-details/marks-details.ts | 40 +++++++++++++--------- src/pages/marks/marks.ts | 18 +++++++--- 8 files changed, 77 insertions(+), 41 deletions(-) diff --git a/config.xml b/config.xml index f6e083d..9ceea38 100644 --- a/config.xml +++ b/config.xml @@ -1,5 +1,5 @@ - + Sakado An app for school. Adrien 'Litarvan' Navratil @@ -12,7 +12,7 @@ - + diff --git a/ionic.config.json b/ionic.config.json index bb2850b..9163aa4 100644 --- a/ionic.config.json +++ b/ionic.config.json @@ -3,6 +3,5 @@ "integrations": { "cordova": {} }, - "type": "ionic-angular", - "app_id": "" + "type": "ionic-angular" } diff --git a/package-lock.json b/package-lock.json index 8518067..ed55a6c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "sakado", - "version": "1.4.1-BETA", + "version": "1.5.0-BETA", "lockfileVersion": 1, "requires": true, "dependencies": { @@ -2462,7 +2462,8 @@ }, "ansi-regex": { "version": "2.1.1", - "bundled": true + "bundled": true, + "optional": true }, "aproba": { "version": "1.2.0", @@ -2480,11 +2481,13 @@ }, "balanced-match": { "version": "1.0.0", - "bundled": true + "bundled": true, + "optional": true }, "brace-expansion": { "version": "1.1.11", "bundled": true, + "optional": true, "requires": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" @@ -2497,15 +2500,18 @@ }, "code-point-at": { "version": "1.1.0", - "bundled": true + "bundled": true, + "optional": true }, "concat-map": { "version": "0.0.1", - "bundled": true + "bundled": true, + "optional": true }, "console-control-strings": { "version": "1.1.0", - "bundled": true + "bundled": true, + "optional": true }, "core-util-is": { "version": "1.0.2", @@ -2608,7 +2614,8 @@ }, "inherits": { "version": "2.0.3", - "bundled": true + "bundled": true, + "optional": true }, "ini": { "version": "1.3.5", @@ -2618,6 +2625,7 @@ "is-fullwidth-code-point": { "version": "1.0.0", "bundled": true, + "optional": true, "requires": { "number-is-nan": "^1.0.0" } @@ -2630,17 +2638,20 @@ "minimatch": { "version": "3.0.4", "bundled": true, + "optional": true, "requires": { "brace-expansion": "^1.1.7" } }, "minimist": { "version": "0.0.8", - "bundled": true + "bundled": true, + "optional": true }, "minipass": { "version": "2.2.4", "bundled": true, + "optional": true, "requires": { "safe-buffer": "^5.1.1", "yallist": "^3.0.0" @@ -2657,6 +2668,7 @@ "mkdirp": { "version": "0.5.1", "bundled": true, + "optional": true, "requires": { "minimist": "0.0.8" } @@ -2735,7 +2747,8 @@ }, "number-is-nan": { "version": "1.0.1", - "bundled": true + "bundled": true, + "optional": true }, "object-assign": { "version": "4.1.1", @@ -2745,6 +2758,7 @@ "once": { "version": "1.4.0", "bundled": true, + "optional": true, "requires": { "wrappy": "1" } @@ -2820,7 +2834,8 @@ }, "safe-buffer": { "version": "5.1.1", - "bundled": true + "bundled": true, + "optional": true }, "safer-buffer": { "version": "2.1.2", @@ -2850,6 +2865,7 @@ "string-width": { "version": "1.0.2", "bundled": true, + "optional": true, "requires": { "code-point-at": "^1.0.0", "is-fullwidth-code-point": "^1.0.0", @@ -2867,6 +2883,7 @@ "strip-ansi": { "version": "3.0.1", "bundled": true, + "optional": true, "requires": { "ansi-regex": "^2.0.0" } @@ -2905,11 +2922,13 @@ }, "wrappy": { "version": "1.0.2", - "bundled": true + "bundled": true, + "optional": true }, "yallist": { "version": "3.0.2", - "bundled": true + "bundled": true, + "optional": true } } }, diff --git a/package.json b/package.json index 4ec2e6e..b00b946 100644 --- a/package.json +++ b/package.json @@ -25,7 +25,7 @@ "@ionic-native/splash-screen": "4.4.0", "@ionic-native/status-bar": "4.4.0", "@ionic/storage": "2.1.3", - "cordova-android": "7.1.1", + "cordova-android": "^7.1.1", "cordova-ios": "4.5.5", "cordova-plugin-device": "^1.1.7", "cordova-plugin-ionic-webview": "^1.1.16", diff --git a/src/app/main.ts b/src/app/main.ts index 5a9b5e4..cda95da 100644 --- a/src/app/main.ts +++ b/src/app/main.ts @@ -20,9 +20,9 @@ import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; import { AppModule } from './app.module'; import { enableProdMode } from '@angular/core'; -export const VERSION = 'Beta 1.5.0'; -export const SERVER_URL = 'https://api.sakado.litarvan.com/'; -export const DEBUG = true; +export const VERSION = 'Beta 1.6.0'; +export const SERVER_URL = 'https://sakado.tk/'; +export const DEBUG = false; if (!DEBUG) { diff --git a/src/pages/about/about.html b/src/pages/about/about.html index 45c1f4f..dd22947 100644 --- a/src/pages/about/about.html +++ b/src/pages/about/about.html @@ -28,7 +28,7 @@

{{ version }}

- + diff --git a/src/pages/marks-details/marks-details.ts b/src/pages/marks-details/marks-details.ts index 6d7fcc1..66a4e6d 100644 --- a/src/pages/marks-details/marks-details.ts +++ b/src/pages/marks-details/marks-details.ts @@ -36,28 +36,36 @@ export class MarksDetailsPage implements OnInit ngOnInit() { this.api.userQuery(`{ + periods { + id + isDefault + } + marks { - name - average - studentClassAverage - minAverage - maxAverage - + period marks { - title - value - away - max + name average - higher - lower - coefficient - time + studentClassAverage + minAverage + maxAverage + + marks { + title + value + away + max + average + higher + lower + coefficient + time + } } } }`).then(result => { - this.marks = result.marks; - console.log(result.marks); + const period = result.periods.find(p => p.isDefault); + this.marks = result.marks.find(p => p.period === period.id).marks; }); } diff --git a/src/pages/marks/marks.ts b/src/pages/marks/marks.ts index cd44723..fa57308 100644 --- a/src/pages/marks/marks.ts +++ b/src/pages/marks/marks.ts @@ -51,13 +51,23 @@ export class MarksPage implements OnInit time } - averages { - student - studentClass + periods { + id + isDefault + } + + marks { + period + averages { + student + studentClass + } } }`).then(result => { + const period = result.periods.find(p => p.isDefault); + + this.averages = result.marks.find(p => p.period === period.id).averages; this.marks = result.lastMarks; - this.averages = result.averages; }); }