Skip to content

Commit

Permalink
Merge pull request #96 from Dataport/fix/lost-markers-on-reclick
Browse files Browse the repository at this point in the history
fix markers being lost on reclicks
  • Loading branch information
warm-coolguy authored Feb 5, 2024
2 parents 692a63d + 0e700cf commit b05b252
Show file tree
Hide file tree
Showing 10 changed files with 26 additions and 10 deletions.
1 change: 1 addition & 0 deletions packages/clients/dish/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

## unpublished

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

## 1.1.0
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 b05b252

Please sign in to comment.