Skip to content

Commit

Permalink
Update Readmes and Changelogs regarding addLoading and removeLoading
Browse files Browse the repository at this point in the history
  • Loading branch information
Softwarecules committed Aug 30, 2024
1 parent a9d454d commit 5ca4cd9
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 6 deletions.
1 change: 1 addition & 0 deletions packages/plugins/AddressSearch/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
- Feature: Add new optional configuration parameter `afterResultComponent` that allows to display a custom component for each search result.
- Feature: There is now a new optional configuration parameter `searchMethods.queryParameters.likeFilterAttributes` for the WfsSearch that allows to add custom key/value pairs which are mapped to attributes of the like filter operator.
- Fix: Adjust documentation and types to properly describe optionality of configuration parameters.
- Chore: Clarify the description to `addLoading` and `removeLoading` within the readme.

## 1.2.1

Expand Down
4 changes: 2 additions & 2 deletions packages/plugins/AddressSearch/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,14 @@ In `categoryProperties` and `groupProperties`, id strings called `groupId` and `
| - | - | - |
| searchMethods | searchMethodsObject[] | Array of search method descriptions. Only searches configured here can be used. |
| afterResultComponent | VueConstructor? | If given, this component will be rendered in the last line of every single search result. It will be forwarded its search result feature as prop `feature` of type `GeoJSON.Feature`, and the focus state of the result as prop `focus` of type `boolean`. |
| addLoading | string? | Optional loading action name to start loading. |
| addLoading | string? | Expects the path to an action within the store. This action is committed with a loading key as the payload when starting reverse geocoding. |
| categoryProperties | Record<string, categoryProperties>? | An object defining properties for a category. The searchMethod's categoryId is used as identifier. A service without categoryId does not have a fallback category. |
| customSearchMethods | Record<string, customSearchMethod>? | An object with named search functions added to the existing set of configurable search methods. (See `addressSearch.searchMethodsObject.type`) This record's keys are added to that enum. |
| customSelectResult | Record<string, customSelectFunction>? | An object that maps categoryIds to functions. These functions are then called as vuex store actions instead of the `selectResult` default implementation. This allows overriding selection behaviour with full store access. Use `''` as key for categoryless results. |
| focusAfterSearch | boolean? | Whether the focus should switch to the first result after a successful search. Defaults to `false`. |
| groupProperties | Record<string, groupProperties>? | An object defining properties for a group. The searchMethod's groupId is used as identifier. All services without groupId fall back to the key `"defaultGroup"`. |
| minLength | number? | Minimal input length after which searches are started. Defaults to 0. |
| removeLoading | string? | Optional loading action name to end loading. |
| removeLoading | string? | Expects the path to an action within the store. This action is commited with a loading key as the payload when finishing reverse geocoding. |
| waitMs | number? | Debounce time in ms for search requests after last user input. Defaults to 0. |

For details on the `displayComponent` attribute, refer to the [Global Plugin Parameters](../../core/README.md#global-plugin-parameters) section of `@polar/core`.
Expand Down
1 change: 1 addition & 0 deletions packages/plugins/LoadingIndicator/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
## unpublished

- Refactor: Remove redundant prop-forwarding by only using one component.
- Chore: Clarify the description to `removeLoading` within the readme.

## 1.1.0

Expand Down
4 changes: 2 additions & 2 deletions packages/plugins/LoadingIndicator/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ map.$store.commit('plugin/loadingIndicator/removeLoadingKey', key)

![Loading indicator example](./readme_loadingIndicator_example.png)

The key must be unique and is kept track of via a Set. It can't be added multiple times, and removing it once always removes it altogether. It is advised to use a key like `{my-plugin-or-application-name}-{procedure-name}` to avoid name conflicts. The LoadingIndicator will usually be used for asynchronous code.
The key must be unique and is managed using a Set. This ensures that it can't be added multiple times, and removing it once will remove it completely. To avoid name conflicts, it is recommended to use a key format like `{my-plugin-or-application-name}-{procedure-name}`. The `LoadingIndicator` is typically used for asynchronous operations.

As such, **always call `removeLoadingKey` in the `finally` section of your code** to prevent hanging loading indicators.
Therefore, **always call `removeLoadingKey` in the `finally` block of your code** to prevent loading indicators from hanging.

### Getters

Expand Down
4 changes: 4 additions & 0 deletions packages/plugins/ReverseGeocoder/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## Unpublished

- Chore: Clarify the description to `addLoading` and `removeLoading` within the readme.

## 1.2.0

- Feature: Improved implementation to make plugin SPA-ready.
Expand Down
4 changes: 2 additions & 2 deletions packages/plugins/ReverseGeocoder/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ This module has been written for the HH WPS service. The return format is custom
| fieldName | type | description |
| - | - | - |
| url | string | URL of the WPS to use for reverse geocoding. |
| addLoading | string? | Points to an action in the store; commited with a loading key as payload on starting reverse geocoding. |
| addLoading | string? | Expects the path to an action within the store. This action is committed with a loading key as the payload when starting reverse geocoding. |
| addressTarget | string? | Points to a path in the store where an address can be put. If given, ReverseGeocoder will update on resolve. If not given, ReverseGeocoder's results can only be retrieved by awaiting its action. |
| coordinateSource | string? | Points to a path in the store where a coordinate may be. If given, ReverseGeocoder will resolve on any updates. If not given, ReverseGeocoder is passive and waits for its action to be called. Please mind that, when referencing another plugin, that plugin must be in `addPlugins` before this one. |
| removeLoading | string? | Points to an action in the store; commited with a loading key as payload on finishing reverse geocoding. |
| removeLoading | string? | Expects the path to an action within the store. This action is commited with a loading key as the payload when finishing reverse geocoding. |
| zoomTo | number? | If specified, plugin zooms to given coordinate after successful reverse geocoding; number indicates maximal zoom level. |


Expand Down

0 comments on commit 5ca4cd9

Please sign in to comment.