pridana komponenta pre FullScreenLoader,
pozity FullScreenLoader po pridani BugAdd a pri nacitani Dashboard
This commit is contained in:
parent
1eda8f80bf
commit
726a9b0f43
35
webapp/src/components/FullScreenLoader.vue
Normal file
35
webapp/src/components/FullScreenLoader.vue
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
<template>
|
||||||
|
<div class="fullscreen-loader">
|
||||||
|
<div class="spinner"></div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
.fullscreen-loader {
|
||||||
|
position: fixed;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
width: 100vw;
|
||||||
|
height: 100vh;
|
||||||
|
background-color: rgba(0, 0, 0, 0.8);
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
z-index: 9999;
|
||||||
|
}
|
||||||
|
|
||||||
|
.spinner {
|
||||||
|
width: 60px;
|
||||||
|
height: 60px;
|
||||||
|
border: 6px solid #fff;
|
||||||
|
border-top: 6px solid #3498db;
|
||||||
|
border-radius: 50%;
|
||||||
|
animation: spin 1s linear infinite;
|
||||||
|
}
|
||||||
|
|
||||||
|
@keyframes spin {
|
||||||
|
to {
|
||||||
|
transform: rotate(360deg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
@ -1,4 +1,6 @@
|
|||||||
<template>
|
<template>
|
||||||
|
<FullScreenLoader v-if="loading" />
|
||||||
|
|
||||||
<div id="bug-add">
|
<div id="bug-add">
|
||||||
<h1>Pridať nový bug</h1>
|
<h1>Pridať nový bug</h1>
|
||||||
|
|
||||||
@ -103,9 +105,11 @@
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { backend } from "../backend";
|
import { backend } from "../backend";
|
||||||
|
import FullScreenLoader from "../components/FullScreenLoader.vue";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "BugAdd",
|
name: "BugAdd",
|
||||||
|
components: { FullScreenLoader },
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
bugReport: {
|
bugReport: {
|
||||||
@ -116,6 +120,7 @@ export default {
|
|||||||
files: [],
|
files: [],
|
||||||
},
|
},
|
||||||
selectedFiles: [],
|
selectedFiles: [],
|
||||||
|
loading: false,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
@ -140,6 +145,7 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
submitForm() {
|
submitForm() {
|
||||||
|
this.loading = true;
|
||||||
// Vytvorenie FormData objektu pre odoslanie súborov
|
// Vytvorenie FormData objektu pre odoslanie súborov
|
||||||
const formData = new FormData();
|
const formData = new FormData();
|
||||||
formData.append("title", this.bugReport.title);
|
formData.append("title", this.bugReport.title);
|
||||||
@ -168,13 +174,15 @@ export default {
|
|||||||
)
|
)
|
||||||
.then((result) => {
|
.then((result) => {
|
||||||
console.log(result);
|
console.log(result);
|
||||||
|
this.resetForm();
|
||||||
|
this.$router.push("/");
|
||||||
})
|
})
|
||||||
.catch((error) => {
|
.catch((error) => {
|
||||||
console.log(error);
|
console.log(error);
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
this.loading = false;
|
||||||
});
|
});
|
||||||
|
|
||||||
// this.resetForm();
|
|
||||||
// this.$router.push("/");
|
|
||||||
},
|
},
|
||||||
resetForm() {
|
resetForm() {
|
||||||
this.bugReport = {
|
this.bugReport = {
|
||||||
|
@ -1,4 +1,6 @@
|
|||||||
<template>
|
<template>
|
||||||
|
<FullScreenLoader v-if="loading" />
|
||||||
|
|
||||||
<div id="dashboard">
|
<div id="dashboard">
|
||||||
<div id="inbox">
|
<div id="inbox">
|
||||||
<h2>Nezaradené</h2>
|
<h2>Nezaradené</h2>
|
||||||
@ -138,14 +140,17 @@ function isDragable(element) {
|
|||||||
import ReportBox from "../components/ReportBox.vue";
|
import ReportBox from "../components/ReportBox.vue";
|
||||||
import draggable from "vuedraggable";
|
import draggable from "vuedraggable";
|
||||||
import { backend } from "../backend";
|
import { backend } from "../backend";
|
||||||
|
import FullScreenLoader from "../components/FullScreenLoader.vue";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
ReportBox,
|
ReportBox,
|
||||||
draggable,
|
draggable,
|
||||||
|
FullScreenLoader,
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
loading: false,
|
||||||
itemsUncategorized: [],
|
itemsUncategorized: [],
|
||||||
itemsWaiting: [],
|
itemsWaiting: [],
|
||||||
itemsInProgress: [],
|
itemsInProgress: [],
|
||||||
@ -153,12 +158,14 @@ export default {
|
|||||||
};
|
};
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
loadData() {
|
loadData(use_loader = true) {
|
||||||
|
if (use_loader) this.loading = true;
|
||||||
backend.getAllGrouped(Array(0, 1, 2, 3)).then((all_grouped) => {
|
backend.getAllGrouped(Array(0, 1, 2, 3)).then((all_grouped) => {
|
||||||
this.itemsUncategorized = all_grouped[0];
|
this.itemsUncategorized = all_grouped[0];
|
||||||
this.itemsWaiting = all_grouped[1];
|
this.itemsWaiting = all_grouped[1];
|
||||||
this.itemsInProgress = all_grouped[2];
|
this.itemsInProgress = all_grouped[2];
|
||||||
this.itemsBlocked = all_grouped[3];
|
this.itemsBlocked = all_grouped[3];
|
||||||
|
if (use_loader) this.loading = false;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
getDataByStatus(report_status) {
|
getDataByStatus(report_status) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user