Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/add new mode for attributions #136

Merged
merged 14 commits into from
Aug 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions packages/plugins/Attributions/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

## unpublished

- Feature: Add new option `'footer'` to configuration parameter `renderType` that changes the attributions to be displayed as a small version of the information box that is always visible.
- Refactor: Replace redundant props with computed properties.

## 1.2.1
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
<template>
<v-scroll-x-reverse-transition>
<v-card dense filled :width="width" :color="color" :max-width="maxWidth">
<v-card-title>
<v-card
:class="renderType === 'footer' ? 'polar-plugin-attributions-footer' : ''"
dense
filled
:width="width"
:color="color"
:max-width="maxWidth"
>
<v-card-title v-if="renderType !== 'footer'">
{{ $t('common:plugins.attributions.title') }}
</v-card-title>
<!-- NOTE: The usage of v-html is considered unsafe as it
Expand Down Expand Up @@ -48,7 +55,9 @@ export default Vue.extend({
return this.renderType === 'independent'
},
color() {
return this.renderIndependently ? '#ffffffdd' : ''
return this.renderType === 'independent' || this.renderType === 'footer'
? '#ffffffdd'
: ''
},
maxWidth() {
return this.renderIndependently
Expand Down Expand Up @@ -76,4 +85,13 @@ export default Vue.extend({
})
</script>

<style scoped lang="scss"></style>
<style scoped lang="scss">
.polar-plugin-attributions-footer {
margin: 4px;
}
.polar-plugin-attributions-footer .v-card__text {
font-size: 0.8rem;
padding: 2px;
line-height: 1.1;
}
</style>
2 changes: 1 addition & 1 deletion packages/plugins/Attributions/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export interface AttributionsGetters extends AttributionsState {
listenToChanges: string[]
mapInfo: string[]
initiallyOpen: boolean
renderType: 'independent' | 'iconMenu'
renderType: 'independent' | 'iconMenu' | 'footer'
staticAttributions: string[]
windowWidth: number
}
1 change: 1 addition & 0 deletions packages/types/custom/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
- Feature: Add `afterResultComponent` to `AddressSearchConfiguration` for custom search result suffixes.
- Feature: Add `mapHasDimensions` to `CoreState` and `CoreGetters`.
- Feature: Add new getter `deviceIsHorizontal` to `CoreGetters`.
- Feature: Add `footer` to `RenderType` as an option to display attributions in a footer.
- Fix: Add `string` as option for `SearchType` since arbitrary strings can be registered.
- Fix: Remove unused parameters `proxyUrl` and `loadingStrategy` from `LayerConfigurationOptions`.
- Fix: Properly document optional parameters of interfaces `AddressSearchConfiguration`, `FeatureList`, `FilterConfigurationTime`, `FilterConfigurationTimeOption`, `GeoLocationConfiguration`, `LayerConfigurationOptionLayers` and `PinsConfiguration`
Expand Down
2 changes: 1 addition & 1 deletion packages/types/custom/core.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export interface PluginOptions {
layoutTag?: string // TODO: Might it be useful to move declaration of NineLayoutTag here?
}

export type RenderType = 'iconMenu' | 'independent'
export type RenderType = 'iconMenu' | 'independent' | 'footer'

/** Possible search methods by type */
export type SearchType = 'bkg' | 'gazetteer' | 'wfs' | 'mpapi' | string
Expand Down
Loading