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

New Release v1.47.0 - #minor #1064

Merged
merged 67 commits into from
Sep 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
67 commits
Select commit Hold shift + click to select a range
75c5dc7
PB-859: Use the same approach to compute polygon area.
ismailsunni Sep 2, 2024
d2f3e76
PB-869: Fix unit test and make sure the area is positive.
ismailsunni Sep 2, 2024
7192ce1
PB-869: Fix unit test.
ismailsunni Sep 2, 2024
fc99fbd
PB-869: Refactor function to compute area and perimeter using geograp…
ismailsunni Sep 4, 2024
49dd1b4
Merge pull request #1053 from geoadmin/pb-869-different-area-calculation
ismailsunni Sep 4, 2024
ac3191d
Keep i18n file key alphabetically sorted
pakb Sep 5, 2024
6082e5a
Merge pull request #1057 from geoadmin/feat-keep-i18n-file-sorted
pakb Sep 5, 2024
7fefb45
PB-843 : enable bi-directional reframe (LV03 <=> LV95)
pakb Aug 28, 2024
c4b339d
PB-843 : reframe LV03 coord at app startup
pakb Aug 28, 2024
0423a13
PB-843 : reframe LV03 coordinate in search bar
pakb Aug 28, 2024
5fd57f0
PB-843 : change coordinate extractor to not use backend service
pakb Sep 2, 2024
c2f1e7e
PB-843 : change reframe helper so that it can output any projection
pakb Sep 6, 2024
f3ef410
Merge pull request #1044 from geoadmin/fix-PB-843-lv03-reframe
pakb Sep 9, 2024
0c86cb0
PB-303: Add reading of icon size from api
LukasJoss Sep 5, 2024
b348c1b
PB-303: Replace hard-coded icon size with metadata of icon
LukasJoss Sep 6, 2024
9dc8e4c
PB-303: Remove cypress test necessary due to hard-coded icon size
LukasJoss Sep 6, 2024
46dd3bd
PB-303: Update kml test file for cypress
LukasJoss Sep 9, 2024
3804696
PB-303: Icon default size is no longer exported
LukasJoss Sep 10, 2024
d1cb44c
Merge pull request #1059 from geoadmin/feat-PB-303-use-icon-size-from…
LukasJoss Sep 10, 2024
0bfa3d9
PB-788 : stop using reserved "id" property for menu section identifier
pakb Aug 30, 2024
73266e0
PB-788 : add new "Help" section on mobile/tablet
pakb Aug 30, 2024
50b316c
PB-788 : add a little CSS trick to circumvent iOS Safari bug
pakb Aug 30, 2024
d19c2c5
Merge pull request #1028 from geoadmin/fix-PB-788-help-menu-section
pakb Sep 11, 2024
5ad5753
Merge pull request #1062 from geoadmin/master
ltshb Sep 11, 2024
b38677e
PB-818: Ensuring scales are respected on print
ltkum Jul 23, 2024
751224a
PB-818: adapt work done to previous changes in print
ltkum Aug 8, 2024
87e03ef
skipping print kml tests while we work on the print, as they use a fi…
ltkum Aug 12, 2024
f6efaf1
PB-818: readability update
ltkum Aug 30, 2024
0598481
PB-818: small change in resize config
ltkum Sep 3, 2024
57788d4
PB-818: PR-review corrections
ltkum Sep 5, 2024
bad40b0
PB-818: adding unit tests for adjust width
ltkum Sep 9, 2024
f4e125c
PB-818: adapt unit tests
ltkum Sep 9, 2024
7bd41b0
Merge pull request #1015 from geoadmin/bugfix-PB-818-font-and-image-s…
pakb Sep 11, 2024
df42862
PB-804 : don't center on search query when sharing position
ltkum Aug 5, 2024
de2ccfd
PB-804: linting and fix small issue
ltkum Aug 5, 2024
eb3a60c
PB-804: stopping search center when redoing an already done search
ltkum Aug 8, 2024
5b2024d
PB-804: allow crossHair parameter with only coordinates
ltkum Aug 8, 2024
be7d4a3
PB-804: dispatching changes to the store
ltkum Sep 2, 2024
f535999
PB-804: Harmonizing crossHair parameter syntax
ltkum Sep 9, 2024
34f4b1a
PB-804: adding a condition to stop e2e tests from being flaky
ltkum Sep 10, 2024
7a8714b
PB-804: avoid changing store value when unnecessary
ltkum Sep 10, 2024
47d3b11
PB-804: handling unexpected undefined in readValueFromQuery
ltkum Sep 10, 2024
9eda047
PB-804: creating an ErrorMessage class, so we can manage warnings and…
ltkum Sep 10, 2024
88c0f1a
PB-804: replacing references to 'WarningMessages' to 'ErrorMessages' …
ltkum Sep 10, 2024
b75e406
Merge pull request #1017 from geoadmin/bugfix-PB-804-dont-follow-sear…
pakb Sep 11, 2024
bb98630
PB-66: Update regex to match new icon set names
LukasJoss Sep 4, 2024
1587420
PB-66: Do not show legacy icon sets in drop down
LukasJoss Sep 4, 2024
1d038d9
PB-66: Add tippy to icon selection
LukasJoss Sep 5, 2024
2da1e60
PB-66: Read icon translation json from api and display it
LukasJoss Sep 5, 2024
c85b3da
PB-66: Add option to tippy tooltip helper to not translate content
LukasJoss Sep 5, 2024
34a3ec0
PB-66: Remove legacy icon set checks as it is now done on back-end
LukasJoss Sep 5, 2024
1ddbede
PB-66: Add cypress test checking for icon tippy
LukasJoss Sep 5, 2024
83d2969
PB-66: Add tippy to dropdown selection
LukasJoss Sep 10, 2024
0332bfa
PB-66: Adapt icon api to changed backend
LukasJoss Sep 10, 2024
a61139f
PB-66: Show all translations on hover
LukasJoss Sep 10, 2024
063409c
PB-66: Update translations on drop-down file
LukasJoss Sep 10, 2024
0c48aa9
PB-66: Show tooltip only when all icons toggle is activated
LukasJoss Sep 11, 2024
21a41be
PB-66: Update translations
LukasJoss Sep 11, 2024
30cc524
PB-66: Use language from back-end
LukasJoss Sep 11, 2024
a8895f4
PB-66: Use class instead of id for tippy in v-for
LukasJoss Sep 12, 2024
045cfe1
Merge pull request #1058 from geoadmin/feat-PB-66-add-new-babs-icons-…
LukasJoss Sep 12, 2024
9590fe8
PB-984: implement an error queue
ltkum Sep 12, 2024
f33fce9
Merge pull request #1065 from geoadmin/feat-PB-984-implement-error-queue
ltkum Sep 12, 2024
c888c1d
PB-970: Add support for simple KMZ file
ltshb Sep 12, 2024
1989a5c
PB-970: Fix KML with inline icons
ltshb Sep 12, 2024
cbe20af
PB-970: Added support for KMZ icons and fix inline KML icon
ltshb Sep 12, 2024
ea12bde
Merge pull request #1063 from geoadmin/feat-PB-970-kmz-support
ltshb Sep 12, 2024
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
75 changes: 73 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@
"geographiclib-geodesic": "^2.1.1",
"hammerjs": "^2.0.8",
"jquery": "^3.7.1",
"jszip": "^3.10.1",
"liang-barsky": "^1.0.5",
"lodash": "^4.17.21",
"maplibre-gl": "^4.6.0",
Expand Down
7 changes: 7 additions & 0 deletions scripts/generate-i18n-files.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,13 @@ sheets.spreadsheets.values.get(
})
}
})
// ordering all keys alphabetically
Object.keys(translations).forEach((lang) => {
const translationForLang = translations[lang]
translations[lang] = Object.keys(translationForLang)
.sort()
.reduce((acc, key) => ({ ...acc, [key]: translationForLang[key] }), {})
})
// we now export each lang as a separate JSON file in our i18n modules' folder
langByIndex.forEach((lang, index) => {
if (index > 0) {
Expand Down
16 changes: 11 additions & 5 deletions src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,12 @@ const i18n = useI18n()
const dispatcher = { dispatcher: 'App.vue' }

let debouncedOnResize

const errorText = computed(() => store.state.ui.errorText)
const error = computed(() => {
if (store.state.ui.errors.size > 0) {
return store.state.ui.errors.values().next().value
}
return null
})
const warning = computed(() => {
if (store.state.ui.warnings.size > 0) {
return store.state.ui.warnings.values().next().value
Expand Down Expand Up @@ -62,11 +66,13 @@ function refreshPageTitle() {
>
<router-view />
<ErrorWindow
v-if="errorText"
v-if="error"
title="error"
@close="store.dispatch('setErrorText', { errorText: null, ...dispatcher })"
@close="store.dispatch('removeError', { error, ...dispatcher })"
>
<div>{{ i18n.t(errorText) }}</div>
<div>
{{ i18n.t(error.msg, error.params) }}
</div>
</ErrorWindow>
<WarningWindow
v-if="warning"
Expand Down
19 changes: 19 additions & 0 deletions src/api/__tests__/print.api.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ import { expect } from 'chai'
import { describe, it } from 'vitest'

import { PrintLayout, PrintLayoutAttribute } from '@/api/print.api.js'
import { PRINT_DPI_COMPENSATION } from '@/config/print.config'
import { adjustWidth } from '@/utils/styleUtils'

describe('Print API unit tests', () => {
describe('PrintLayoutAttribute tests', () => {
Expand Down Expand Up @@ -61,5 +63,22 @@ describe('Print API unit tests', () => {
)
expect(scalesInMapAttr.scales).to.eql(scales)
})
it('calculate the width correctly with the "adjustWidth" function', () => {
// invalid values should return 0
expect(adjustWidth(100, 'invalid value')).to.eql(0)
expect(adjustWidth(100, null)).to.eql(0)
expect(adjustWidth(100, undefined)).to.eql(0)
expect(adjustWidth(null, 254)).to.eql(0)
expect(adjustWidth(undefined, 254)).to.eql(0)
expect(adjustWidth('invalid value', 254)).to.eql(0)
// the dpi parameter should be a positive number
expect(adjustWidth(100, 0)).to.eql(0)
expect(adjustWidth(100, -15)).to.eql(0)
// checking with a slight margin for float rounding errors.
expect(adjustWidth(100, 254)).to.be.closeTo(
(100 * PRINT_DPI_COMPENSATION) / 254,
1 / 254
)
})
})
})
2 changes: 1 addition & 1 deletion src/api/features/EditableFeature.class.js
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ export default class EditableFeature extends SelectableFeature {
crossOrigin: 'Anonymous',
anchor: this.icon.anchor,
scale: this.iconSizeScale,
size: DEFAULT_ICON_URL_PARAMS.size,
size: this.icon.size,
})
: null
}
Expand Down
18 changes: 11 additions & 7 deletions src/api/files.api.js
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ export function loadKmlMetadata(kmlLayer) {
* Loads the XML data from the file of a given KML layer, using the KML file URL of the layer.
*
* @param {KMLLayer} kmlLayer
* @returns {Promise<String>}
* @returns {Promise<ArrayBuffer>}
*/
export function loadKmlData(kmlLayer) {
return new Promise((resolve, reject) => {
Expand All @@ -313,7 +313,9 @@ export function loadKmlData(kmlLayer) {
new Error(`No file URL defined in this KML layer, cannot load data ${kmlLayer.id}`)
)
}
getFileFromUrl(kmlLayer.kmlFileUrl)
// The file might be a KMZ file, which is a zip archive. Reading zip archive as text
// is asking for trouble therefore we use ArrayBuffer
getFileFromUrl(kmlLayer.kmlFileUrl, { responseType: 'arraybuffer' })
.then((response) => {
if (response.status === 200 && response.data) {
resolve(response.data)
Expand All @@ -339,16 +341,18 @@ export function loadKmlData(kmlLayer) {
*
* @param {string} url URL to fetch
* @param {Number} [options.timeout] How long should the call wait before timing out
* @param {string} [options.responseType] Type of data that the server will respond with. Options
* are 'arraybuffer', 'document', 'json', 'text', 'stream'. Default is `json`
* @returns {Promise<AxiosResponse<any, any>>}
*/
export async function getFileFromUrl(url, options = {}) {
const { timeout = null } = options
const { timeout = null, responseType = null } = options
if (/^https?:\/\/localhost/.test(url) || isInternalUrl(url)) {
// don't go through proxy if it is on localhost or the internal server
return axios.get(url, { timeout })
return axios.get(url, { timeout, responseType })
} else if (url.startsWith('http://')) {
// HTTP request goes through the proxy
return axios.get(proxifyUrl(url), { timeout })
return axios.get(proxifyUrl(url), { timeout, responseType })
}

// For other urls we need to check if they support CORS
Expand All @@ -370,8 +374,8 @@ export async function getFileFromUrl(url, options = {}) {

if (supportCORS) {
// Server support CORS
return axios.get(url, { timeout })
return axios.get(url, { timeout, responseType })
}
// server don't support CORS use proxy
return axios.get(proxifyUrl(url), { timeout })
return axios.get(proxifyUrl(url), { timeout, responseType })
}
Loading
Loading