Skip to content

Commit 3e5a290

Browse files
authored
Merge pull request #1389 from geoadmin/feat-PB-1866-make-delete-modal-easier-to-understand
PB-1866: Make delete drawing window easier to understand
2 parents 5e0b2b8 + 0b3abff commit 3e5a290

File tree

7 files changed

+64
-19
lines changed

7 files changed

+64
-19
lines changed

packages/mapviewer/src/modules/drawing/components/DrawingToolbox.vue

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ const debounceSaveDrawingName = debounce(async (newName) => {
163163
/>
164164
<div :class="[{ 'drawing-toolbox-closed': !drawMenuOpen }, 'drawing-toolbox']">
165165
<div
166-
class="card text-center drawing-toolbox-content shadow-lg rounded-bottom rounded-top-0 rounded-start-0"
166+
class="card drawing-toolbox-content rounded-bottom rounded-top-0 rounded-start-0 text-center shadow-lg"
167167
:class="{ 'rounded-bottom-0': isPhoneMode }"
168168
>
169169
<GeoadminTooltip
@@ -173,7 +173,7 @@ const debounceSaveDrawingName = debounce(async (newName) => {
173173
>
174174
<div
175175
v-if="online"
176-
class="d-flex justify-content-center align-items-center gap-2 mt-3 mx-4"
176+
class="d-flex justify-content-center align-items-center mx-4 mt-3 gap-2"
177177
>
178178
<label
179179
for="drawing-name"
@@ -282,7 +282,7 @@ const debounceSaveDrawingName = debounce(async (newName) => {
282282
class="row mt-2"
283283
>
284284
<div
285-
class="col text-center text-muted"
285+
class="col text-muted text-center"
286286
data-cy="drawing-toolbox-disclaimer"
287287
>
288288
<!-- eslint-disable vue/no-v-html-->
@@ -297,7 +297,7 @@ const debounceSaveDrawingName = debounce(async (newName) => {
297297
class="text-center"
298298
>
299299
<button
300-
class="button-open-close-draw-menu btn btn-dark m-auto ps-4 pe-4 rounded-0 rounded-bottom"
300+
class="button-open-close-draw-menu btn btn-dark rounded-0 rounded-bottom m-auto pe-4 ps-4"
301301
data-cy="menu-button"
302302
@click="drawMenuOpen = !drawMenuOpen"
303303
>
@@ -310,9 +310,20 @@ const debounceSaveDrawingName = debounce(async (newName) => {
310310
v-if="showClearConfirmationModal"
311311
show-confirmation-buttons
312312
fluid
313+
confirm-key="confirm_delete"
314+
confirm-icon="far fa-trash-alt"
313315
@close="onCloseClearConfirmation"
314316
>
315-
{{ t('confirm_remove_all_features') }}
317+
<div class="mb-2">
318+
{{ t('confirm_remove_all_features') }}
319+
</div>
320+
<div class="alert alert-warning">
321+
<FontAwesomeIcon
322+
class="me-1"
323+
icon="warning"
324+
/>
325+
{{ t('confirm_no_cancel') }}
326+
</div>
316327
</ModalWithBackdrop>
317328
<ModalWithBackdrop
318329
v-if="showShareModal"

packages/mapviewer/src/modules/i18n/locales/de.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,9 @@
8888
"cms_release_url": "https://www.geo.admin.ch/de/#Neue-Daten-und-Aktualisierungen",
8989
"commune": "Gemeinde",
9090
"compare": "Vergleichen",
91-
"confirm_remove_all_features": "Wollen Sie wirklich alle Objekte löschen?",
91+
"confirm_delete": "Alles löschen",
92+
"confirm_no_cancel": "Dieser Vorgang kann nicht rückgängig gemacht werden.",
93+
"confirm_remove_all_features": "Möchten Sie wirklich Ihre gesamte Zeichnung löschen?",
9294
"confirm_remove_selected_features": "Wollen Sie wirklich alle selektierten Objekte löschen?",
9395
"connect": "Verbinden",
9496
"contact_us": "Kontakt",

packages/mapviewer/src/modules/i18n/locales/en.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,9 @@
8888
"cms_release_url": "https://www.geo.admin.ch/en/#New-data-and-updates ",
8989
"commune": "City",
9090
"compare": "Compare",
91-
"confirm_remove_all_features": "Do you really want to delete all features?",
91+
"confirm_delete": "Delete everything",
92+
"confirm_no_cancel": " This action can't be cancelled.",
93+
"confirm_remove_all_features": "Do you really want to delete your entire drawing?",
9294
"confirm_remove_selected_features": "Do you really want to delete the selected features?",
9395
"connect": "Connect",
9496
"contact_us": "Contact",

packages/mapviewer/src/modules/i18n/locales/fr.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,9 @@
8888
"cms_release_url": "https://www.geo.admin.ch/fr/#Nouvelles-données-et-mises-à-jour",
8989
"commune": "Commune",
9090
"compare": "Comparer",
91-
"confirm_remove_all_features": "Voulez-vous vraiment effacer tous les objets?",
91+
"confirm_delete": "Tout effacer",
92+
"confirm_no_cancel": " Cette action ne peut pas être annulée.",
93+
"confirm_remove_all_features": "Voulez-vous vraiment supprimer l'intégralité de votre dessin ?",
9294
"confirm_remove_selected_features": "Voulez-vous vraiment effacer les objets sélectionnés?",
9395
"connect": "Connecter",
9496
"contact_us": "Contact",

packages/mapviewer/src/modules/i18n/locales/it.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,9 @@
8888
"cms_release_url": "https://www.geo.admin.ch/it/#Nuovi-dati-e-aggiornamenti ",
8989
"commune": "Comune",
9090
"compare": "Confrontare",
91-
"confirm_remove_all_features": "Volete veramente cancellare tutti gli oggetti?",
91+
"confirm_delete": "Elimina tutto",
92+
"confirm_no_cancel": " Questa azione non potrà essere annullata.",
93+
"confirm_remove_all_features": "È sicuro di voler eliminare l'intero disegno?",
9294
"confirm_remove_selected_features": "Volete veramente cancellare gli oggetti selezionati?",
9395
"connect": "Connessione",
9496
"contact_us": "Contatto",

packages/mapviewer/src/modules/i18n/locales/rm.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,9 @@
8888
"cms_release_url": "https://www.geo.admin.ch/de/#Neue-Daten-und-Aktualisierungen",
8989
"commune": "Vischnanca",
9090
"compare": "Confruntar",
91-
"confirm_remove_all_features": "Vulais Vus propi stizzar tut ils objects?",
91+
"confirm_delete": "Stizzar tut",
92+
"confirm_no_cancel": " Quest'acziun na po betg vegnir revocada.",
93+
"confirm_remove_all_features": "Ès Vus segir che Vus vulais stizzar tut il design?",
9294
"confirm_remove_selected_features": "Stizzar tut ils objects?",
9395
"connect": "Connectar",
9496
"contact_us": "Contact",

packages/mapviewer/src/utils/components/ModalWithBackdrop.vue

Lines changed: 33 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,25 @@ const { title, allowPrint, showConfirmationButtons, fluid, headerPrimary, top, h
3737
type: Boolean,
3838
default: false,
3939
},
40+
confirmKey: {
41+
type: String,
42+
default: 'success',
43+
},
44+
cancelKey: {
45+
type: String,
46+
default: 'cancel',
47+
},
48+
confirmIcon: {
49+
type: String,
50+
default: null,
51+
},
52+
cancelIcon: {
53+
type: String,
54+
default: null,
55+
},
4056
/**
41-
* Hide the modal with backdrop, can be used to temporarily hide the modal without loosing its
42-
* content
57+
* Hide the modal with backdrop, can be used to temporarily hide the modal without loosing
58+
* its content
4359
*/
4460
hide: {
4561
type: Boolean,
@@ -69,7 +85,7 @@ function onHideParentModal(hide) {
6985
<template>
7086
<teleport to="#main-component">
7187
<!-- Must teleport inside main-component in order for dynamic outlines to work and to be
72-
sure that it is always on top of the reset. -->
88+
sure that it is always on top of the rest. -->
7389
<div
7490
v-show="!hide && !hideForPrint"
7591
data-cy="modal-with-backdrop"
@@ -94,11 +110,11 @@ function onHideParentModal(hide) {
94110
>
95111
<div
96112
class="card-header d-flex align-middle"
97-
:class="{ 'bg-primary text-white border-primary': headerPrimary }"
113+
:class="{ 'bg-primary border-primary text-white': headerPrimary }"
98114
>
99115
<span
100116
v-if="title"
101-
class="flex-grow-1 text-start text-truncate"
117+
class="flex-grow-1 text-truncate text-start"
102118
data-cy="modal-with-backdrop-title"
103119
>
104120
{{ title }}
@@ -122,27 +138,35 @@ function onHideParentModal(hide) {
122138
</div>
123139
<div
124140
ref="modalContent"
125-
class="card-body pt-3 ps-4 pe-4"
141+
class="card-body pe-4 ps-4 pt-3"
126142
data-cy="modal-content"
127143
>
128144
<slot />
129145
<div
130146
v-if="showConfirmationButtons"
131-
class="mt-1 d-flex justify-content-end"
147+
class="d-flex justify-content-end mt-1"
132148
>
133149
<button
134150
class="btn btn-light me-2"
135151
data-cy="modal-cancel-button"
136152
@click.stop="onClose(false)"
137153
>
138-
{{ t('cancel') }}
154+
<FontAwesomeIcon
155+
v-if="!!cancelIcon"
156+
:icon="cancelIcon"
157+
></FontAwesomeIcon>
158+
{{ t(cancelKey) }}
139159
</button>
140160
<button
141161
class="btn btn-primary"
142162
data-cy="modal-confirm-button"
143163
@click.stop="onClose(true)"
144164
>
145-
{{ t('success') }}
165+
<FontAwesomeIcon
166+
v-if="!!confirmIcon"
167+
:icon="confirmIcon"
168+
></FontAwesomeIcon>
169+
{{ t(confirmKey) }}
146170
</button>
147171
</div>
148172
</div>

0 commit comments

Comments
 (0)