From cbc3595ed6532773cf832b49abd4fddd9ce94177 Mon Sep 17 00:00:00 2001 From: JoshuaRiewesell <40123349+JoshuaRiewesell@users.noreply.github.com> Date: Tue, 26 Mar 2024 11:39:59 +0100 Subject: [PATCH 1/2] #87 frontend: add material list and DeleteItemPopup --- .../screensTrainer/ScreenExerciseCreation.vue | 10 ++- .../pagesResourceCreation/PageMaterial.vue | 77 +++++++++++++++++-- .../pagesResourceCreation/PagePersonnel.vue | 13 +++- .../{AreaPopup.vue => DeleteItemPopup.vue} | 26 +++---- .../src/components/widgets/PersonnelPopup.vue | 51 ------------ frontend/src/sockets/MessageData.ts | 14 ++-- frontend/src/sockets/SocketTrainer.ts | 27 +++++-- 7 files changed, 129 insertions(+), 89 deletions(-) rename frontend/src/components/widgets/{AreaPopup.vue => DeleteItemPopup.vue} (61%) delete mode 100644 frontend/src/components/widgets/PersonnelPopup.vue diff --git a/frontend/src/components/screensTrainer/ScreenExerciseCreation.vue b/frontend/src/components/screensTrainer/ScreenExerciseCreation.vue index 79e6a174..5e4ae8f8 100644 --- a/frontend/src/components/screensTrainer/ScreenExerciseCreation.vue +++ b/frontend/src/components/screensTrainer/ScreenExerciseCreation.vue @@ -6,7 +6,7 @@ import TopBarTrainer from "@/components/widgets/TopBarTrainer.vue" import {svg} from "@/assets/Svg" import {setArea} from "@/components/screensTrainer/ScreenResourceCreation.vue" - import AreaPopup from '../widgets/AreaPopup.vue' + import DeleteItemPopup from '../widgets/DeleteItemPopup.vue' const exerciseStore = useExerciseStore() @@ -32,11 +32,15 @@ socketTrainer.areaAdd() } + function deleteArea(){ + socketTrainer.areaDelete(currentArea.value) + } + const showPopup = ref(false) \ No newline at end of file diff --git a/frontend/src/components/screensTrainer/pagesResourceCreation/PagePersonnel.vue b/frontend/src/components/screensTrainer/pagesResourceCreation/PagePersonnel.vue index 5726920f..26ef2a72 100644 --- a/frontend/src/components/screensTrainer/pagesResourceCreation/PagePersonnel.vue +++ b/frontend/src/components/screensTrainer/pagesResourceCreation/PagePersonnel.vue @@ -2,8 +2,8 @@ import {computed, ref} from 'vue' import {useExerciseStore} from '@/stores/Exercise' import ToggleSwitchForListItems from '@/components/widgets/ToggleSwitchForListItems.vue' - import PersonnelPopup from '@/components/widgets/PersonnelPopup.vue' import socketTrainer from '@/sockets/SocketTrainer' + import DeleteItemPopup from '@/components/widgets/DeleteItemPopup.vue' const props = defineProps({ currentArea: { @@ -28,10 +28,19 @@ function addPersonnel() { socketTrainer.personnelAdd(props.currentArea) } + + function deletePersonnel(){ + socketTrainer.personnelDelete(currentPersonnel.value) + }