From bfeb00fa1948b66c3e123f65cd32f36f736cc104 Mon Sep 17 00:00:00 2001 From: Konstantin Schulz Date: Mon, 30 Mar 2020 15:43:01 +0200 Subject: [PATCH] docker container is now closed automatically after the build has finished --- .gitlab-ci.yml | 2 +- docker-compose.yml | 1 - package.json | 2 +- src/app/exercise-list/exercise-list.page.html | 12 ++++++++++++ src/app/exercise-list/exercise-list.page.spec.ts | 1 - src/app/exercise-list/exercise-list.page.ts | 5 +++-- src/assets/i18n/de.json | 1 + src/assets/i18n/en.json | 1 + 8 files changed, 19 insertions(+), 6 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 062ef7e..3861031 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -4,7 +4,7 @@ coverage: stage: test script: - docker-compose build - - docker-compose run --entrypoint="npm run test" mc_frontend + - docker-compose run --rm --entrypoint="npm run test" mc_frontend coverage: '/Statements.*?(\d+(?:\.\d+)?)%/' tags: - node diff --git a/docker-compose.yml b/docker-compose.yml index ff24eff..9cadb7c 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -8,7 +8,6 @@ services: entrypoint: ng build --prod app environment: - CHROME_BIN=google-chrome - restart: always stdin_open: true tty: true # do not use mounted volume in combination with the node_modules directory being ignored in .dockerignore diff --git a/package.json b/package.json index ba2b3e3..f27dd63 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "mc_frontend", - "version": "1.7.4", + "version": "1.7.7", "author": "Ionic Framework", "homepage": "https://ionicframework.com/", "scripts": { diff --git a/src/app/exercise-list/exercise-list.page.html b/src/app/exercise-list/exercise-list.page.html index 56ce5ca..6037c23 100644 --- a/src/app/exercise-list/exercise-list.page.html +++ b/src/app/exercise-list/exercise-list.page.html @@ -143,3 +143,15 @@ + + + + + + + {{ 'EXERCISES_REFRESH' | translate }} + + + + + diff --git a/src/app/exercise-list/exercise-list.page.spec.ts b/src/app/exercise-list/exercise-list.page.spec.ts index 4d4c444..6fd6c06 100644 --- a/src/app/exercise-list/exercise-list.page.spec.ts +++ b/src/app/exercise-list/exercise-list.page.spec.ts @@ -100,7 +100,6 @@ describe('ExerciseListPage', () => { const requestSpy: Spy = spyOn(exerciseListPage.helperService, 'makeGetRequest').and.callFake(() => Promise.reject()); spyOn(exerciseListPage.helperService, 'goToPreviewPage').and.returnValue(Promise.resolve(true)); exerciseListPage.showExercise(new ExerciseMC()).then(() => { - }, () => { requestSpy.and.returnValue(Promise.resolve(new AnnisResponse())); exerciseListPage.showExercise(new ExerciseMC({exercise_type: MoodleExerciseType.markWords.toString()})).then(() => { expect(exerciseListPage.corpusService.exercise.type).toBe(ExerciseType.markWords); diff --git a/src/app/exercise-list/exercise-list.page.ts b/src/app/exercise-list/exercise-list.page.ts index 294b842..712d1e2 100644 --- a/src/app/exercise-list/exercise-list.page.ts +++ b/src/app/exercise-list/exercise-list.page.ts @@ -86,7 +86,7 @@ export class ExerciseListPage implements OnInit { return new Date(dateMilliseconds).toLocaleDateString(); } - getExerciseList(): Promise { + getExerciseList(force: boolean = false): Promise { return new Promise((resolve, reject) => { const url: string = configMC.backendBaseUrl + configMC.backendApiExerciseListPath; this.hasVocChanged = false; @@ -95,7 +95,7 @@ export class ExerciseListPage implements OnInit { this.storage.get(configMC.localStorageKeyUpdateInfo).then((jsonString: string) => { const updateInfo: UpdateInfo = JSON.parse(jsonString) as UpdateInfo; // if there are no exercises in the cache, force refresh - const lastUpdateTime: number = state.exerciseList.length ? updateInfo.exerciseList : 0; + const lastUpdateTime: number = force ? 0 : (state.exerciseList.length ? updateInfo.exerciseList : 0); params = params.set('last_update_time', lastUpdateTime.toString()); if (this.vocService.currentReferenceVocabulary) { params = params.set('vocabulary', VocabularyCorpus[this.vocService.currentReferenceVocabulary]); @@ -154,6 +154,7 @@ export class ExerciseListPage implements OnInit { }, () => { return reject(); }); + }).catch(() => { }); } diff --git a/src/assets/i18n/de.json b/src/assets/i18n/de.json index ea465e1..dbccc05 100644 --- a/src/assets/i18n/de.json +++ b/src/assets/i18n/de.json @@ -198,6 +198,7 @@ "EXERCISE_TYPE_MATCHING": "Zuordnung", "EXERCISES": "Übungen", "EXERCISES_CREATED": "Erstellte Übungen:", + "EXERCISES_REFRESH": "Übungen neu laden", "FEEDBACK": "Feedback", "FILE_TYPE_DOCX": "DOCX", "FILE_TYPE_PDF": "PDF", diff --git a/src/assets/i18n/en.json b/src/assets/i18n/en.json index 40370ca..e2c7a78 100644 --- a/src/assets/i18n/en.json +++ b/src/assets/i18n/en.json @@ -198,6 +198,7 @@ "EXERCISE_TYPE_MATCHING": "Matching", "EXERCISES": "Exercises", "EXERCISES_CREATED": "Exercises created:", + "EXERCISES_REFRESH": "Refresh exercises", "FEEDBACK": "Feedback", "FILE_TYPE_DOCX": "DOCX", "FILE_TYPE_PDF": "PDF", -- GitLab