@@ -3,7 +3,10 @@ import { computed } from 'vue'
33import useMap from ' ../composables/useMap'
44import { geoJsonResults } from ' ../composables/useMap'
55import useSettings from ' ../composables/useSettings'
6+ import GlobalContributeModal from ' ./GlobalContributeModal.vue'
7+ import GlobalFeedbackDetailsModal from ' ./GlobalFeedbackDetailsModal.vue'
68import useGlobalFeedback from ' ../composables/useGlobalFeedback'
9+ import useGlobalContribute from ' ../composables/useGlobalContribute'
710
811const { settings } = useSettings ()
912const { map } = useMap ()
@@ -21,11 +24,21 @@ const {
2124 isSubmittingQuick,
2225 isSubmittingDetails,
2326 openDetailsDialog,
24- closeDetailsDialog,
2527 submitQuickFeedback,
2628 submitDetailedFeedback,
2729} = useGlobalFeedback (map )
2830
31+ const {
32+ CONTRIBUTION_OPTIONS,
33+ contributeDialogOpen,
34+ contributeForm,
35+ canSubmit : canSubmitContribute,
36+ isSubmitting : isSubmittingContribute,
37+ openContributeDialog,
38+ submitContribute,
39+ updateFormField,
40+ } = useGlobalContribute ()
41+
2942const sliderLabels = computed (() => {
3043 return Object .fromEntries (options .map ((opt , i ) => [i , opt .title ]))
3144})
@@ -61,6 +74,9 @@ const sliderLabels = computed(() => {
6174 </div >
6275
6376 <div class =" feedback-actions mt-3" >
77+ <v-btn variant =" outlined" color =" teal" size =" small" @click =" openContributeDialog" >
78+ Contribute
79+ </v-btn >
6480 <v-btn
6581 variant =" outlined"
6682 color =" teal"
@@ -89,71 +105,24 @@ const sliderLabels = computed(() => {
89105 </v-card-text >
90106 </v-card >
91107
92- <v-dialog v-model =" detailsDialogOpen" max-width =" 530" >
93- <v-card >
94- <v-card-title class =" text-h5" >Tell Us More</v-card-title >
95- <v-card-subtitle class =" text-body2 px-6 pb-2 text-wrap" >
96- We are just getting started! We know there is room to improve and we need your feedback!
97- </v-card-subtitle >
98-
99- <v-card-text >
100- <v-textarea
101- v-model =" detailsForm.qualityFeedback"
102- label =" What was good/bad? How must the field boundaries improve to be useful to you?"
103- variant =" outlined"
104- rows =" 4"
105- auto-grow
106- required
107- class =" mb-3"
108- ></v-textarea >
109-
110- <v-textarea
111- v-model =" detailsForm.useCase"
112- label =" How would you like to use field boundaries? Tell us about your use case."
113- variant =" outlined"
114- rows =" 3"
115- auto-grow
116- required
117- class =" mb-3"
118- ></v-textarea >
119-
120- <v-text-field
121- v-model =" detailsForm.name"
122- label =" Name"
123- variant =" outlined"
124- class =" mb-3"
125- ></v-text-field >
126-
127- <v-text-field
128- v-model =" detailsForm.email"
129- type =" email"
130- label =" Email"
131- variant =" outlined"
132- class =" mb-3"
133- ></v-text-field >
134-
135- <v-text-field
136- v-model =" detailsForm.organization"
137- label =" Organization"
138- variant =" outlined"
139- ></v-text-field >
140- </v-card-text >
141-
142- <v-card-actions >
143- <v-spacer ></v-spacer >
144- <v-btn variant =" text" @click =" closeDetailsDialog" >Cancel</v-btn >
145- <v-btn
146- color =" teal"
147- variant =" flat"
148- :disabled =" !canSubmitDetailed"
149- :loading =" isSubmittingDetails"
150- @click =" submitDetailedFeedback"
151- >
152- Submit
153- </v-btn >
154- </v-card-actions >
155- </v-card >
156- </v-dialog >
108+ <GlobalFeedbackDetailsModal
109+ v-model =" detailsDialogOpen "
110+ :details-form =" detailsForm "
111+ :can-submit =" canSubmitDetailed "
112+ :is-submitting =" isSubmittingDetails "
113+ @update :form =" (field , value ) => (detailsForm [field ] = value ) "
114+ @submit =" submitDetailedFeedback "
115+ />
116+
117+ <GlobalContributeModal
118+ v-model =" contributeDialogOpen "
119+ :contribute-form =" contributeForm "
120+ :contribution-options =" CONTRIBUTION_OPTIONS "
121+ :can-submit =" canSubmitContribute "
122+ :is-submitting =" isSubmittingContribute "
123+ @update :form =" updateFormField "
124+ @submit =" submitContribute "
125+ />
157126 </div >
158127</template >
159128
0 commit comments