Skip to content
Snippets Groups Projects
Commit 15439b4b authored by David Siegfried's avatar David Siegfried
Browse files

hide import-success message, closes #3464

Closes #3464

Merge request studip/studip!2363
parent 690fd51c
No related branches found
No related tags found
No related merge requests found
......@@ -23,7 +23,7 @@
</label>
</form>
<div role="status" aria-live="polite">
<courseware-companion-box
<courseware-companion-box
v-show="importDone && importErrors.length === 0"
:msgCompanion="$gettext('Import erfolgreich!')"
mood="special"
......@@ -111,6 +111,10 @@ export default {
return this.importFilesProgress === 100;
},
importDone() {
if (!this.importZipFile) {
this.setImportFilesProgress(0);
this.setImportStructuresProgress(0);
}
return (this.importFilesProgress === 100 && this.importStructuresProgress === 100);
}
},
......@@ -197,4 +201,4 @@ export default {
}
}
}
</script>
\ No newline at end of file
</script>
......@@ -66,7 +66,7 @@
<textarea v-model="modifiedData.description" :placeholder="loadedDescription" required />
</label>
</form>
<courseware-companion-box
<courseware-companion-box
v-else
:msgCompanion="$gettext('Bitte wählen Sie ein Import-Archiv aus.')"
mood="unsure"
......@@ -82,7 +82,7 @@
>
<template v-slot:dialogContent>
<div role="status" aria-live="polite">
<courseware-companion-box
<courseware-companion-box
v-show="importDone && importErrors.length === 0"
:msgCompanion="$gettext('Import erfolgreich!')"
mood="special"
......@@ -183,7 +183,7 @@ export default {
importStructuresProgress: 'importStructuresProgress',
importErrors: 'importErrors',
lastCreateCoursewareUnit: 'courseware-units/lastCreated',
}),
colors() {
return this.mixinColors.filter(color => color.darkmode);
......@@ -192,6 +192,10 @@ export default {
return this.importFilesProgress === 100;
},
importDone() {
if (!this.importZipFile) {
this.setImportFilesProgress(0);
this.setImportStructuresProgress(0);
}
return this.importFilesProgress === 100 && this.importStructuresProgress === 100;
},
hasValidFile() {
......@@ -216,7 +220,7 @@ export default {
}),
setImport(event) {
this.importZipFile = event.target.files[0];
this.loadZipData();
this.loadZipData();
},
async loadZipData() {
......@@ -240,7 +244,7 @@ export default {
this.archiveErrors.push(this.$gettext('Beim laden des Archivs ist ein Fehler aufgetreten. Vermutlich ist das Archiv beschädigt.'));
filesError = true;
}
if (this.zip) {
if (this.zip.file('courseware.json') === null) {
this.archiveErrors.push(this.$gettext('Das Archiv enthält keine courseware.json Datei.'));
......@@ -370,4 +374,4 @@ export default {
}
}
}
</script>
\ No newline at end of file
</script>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment