Commit bfeb00fa authored by Konstantin Schulz's avatar Konstantin Schulz

docker container is now closed automatically after the build has finished

parent 33b056d3
Pipeline #10945 passed with stage
in 2 minutes and 6 seconds
......@@ -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
......
......@@ -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
......
{
"name": "mc_frontend",
"version": "1.7.4",
"version": "1.7.7",
"author": "Ionic Framework",
"homepage": "https://ionicframework.com/",
"scripts": {
......
......@@ -143,3 +143,15 @@
</ng-template>
</ion-grid>
</ion-content>
<ion-footer>
<ion-toolbar>
<ion-tabs id="tabs">
<ion-tab-bar slot="bottom">
<ion-tab-button (click)="getExerciseList(true)">
<ion-icon name="refresh"></ion-icon>
<ion-label>{{ 'EXERCISES_REFRESH' | translate }}</ion-label>
</ion-tab-button>
</ion-tab-bar>
</ion-tabs>
</ion-toolbar>
</ion-footer>
......@@ -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);
......
......@@ -86,7 +86,7 @@ export class ExerciseListPage implements OnInit {
return new Date(dateMilliseconds).toLocaleDateString();
}
getExerciseList(): Promise<void> {
getExerciseList(force: boolean = false): Promise<void> {
return new Promise<void>((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(() => {
});
}
......
......@@ -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",
......
......@@ -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",
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment