Skip to content

Commit

Permalink
Merge branch 'main' of https://github.com/Dataport/polar into fix/plu…
Browse files Browse the repository at this point in the history
…gin-filter-inconsistencies
  • Loading branch information
warm-coolguy committed Jun 27, 2024
2 parents 2c9df77 + 98f96ac commit 6e8cd15
Show file tree
Hide file tree
Showing 62 changed files with 389 additions and 476 deletions.
8 changes: 3 additions & 5 deletions packages/clients/dish/src/plugins/Gfi/ActionButton.vue
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,12 @@

<script lang="ts">
import Vue from 'vue'
import { mapGetters } from 'vuex'
export default Vue.extend({
name: 'DishActionButton',
props: {
exportProperty: {
type: String,
default: '',
},
computed: {
...mapGetters('plugin/gfi', ['exportProperty']),
},
})
</script>
Expand Down
23 changes: 4 additions & 19 deletions packages/clients/dish/src/plugins/Gfi/Content.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<template>
<v-card class="dish-gfi-content">
<v-card-actions v-if="!hasWindowSize || !hasSmallWidth">
<ActionButton :export-property="exportProperty"></ActionButton>
<ActionButton></ActionButton>
<v-spacer></v-spacer>
<v-btn
icon
Expand Down Expand Up @@ -91,8 +91,7 @@
</template>

<script lang="ts">
import Vue, { PropType } from 'vue'
import { GeoJsonProperties } from 'geojson'
import Vue from 'vue'
import { mapActions, mapMutations, mapGetters } from 'vuex'
import ActionButton from './ActionButton.vue'
Expand All @@ -101,20 +100,6 @@ type GfiIndexStep = -1 | 1
export default Vue.extend({
name: 'DishGfiContent',
components: { ActionButton },
props: {
currentProperties: {
type: Object as PropType<GeoJsonProperties>,
required: true,
},
clientWidth: {
type: Number,
required: true,
},
exportProperty: {
type: String,
default: '',
},
},
data: () => ({
infoFields: [
'Kreis',
Expand All @@ -127,8 +112,9 @@ export default Vue.extend({
sachgesamtheitOpen: false,
}),
computed: {
...mapGetters(['hasSmallWidth', 'hasWindowSize']),
...mapGetters(['clientWidth', 'hasSmallWidth', 'hasWindowSize']),
...mapGetters('plugin/gfi', [
'currentProperties',
'imageLoaded',
'visibleWindowFeatureIndex',
'windowFeatures',
Expand Down Expand Up @@ -173,7 +159,6 @@ export default Vue.extend({
if (this.hasWindowSize && this.hasSmallWidth) {
this.setMoveHandleActionButton({
component: ActionButton,
props: { exportProperty: this.exportProperty },
})
}
},
Expand Down
4 changes: 2 additions & 2 deletions packages/clients/meldemichel/src/mapConfigurations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import {
PinsConfiguration,
ReverseGeocoderConfiguration,
} from '@polar/lib-custom-types'
import { MpApiParameters } from '@polar/plugin-address-search/src/types'
import { MODE, SKAT, REPORT_STATUS } from './enums'
import language from './language'
import { MeldemichelCreateMapParams } from './types'
Expand Down Expand Up @@ -88,12 +89,11 @@ const commonAttributions: Partial<AttributionsConfiguration> = {
const addressSearch: AddressSearchConfiguration = {
searchMethods: [
{
// @ts-expect-error | missing field "epsg" filled later in process
queryParameters: {
searchAddress: true,
searchStreets: true,
searchHouseNumbers: true,
},
} as MpApiParameters,
type: 'mpapi',
url: 'https://geodienste.hamburg.de/HH_WFS_GAGES?service=WFS&request=GetFeature&version=2.0.0',
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,11 @@ export default Vue.extend({
name: 'MeldemichelGfiFeatureActionButtons',
computed: {
...mapGetters('plugin/gfi', [
'showSwitchButtons',
'visibleWindowFeatureIndex',
'windowFeatures',
]),
...mapGetters(['hasSmallWidth', 'hasWindowSize']),
/** only show switch buttons if multiple property sets are available */
showSwitchButtons(): boolean {
return this.windowFeatures.length > 1
},
showSmall(): boolean {
return !this.hasWindowSize || !this.hasSmallWidth
},
Expand Down
15 changes: 1 addition & 14 deletions packages/clients/meldemichel/src/plugins/Gfi/Feature.vue
Original file line number Diff line number Diff line change
Expand Up @@ -49,30 +49,20 @@
<script lang="ts">
import Vue from 'vue'
import { mapActions, mapGetters, mapMutations } from 'vuex'
import { GeoJsonProperties } from 'geojson'
import ActionButtons from './ActionButtons.vue'
export default Vue.extend({
name: 'MeldemichelGfiFeature',
components: {
ActionButtons,
},
props: {
clientWidth: {
type: Number,
required: true,
},
exportProperty: {
type: String,
default: '',
},
},
data: () => ({
infoFields: ['skat', 'start', 'statu'],
}),
computed: {
...mapGetters(['hasSmallWidth', 'hasWindowSize']),
...mapGetters('plugin/gfi', [
'currentProperties',
'imageLoaded',
'visibleWindowFeatureIndex',
'windowFeatures',
Expand All @@ -81,9 +71,6 @@ export default Vue.extend({
displayImage(): boolean {
return this.currentProperties.pic
},
currentProperties(): GeoJsonProperties {
return { ...this.windowFeatures[this.visibleWindowFeatureIndex] }
},
},
watch: {
currentProperties(newProps: object) {
Expand Down
1 change: 0 additions & 1 deletion packages/clients/snowbox/src/addPlugins.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,6 @@ export const addPlugins = (core) => {
),
Legend({
displayComponent: true,
maxWidth: 500,
layoutTag: NineLayoutTag.BOTTOM_RIGHT,
}),
Scale(
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

- Feature: Use newly added store parameter `deviceIsHorizontal` in place of computed value `isHorizontal`.

## 2.1.1

- 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.
Expand Down
7 changes: 2 additions & 5 deletions packages/components/MoveHandle.vue
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,7 @@ export default Vue.extend({
timeoutReference: 0,
}),
computed: {
...mapGetters(['hasSmallHeight', 'hasWindowSize']),
isHorizontal() {
return this.hasSmallHeight && this.hasWindowSize
},
...mapGetters(['deviceIsHorizontal', 'hasSmallHeight', 'hasWindowSize']),
moveEventNames(): MoveEventNames {
return this.touchDevice
? { move: 'touchmove', end: 'touchend' }
Expand All @@ -86,7 +83,7 @@ export default Vue.extend({
},
watch: {
// Fixes an issue if the orientation of a mobile device is changed while a plugin is open
isHorizontal(newVal: boolean) {
deviceIsHorizontal(newVal: boolean) {
if (!newVal) {
this.updateMaxHeight()
}
Expand Down
2 changes: 2 additions & 0 deletions packages/core/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
## unpublished

- Feature: Add new state parameter `mapHasDimensions` to let plugins have a "hook" to react on when the map is ready.
- Feature: Add `deviceIsHorizontal` as a getter to have a more central place to check if the device is in landscape mode.
- Fix: Adjust documentation to properly describe optionality of configuration parameters.

## 1.4.1

Expand Down
10 changes: 5 additions & 5 deletions packages/core/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,11 @@ The mapConfiguration allows controlling many client instance details.
| fieldName | type | description |
| --------------------------- | ---------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| layerConf | LayerConf | Layer configuration as required by masterportalAPI. |
| language | enum["de", "en"] | Initial language. Live changes not yet implemented, waiting for requirement. |
| language | enum["de", "en"] | Initial language. |
| <...masterportalAPI.fields> | various | The object is also used to initialize the masterportalAPI. Please refer to their documentation for options. |
| <plugin.fields> | various | Many plugins added with `addPlugin` may respect additional configuration. Please see the respective plugin documentations. Global plugin parameters are described below. |
| locales | LanguageOption[] | All locales in POLAR's plugins can be overridden to fit your needs.|
| vuetify | object | You may add vuetify configuration here. |
| <plugin.fields> | various? | Many plugins added with `addPlugin` may respect additional configuration. Please see the respective plugin documentations. Global plugin parameters are described below. |
| locales | LanguageOption[]? | All locales in POLAR's plugins can be overridden to fit your needs.|
| vuetify | object? | You may add vuetify configuration here. |
| extendedMasterportalapiMarkers | extendedMasterportalapiMarkers? | Optional. If set, all configured visible vector layers' features can be hovered and selected by mouseover and click respectively. They are available as features in the store. Layers with `clusterDistance` will be clustered to a multi-marker that supports the same features. Please mind that this only works properly if you configure nothing but point marker vector layers styled by the masterportalAPI. |
| stylePath | string? | If no link tag with `data-polar="true"` is found in the document, this path will be used to create the link node in the client itself. It defaults to `'./style.css'`. Please mind that `data-polar="true"` is deprecated since it potentially led to flashes of misstyled content. stylePath will replace that solution in the next major release. |
| renderFaToLightDom | boolean? | POLAR requires FontAwesome in the Light/Root DOM due to an [unfixed bug in many browsers](https://bugs.chromium.org/p/chromium/issues/detail?id=336876). This value defaults to `true`. POLAR will, by default, just add the required CSS by itself. Should you have a version of Fontawesome already included, you can try to set this to `false` to check whether the versions are interoperable. |
Expand Down Expand Up @@ -213,7 +213,7 @@ Most plugins honor this additional field.

| fieldName | type | description |
| ---------------- | ------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| displayComponent | boolean | Optional field that allows hiding UI elements from the user. The store will still be initialized, allowing you to add your own UI elements and control the plugin's functionality via the Store. This may or may not make sense, depending on the plugin. |
| displayComponent | boolean? | Optional field that allows hiding UI elements from the user. The store will still be initialized, allowing you to add your own UI elements and control the plugin's functionality via the Store. This may or may not make sense, depending on the plugin. Defaults to `false` , meaning the default UI is hidden. |

##### mapConfiguration.vuetify

Expand Down
2 changes: 2 additions & 0 deletions packages/core/src/vuePlugins/vuex.ts
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,8 @@ export const makeStore = () => {
window.innerWidth === state.clientWidth
)
},
deviceIsHorizontal: (_, getters) =>
getters.hasSmallHeight && getters.hasWindowSize,
},
mutations: {
...generateSimpleMutations(getInitialState()),
Expand Down
1 change: 1 addition & 0 deletions packages/lib/getFeatures/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
## unpublished

- Breaking: `getWfsFeatures` now throws errors if required parameters on the wfs configuration are missing instead of only printing error messages on the console.
- Fix: Properly extend interface `WfsParameters` from `QueryParameters` to reflect actual usage.

## 1.0.1

Expand Down
3 changes: 3 additions & 0 deletions packages/lib/getFeatures/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,8 @@
},
"peerDependencies": {
"ol": "^7.1.0"
},
"devDependencies": {
"@polar/lib-custom-types": "^1.0.0"
}
}
17 changes: 8 additions & 9 deletions packages/lib/getFeatures/types.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { Feature as GeoJsonFeature } from 'geojson'
import { QueryParameters } from '@polar/lib-custom-types'

/** Optional options related to a GetFeature request */
export interface AdditionalSearchOptions {
Expand Down Expand Up @@ -41,25 +42,23 @@ export interface SearchParameters {
}

/** Parameters for wfs searches */
export interface WfsParameters {
export interface WfsParameters extends QueryParameters {
/** Feature prefix from xmlns namespace without :; e.g. 'ave' */
featurePrefix: string
/** Name of the type of features (see ?service=wfs&request=DescribeFeatureType) */
typeName: string
/** Namespace of feature type */
xmlns: string
/** Name of the type's field to search in; mutually exclusive to patterns */
fieldName?: string
/** Input destructor patterns, e.g. \{\{streetName\}\} \{\{houseNumber\}\}; mutually exclusive to fieldName */
patterns?: string[]
/** RegExp to define pattern, e.g. \{houseNumber: '([1-9][0-9]*[a-z]?)', ...\}; only if patterns present */
patternKeys?: Record<string, string>
/** Feature prefix from xmlns namespace without :; e.g. 'ave' */
featurePrefix: string
/** Namespace of feature type */
xmlns: string
/** Limits requested features */
maxFeatures?: number
/** By default, if searching for "search", it is sent as "search*"; can be deactivated */
useRightHandWildcard?: boolean
/** srsName for wfs query */
srsName?: string
/** By default, if searching for "search", it is sent as "search*"; can be deactivated */
useRightHandWildcard?: boolean
}

/**
Expand Down
1 change: 1 addition & 0 deletions packages/plugins/AddressSearch/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
## unpublished

- Feature: Add title internationalization; i.e. features may now contain locale keys as titles.
- Fix: Adjust documentation and types to properly describe optionality of configuration parameters.

## 1.2.1

Expand Down
Loading

0 comments on commit 6e8cd15

Please sign in to comment.