-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* extracted common information into seperate component * Added downloadable file for agb accept component * Added input fields for seller information * Added constant for maximum title length * updated input fields for common information * Added icons infront of the inputs * updated responsivnes * added added all information steps for editing ad * added subtitle to common card * changed type of eventbus to adTo * added disable mechanism for all inputs * reworked api with template * 🍻 tested new sso api * 🍻 tested new sso api * 💩 * corrected snackbar * better readability * added userId and computed properties to user store * added api calls for user to navbar * 💩 needs removal of api calls * added authentication to api-specs * regenerated api files * exported function for xsrf-token to be used in the composable * cleaned up api loagic an introduced loading animation * sanitized inputed username * 🎨 linted and reformated code * Fix code scanning alert no. 66: Log Injection better sanitize Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com> --------- Co-authored-by: jannik.lange <[email protected]> Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
- Loading branch information
1 parent
5cce51f
commit d7c6b00
Showing
26 changed files
with
742 additions
and
119 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
.openapi-generator-ignore | ||
apis/DefaultApi.ts | ||
apis/index.ts | ||
index.ts | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,13 +2,14 @@ | |
<v-dialog | ||
v-model="dialog" | ||
persistent | ||
max-width="1400px" | ||
max-width="900px" | ||
> | ||
<v-card> | ||
<v-card-title> | ||
<v-container class="mx-0 ad-max-width"> | ||
<v-row> | ||
<p>Anzeige erstellen oder bearbeiten</p> | ||
<p v-if="isAdCreate">Anzeige erstellen</p> | ||
<p v-else>Anzeige bearbeiten</p> | ||
<v-spacer /> | ||
<v-btn | ||
prepend-icon="mdi-window-close" | ||
|
@@ -20,17 +21,41 @@ | |
</v-container> | ||
</v-card-title> | ||
<v-card-text> | ||
<ad-edit-stepper /> | ||
<v-form v-model="form"> | ||
<ad-display-card> | ||
<template #subtitle> Allgemeine Informationen </template> | ||
<template #text> | ||
<common-ad-information :disabled="disabledInputs" /> | ||
</template> | ||
</ad-display-card> | ||
<v-divider /> | ||
<ad-display-card> | ||
<template #subtitle> Optionale Informationen </template> | ||
<template #text> | ||
<optional-ad-information :disabled="disabledInputs" /> | ||
</template> | ||
</ad-display-card> | ||
<v-divider /> | ||
<ad-display-card> | ||
<template #subtitle> Verkäufer Informationen </template> | ||
<template #text> | ||
<seller-ad-information :disabled="disabledInputs" /> | ||
</template> | ||
</ad-display-card> | ||
</v-form> | ||
</v-card-text> | ||
<v-card-actions> | ||
<v-card-actions class="px-4"> | ||
<v-btn | ||
variant="elevated" | ||
color="accent" | ||
prepend-icon="mdi-content-save-outline" | ||
@click="createAd" | ||
> | ||
Erstellen / Speichern | ||
<p v-if="isAdCreate">Erstellen</p> | ||
<p v-else>Speichern</p> | ||
</v-btn> | ||
<v-btn | ||
v-if="!isAdCreate" | ||
variant="elevated" | ||
color="error" | ||
prepend-icon="mdi-trash-can-outline" | ||
|
@@ -43,19 +68,114 @@ | |
</template> | ||
|
||
<script setup lang="ts"> | ||
import type { | ||
AdCategory, | ||
AdTO, | ||
SwbFileTO, | ||
SwbImageTO, | ||
SwbUserTO, | ||
} from "@/api/swbrett"; | ||
import { useEventBus } from "@vueuse/core"; | ||
import { ref } from "vue"; | ||
import { computed, ref } from "vue"; | ||
import AdEditStepper from "@/components/Ad/Edit/AdEditStepper.vue"; | ||
import CommonAdInformation from "@/components/Ad/Edit/CommonAdInformation.vue"; | ||
import OptionalAdInformation from "@/components/Ad/Edit/OptionalAdInformation.vue"; | ||
import SellerAdInformation from "@/components/Ad/Edit/SellerAdInformation.vue"; | ||
import AdDisplayCard from "@/components/common/AdDisplayCard.vue"; | ||
import { | ||
useCreateAd, | ||
useDeleteAd, | ||
useUpdateAd, | ||
} from "@/composables/api/useAdApi"; | ||
import { useCreateUser } from "@/composables/api/useUserApi"; | ||
import { EV_EDIT_AD_DIALOG } from "@/Constants"; | ||
const dialog = ref(false); | ||
const { | ||
data: updateAdData, | ||
call: updateAdCall, | ||
loading: updateAdLoading, | ||
error: updateAdError, | ||
} = useUpdateAd(); | ||
const { | ||
call: deleteAdCall, | ||
loading: deleteAdLoading, | ||
error: deleteAdError, | ||
} = useDeleteAd(); | ||
const { | ||
data: createAdData, | ||
call: createAdCall, | ||
loading: createAdLoading, | ||
error: createAdError, | ||
} = useCreateAd(); | ||
const { data, call, loading, error } = useCreateUser(); | ||
const dialog = ref<boolean>(false); | ||
const adTo = ref<AdTO>(); | ||
const disabledInputs = ref<boolean>(false); | ||
const dialogBus = useEventBus<boolean>(EV_EDIT_AD_DIALOG); | ||
const dialogBus = useEventBus<AdTO>(EV_EDIT_AD_DIALOG); | ||
dialogBus.on((event: boolean) => (dialog.value = event)); | ||
const form = ref<boolean>(); | ||
dialogBus.on((event: AdTO) => { | ||
dialog.value = true; | ||
adTo.value = event; | ||
}); | ||
const exampleAd: AdTO = { | ||
id: 1, | ||
swbUser: { | ||
id: 123, | ||
name: "John Doe", | ||
email: "[email protected]", | ||
} as SwbUserTO, | ||
adCategory: { | ||
id: 10, | ||
name: "Electronics", | ||
} as AdCategory, | ||
adType: "SEEK", // Beispielwert aus AdTOAdTypeEnum | ||
active: true, | ||
title: "Smartphone for Sale", | ||
description: "A lightly used smartphone in excellent condition.", | ||
price: 250, | ||
phone: "+123456789", | ||
email: "[email protected]", | ||
link: "https://example.com/listing/1", | ||
creationDateTime: new Date("2024-01-01T12:00:00Z"), | ||
expiryDate: new Date("2024-12-31T23:59:59Z"), | ||
imagePreviewBase64: "data:image/png;base64,iVBORw0KGgoAAAANS...", | ||
adImg: { | ||
id: 101, | ||
fileName: "smartphone.png", | ||
url: "https://example.com/images/smartphone.png", | ||
} as SwbImageTO, | ||
adFiles: [ | ||
{ | ||
id: 201, | ||
fileName: "manual.pdf", | ||
url: "https://example.com/files/manual.pdf", | ||
} as SwbFileTO, | ||
], | ||
views: 150, | ||
}; | ||
const createAd = () => { | ||
call({ | ||
swbUserTO: { | ||
displayName: "user", | ||
id: 4, | ||
lhmObjectId: "idontknow", | ||
}, | ||
}); | ||
}; | ||
const close = () => (dialog.value = false); | ||
const isAdCreate = computed(() => adTo.value === undefined); | ||
</script> | ||
|
||
<style scoped></style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.