Skip to content

Commit

Permalink
added an EditRequestModal
Browse files Browse the repository at this point in the history
  • Loading branch information
CommanderStorm committed Jun 19, 2023
1 parent 5daa35b commit bd79390
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 0 deletions.
34 changes: 34 additions & 0 deletions webclient/src/components/feedback/EditRequestModal.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<script setup lang="ts">
import BasicFeedbackModal from "@/components/feedback/TokenBasedModal.vue";
import { useGlobalStore } from "@/stores/global";
const global = useGlobalStore();
</script>

<template>
<BasicFeedbackModal :data="global.propose_edits.data">
<template v-slot:modal>
<div class="form-group">
<label class="form-label" for="additional_context">{{ $t("feedback.message") }}</label>
<textarea
class="form-input"
id="additional_context"
:placeholder="$t('feedback.message')"
v-model="global.propose_edits.data.additional_context"
rows="6"
/>
</div>
<h2>{{ $t("feedback.coordinates") }}</h2>
coordinates can be previewed here
</template>
<template v-slot:success> success </template>
</BasicFeedbackModal>
</template>

<style lang="scss" scoped>
@import "@/assets/variables";
.modal {
#additional_context {
min-width: 100%;
}
}
</style>
8 changes: 8 additions & 0 deletions webclient/src/stores/global.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { defineStore } from "pinia";
import type { components } from "@/api_types";
type PostFeedbackRequest = components["schemas"]["PostFeedbackRequest"];
type ProposeEditsRequest = components["schemas"]["ProposeEditsRequest"];

export type Coord = {
coords: {
Expand All @@ -22,6 +23,13 @@ export const useGlobalStore = defineStore({
deletion_requested: false,
} as Omit<PostFeedbackRequest, "privacy_checked" | "token">,
},
propose_edits: {
open: false,
data: {
edits: {},
additional_context: "",
} as Omit<ProposeEditsRequest, "privacy_checked" | "token">,
},
}),
actions: {
focusSearchBar(): void {
Expand Down

0 comments on commit bd79390

Please sign in to comment.