added CRUD for Projects,
added set project for report
This commit is contained in:
+27
-2
@@ -15,7 +15,20 @@
|
||||
v-model="short_bug"
|
||||
@keyup.enter="onShortBugEnter"
|
||||
/>
|
||||
<button @click="shortBugAdd">
|
||||
<select
|
||||
v-model="selectedProjectId"
|
||||
aria-label="Projekt rýchleho tasku"
|
||||
@change="setSelectedProject(selectedProjectId)"
|
||||
>
|
||||
<option
|
||||
v-for="project in activeProjects"
|
||||
:key="project.project_id"
|
||||
:value="project.project_id"
|
||||
>
|
||||
{{ project.project_name }}
|
||||
</option>
|
||||
</select>
|
||||
<button :disabled="selectedProjectId == null" @click="shortBugAdd">
|
||||
<font-awesome-icon :icon="['fas', 'circle-check']" /> Pridať
|
||||
</button>
|
||||
</div>
|
||||
@@ -44,6 +57,10 @@
|
||||
><font-awesome-icon :icon="['fas', 'box-archive']" />
|
||||
Archív</router-link
|
||||
>
|
||||
<router-link to="/projects"
|
||||
><font-awesome-icon :icon="['fas', 'diagram-project']" />
|
||||
Projekty</router-link
|
||||
>
|
||||
<router-link to="/api"
|
||||
><font-awesome-icon :icon="['fas', 'plug']" /> API</router-link
|
||||
>
|
||||
@@ -66,6 +83,12 @@ import {
|
||||
getDragDropPreference,
|
||||
setDragDropEnabled,
|
||||
} from "./dragDropSettings";
|
||||
import {
|
||||
activeProjects,
|
||||
loadProjects,
|
||||
selectedProjectId,
|
||||
setSelectedProject,
|
||||
} from "./projects";
|
||||
|
||||
const short_bug = ref("");
|
||||
const dragMediaQuery = getDragDropMediaQuery();
|
||||
@@ -88,14 +111,16 @@ function onShortBugEnter(event) {
|
||||
}
|
||||
|
||||
function shortBugAdd() {
|
||||
if (selectedProjectId.value == null) return;
|
||||
let content = short_bug.value;
|
||||
short_bug.value = "";
|
||||
backend.add(content, "", "0", "0", "1").then(() => {
|
||||
backend.add(content, "", "0", selectedProjectId.value, "1").then(() => {
|
||||
events.emit("reports-changed");
|
||||
});
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
loadProjects().catch((error) => console.log(error));
|
||||
if (dragMediaQuery != null) {
|
||||
dragMediaQuery.addEventListener("change", updateAutomaticDragDropState);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user