diff --git a/packages/viewer/src/api/icon.api.ts b/packages/viewer/src/api/icon.api.ts index 18df91957a..0a014b9f0f 100644 --- a/packages/viewer/src/api/icon.api.ts +++ b/packages/viewer/src/api/icon.api.ts @@ -3,12 +3,7 @@ import axios from 'axios' import { fromString } from 'ol/color' import { getViewerDedicatedServicesBaseUrl } from '@/config/baseUrl.config' -import { - type FeatureStyleColor, - type FeatureStyleSize, - LARGE, - RED, -} from '@/utils/featureStyleUtils' +import { type FeatureStyleColor, LARGE, RED } from '@/utils/featureStyleUtils' /** * Generate an icon URL from its template. If no iconScale is given, the default scale 1 will be @@ -17,19 +12,18 @@ import { * * @returns A full URL to this icon on the service-icons backend */ -export function generateIconURL( - icon: DrawingIcon, - iconColor: FeatureStyleColor = RED, - iconSize: FeatureStyleSize = LARGE -) { +export function generateIconURL(icon: DrawingIcon, iconColor: FeatureStyleColor = RED) { const rgb = fromString(iconColor.fill) - return icon.imageTemplateURL - .replace('{icon_set_name}', icon.iconSetName) - .replace('{icon_name}', icon.name) - .replace('{icon_scale}', iconSize.iconScale + 'x') - .replace('{r}', `${rgb[0]}`) - .replace('{g}', `${rgb[1]}`) - .replace('{b}', `${rgb[2]}`) + return ( + icon.imageTemplateURL + .replace('{icon_set_name}', icon.iconSetName) + .replace('{icon_name}', icon.name) + // we always use the LARGE icon scale and resize the icon with the property in KMLs + .replace('{icon_scale}', LARGE.iconScale + 'x') + .replace('{r}', `${rgb[0]}`) + .replace('{g}', `${rgb[1]}`) + .replace('{b}', `${rgb[2]}`) + ) } /** diff --git a/packages/viewer/src/modules/drawing/components/DrawingToolbox.vue b/packages/viewer/src/modules/drawing/components/DrawingToolbox.vue index 8888079847..70bfdabb35 100644 --- a/packages/viewer/src/modules/drawing/components/DrawingToolbox.vue +++ b/packages/viewer/src/modules/drawing/components/DrawingToolbox.vue @@ -2,7 +2,6 @@ import type { SingleCoordinate } from '@swissgeo/coordinates' import { FontAwesomeIcon } from '@fortawesome/vue-fontawesome' -import log from '@swissgeo/log' import GeoadminTooltip from '@swissgeo/tooltip' import DOMPurify from 'dompurify' import { computed, ref } from 'vue' @@ -48,6 +47,7 @@ const showNoActiveKmlWarning = computed(() => layersStore.activeKmlLaye const tooltipText = computed(() => t(showNoActiveKmlWarning.value ? 'drawing_empty_cannot_edit_name' : '') ) + const isDrawingLineOrMeasure = computed(() => { return ( !!drawingStore.edit.featureType && @@ -117,12 +117,7 @@ const online = computed(() => drawingStore.online) function onCloseClearConfirmation(confirmed: boolean) { showClearConfirmationModal.value = false if (confirmed) { - drawingStore.closeDrawing(dispatcher).catch((error) => { - log.error({ - title: 'DrawingToolbox.vue', - messages: ['Error while closing drawing', error], - }) - }) + drawingStore.deleteCurrentDrawing(dispatcher) } } @@ -373,6 +368,7 @@ $zindex-drawing-toolbox: -1; position: relative; z-index: $zindex-drawing-toolbox; transition: transform $animation-time; + .button-open-close-draw-menu { height: $openCloseButtonHeight; } @@ -397,6 +393,7 @@ $zindex-drawing-toolbox: -1; .drawing-toolbox { position: absolute; max-width: $menu-tray-width; + .drawing-toolbox-content { transition: opacity $animation-time; } @@ -419,4 +416,4 @@ $zindex-drawing-toolbox: -1; gap: 0.5rem 2rem; } } - + \ No newline at end of file diff --git a/packages/viewer/src/modules/drawing/components/useDrawingModeInteraction.composable.ts b/packages/viewer/src/modules/drawing/components/useDrawingModeInteraction.composable.ts index 4d63b7ee20..b08dad9dde 100644 --- a/packages/viewer/src/modules/drawing/components/useDrawingModeInteraction.composable.ts +++ b/packages/viewer/src/modules/drawing/components/useDrawingModeInteraction.composable.ts @@ -268,6 +268,9 @@ export default function useDrawingModeInteraction(config?: UseDrawingModeInterac } function onDrawStart(event: DrawEvent) { + if (drawingStore.online && drawingStore.reportProblemDrawing) { + drawingStore.setReportProblemDrawing(false, dispatcher) + } if (isExtending && startingFeature) { // hide the starting feature and store its style to restore it later previousStyle = startingFeature.getStyle() diff --git a/packages/viewer/src/modules/infobox/components/styling/DrawingStyleMediaLink.vue b/packages/viewer/src/modules/infobox/components/styling/DrawingStyleMediaLink.vue index 7d19edc4d5..2449c228e9 100644 --- a/packages/viewer/src/modules/infobox/components/styling/DrawingStyleMediaLink.vue +++ b/packages/viewer/src/modules/infobox/components/styling/DrawingStyleMediaLink.vue @@ -17,8 +17,8 @@ const emit = defineEmits<{ }>() const { t } = useI18n() -const generatedMediaLink = ref(undefined) -const linkDescription = ref(undefined) +const generatedMediaLink = ref() +const linkDescription = ref() const isFormValid = ref(false) const activateValidation = ref(false) @@ -117,14 +117,14 @@ function onUrlValidate(result: TextInputValidateResult): void { placeholder="paste_url" :validate="validateUrl" data-cy="drawing-style-media-url" - @keydown.enter="addLink()" + @keydown.enter="addLink" @validate="onUrlValidate" > diff --git a/packages/viewer/src/modules/map/components/openlayers/OpenLayersVisibleLayers.vue b/packages/viewer/src/modules/map/components/openlayers/OpenLayersVisibleLayers.vue index f7889eb6a5..0d38a4efc5 100644 --- a/packages/viewer/src/modules/map/components/openlayers/OpenLayersVisibleLayers.vue +++ b/packages/viewer/src/modules/map/components/openlayers/OpenLayersVisibleLayers.vue @@ -23,7 +23,7 @@ const filteredVisibleLayers = computed(() => { // In report problem drawing mode show the drawing layer and the temporary layer if (drawingStore.overlay.show && !drawingStore.online && drawingStore.layer.temporaryKmlId) { return layersStore.visibleLayers.filter( - (layer) => layer.id !== drawingStore.layer.temporaryKmlId + (layer) => layer.id !== `KML|${drawingStore.layer.temporaryKmlId}` ) } return layersStore.visibleLayers diff --git a/packages/viewer/src/modules/menu/components/help/ReportProblemButton.vue b/packages/viewer/src/modules/menu/components/help/ReportProblemButton.vue index 4aa93f19db..0706d22f05 100644 --- a/packages/viewer/src/modules/menu/components/help/ReportProblemButton.vue +++ b/packages/viewer/src/modules/menu/components/help/ReportProblemButton.vue @@ -93,7 +93,7 @@ const isEmailValid = ref(true) const showDrawingOverlay = computed(() => drawingStore.overlay.show) const temporaryKml: ComputedRef = computed( - () => layersStore.systemLayers.find((l) => l.id === temporaryKmlId) as KMLLayer + () => layersStore.systemLayers.find((l) => l.id === `KML|${temporaryKmlId}`) as KMLLayer ) const isTemporaryKmlValid = computed( @@ -177,9 +177,10 @@ function closeAndCleanForm() { request.value.failed = false request.value.completed = false if (temporaryKml.value) { - layersStore.removeSystemLayer(temporaryKmlId, dispatcher) + layersStore.removeSystemLayer(`KML|${temporaryKmlId}`, dispatcher) drawingStore.clearDrawingFeatures(dispatcher) } + drawingStore.setReportProblemDrawing(false, dispatcher) } function onTextValidate(valid: boolean) { @@ -224,6 +225,7 @@ function toggleDrawingOverlay() { }, dispatcher ) + drawingStore.setReportProblemDrawing(true, dispatcher) } function selectItem(dropdownItem: DropdownItem) { diff --git a/packages/viewer/src/store/modules/drawing/actions/clearDrawingFeatures.ts b/packages/viewer/src/store/modules/drawing/actions/clearDrawingFeatures.ts index ab491c2120..fde547a85a 100644 --- a/packages/viewer/src/store/modules/drawing/actions/clearDrawingFeatures.ts +++ b/packages/viewer/src/store/modules/drawing/actions/clearDrawingFeatures.ts @@ -1,7 +1,10 @@ import type { DrawingStore } from '@/store/modules/drawing/types/drawing' import type { ActionDispatcher } from '@/store/types' +import { DrawingSaveState } from '@/store/modules/drawing/types/DrawingSaveState.enum' + export default function clearDrawingFeatures(this: DrawingStore, dispatcher: ActionDispatcher) { this.feature.all = [] this.feature.current = undefined -} + this.save.state = DrawingSaveState.Initial +} diff --git a/packages/viewer/src/store/modules/drawing/actions/closeDrawing.ts b/packages/viewer/src/store/modules/drawing/actions/closeDrawing.ts index b2226df532..da6aa2cbbc 100644 --- a/packages/viewer/src/store/modules/drawing/actions/closeDrawing.ts +++ b/packages/viewer/src/store/modules/drawing/actions/closeDrawing.ts @@ -41,25 +41,27 @@ export default async function closeDrawing(this: DrawingStore, dispatcher: Actio await debounceSaveDrawing({ debounceTime: 0, retryOnError: false }) } - this.toggleDrawingOverlay( - { - show: false, - }, - dispatcher - ) - if (this.layer.config) { // flagging the layer as not edited anymore (not displayed on the map by the drawing module anymore) - layersStore.updateLayer( - this.layer.config, - { + if (!this.online) { + const updatedLayer = { + ...this.layer.config, isEdited: false, - }, - dispatcher - ) + } + layersStore.updateSystemLayer(updatedLayer, dispatcher) + } else { + layersStore.updateLayer( + this.layer.config, + { + isEdited: false, + }, + dispatcher + ) + } + delete this.layer.config } - + this.overlay.show = false this.edit.featureType = undefined this.layer.ol?.getSource()?.clear() diff --git a/packages/viewer/src/store/modules/drawing/actions/deleteCurrentDrawing.ts b/packages/viewer/src/store/modules/drawing/actions/deleteCurrentDrawing.ts new file mode 100644 index 0000000000..1de1249018 --- /dev/null +++ b/packages/viewer/src/store/modules/drawing/actions/deleteCurrentDrawing.ts @@ -0,0 +1,29 @@ +import type { DrawingStore } from '@/store/modules/drawing/types/drawing' +import type { ActionDispatcher } from '@/store/types' + +import { DrawingSaveState } from '@/store/modules/drawing/types/DrawingSaveState.enum' +import useLayersStore from '@/store/modules/layers' + +export default function deleteCurrentDrawing( + this: DrawingStore, + dispatcher: ActionDispatcher +) { + if (!this.layer.config && !this.layer.temporaryKmlId) { + return + } + this.clearDrawingFeatures(dispatcher) + this.setDrawingSaveState(DrawingSaveState.Initial, dispatcher) + this.setDrawingMode(undefined, dispatcher) + this.setIsDrawingEditShared(false, dispatcher) + + const layersStore = useLayersStore() + + if (this.online && this.layer.config?.id) { + layersStore.removeLayer(this.layer.config.id, dispatcher) + } else if (this.layer.temporaryKmlId) { + layersStore.removeSystemLayer(`KML|${this.layer.temporaryKmlId}`, dispatcher) + } + + this.layer.ol?.getSource()?.clear() + this.edit.featureType = undefined +} diff --git a/packages/viewer/src/store/modules/drawing/actions/initiateDrawing.ts b/packages/viewer/src/store/modules/drawing/actions/initiateDrawing.ts index aba3c21741..fa2a74de70 100644 --- a/packages/viewer/src/store/modules/drawing/actions/initiateDrawing.ts +++ b/packages/viewer/src/store/modules/drawing/actions/initiateDrawing.ts @@ -68,8 +68,7 @@ export default async function initiateDrawing( } let kmlLayer: KMLLayer | undefined - - if (preExistingDrawing) { + if (preExistingDrawing && this.online) { kmlLayer = preExistingDrawing this.isDrawingNew = !!kmlLayer.adminId } else if (adminId) { @@ -97,7 +96,7 @@ export default async function initiateDrawing( }) ), config: kmlLayer, - temporaryKmlId, + temporaryKmlId: temporaryKmlId ?? this.layer.temporaryKmlId, } log.debug({ diff --git a/packages/viewer/src/store/modules/drawing/actions/setCurrentlyDrawnFeature.ts b/packages/viewer/src/store/modules/drawing/actions/setCurrentlyDrawnFeature.ts index 41fe42e41b..e4c148574c 100644 --- a/packages/viewer/src/store/modules/drawing/actions/setCurrentlyDrawnFeature.ts +++ b/packages/viewer/src/store/modules/drawing/actions/setCurrentlyDrawnFeature.ts @@ -30,6 +30,7 @@ export default function setCurrentlyDrawnFeature( profileStore.setProfileFeature(this.feature.current, dispatcher) } if (!this.feature.all.some((feature) => feature.id === this.feature.current?.id)) { + this.feature.all.push(this.feature.current) debounceSaveDrawing().catch((error) => { log.error({ title: 'Drawing store / setCurrentlyDrawnFeature', diff --git a/packages/viewer/src/store/modules/drawing/actions/setReportProblemDrawing.ts b/packages/viewer/src/store/modules/drawing/actions/setReportProblemDrawing.ts new file mode 100644 index 0000000000..474cce9bf3 --- /dev/null +++ b/packages/viewer/src/store/modules/drawing/actions/setReportProblemDrawing.ts @@ -0,0 +1,10 @@ +import type { DrawingStore } from '@/store/modules/drawing/types/drawing' +import type { ActionDispatcher } from '@/store/types' + +export default function setReportProblemDrawing( + this: DrawingStore, + isReportProblemDrawing: boolean, + dispatcher: ActionDispatcher +) { + this.reportProblemDrawing = isReportProblemDrawing +} diff --git a/packages/viewer/src/store/modules/drawing/actions/toggleDrawingOverlay.ts b/packages/viewer/src/store/modules/drawing/actions/toggleDrawingOverlay.ts index 43f2dfddda..477786d3f4 100644 --- a/packages/viewer/src/store/modules/drawing/actions/toggleDrawingOverlay.ts +++ b/packages/viewer/src/store/modules/drawing/actions/toggleDrawingOverlay.ts @@ -22,11 +22,8 @@ export default function toggleDrawingOverlay( optionsOrDispatcher: ToggleDrawingOverlayOptions | ActionDispatcher, dispatcherOrNothing?: ActionDispatcher ) { - const options = !dispatcherOrNothing ? (optionsOrDispatcher as ToggleDrawingOverlayOptions) : {} - const dispatcher = dispatcherOrNothing - ? dispatcherOrNothing - : (optionsOrDispatcher as ActionDispatcher) - + const dispatcher = dispatcherOrNothing ?? (optionsOrDispatcher as ActionDispatcher) + const options = dispatcherOrNothing ? (optionsOrDispatcher as ToggleDrawingOverlayOptions) : {} const { show, online, kmlId, title = 'draw_mode_title' } = options this.overlay.show = typeof show === 'boolean' ? show : !this.overlay.show this.overlay.title = title diff --git a/packages/viewer/src/store/modules/drawing/actions/updateCurrentDrawingFeature.ts b/packages/viewer/src/store/modules/drawing/actions/updateCurrentDrawingFeature.ts index bad7925d92..8cc71b62c2 100644 --- a/packages/viewer/src/store/modules/drawing/actions/updateCurrentDrawingFeature.ts +++ b/packages/viewer/src/store/modules/drawing/actions/updateCurrentDrawingFeature.ts @@ -8,13 +8,7 @@ import { generateIconURL } from '@/api/icon.api' import { DrawingSaveState } from '@/store/modules/drawing/types/DrawingSaveState.enum' import debounceSaveDrawing from '@/store/modules/drawing/utils/debounceSaveDrawing' import useProfileStore from '@/store/modules/profile' -import { - calculateTextOffset, - type FeatureStyleColor, - type FeatureStyleSize, - MEDIUM, - RED, -} from '@/utils/featureStyleUtils' +import { calculateTextOffset } from '@/utils/featureStyleUtils' export default function updateCurrentDrawingFeature( this: DrawingStore, @@ -24,21 +18,24 @@ export default function updateCurrentDrawingFeature( if (this.feature.current) { this.save.state = DrawingSaveState.UnsavedChanges - let needIconUrlRefresh = false - Object.assign(this.feature.current, valuesToUpdate) // keeping values as preferred, if present, so that the next time the user draws, the values are used if (valuesToUpdate.iconSize) { this.edit.preferred.size = valuesToUpdate.iconSize - needIconUrlRefresh = true } if (valuesToUpdate.textSize) { this.edit.preferred.size = valuesToUpdate.textSize } if (valuesToUpdate.fillColor) { this.edit.preferred.color = valuesToUpdate.fillColor - needIconUrlRefresh = true + // refreshing the icon color if present + if (this.feature.current.icon) { + this.feature.current.icon.imageURL = generateIconURL( + this.feature.current.icon, + valuesToUpdate.fillColor + ) + } } if (valuesToUpdate.textColor) { this.edit.preferred.color = valuesToUpdate.textColor @@ -62,18 +59,6 @@ export default function updateCurrentDrawingFeature( } } - if (this.feature.current.icon && needIconUrlRefresh) { - const newIconSize: FeatureStyleSize = - valuesToUpdate.iconSize ?? this.feature.current.iconSize ?? MEDIUM - const newIconColor: FeatureStyleColor = - valuesToUpdate.fillColor ?? this.feature.current.fillColor ?? RED - this.feature.current.icon.imageURL = generateIconURL( - this.feature.current.icon, - newIconColor, - newIconSize - ) - } - const profileStore = useProfileStore() // updating the profile feature if the currently drawn feature is the profile feature if (profileStore.feature?.id === this.feature.current.id) { diff --git a/packages/viewer/src/store/modules/drawing/getters/showNotSharedDrawingWarning.ts b/packages/viewer/src/store/modules/drawing/getters/showNotSharedDrawingWarning.ts index 8875c6406b..8466ea2620 100644 --- a/packages/viewer/src/store/modules/drawing/getters/showNotSharedDrawingWarning.ts +++ b/packages/viewer/src/store/modules/drawing/getters/showNotSharedDrawingWarning.ts @@ -5,6 +5,7 @@ export default function showNotSharedDrawingWarning(this: DrawingStore): boolean !this.isVisitWithAdminId && !this.isDrawingEditShared && this.isDrawingModified && - this.online + this.online && + !this.reportProblemDrawing ) } diff --git a/packages/viewer/src/store/modules/drawing/index.ts b/packages/viewer/src/store/modules/drawing/index.ts index 7b676e899a..15f2e0bb83 100644 --- a/packages/viewer/src/store/modules/drawing/index.ts +++ b/packages/viewer/src/store/modules/drawing/index.ts @@ -4,6 +4,7 @@ import type { DrawingStoreGetters, DrawingStoreState } from '@/store/modules/dra import clearDrawingFeatures from '@/store/modules/drawing/actions/clearDrawingFeatures' import closeDrawing from '@/store/modules/drawing/actions/closeDrawing' +import deleteCurrentDrawing from '@/store/modules/drawing/actions/deleteCurrentDrawing' import deleteDrawingFeature from '@/store/modules/drawing/actions/deleteDrawingFeature' import initiateDrawing from '@/store/modules/drawing/actions/initiateDrawing' import loadAvailableIconSets from '@/store/modules/drawing/actions/loadAvailableIconSets' @@ -15,6 +16,7 @@ import setDrawingSaveState from '@/store/modules/drawing/actions/setDrawingSaveS import setEditingMode from '@/store/modules/drawing/actions/setEditingMode' import setIsDrawingEditShared from '@/store/modules/drawing/actions/setIsDrawingEditShared' import setIsVisitWithAdminId from '@/store/modules/drawing/actions/setIsVisitWithAdminId' +import setReportProblemDrawing from '@/store/modules/drawing/actions/setReportProblemDrawing' import toggleDrawingOverlay from '@/store/modules/drawing/actions/toggleDrawingOverlay' import updateCurrentDrawingFeature from '@/store/modules/drawing/actions/updateCurrentDrawingFeature' import updateDrawingPreferences from '@/store/modules/drawing/actions/updateDrawingPreferences' @@ -56,6 +58,7 @@ const state = (): DrawingStoreState => ({ state: DrawingSaveState.Initial, pending: undefined, }, + reportProblemDrawing: false, online: true, name: undefined, isDrawingNew: true, @@ -70,6 +73,8 @@ const getters: DrawingStoreGetters = { } const actions = { + deleteCurrentDrawing, + setReportProblemDrawing, clearDrawingFeatures, deleteDrawingFeature, loadAvailableIconSets, diff --git a/packages/viewer/src/store/modules/drawing/types/drawing.ts b/packages/viewer/src/store/modules/drawing/types/drawing.ts index f34b94aab5..e91064f1af 100644 --- a/packages/viewer/src/store/modules/drawing/types/drawing.ts +++ b/packages/viewer/src/store/modules/drawing/types/drawing.ts @@ -56,6 +56,8 @@ export interface DrawingStoreState { state: DrawingSaveState pending: ReturnType | undefined } + /** Flag to indicate if the user is currently reporting a problem with the drawing */ + reportProblemDrawing: boolean /** KML is saved online using the KML backend service */ online: boolean /** The name of the drawing, or undefined if no drawing is currently edited. */ diff --git a/packages/viewer/src/store/modules/drawing/utils/debounceSaveDrawing.ts b/packages/viewer/src/store/modules/drawing/utils/debounceSaveDrawing.ts index 19ca1734bf..37080e46ef 100644 --- a/packages/viewer/src/store/modules/drawing/utils/debounceSaveDrawing.ts +++ b/packages/viewer/src/store/modules/drawing/utils/debounceSaveDrawing.ts @@ -40,15 +40,47 @@ function willModify() { } } +async function saveLocalDrawing(kmlData: string) { + const drawingStore = useDrawingStore() + const layersStore = useLayersStore() + const kmlMetadata = await createKml(kmlData) + + const kmlLayer = layerUtils.makeKMLLayer({ + name: drawingStore.name, + kmlFileUrl: drawingStore.layer.temporaryKmlId, + isVisible: true, + opacity: 1, + kmlData: kmlData, + kmlMetadata, + adminId: kmlMetadata.adminId, + isEdited: true, + }) + drawingStore.layer.config = kmlLayer + + if (!layersStore.systemLayers.find((systemLayer) => systemLayer.id === kmlLayer.id)) { + layersStore.addSystemLayer(kmlLayer, dispatcher) + } else { + layersStore.updateSystemLayer(kmlLayer, dispatcher) + } +} + async function saveDrawing({ retryOnError = true }: { retryOnError?: boolean }) { const drawingStore = useDrawingStore() - if (!drawingStore.layer.ol || !drawingStore.online) { + if (!drawingStore.layer.ol) { return } - - const layersStore = useLayersStore() const positionStore = usePositionStore() + const kmlData = generateKmlString( + positionStore.projection, + drawingStore.layer.ol?.getSource()?.getFeatures() ?? [], + drawingStore.name + ) + if (!drawingStore.online) { + await saveLocalDrawing(kmlData) + return + } + const layersStore = useLayersStore() try { log.debug({ diff --git a/packages/viewer/src/store/modules/layers/actions/removeLayer.ts b/packages/viewer/src/store/modules/layers/actions/removeLayer.ts index 9e5b711892..2cf4c0b188 100644 --- a/packages/viewer/src/store/modules/layers/actions/removeLayer.ts +++ b/packages/viewer/src/store/modules/layers/actions/removeLayer.ts @@ -57,7 +57,6 @@ export default function removeLayer( (layer) => !matchTwoLayers(layerId, isExternal, baseUrl, layer) ) } - removedLayers.forEach((layer) => { if (layer.type === LayerType.GEOJSON) { const geoJsonLayer = layer as GeoAdminGeoJSONLayer diff --git a/packages/viewer/src/utils/__tests__/kmlUtils.spec.ts b/packages/viewer/src/utils/__tests__/kmlUtils.spec.ts index db07e1d2d4..dc38e84260 100644 --- a/packages/viewer/src/utils/__tests__/kmlUtils.spec.ts +++ b/packages/viewer/src/utils/__tests__/kmlUtils.spec.ts @@ -12,7 +12,7 @@ import type { EditableFeature } from '@/api/features.api' import { type DrawingIconSet, generateIconURL } from '@/api/icon.api' import { getServiceKmlBaseUrl } from '@/config/baseUrl.config' import { fakeIconSets } from '@/utils/__tests__/legacyKmlUtils.spec' -import { BLUE, EXTRA_LARGE } from '@/utils/featureStyleUtils' +import { BLUE } from '@/utils/featureStyleUtils' import { getIcon, getKmlExtent, @@ -350,7 +350,7 @@ describe('Test KML utils', () => { 'https://fake.image.url/api/icons/sets/default/icons/001-marker@1x-255,0,0.png' ) }) - it('get icon with standard arguments from the set with scale and color', () => { + it('get icon with standard arguments from the set with color', () => { const icon = getIcon( { set: 'default', @@ -363,8 +363,8 @@ describe('Test KML utils', () => { expect(icon).toBeDefined() expect(icon!.name).to.be.equal('001-marker') expect(icon!.iconSetName).to.be.equal('default') - expect(generateIconURL(icon!, BLUE, EXTRA_LARGE)).to.be.equal( - 'https://fake.image.url/api/icons/sets/default/icons/001-marker@1.25x-0,0,255.png' + expect(generateIconURL(icon!, BLUE)).to.be.equal( + 'https://fake.image.url/api/icons/sets/default/icons/001-marker@1x-0,0,255.png' ) }) it('get icon with standard arguments from the babs set', () => { diff --git a/packages/viewer/src/utils/components/EmailInput.vue b/packages/viewer/src/utils/components/EmailInput.vue index af7feefaa1..36d156983a 100644 --- a/packages/viewer/src/utils/components/EmailInput.vue +++ b/packages/viewer/src/utils/components/EmailInput.vue @@ -1,121 +1,105 @@