Skip to content

Commit

Permalink
fix markers being lost on reclicks
Browse files Browse the repository at this point in the history
Markers were lost due to technically required closing operations that
were mixed with user-intended closing operations. However, pins should
only disappear when users intend the closing operation. When re-clicking
now, the pin no longer disappears, since that was not the users
intention.
  • Loading branch information
warm-coolguy committed Jan 25, 2024
1 parent 3f6e478 commit 5c3bd2f
Show file tree
Hide file tree
Showing 10 changed files with 29 additions and 10 deletions.
4 changes: 4 additions & 0 deletions packages/clients/dish/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# CHANGELOG

## unpublished

- Fix: The marker previously disappeared on being moved/reclicked on a second feature. This issue has been resolved.

## 1.1.0

- Feature: Update icon of `layerChooser` in `iconMenu` to `fa-layer-group` to clear-up the content hidden behind the menu button.
Expand Down
2 changes: 1 addition & 1 deletion packages/clients/dish/src/plugins/Gfi/Content.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
icon
small
:aria-label="$t('common:plugins.gfi.header.close')"
@click="close"
@click="close(true)"
>
<v-icon small>fa-xmark</v-icon>
</v-btn>
Expand Down
4 changes: 4 additions & 0 deletions packages/components/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# CHANGELOG

## unpublished

- Fix: The GFI's new flag `userInteraction` on the close interaction is now filled and forwarded according to whether the close call was due to the user intentionally closing the GFI rather than opening a new GFI. This is required for a fix in the GFI plugin.

## 2.1.0

- Feature: Add the possibility to update the icon of the button for closing the MoveHandle.
Expand Down
6 changes: 3 additions & 3 deletions packages/components/MoveHandle.vue
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<v-card-actions>
<slot name="actionButton" />
<v-spacer></v-spacer>
<v-btn icon small :aria-label="closeLabel" @click="close">
<v-btn icon small :aria-label="closeLabel" @click="close(true)">
<v-icon><slot name="closeIcon">fa-xmark</slot></v-icon>
</v-btn>
</v-card-actions>
Expand Down Expand Up @@ -139,9 +139,9 @@ export default Vue.extend({
},
methods: {
...mapMutations(['setMoveHandle']),
close() {
close(userInteraction: boolean) {
this.setMoveHandle(null)
this.closeFunction()
this.closeFunction(userInteraction)
},
moveHandle(key: string): void {
if (key === 'ArrowUp' || key === 'ArrowDown') {
Expand Down
4 changes: 4 additions & 0 deletions packages/core/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# CHANGELOG

## unpublished

- Fix: The GFI's new flag `userInteraction` on the close interaction is forwarded. This is required for a fix in the GFI plugin.

## 1.4.0

- Feature: Add hatchable markers; that is, when using `extendedMasterportalapiMarkers`, marker fills can now contain patterns for better accessibility.
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/components/MapContainer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ export default Vue.extend({
(this.moveHandle === null ||
this.moveHandle.plugin !== oldHandle.plugin)
) {
oldHandle.closeFunction()
oldHandle.closeFunction(false)
}
// Make sure the element is properly updated.
this.moveHandleKey += 1
Expand Down
4 changes: 4 additions & 0 deletions packages/plugins/Gfi/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# CHANGELOG

## unpublished

- Fix: The `close` method previously always removed the pin when not in `extendedMasterportalapiMarkers` mode. This issue has been resolved by distinguishing whether a close operation happened in effect to a direct closing user interaction or was technically motivated.

## 1.2.1

- Fix: Add missing deregistration of event listeners on destruction.
Expand Down
2 changes: 1 addition & 1 deletion packages/plugins/Gfi/src/components/Feature.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
icon
small
:aria-label="$t(closeLabel)"
@click="close"
@click="close(true)"
>
<v-icon>fa-xmark</v-icon>
</v-btn>
Expand Down
4 changes: 2 additions & 2 deletions packages/plugins/Gfi/src/components/Gfi.vue
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,8 @@ export default Vue.extend({
methods: {
...mapMutations(['setMoveHandle']),
...mapActions('plugin/gfi', ['close']),
closeWindow() {
this.close()
closeWindow(userInteraction: boolean) {
this.close(userInteraction)
// The list view is currently only implemented if the gfi is rendered as part of the iconMenu.
// TODO: Finding a different solution may be a task to be tackled in the future
if (
Expand Down
7 changes: 5 additions & 2 deletions packages/plugins/Gfi/src/store/actions/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -215,11 +215,14 @@ export const makeActions = () => {
}
})
},
close({ commit, dispatch, rootGetters }) {
close({ commit, dispatch, rootGetters }, userInteraction = false) {
commit('clearFeatureInformation')
commit('setImageLoaded', false)
// NOTE: null is needed, as the payload is always the second argument...
if (!rootGetters.configuration?.extendedMasterportalapiMarkers) {
if (
!rootGetters.configuration?.extendedMasterportalapiMarkers &&
userInteraction
) {
dispatch('plugin/pins/removeMarker', null, { root: true })
}
dispatch('setCoreSelection', { feature: null })
Expand Down

0 comments on commit 5c3bd2f

Please sign in to comment.