Commit 2dfaec50 authored by Daniel Regenass's avatar Daniel Regenass 👽
Browse files

Merge branch 'develop' into 'master'

Release Merge 2022.1.1

See merge request !14
parents 455d246f ef2d730f
......@@ -6,7 +6,7 @@
<groupId>ch.ethz.id.sws.doi</groupId>
<artifactId>doi-online-gui</artifactId>
<packaging>war</packaging>
<version>2022.1.0</version>
<version>2022.1.1</version>
<name>DOI Online GUI</name>
<scm>
......
<template>
<transition name="modal-fade">
<div class="modal" v-if="isModalOpen">
<div class="modal-wrapper" v-on:click="closeModal(false)">
<div
class="modal-container"
v-bind:class="{ 'has-fixed-footer': false }"
role="dialog"
aria-modal="true"
aria-labelledby="modalTitle"
aria-describedby="modalDescription"
>
<header class="modal-header" id="modalTitle">
<p>{{ $t('components.fw.confirmBox.title') }}</p>
<button
class="btn-modal-close"
v-on:click="closeModal(false)"
aria-label="Modal schliessen"
/>
</header>
<main class="modal-body" id="modalDescription">
<slot name="modalBody">
<p>{{ modalContent }}</p>
</slot>
</main>
<footer class="modal-footer">
<slot name="modalFooter">
<button type="button" class="btn btn-submit" v-on:click="closeModal(true)" v-bind:aria-label="this.$t('components.fw.confirmBox.ok.aria-label')">{{ $t('components.fw.confirmBox.ok.label') }}</button>
<button type="button" class="btn btn-close" v-on:click="closeModal(false)" v-bind:aria-label="this.$t('components.fw.confirmBox.cancel.aria-label')">{{ $t('components.fw.confirmBox.cancel.label') }}</button>
</slot>
</footer>
</div>
</div>
</div>
</transition>
</template>
<script>
export default {
name: 'ConfirmBox',
data: () => {
return {
isModalOpen: false,
modalContent: "Modal Content Text",
okFunction: null,
cancelFunction: null
}
},
methods: {
closeModal(isOk) {
this.isModalOpen = false
document.querySelector('body').classList.remove('overflow-hidden')
if (isOk && this.okFunction) {
this.okFunction()
} else if (this.cancelFunction) {
this.cancelFunction()
}
},
openModal(contentText, okFunction, cancelFunction) {
this.isModalOpen = true
this.modalContent = contentText
this.okFunction = okFunction
this.cancelFunction = cancelFunction
document.querySelector('body').classList.add('overflow-hidden')
}
}
};
</script>
<style lang="scss">
.has-fixed-footer {
.modal-content {
padding-bottom: 7rem;
}
.modal-footer {
position: fixed;
background: white;
bottom: 4rem;
width: 44rem;
height: 6rem;
}
}
</style>
......@@ -23,10 +23,13 @@
"colUnhandledErrors": "Unbehandelte Fehler",
"colBatchStatus": "Batch Status",
"colCommands": "Befehle",
"footerTotal": "Total",
"footerTotal": "Total",
"confirmBoxText": "Soll die Batch Anforderung {name} für das Repositorium {repository} wirklich übermittelt werden?",
"modalSuccessTitle": "Bestätigung",
"modalFullSyncText": "Fullsync Batch Anforderung für {name} wurde übermittelt.",
"modalFullImportText": "FullImport Batch Anforderung für {name} wurde übermittelt.",
"modalImportText": "Import Batch Anforderung für {name} wurde übermittelt.",
"modalUpdateText": "Update Batch Anforderung für {name} wurde übermittelt.",
"modalFullExportText": "FullExport Batch Anforderung für {name} wurde übermittelt.",
"modalExportText": "Export Batch Anforderung für {name} wurde übermittelt.",
"modalClearText": "Clear Batch Anforderung für {name} wurde übermittelt.",
"modalFailureTitle": "Fehlgeschlagen",
......@@ -381,7 +384,18 @@
"Do",
"Fr",
"Sa"
]
]
},
"confirmBox": {
"ok": {
"label": "OK",
"aria-label": "OK"
},
"cancel": {
"label": "Abbruch",
"aria-label": "Abbruch"
},
"title": "Bitte bestätigen"
}
},
"layout": {
......
......@@ -23,10 +23,13 @@
"colUnhandledErrors": "Unhandled Errors",
"colBatchStatus": "Batch Status",
"colCommands": "Commands",
"footerTotal": "Total",
"footerTotal": "Total",
"confirmBoxText": "Do you really want to initiate batch request {name} for repository {repository}?",
"modalSuccessTitle": "Confirmation",
"modalFullSyncText": "Fullsync batch request for {name} has been submitted.",
"modalFullImportText": "FullImport batch request for {name} has been submitted.",
"modalImportText": "Import batch request for {name} has been submitted.",
"modalUpdateText": "Update batch request for {name} has been submitted.",
"modalFullExportText": "FullExport batch request for {name} has been submitted.",
"modalExportText": "Export batch request for {name} has been submitted.",
"modalClearText": "Clear batch request for {name} has been submitted.",
"modalFailureTitle": "Failure",
......@@ -381,7 +384,18 @@
"Th",
"Fr",
"Sa"
]
]
},
"confirmBox": {
"ok": {
"label": "OK",
"aria-label": "OK"
},
"cancel": {
"label": "Cancel",
"aria-label": "Cancel"
},
"title": "Please confirm"
}
},
"layout": {
......
......@@ -124,12 +124,14 @@
<p>{{ modalText }}</p>
</div>
</template>
</Modal>
</Modal>
<ConfirmBox ref="confirmBox"></ConfirmBox>
</template>
<script>
import Logger from 'js-logger'
import Modal from '@/components/fw/Modal'
import Modal from '@/components/fw/Modal'
import ConfirmBox from '@/components/fw/ConfirmBox'
import DateUtils from '@/mixins/DateUtils'
import DOIOnlineServices from '@/services/DOIOnlineServices'
......@@ -138,8 +140,9 @@ export default {
mixins: [DateUtils],
components: {
Modal
components: {
Modal,
ConfirmBox
},
data: () => {
......@@ -181,7 +184,10 @@ export default {
Logger.debug("REST streamDashbaord: " + JSON.stringify(streamedData) + ", isCompleted =" + isCompleted)
})
},
onClickFullImport(entry) {
onClickFullImport(entry) {
this.$refs.confirmBox.openModal(this.$t('app.views.index.dashboardTable.confirmBoxText', {name: 'FullImport Batch', repository: entry.name}), () => this.startFullImport(entry), null)
},
startFullImport(entry) {
this.restError = null
let loader = this.$loading.show({
container: null,
......@@ -190,8 +196,8 @@ export default {
this.restServices.startFullImport(entry.id,
() => {
loader.hide()
this.modalText = this.$t('app.views.index.dashboardTable.modalFullSyncText', {name: entry.name})
loader.hide()
this.modalText = this.$t('app.views.index.dashboardTable.modalFullImportText', {name: entry.name})
this.$refs.modalBatchInfo.openModal(this.$t('app.views.index.dashboardTable.modalSuccessTitle'))
entry['has-manual-batch-pending'] = true
......@@ -207,7 +213,10 @@ export default {
}
)
},
onClickImport(entry) {
onClickImport(entry) {
this.$refs.confirmBox.openModal(this.$t('app.views.index.dashboardTable.confirmBoxText', {name: 'Import Batch', repository: entry.name}), () => this.startImport(entry), null)
},
startImport(entry) {
this.restError = null
let loader = this.$loading.show({
container: null,
......@@ -216,8 +225,8 @@ export default {
this.restServices.startImport(entry.id,
() => {
loader.hide()
this.modalText = this.$t('app.views.index.dashboardTable.modalUpdateText', {name: entry.name})
loader.hide()
this.modalText = this.$t('app.views.index.dashboardTable.modalImportText', {name: entry.name})
this.$refs.modalBatchInfo.openModal(this.$t('app.views.index.dashboardTable.modalSuccessTitle'))
entry['has-manual-batch-pending'] = true
......@@ -233,7 +242,10 @@ export default {
}
)
},
onClickUpdate(entry) {
onClickUpdate(entry) {
this.$refs.confirmBox.openModal(this.$t('app.views.index.dashboardTable.confirmBoxText', {name: 'Update Batch', repository: entry.name}), () => this.startkUpdate(entry), null)
},
startkUpdate(entry) {
this.restError = null
let loader = this.$loading.show({
container: null,
......@@ -259,7 +271,10 @@ export default {
}
)
},
onClickFullExport(entry) {
onClickFullExport(entry) {
this.$refs.confirmBox.openModal(this.$t('app.views.index.dashboardTable.confirmBoxText', {name: 'FullExport Batch', repository: entry.name}), () => this.startFullExport(entry), null)
},
startFullExport(entry) {
this.restError = null
let loader = this.$loading.show({
container: null,
......@@ -268,8 +283,8 @@ export default {
this.restServices.startFullExport(entry.id,
() => {
loader.hide()
this.modalText = this.$t('app.views.index.dashboardTable.modalExportText', {name: entry.name})
loader.hide()
this.modalText = this.$t('app.views.index.dashboardTable.modalFullExportText', {name: entry.name})
this.$refs.modalBatchInfo.openModal(this.$t('app.views.index.dashboardTable.modalSuccessTitle'))
entry['has-manual-batch-pending'] = true
......@@ -285,7 +300,10 @@ export default {
}
)
},
onClickExport(entry) {
onClickExport(entry) {
this.$refs.confirmBox.openModal(this.$t('app.views.index.dashboardTable.confirmBoxText', {name: 'Export Batch', repository: entry.name}), () => this.startExport(entry), null)
},
startExport(entry) {
this.restError = null
let loader = this.$loading.show({
container: null,
......@@ -311,7 +329,10 @@ export default {
}
)
},
onClickClear(entry) {
onClickClear(entry) {
this.$refs.confirmBox.openModal(this.$t('app.views.index.dashboardTable.confirmBoxText', {name: 'Clear Batch', repository: entry.name}), () => this.startClear(entry), null)
},
startClear(entry) {
this.restError = null
let loader = this.$loading.show({
container: null,
......
Supports Markdown
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