Koha/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/Dialog.vue
Jonathan Druart b563544200
Bug 32030: Pretty vue files
The plan was to rewrite the whole history, but it failed
(see https://tree.taiga.io/project/joubu-koha-erm/us/129)

yarn run prettier --trailing-comma es5 --semi false --arrow-parens avoid --write **/*.vue

TODO - Add a QA check + git pre-commit hook

Signed-off-by: Jonathan Field <jonathan.field@ptfs-europe.com>

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2022-11-08 09:44:44 -03:00

45 lines
1.1 KiB
Vue

<template>
<div class="dialog message" v-if="message">{{ message }}</div>
<div class="dialog alert" v-if="error">{{ error }}</div>
<div class="dialog alert modal" v-if="warning">
{{ warning }}
<a
id="close_modal"
class="btn btn-default btn-xs"
role="button"
@click="removeMessages"
>{{ $__("Close") }}</a
>
</div>
<!-- Must be styled differently -->
</template>
<script>
import { inject } from "vue"
import { storeToRefs } from "pinia"
export default {
setup() {
const mainStore = inject("mainStore")
const { message, error, warning } = storeToRefs(mainStore)
const { removeMessages } = mainStore
return { message, error, warning, removeMessages }
},
}
</script>
<style scoped>
.modal {
position: fixed;
z-index: 9998;
display: table;
transition: opacity 0.3s ease;
margin: auto;
padding: 20px 30px;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.33);
transition: all 0.3s ease;
}
#close_modal {
float: right;
cursor: pointer;
}
</style>