frontend/src/components/artifact/ArtifactWrapper.vue in mihari-5.2.4 vs frontend/src/components/artifact/ArtifactWrapper.vue in mihari-5.3.0

- old
+ new

@@ -1,62 +1,59 @@ <template> <Loading v-if="getArtifactTask.isRunning"></Loading> - <ErrorMessage - v-if="getArtifactTask.isError" - :error="getArtifactTask.last?.error" - ></ErrorMessage> + <ErrorMessage v-if="getArtifactTask.isError" :error="getArtifactTask.last?.error"></ErrorMessage> <ArtifactComponent :artifact="getArtifactTask.last.value" @refresh="refresh" v-if="getArtifactTask.last?.value" ></ArtifactComponent> </template> <script lang="ts"> -import { defineComponent, onMounted, watch } from "vue"; +import { defineComponent, onMounted, watch } from "vue" -import { generateGetArtifactTask } from "@/api-helper"; -import ArtifactComponent from "@/components/artifact/Artifact.vue"; -import ErrorMessage from "@/components/ErrorMessage.vue"; -import Loading from "@/components/Loading.vue"; +import { generateGetArtifactTask } from "@/api-helper" +import ArtifactComponent from "@/components/artifact/Artifact.vue" +import ErrorMessage from "@/components/ErrorMessage.vue" +import Loading from "@/components/Loading.vue" export default defineComponent({ name: "ArtifactWrapper", components: { ArtifactComponent, Loading, - ErrorMessage, + ErrorMessage }, props: { id: { type: String, - required: true, - }, + required: true + } }, setup(props) { - const getArtifactTask = generateGetArtifactTask(); + const getArtifactTask = generateGetArtifactTask() const getArtifact = async () => { - await getArtifactTask.perform(props.id); - }; + await getArtifactTask.perform(props.id) + } const refresh = async () => { - await getArtifact(); - }; + await getArtifact() + } onMounted(async () => { - await getArtifact(); - }); + await getArtifact() + }) watch(props, async () => { - await getArtifact(); - }); + await getArtifact() + }) return { getArtifactTask, - refresh, - }; - }, -}); + refresh + } + } +}) </script>