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 @@ ...@@ -23,7 +23,7 @@
</label> </label>
</form> </form>
<div role="status" aria-live="polite"> <div role="status" aria-live="polite">
<courseware-companion-box <courseware-companion-box
v-show="importDone && importErrors.length === 0" v-show="importDone && importErrors.length === 0"
:msgCompanion="$gettext('Import erfolgreich!')" :msgCompanion="$gettext('Import erfolgreich!')"
mood="special" mood="special"
...@@ -111,6 +111,10 @@ export default { ...@@ -111,6 +111,10 @@ export default {
return this.importFilesProgress === 100; return this.importFilesProgress === 100;
}, },
importDone() { importDone() {
if (!this.importZipFile) {
this.setImportFilesProgress(0);
this.setImportStructuresProgress(0);
}
return (this.importFilesProgress === 100 && this.importStructuresProgress === 100); return (this.importFilesProgress === 100 && this.importStructuresProgress === 100);
} }
}, },
...@@ -197,4 +201,4 @@ export default { ...@@ -197,4 +201,4 @@ export default {
} }
} }
} }
</script> </script>
\ No newline at end of file
...@@ -66,7 +66,7 @@ ...@@ -66,7 +66,7 @@
<textarea v-model="modifiedData.description" :placeholder="loadedDescription" required /> <textarea v-model="modifiedData.description" :placeholder="loadedDescription" required />
</label> </label>
</form> </form>
<courseware-companion-box <courseware-companion-box
v-else v-else
:msgCompanion="$gettext('Bitte wählen Sie ein Import-Archiv aus.')" :msgCompanion="$gettext('Bitte wählen Sie ein Import-Archiv aus.')"
mood="unsure" mood="unsure"
...@@ -82,7 +82,7 @@ ...@@ -82,7 +82,7 @@
> >
<template v-slot:dialogContent> <template v-slot:dialogContent>
<div role="status" aria-live="polite"> <div role="status" aria-live="polite">
<courseware-companion-box <courseware-companion-box
v-show="importDone && importErrors.length === 0" v-show="importDone && importErrors.length === 0"
:msgCompanion="$gettext('Import erfolgreich!')" :msgCompanion="$gettext('Import erfolgreich!')"
mood="special" mood="special"
...@@ -183,7 +183,7 @@ export default { ...@@ -183,7 +183,7 @@ export default {
importStructuresProgress: 'importStructuresProgress', importStructuresProgress: 'importStructuresProgress',
importErrors: 'importErrors', importErrors: 'importErrors',
lastCreateCoursewareUnit: 'courseware-units/lastCreated', lastCreateCoursewareUnit: 'courseware-units/lastCreated',
}), }),
colors() { colors() {
return this.mixinColors.filter(color => color.darkmode); return this.mixinColors.filter(color => color.darkmode);
...@@ -192,6 +192,10 @@ export default { ...@@ -192,6 +192,10 @@ export default {
return this.importFilesProgress === 100; return this.importFilesProgress === 100;
}, },
importDone() { importDone() {
if (!this.importZipFile) {
this.setImportFilesProgress(0);
this.setImportStructuresProgress(0);
}
return this.importFilesProgress === 100 && this.importStructuresProgress === 100; return this.importFilesProgress === 100 && this.importStructuresProgress === 100;
}, },
hasValidFile() { hasValidFile() {
...@@ -216,7 +220,7 @@ export default { ...@@ -216,7 +220,7 @@ export default {
}), }),
setImport(event) { setImport(event) {
this.importZipFile = event.target.files[0]; this.importZipFile = event.target.files[0];
this.loadZipData(); this.loadZipData();
}, },
async loadZipData() { async loadZipData() {
...@@ -240,7 +244,7 @@ export default { ...@@ -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.')); this.archiveErrors.push(this.$gettext('Beim laden des Archivs ist ein Fehler aufgetreten. Vermutlich ist das Archiv beschädigt.'));
filesError = true; filesError = true;
} }
if (this.zip) { if (this.zip) {
if (this.zip.file('courseware.json') === null) { if (this.zip.file('courseware.json') === null) {
this.archiveErrors.push(this.$gettext('Das Archiv enthält keine courseware.json Datei.')); this.archiveErrors.push(this.$gettext('Das Archiv enthält keine courseware.json Datei.'));
...@@ -370,4 +374,4 @@ export default { ...@@ -370,4 +374,4 @@ export default {
} }
} }
} }
</script> </script>
\ No newline at end of file
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