Skip to content

Commit 2b22451

Browse files
committed
Bump bootstrap-vue-next, fix toast display
1 parent edd9c35 commit 2b22451

File tree

13 files changed

+87
-69
lines changed

13 files changed

+87
-69
lines changed

apps/duckguessr/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@
3131
"@vueuse/integrations": "^14.1.0",
3232
"@vueuse/nuxt": "^14.1.0",
3333
"axios-cache-interceptor": "^1.11.2",
34+
"bootstrap": "^5.3.8",
35+
"bootstrap-vue-next": "^0.42.0",
3436
"js-cookie": "^3.0.5",
3537
"nuxt": "^4.2.2",
3638
"pinia": "^3.0.4",
@@ -57,8 +59,6 @@
5759
"@types/eslint-scope": "^8.3.2",
5860
"@types/js-cookie": "^3.0.6",
5961
"@types/node": "^22.19.3",
60-
"bootstrap": "^5.3.8",
61-
"bootstrap-vue-next": "^0.40.9",
6262
"concurrently": "^9.2.1",
6363
"eslint": "^9.39.2",
6464
"eslint-config-prettier": "^10.1.8",

apps/duckguessr/pnpm-lock.yaml

Lines changed: 12 additions & 12 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

apps/dumili/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
"@vueuse/integrations": "^13.9.0",
3434
"axios-cache-interceptor": "^1.11.2",
3535
"bootstrap": "^5.3.8",
36-
"bootstrap-vue-next": "^0.30.5",
36+
"bootstrap-vue-next": "^0.42.0",
3737
"js-cookie": "^3.0.5",
3838
"pinia": "^3.0.4",
3939
"socket-call-client": "^0.7.7",

apps/dumili/pnpm-lock.yaml

Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

apps/edgecreator/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
"axios": "^1.13.2",
3636
"axios-cache-interceptor": "^1.11.2",
3737
"bootstrap": "^5.3.8",
38-
"bootstrap-vue-next": "^0.30.5",
38+
"bootstrap-vue-next": "^0.42.0",
3939
"cropperjs": "^1.6.2",
4040
"interactjs": "^1.10.27",
4141
"js-cookie": "^3.0.5",

apps/edgecreator/pnpm-lock.yaml

Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

apps/edgecreator/src/App.vue

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<template>
2-
<BToastOrchestrator />
3-
<suspense><router-view /></suspense>
2+
<suspense
3+
><BApp><router-view /></BApp
4+
></suspense>
45
</template>
56

67
<script setup lang="ts">

apps/edgecreator/src/composables/useRedirect.ts

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { useToastController } from "bootstrap-vue-next";
1+
import { useToast } from "bootstrap-vue-next";
22
import { watch } from "vue";
33
import { useRoute } from "vue-router";
44

@@ -9,11 +9,9 @@ export default () =>
99
() => route.hash,
1010
(newValue) => {
1111
const toastError = (message: string) =>
12-
useToastController().show({
13-
props: {
14-
body: message,
15-
title: "Error",
16-
},
12+
useToast().create({
13+
body: message,
14+
title: "Error",
1715
});
1816
switch (newValue) {
1917
case "#401":

apps/edgecreator/src/composables/useStepOptions.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ export const useStepOptions = () => {
6161
);
6262
}
6363

64-
// useToastController().show!({
64+
// useToast().create({
6565
// props: {
6666
// body: text!,
6767
// title: t("Tip").toString(),

apps/edgecreator/src/pages/upload.vue

Lines changed: 39 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -34,27 +34,39 @@ meta:
3434
:zoomable="false"
3535
/>
3636
</div>
37-
<b-container fluid>
37+
<b-alert variant="info" :model-value="true">
3838
{{
3939
// eslint-disable-next-line max-len
4040
$t(
4141
'For each edge present on the picture, please select the part of the picture corresponding to the edge, fill in the information related to the edge hereunder then click on "Add". Once all the edges on the picture have been indicated, click on "Send the edge pictures".',
4242
)
4343
}}
44-
</b-container>
45-
<issue-select
46-
:key="crops.length"
47-
disable-ongoing-or-published
48-
:disable-not-ongoing-nor-published="false"
49-
@change="currentCrop.issuecode = $event.issuecode"
44+
</b-alert>
45+
<b-alert
46+
v-if="isWidthBiggerThanHeight"
47+
variant="danger"
48+
:model-value="true"
5049
>
51-
<template #dimensions>
52-
<dimensions v-model="currentCrop" />
53-
</template>
54-
</issue-select>
55-
<b-button :disabled="!currentCrop" class="mt-3 mb-4" @click="addCrop">
56-
{{ $t("Add") }}
57-
</b-button>
50+
{{
51+
$t(
52+
"The width of your selection is bigger than its height! Make sure that the edges appear vertically on the photo.",
53+
)
54+
}}
55+
</b-alert>
56+
<template v-else>
57+
<issue-select
58+
disable-ongoing-or-published
59+
:disable-not-ongoing-nor-published="false"
60+
@change="currentCrop.issuecode = $event.issuecode"
61+
>
62+
<template #dimensions>
63+
<dimensions v-model="currentCrop" />
64+
</template>
65+
</issue-select>
66+
<b-button :disabled="!currentCrop" class="mt-3 mb-4" @click="addCrop">
67+
{{ $t("Add") }}
68+
</b-button>
69+
</template>
5870
<b-card-group deck columns>
5971
<b-card
6072
v-for="(crop, i) in crops"
@@ -123,7 +135,7 @@ meta:
123135
<script lang="ts" setup>
124136
import "cropperjs/dist/cropper.css";
125137
126-
import { useToastController } from "bootstrap-vue-next";
138+
import { useToast } from "bootstrap-vue-next";
127139
import type Cropper from "cropperjs";
128140
import { nextTick } from "vue";
129141
import VueCropper from "vue-cropperjs";
@@ -140,6 +152,8 @@ const { upload: uploadEvents } = inject(edgecreatorSocketInjectionKey)!;
140152
141153
const { saveEdgeSvg } = useSaveEdge();
142154
155+
const toast = useToast();
156+
143157
interface Crop {
144158
width: number;
145159
height: number;
@@ -160,6 +174,8 @@ const crops = ref<CropWithData[]>([]);
160174
const uploadedImageData = ref<{ url: string }>();
161175
const cropper = ref<Cropper>();
162176
177+
const isWidthBiggerThanHeight = ref(false);
178+
163179
const initialContributors = computed(
164180
(): Omit<ModelContributor, "issuecode">[] =>
165181
!collection().user
@@ -178,7 +194,7 @@ const initialContributors = computed(
178194
const addCrop = () => {
179195
const data = cropper.value!.getData() as CropperData;
180196
if (data.height < data.width) {
181-
useToastController().show({
197+
toast.create({
182198
props: {
183199
body: i18n
184200
.t(
@@ -267,6 +283,13 @@ const drop = (e: DragEvent) => {
267283
const update = (data: { url: string }) => {
268284
uploadedImageData.value = { url: data.url };
269285
};
286+
287+
onMounted(() => {
288+
setInterval(() => {
289+
isWidthBiggerThanHeight.value =
290+
cropper.value?.getData().width > cropper.value?.getData().height;
291+
}, 100);
292+
});
270293
</script>
271294

272295
<style scoped lang="scss">

0 commit comments

Comments
 (0)