update frontend lib : leaflet + oruga - #1815
This commit is contained in:
@@ -45,7 +45,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="">
|
||||
<o-button native-type="submit" variant="primary" icon-left="send">{{
|
||||
<o-button type="submit" variant="primary" icon-left="send">{{
|
||||
t("Send")
|
||||
}}</o-button>
|
||||
</div>
|
||||
|
||||
@@ -162,7 +162,7 @@
|
||||
/>
|
||||
<o-button
|
||||
:disabled="newComment.text.trim().length === 0"
|
||||
native-type="submit"
|
||||
type="submit"
|
||||
variant="primary"
|
||||
class="self-end"
|
||||
>{{ t("Post a reply") }}</o-button
|
||||
|
||||
@@ -19,9 +19,7 @@
|
||||
{{ error }}
|
||||
</o-notification>
|
||||
<footer class="flex gap-2 py-3 mx-2 justify-end">
|
||||
<o-button :disabled="!canSend" nativeType="submit">{{
|
||||
t("Send")
|
||||
}}</o-button>
|
||||
<o-button :disabled="!canSend" type="submit">{{ t("Send") }}</o-button>
|
||||
</footer>
|
||||
</form>
|
||||
</template>
|
||||
|
||||
@@ -118,7 +118,7 @@
|
||||
/>
|
||||
<div class="flex gap-2 mt-2">
|
||||
<o-button
|
||||
native-type="submit"
|
||||
type="submit"
|
||||
:disabled="['<p></p>', '', comment.text].includes(updatedComment)"
|
||||
variant="primary"
|
||||
>{{ t("Update") }}</o-button
|
||||
|
||||
@@ -327,7 +327,7 @@
|
||||
@keyup.enter="isJoinConfirmationModalActive = false"
|
||||
>{{ t("Cancel") }}
|
||||
</o-button>
|
||||
<o-button variant="primary" native-type="submit">
|
||||
<o-button variant="primary" type="submit">
|
||||
{{ t("Confirm my participation") }}
|
||||
</o-button>
|
||||
</div>
|
||||
|
||||
@@ -91,7 +91,7 @@
|
||||
<o-field :label="$t('Element value')">
|
||||
<o-input v-model="newElement.value" />
|
||||
</o-field>
|
||||
<o-button class="mt-2" variant="primary" native-type="submit">{{
|
||||
<o-button class="mt-2" variant="primary" type="submit">{{
|
||||
$t("Add")
|
||||
}}</o-button>
|
||||
</form>
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
:label-for="id"
|
||||
:message="fieldErrors"
|
||||
:variant="fieldErrors ? 'danger' : ''"
|
||||
class="!-mt-2"
|
||||
class="!-mt-2 flex"
|
||||
:labelClass="labelClass"
|
||||
>
|
||||
<template #label>
|
||||
@@ -20,18 +20,16 @@
|
||||
:title="t('Use my location')"
|
||||
/>
|
||||
<o-autocomplete
|
||||
:data="addressData"
|
||||
v-model="queryTextWithDefault"
|
||||
:options="addressData"
|
||||
:placeholder="placeholderWithDefault"
|
||||
:formatter="(elem: IAddress) => addressFullName(elem)"
|
||||
:debounce="debounceDelay"
|
||||
@input="asyncData"
|
||||
:icon="canShowLocateMeButton ? null : 'map-marker'"
|
||||
expanded
|
||||
@select="setSelected"
|
||||
:id="id"
|
||||
:disabled="disabled"
|
||||
dir="auto"
|
||||
@input="asyncData"
|
||||
@select="setSelected"
|
||||
class="FullAddressAutoComplete-o-autocomplete !mt-0 !h-full"
|
||||
>
|
||||
<template #default="{ option }">
|
||||
@@ -151,7 +149,7 @@
|
||||
</o-field>
|
||||
</section>
|
||||
<footer class="mt-3 flex gap-2 items-center">
|
||||
<o-button native-type="submit">
|
||||
<o-button type="submit">
|
||||
{{ t("Save") }}
|
||||
</o-button>
|
||||
<o-button outlined type="button" @click="resetAddress">
|
||||
@@ -204,6 +202,7 @@ import { useReverseGeocode } from "@/composition/apollo/address";
|
||||
import { useLazyQuery } from "@vue/apollo-composable";
|
||||
import { AddressSearchType } from "@/types/enums";
|
||||
import Loading from "vue-material-design-icons/Loading.vue";
|
||||
import type { OptionsProp } from "@oruga-ui/oruga-next";
|
||||
const MapLeaflet = defineAsyncComponent(
|
||||
() => import("@/components/LeafletMap.vue")
|
||||
);
|
||||
@@ -246,7 +245,7 @@ const mapDefaultZoom = computed(() => {
|
||||
return 5;
|
||||
});
|
||||
|
||||
const addressData = ref<IAddress[]>([]);
|
||||
const addressData = ref<OptionsProp>();
|
||||
|
||||
const defaultAddress = new Address();
|
||||
defaultAddress.geom = undefined;
|
||||
@@ -328,6 +327,15 @@ const { load: searchAddressLoad, refetch: searchAddressRefetch } =
|
||||
searchAddress: IAddress[];
|
||||
}>(ADDRESS);
|
||||
|
||||
function convert_to_complete(addesses: IAddress[]) {
|
||||
return addesses.map((elem: IAddress) => {
|
||||
return {
|
||||
label: elem.description, // addressFullName(elem),
|
||||
value: elem,
|
||||
};
|
||||
});
|
||||
}
|
||||
|
||||
const asyncData = async (query: string): Promise<void> => {
|
||||
console.debug("Finding addresses");
|
||||
if (!query.length) {
|
||||
@@ -359,7 +367,7 @@ const asyncData = async (query: string): Promise<void> => {
|
||||
return;
|
||||
}
|
||||
console.debug("onAddressSearchResult", result.searchAddress);
|
||||
addressData.value = result.searchAddress;
|
||||
addressData.value = convert_to_complete(result.searchAddress);
|
||||
isFetching.value = false;
|
||||
} catch (e) {
|
||||
console.error(e);
|
||||
@@ -377,7 +385,7 @@ const queryText = ref();
|
||||
const queryTextWithDefault = computed({
|
||||
get() {
|
||||
return (
|
||||
queryText.value ?? selectedAddressText.value ?? props.defaultText ?? ""
|
||||
selectedAddressText.value ?? queryText.value ?? props.defaultText ?? ""
|
||||
);
|
||||
},
|
||||
set(newValue: string) {
|
||||
@@ -431,13 +439,16 @@ const reverseGeoCode = async (e: LatLng, zoom: number) => {
|
||||
locale: locale.value as unknown as string,
|
||||
});
|
||||
if (!result) return;
|
||||
addressData.value = result.reverseGeocode;
|
||||
addressData.value = [];
|
||||
|
||||
if (addressData.value.length > 0) {
|
||||
const foundAddress = addressData.value[0];
|
||||
if (result.reverseGeocode.length > 0) {
|
||||
const foundAddress = result.reverseGeocode[0];
|
||||
Object.assign(selected, foundAddress);
|
||||
queryText.value = addressFullName(foundAddress);
|
||||
addressData.value = [
|
||||
{ label: queryTextWithDefault.value, value: foundAddress },
|
||||
];
|
||||
console.debug("reverse geocode succeded, setting new address");
|
||||
queryTextWithDefault.value = addressFullName(foundAddress);
|
||||
emit("update:modelValue", selected);
|
||||
}
|
||||
} catch (err) {
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
:placeholder="t(`I've clicked on X, then on Y`)"
|
||||
/>
|
||||
</o-field>
|
||||
<o-button icon-left="send" native-type="submit" variant="primary">{{
|
||||
<o-button icon-left="send" type="submit" variant="primary">{{
|
||||
t("Send feedback")
|
||||
}}</o-button>
|
||||
<p class="prose dark:prose-invert">
|
||||
|
||||
@@ -54,14 +54,14 @@
|
||||
<div class="flex flex-col flex-wrap sm:flex-row gap-2 justify-center">
|
||||
<o-button
|
||||
:class="'search-Event min-w-40 ' + select_button_class('EVENTS')"
|
||||
native-type="submit"
|
||||
type="submit"
|
||||
icon-left="calendar"
|
||||
>
|
||||
{{ t("Events") + number_result("EVENTS") }}
|
||||
</o-button>
|
||||
<o-button
|
||||
:class="'search-Activity min-w-40 ' + select_button_class('LONGEVENTS')"
|
||||
native-type="submit"
|
||||
type="submit"
|
||||
icon-left="calendar-star"
|
||||
v-if="isLongEvents"
|
||||
>
|
||||
@@ -69,7 +69,7 @@
|
||||
</o-button>
|
||||
<o-button
|
||||
:class="'search-Group min-w-40 ' + select_button_class('GROUPS')"
|
||||
native-type="submit"
|
||||
type="submit"
|
||||
icon-left="account-multiple"
|
||||
>
|
||||
{{ t("Groups") + number_result("GROUPS") }}
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
</div>
|
||||
<o-button
|
||||
class="search-Event min-w-40 sm:w-auto"
|
||||
native-type="submit"
|
||||
type="submit"
|
||||
icon-left="magnify"
|
||||
>
|
||||
{{ t("Search") }}
|
||||
|
||||
@@ -45,7 +45,7 @@
|
||||
</o-notification>
|
||||
<o-button
|
||||
class="mt-3"
|
||||
nativeType="submit"
|
||||
type="submit"
|
||||
:disabled="selectedRoles.length == 0"
|
||||
>{{ t("Send") }}</o-button
|
||||
>
|
||||
|
||||
@@ -70,12 +70,9 @@
|
||||
</o-checkbox>
|
||||
</o-field>
|
||||
<div class="flex gap-2 my-2">
|
||||
<o-button
|
||||
:disabled="sendingForm"
|
||||
variant="primary"
|
||||
native-type="submit"
|
||||
>{{ $t("Send email") }}</o-button
|
||||
>
|
||||
<o-button :disabled="sendingForm" variant="primary" type="submit">{{
|
||||
$t("Send email")
|
||||
}}</o-button>
|
||||
<o-button
|
||||
native-type="button"
|
||||
variant="text"
|
||||
|
||||
Reference in New Issue
Block a user