update frontend lib : leaflet + oruga - #1815

This commit is contained in:
Laurent GAY
2025-10-24 17:40:29 +02:00
committed by setop
parent b5852a95eb
commit 58a1d857a1
75 changed files with 944 additions and 1076 deletions

View File

@@ -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>

View File

@@ -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

View File

@@ -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>

View File

@@ -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

View File

@@ -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>

View File

@@ -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>

View File

@@ -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) {

View File

@@ -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">

View File

@@ -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") }}

View File

@@ -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") }}

View File

@@ -45,7 +45,7 @@
</o-notification>
<o-button
class="mt-3"
nativeType="submit"
type="submit"
:disabled="selectedRoles.length == 0"
>{{ t("Send") }}</o-button
>

View File

@@ -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"

View File

@@ -11,9 +11,9 @@ export const dateFnsPlugin = {
}
import(
`../../node_modules/date-fns/esm/locale/${dateFnsfileForLanguage(
`../../node_modules/date-fns/locale/${dateFnsfileForLanguage(
options.locale
)}/index.js`
)}/cdn.js`
).then((localeEntity: { default: Locale }) => {
app.provide("dateFnsLocale", localeEntity.default);
app.config.globalProperties.$dateFnsLocale = localeEntity.default;

View File

@@ -247,7 +247,7 @@
<o-button outlined @click="isEmailChangeModalActive = false">{{
t("Close")
}}</o-button>
<o-button native-type="submit" variant="primary">{{
<o-button type="submit" variant="primary">{{
t("Change email")
}}</o-button>
</footer>
@@ -301,7 +301,7 @@
<o-button @click="isRoleChangeModalActive = false" outlined>{{
t("Close")
}}</o-button>
<o-button native-type="submit" variant="primary">{{
<o-button type="submit" variant="primary">{{
t("Change role")
}}</o-button>
</footer>
@@ -330,7 +330,7 @@
<o-button @click="isConfirmationModalActive = false">{{
t("Close")
}}</o-button>
<o-button native-type="submit" variant="primary">{{
<o-button type="submit" variant="primary">{{
t("Confirm user")
}}</o-button>
</footer>

View File

@@ -23,7 +23,7 @@
/>
</p>
<p class="control">
<o-button variant="primary" native-type="submit">{{
<o-button variant="primary" type="submit">{{
t("Add an instance")
}}</o-button>
<o-loading

View File

@@ -505,7 +505,7 @@
</div>
</div>
</section>
<o-button native-type="submit" variant="primary">{{
<o-button type="submit" variant="primary">{{
t("Save instance settings")
}}</o-button>
</form>

View File

@@ -129,7 +129,7 @@
</o-field>
<o-button
class="my-2"
native-type="submit"
type="submit"
:disabled="['<p></p>', ''].includes(newComment)"
variant="primary"
>{{ t("Reply") }}</o-button

View File

@@ -52,7 +52,7 @@
/>
</o-field>
<o-button class="mt-2" native-type="submit">
<o-button class="mt-2" type="submit">
{{ t("Create the discussion") }}
</o-button>
</form>

View File

@@ -72,7 +72,7 @@
<div class="flex gap-2 mt-2">
<o-button
variant="primary"
native-type="submit"
type="submit"
icon-right="check"
:title="t('Update discussion title')"
/>
@@ -133,7 +133,7 @@
</o-field>
<o-button
class="my-2"
native-type="submit"
type="submit"
:disabled="['<p></p>', ''].includes(newComment)"
variant="primary"
>{{ t("Reply") }}</o-button

View File

@@ -203,7 +203,7 @@
variant="primary"
:disabled="loading"
:loading="loading"
native-type="submit"
type="submit"
class="mt-3"
>
{{ t("Create my group") }}

View File

@@ -48,7 +48,7 @@
/>
</p>
<p class="control">
<o-button variant="primary" native-type="submit">{{
<o-button variant="primary" type="submit">{{
t("Invite member")
}}</o-button>
</p>

View File

@@ -167,7 +167,7 @@
<div class="flex flex-wrap gap-2 my-2">
<o-button
:loading="loadingUpdateGroup"
native-type="submit"
type="submit"
variant="primary"
>{{ t("Update group") }}</o-button
>

View File

@@ -56,7 +56,7 @@
</div>
<div class="text-center">
<o-button native-type="submit">{{ t("Continue") }}</o-button>
<o-button type="submit">{{ t("Continue") }}</o-button>
</div>
</form>
<AuthorizeApplication

View File

@@ -104,7 +104,7 @@
@click="publish(true)"
>{{ t("Save draft") }}</o-button
>
<o-button variant="primary" native-type="submit">
<o-button variant="primary" type="submit">
<span v-if="isUpdate === false || post?.draft === true">{{
t("Publish")
}}</span>

View File

@@ -75,7 +75,7 @@
/>
</o-field>
<o-button native-type="submit">{{ t("Rename resource") }}</o-button>
<o-button type="submit">{{ t("Rename resource") }}</o-button>
</form>
</section>
</div>
@@ -138,7 +138,7 @@
/>
</o-field>
<o-button class="mt-2" native-type="submit">{{
<o-button class="mt-2" type="submit">{{
createResourceButtonLabel
}}</o-button>
</form>
@@ -208,7 +208,7 @@
/>
</o-field>
<o-button native-type="submit" class="mt-2">{{
<o-button type="submit" class="mt-2">{{
t("Create resource")
}}</o-button>
</form>

View File

@@ -204,7 +204,7 @@
<div class="flex items-center justify-center">
<o-button
class="mt-2"
native-type="submit"
type="submit"
variant="danger"
size="large"
>

View File

@@ -37,7 +37,7 @@
<o-checkbox v-model="newTodo.status" />
<o-input expanded v-model="newTodo.title" />
</o-field>
<o-button native-type="submit">{{ $t("Add a todo") }}</o-button>
<o-button type="submit">{{ $t("Add a todo") }}</o-button>
</form>
</section>
</template>

View File

@@ -34,7 +34,7 @@
<o-field :label="$t('List title')">
<o-input v-model="newTodoList.title" />
</o-field>
<o-button native-type="submit">{{ $t("Create a new list") }}</o-button>
<o-button type="submit">{{ $t("Create a new list") }}</o-button>
</form>
<div v-for="todoList in todoLists" :key="todoList.id">
<router-link

View File

@@ -75,7 +75,7 @@
<o-button
variant="primary"
size="large"
native-type="submit"
type="submit"
:disabled="submitted"
>
{{ t("Login") }}

View File

@@ -184,7 +184,7 @@
variant="primary"
size="large"
:disabled="sendingForm"
native-type="submit"
type="submit"
>
{{ t("Create an account") }}
</o-button>

View File

@@ -18,7 +18,7 @@
/>
</o-field>
<p class="flex flex-wrap gap-1 mt-2">
<o-button variant="primary" native-type="submit">
<o-button variant="primary" type="submit">
{{ $t("Send the confirmation email again") }}
</o-button>
<o-button

View File

@@ -30,7 +30,7 @@
/>
</o-field>
<p class="my-4 flex gap-2">
<o-button variant="primary" native-type="submit">
<o-button variant="primary" type="submit">
{{ t("Submit") }}
</o-button>
<o-button