pridane ID reportu do zobrazenia na dashboard,
odstrany upload suboru pre vytvorenie noveho reportu, pridane tlacitko na Hotovo pre bug, pridane komfety a zvukove jingle pre Hotovo bug
This commit is contained in:
parent
c7dcdf228e
commit
506e847b5d
7
webapp/package-lock.json
generated
7
webapp/package-lock.json
generated
@ -12,6 +12,7 @@
|
|||||||
"@fortawesome/fontawesome-svg-core": "^6.7.2",
|
"@fortawesome/fontawesome-svg-core": "^6.7.2",
|
||||||
"@fortawesome/free-solid-svg-icons": "^6.7.2",
|
"@fortawesome/free-solid-svg-icons": "^6.7.2",
|
||||||
"@fortawesome/vue-fontawesome": "^3.0.8",
|
"@fortawesome/vue-fontawesome": "^3.0.8",
|
||||||
|
"js-confetti": "^0.12.0",
|
||||||
"mitt": "^3.0.1",
|
"mitt": "^3.0.1",
|
||||||
"vue": "^3.5.13",
|
"vue": "^3.5.13",
|
||||||
"vue-router": "^4.5.0",
|
"vue-router": "^4.5.0",
|
||||||
@ -1267,6 +1268,12 @@
|
|||||||
"node": ">=8"
|
"node": ">=8"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/js-confetti": {
|
||||||
|
"version": "0.12.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/js-confetti/-/js-confetti-0.12.0.tgz",
|
||||||
|
"integrity": "sha512-1R0Akxn3Zn82pMqW65N1V2NwKkZJ75bvBN/VAb36Ya0YHwbaSiAJZVRr/19HBxH/O8x2x01UFAbYI18VqlDN6g==",
|
||||||
|
"license": "MIT"
|
||||||
|
},
|
||||||
"node_modules/magic-string": {
|
"node_modules/magic-string": {
|
||||||
"version": "0.30.17",
|
"version": "0.30.17",
|
||||||
"resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.17.tgz",
|
"resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.17.tgz",
|
||||||
|
@ -13,6 +13,7 @@
|
|||||||
"@fortawesome/fontawesome-svg-core": "^6.7.2",
|
"@fortawesome/fontawesome-svg-core": "^6.7.2",
|
||||||
"@fortawesome/free-solid-svg-icons": "^6.7.2",
|
"@fortawesome/free-solid-svg-icons": "^6.7.2",
|
||||||
"@fortawesome/vue-fontawesome": "^3.0.8",
|
"@fortawesome/vue-fontawesome": "^3.0.8",
|
||||||
|
"js-confetti": "^0.12.0",
|
||||||
"mitt": "^3.0.1",
|
"mitt": "^3.0.1",
|
||||||
"vue": "^3.5.13",
|
"vue": "^3.5.13",
|
||||||
"vue-router": "^4.5.0",
|
"vue-router": "^4.5.0",
|
||||||
|
BIN
webapp/public/sounds/crazy-phrog-short.mp3
Normal file
BIN
webapp/public/sounds/crazy-phrog-short.mp3
Normal file
Binary file not shown.
BIN
webapp/public/sounds/crazy-phrog.mp3
Normal file
BIN
webapp/public/sounds/crazy-phrog.mp3
Normal file
Binary file not shown.
BIN
webapp/public/sounds/tada.mp3
Normal file
BIN
webapp/public/sounds/tada.mp3
Normal file
Binary file not shown.
BIN
webapp/public/sounds/tada2.mp3
Normal file
BIN
webapp/public/sounds/tada2.mp3
Normal file
Binary file not shown.
@ -279,6 +279,10 @@ button:focus-visible,
|
|||||||
text-align: left;
|
text-align: left;
|
||||||
padding: 5px;
|
padding: 5px;
|
||||||
}
|
}
|
||||||
|
#dashboard .report .report-id {
|
||||||
|
text-align: center;
|
||||||
|
padding: 5px;
|
||||||
|
}
|
||||||
#dashboard .report .report-date {
|
#dashboard .report .report-date {
|
||||||
text-align: right;
|
text-align: right;
|
||||||
padding: 5px;
|
padding: 5px;
|
||||||
|
@ -22,6 +22,7 @@ defineProps({
|
|||||||
</div>
|
</div>
|
||||||
<div class="report-footer">
|
<div class="report-footer">
|
||||||
<div class="report-group"><font-awesome-icon :icon="['fas', 'diagram-project']" /> {{ group }}</div>
|
<div class="report-group"><font-awesome-icon :icon="['fas', 'diagram-project']" /> {{ group }}</div>
|
||||||
|
<div class="report-id"><font-awesome-icon :icon="['fas', 'hashtag']" /> {{ report_id }}</div>
|
||||||
<div class="report-date"><font-awesome-icon :icon="['fas', 'calendar-days']" /> {{ date }}</div>
|
<div class="report-date"><font-awesome-icon :icon="['fas', 'calendar-days']" /> {{ date }}</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -30,33 +30,6 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="cols">
|
<div class="cols">
|
||||||
<div class="form-group">
|
|
||||||
<label for="files">Prílohy:</label>
|
|
||||||
<input
|
|
||||||
type="file"
|
|
||||||
id="files"
|
|
||||||
@change="handleFileUpload"
|
|
||||||
multiple
|
|
||||||
class="form-control file-input"
|
|
||||||
/>
|
|
||||||
<div class="selected-files" v-if="selectedFiles.length > 0">
|
|
||||||
<p>Vybrané súbory:</p>
|
|
||||||
|
|
||||||
<p v-for="(file, index) in selectedFiles" :key="index">
|
|
||||||
<button
|
|
||||||
type="button"
|
|
||||||
class="remove-file"
|
|
||||||
@click="removeFile(index)"
|
|
||||||
>
|
|
||||||
<font-awesome-icon :icon="['fas', 'circle-xmark']" /> Odober
|
|
||||||
súbor
|
|
||||||
</button>
|
|
||||||
|
|
||||||
{{ file.name }} ({{ formatFileSize(file.size) }})
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label for="priority">Priorita:</label>
|
<label for="priority">Priorita:</label>
|
||||||
<select
|
<select
|
||||||
@ -88,7 +61,6 @@
|
|||||||
<option value="antispam">Antispam</option>
|
<option value="antispam">Antispam</option>
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="form-actions">
|
<div class="form-actions">
|
||||||
<router-link to="/" class="button"
|
<router-link to="/" class="button"
|
||||||
@ -99,7 +71,10 @@
|
|||||||
<font-awesome-icon :icon="['fas', 'circle-check']" /> Odoslať
|
<font-awesome-icon :icon="['fas', 'circle-check']" /> Odoslať
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
|
<p>Poznamka: Subory je mozne pridat ako prilohy az po vytvoreni noveho reportu..</p>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@ -124,26 +99,6 @@ export default {
|
|||||||
};
|
};
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
handleFileUpload(event) {
|
|
||||||
const files = event.target.files;
|
|
||||||
if (files) {
|
|
||||||
for (let i = 0; i < files.length; i++) {
|
|
||||||
this.selectedFiles.push(files[i]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
removeFile(index) {
|
|
||||||
this.selectedFiles.splice(index, 1);
|
|
||||||
},
|
|
||||||
formatFileSize(size) {
|
|
||||||
if (size < 1024) {
|
|
||||||
return size + " B";
|
|
||||||
} else if (size < 1024 * 1024) {
|
|
||||||
return (size / 1024).toFixed(2) + " KB";
|
|
||||||
} else {
|
|
||||||
return (size / (1024 * 1024)).toFixed(2) + " MB";
|
|
||||||
}
|
|
||||||
},
|
|
||||||
submitForm() {
|
submitForm() {
|
||||||
this.loading = true;
|
this.loading = true;
|
||||||
// Vytvorenie FormData objektu pre odoslanie súborov
|
// Vytvorenie FormData objektu pre odoslanie súborov
|
||||||
@ -152,17 +107,11 @@ export default {
|
|||||||
formData.append("description", this.bugReport.description);
|
formData.append("description", this.bugReport.description);
|
||||||
formData.append("priority", this.bugReport.priority);
|
formData.append("priority", this.bugReport.priority);
|
||||||
|
|
||||||
// Pridanie súborov do FormData
|
|
||||||
this.selectedFiles.forEach((file, index) => {
|
|
||||||
formData.append(`file${index}`, file);
|
|
||||||
});
|
|
||||||
|
|
||||||
// Tu by nasledovalo odoslanie dát na server
|
// Tu by nasledovalo odoslanie dát na server
|
||||||
console.log("Odosielam bug report:", {
|
console.log("Odosielam bug report:", {
|
||||||
title: this.bugReport.title,
|
title: this.bugReport.title,
|
||||||
description: this.bugReport.description,
|
description: this.bugReport.description,
|
||||||
priority: this.bugReport.priority,
|
priority: this.bugReport.priority,
|
||||||
files: this.selectedFiles.map((f) => f.name),
|
|
||||||
});
|
});
|
||||||
backend
|
backend
|
||||||
.add(
|
.add(
|
||||||
@ -175,7 +124,7 @@ export default {
|
|||||||
.then((result) => {
|
.then((result) => {
|
||||||
console.log(result);
|
console.log(result);
|
||||||
this.resetForm();
|
this.resetForm();
|
||||||
this.$router.push("/");
|
this.$router.push("/report/" + result.report_id);
|
||||||
})
|
})
|
||||||
.catch((error) => {
|
.catch((error) => {
|
||||||
console.log(error);
|
console.log(error);
|
||||||
@ -191,10 +140,6 @@ export default {
|
|||||||
priority: "",
|
priority: "",
|
||||||
files: [],
|
files: [],
|
||||||
};
|
};
|
||||||
this.selectedFiles = [];
|
|
||||||
// Resetovanie file input
|
|
||||||
const fileInput = document.getElementById("files");
|
|
||||||
if (fileInput) fileInput.value = "";
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
@ -28,6 +28,11 @@
|
|||||||
<font-awesome-icon :icon="['fas', 'trash-can']" /> Zmazať
|
<font-awesome-icon :icon="['fas', 'trash-can']" /> Zmazať
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
<div>
|
||||||
|
<button @click="reportDone">
|
||||||
|
<font-awesome-icon :icon="['fas', 'circle-check']" /> Hotovo, presunut do archivu
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<h1 contenteditable="true" @blur="onTitleChange" ref="reportTitle">
|
<h1 contenteditable="true" @blur="onTitleChange" ref="reportTitle">
|
||||||
{{ report.report_title }}
|
{{ report.report_title }}
|
||||||
@ -142,6 +147,7 @@
|
|||||||
<script>
|
<script>
|
||||||
import { backend } from "../backend";
|
import { backend } from "../backend";
|
||||||
import FullScreenLoader from "../components/FullScreenLoader.vue";
|
import FullScreenLoader from "../components/FullScreenLoader.vue";
|
||||||
|
import JSConfetti from 'js-confetti'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "Report",
|
name: "Report",
|
||||||
@ -203,6 +209,20 @@ export default {
|
|||||||
this.$router.push("/");
|
this.$router.push("/");
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
reportDone() {
|
||||||
|
backend.update(this.report_id, {
|
||||||
|
report_status: 4,
|
||||||
|
}).then(() => {
|
||||||
|
let tadas = ['/sounds/tada.mp3', '/sounds/tada2.mp3', '/sounds/crazy-phrog-short.mp3'];
|
||||||
|
const audio = new Audio(tadas[Math.floor(Math.random() * tadas.length)]);
|
||||||
|
audio.play();
|
||||||
|
const confetti = new JSConfetti();
|
||||||
|
confetti.addConfetti();
|
||||||
|
setTimeout(() => {
|
||||||
|
this.$router.push("/");
|
||||||
|
}, 3000);
|
||||||
|
});
|
||||||
|
},
|
||||||
attachmentAdd() {
|
attachmentAdd() {
|
||||||
let comment = this.$refs.attachmentNewContent.value;
|
let comment = this.$refs.attachmentNewContent.value;
|
||||||
if (comment.trim().length > 0) {
|
if (comment.trim().length > 0) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user