From eb2420e3775d6653a0ae3fe11adb877027c74944 Mon Sep 17 00:00:00 2001 From: Arild Matsson Date: Mon, 20 Jan 2025 10:58:39 +0100 Subject: [PATCH 1/3] fix: simple search param url watch --- app/scripts/components/simple-search.ts | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/app/scripts/components/simple-search.ts b/app/scripts/components/simple-search.ts index 3cf430dc..add49320 100644 --- a/app/scripts/components/simple-search.ts +++ b/app/scripts/components/simple-search.ts @@ -306,17 +306,15 @@ angular.module("korpApp").component("simpleSearch", { } }) - // Reach to changes in URL params - $scope.$watch( - () => $location.search(), - (search) => { - ctrl.freeOrder = search.in_order != null - ctrl.prefix = search.prefix != null - ctrl.mid_comp = search.mid_comp != null - ctrl.suffix = search.suffix != null - ctrl.isCaseInsensitive = search.isCaseInsensitive != null - } - ) + // React to changes in URL params + $scope.$on("$locationChangeSuccess", () => { + const search = $location.search() + ctrl.freeOrder = search.in_order != null + ctrl.prefix = search.prefix != null + ctrl.mid_comp = search.mid_comp != null + ctrl.suffix = search.suffix != null + ctrl.isCaseInsensitive = search.isCaseInsensitive != null + }) ctrl.onChange = (value, isPlain) => { ctrl.currentText = isPlain ? value : undefined From f24dc2b10f25151bf3aafc65d8a24590656159cd Mon Sep 17 00:00:00 2001 From: Arild Matsson Date: Wed, 22 Jan 2025 13:34:21 +0100 Subject: [PATCH 2/3] fix: if condition typo Fixes #425 --- CHANGELOG.md | 5 +++++ app/scripts/controllers/statistics_controller.ts | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8f20cc7a..6c252df8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,11 @@ ## [Unreleased] +### Fixed + +- Assignment typo in if condition causes error when aborting statistics request [#425](https://github.com/spraakbanken/korp-frontend/issues/425) +- Simple search options were not properly synced from URL params + ## [9.8.0] - 2025-01-20 ### Added diff --git a/app/scripts/controllers/statistics_controller.ts b/app/scripts/controllers/statistics_controller.ts index 9aa3aeda..a36232be 100644 --- a/app/scripts/controllers/statistics_controller.ts +++ b/app/scripts/controllers/statistics_controller.ts @@ -124,7 +124,7 @@ angular.module("korpApp").directive("statsResultCtrl", () => ({ ) .catch((error) => { // AbortError is expected if a new search is made before the previous one is finished - if ((error.name = "AbortError")) return + if (error.name == "AbortError") return console.error(error) // TODO Show error $timeout(() => { From 3a0a69bc438244c9a4d6781d294c7f95eaf091f3 Mon Sep 17 00:00:00 2001 From: Arild Matsson Date: Thu, 23 Jan 2025 12:51:02 +0100 Subject: [PATCH 3/3] chore: bump to 9.8.1 --- CHANGELOG.md | 3 +++ app/markup/about.html | 2 +- package.json | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6c252df8..bfbcb332 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ ## [Unreleased] +## [9.8.1] - 2025-01-23 + ### Fixed - Assignment typo in if condition causes error when aborting statistics request [#425](https://github.com/spraakbanken/korp-frontend/issues/425) @@ -341,6 +343,7 @@ - Lots of bug fixes for the sidebar [unreleased]: https://github.com/spraakbanken/korp-frontend/compare/master...dev +[9.8.1]: https://github.com/spraakbanken/korp-frontend/releases/tag/v9.8.1 [9.8.0]: https://github.com/spraakbanken/korp-frontend/releases/tag/v9.8.0 [9.7.2]: https://github.com/spraakbanken/korp-frontend/releases/tag/v9.7.2 [9.7.1]: https://github.com/spraakbanken/korp-frontend/releases/tag/v9.7.1 diff --git a/app/markup/about.html b/app/markup/about.html index 8b527b25..568eaa42 100644 --- a/app/markup/about.html +++ b/app/markup/about.html @@ -1,5 +1,5 @@ diff --git a/package.json b/package.json index 374322ab..198f684a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "korp-frontend", - "version": "9.8.0", + "version": "9.8.1", "dependencies": { "@fontsource/source-sans-pro": "^5.1.0", "@fortawesome/fontawesome-free": "6.2.1",