Skip to content

Commit 29dfafe

Browse files
committed
merge: hotfix-9.11.1 into master
2 parents 84f8c80 + 81a3611 commit 29dfafe

File tree

12 files changed

+39
-21
lines changed

12 files changed

+39
-21
lines changed

CHANGELOG.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,17 @@
22

33
## [Unreleased]
44

5+
## [9.11.1] – 2025-09-20
6+
7+
### Fixed
8+
9+
- Uncaught exception from aborted trend diagram request (when zooming) [#449](https://github.com/spraakbanken/korp-frontend/issues/449)
10+
- Protected corpora can be selected using "Select all" button or selecting folder [#483](https://github.com/spraakbanken/korp-frontend/issues/483)
11+
- Missing translation for compounds option in extended search [#460](https://github.com/spraakbanken/korp-frontend/issues/460)
12+
- Escape HTML in statistics table unless a stringifier function exists [#486](https://github.com/spraakbanken/korp-frontend/issues/486)
13+
- Auto scroll to match column broken for RTL [#481](https://github.com/spraakbanken/korp-frontend/issues/481)
14+
- Remove colon and number from lemma (baseform) values [#484](https://github.com/spraakbanken/korp-frontend/issues/484)
15+
516
## [9.11.0] – 2025-09-11
617

718
### Added
@@ -526,6 +537,7 @@
526537
- Lots of bug fixes for the sidebar
527538

528539
[unreleased]: https://github.com/spraakbanken/korp-frontend/compare/master...dev
540+
[9.11.1]: https://github.com/spraakbanken/korp-frontend/releases/tag/v9.11.1
529541
[9.11.0]: https://github.com/spraakbanken/korp-frontend/releases/tag/v9.11.0
530542
[9.10.1]: https://github.com/spraakbanken/korp-frontend/releases/tag/v9.10.1
531543
[9.10.0]: https://github.com/spraakbanken/korp-frontend/releases/tag/v9.10.0

app/markup/about.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<div class="modal-header">
2-
<h2>Korp version 9.11.0</h2>
2+
<h2>Korp version 9.11.1</h2>
33
<span ng-click="clickX()" class="close-x">×</span>
44
</div>
55

app/scripts/components/corpus-chooser/corpus-chooser.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -212,15 +212,15 @@ angular.module("korpApp").component("corpusChooser", {
212212

213213
/** Handle selection change from GUI. */
214214
function select(ids: string[]) {
215-
updateSelection(ids)
215+
const selected = updateSelection(ids)
216216
// Store new selection if it has actually changed
217-
if (!isEqual(ids, store.corpus)) {
218-
store.corpus = [...ids]
217+
if (!isEqual(selected, store.corpus)) {
218+
store.corpus = [...selected]
219219
}
220220
}
221221

222222
/** Update selected state, respecting authorization. */
223-
function updateSelection(ids: string[]): void {
223+
function updateSelection(ids: string[]): string[] {
224224
// This modifies corpus.selected
225225
const selection = filterCorporaOnCredentials(ids, auth.getCredentials())
226226

@@ -231,6 +231,8 @@ angular.module("korpApp").component("corpusChooser", {
231231
if (selection.length == 1) {
232232
$ctrl.firstCorpus = settings.corpora[selection[0]].title
233233
}
234+
235+
return selection
234236
}
235237

236238
$ctrl.onShowInfo = (node: ChooserFolderSub | CorpusTransformed) => {

app/scripts/components/kwic/kwic.ts

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -542,13 +542,7 @@ angular.module("korpApp").component("kwic", {
542542
}
543543

544544
function centerScrollbar() {
545-
const m = $element.find(".match:first")
546-
if (!m.length) return
547-
548-
const area = $element.find(".table_scrollarea").scrollLeft(0)
549-
const match = m.first().position().left + m.width()! / 2
550-
const sidebarWidth = $("#sidebar").outerWidth() || 0
551-
area.stop(true, true).scrollLeft(match - ($("body").innerWidth()! - sidebarWidth) / 2)
545+
$element.find(".match").get(0)?.scrollIntoView({ inline: "center" })
552546
}
553547

554548
/** Add offsets to align each linked sentence with its main one */

app/scripts/components/results-trend-diagram.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -264,6 +264,9 @@ angular.module("korpApp").component("resultsTrendDiagram", {
264264
}
265265

266266
async function makeRequest(from: Moment, to: Moment) {
267+
// Abort any running request
268+
if ($ctrl.loading) $ctrl.task.abort()
269+
267270
drawPreloader(from, to)
268271
$ctrl.setProgress(true, 0)
269272
$ctrl.error = undefined
@@ -284,8 +287,10 @@ angular.module("korpApp").component("resultsTrendDiagram", {
284287
}
285288
})
286289
} catch (error) {
290+
// AbortError is expected if a new search is made before the previous one is finished
291+
if (error.name == "AbortError") return
292+
console.error(error)
287293
$timeout(() => {
288-
console.error(error)
289294
$ctrl.error = error
290295
$ctrl.setProgress(false, 0)
291296
})

app/scripts/components/wordpicture/word-picture-table.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,11 @@ angular.module("korpApp").component("wordPictureTable", {
3333
<div class="lemgram_table">
3434
<div class="lemgram_help">
3535
<span ng-repeat="column in $ctrl.table.columnsBefore" ng-class="column.config.css_class">
36-
{{'rel_' + column.rel | loc:$root.lang}}
36+
{{(column.config.alt_label || 'rel_' + column.rel) | loc:$root.lang}}
3737
</span>
3838
<span><b>{{$ctrl.heading}}</b></span>
3939
<span ng-repeat="column in $ctrl.table.columnsAfter" ng-class="column.config.css_class">
40-
{{'rel_' + column.rel | loc:$root.lang}}
40+
{{(column.config.alt_label || 'rel_' + column.rel) | loc:$root.lang}}
4141
</span>
4242
</div>
4343
<word-picture-column

app/scripts/statistics/statistics-grid.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import { Dataset, isTotalRow, Row, SingleRow } from "./statistics.types"
88
import { StoreService } from "@/services/store"
99
import settings from "@/settings"
1010
import { locObj } from "@/i18n"
11-
import { escapeHtml } from "@/util"
1211
import { formatFrequency } from "@/i18n/util"
1312
import { LangString } from "@/i18n/types"
1413
import { zip } from "lodash"
@@ -112,7 +111,7 @@ function createColumns(store: StoreService, corpora: string[], attrs: string[]):
112111
sortable: true,
113112
formatter: (row, cell, value, columnDef, data: Row) => {
114113
if (isTotalRow(data)) return "Σ"
115-
const output = escapeHtml(data.formattedValue[reduceVal!]) || `<span class="opacity-50">&empty;</span>`
114+
const output = data.formattedValue[reduceVal!] || `<span class="opacity-50">&empty;</span>`
116115
return `<div class="link" data-row="${data.rowId}" ${dir}>${output}</div>`
117116
},
118117
minWidth,

app/scripts/statistics/statistics.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import { corpusListing, corpusSelection } from "@/corpora/corpus_listing"
99
import { CorpusSet } from "@/corpora/corpus-set"
1010
import { Lemgram } from "@/lemgram"
1111
import { Saldo } from "@/saldo"
12+
import { escape } from "lodash"
1213

1314
type Stringifier = (tokens: string[], ignoreCase?: boolean) => string
1415

@@ -132,14 +133,14 @@ function reduceStringify(name: string, cl?: CorpusSet): (values: string[]) => st
132133
// Use named stringifier from custom config code
133134
if (attr?.stats_stringify) return customFunctions[attr.stats_stringify]
134135

135-
const transforms: ((token: string) => string)[] = []
136+
const transforms: ((token: string) => string)[] = [escape]
136137

137138
if (attr?.ranked) transforms.push((token) => token.replace(/:.*/g, ""))
138139
if (attr?.translation) transforms.push((token) => locAttribute(attr.translation, token))
139140

140141
if (["prefix", "suffix", "lex"].includes(name)) transforms.push((token) => Lemgram.parse(token)?.toHtml() || token)
141142
else if (name == "saldo" || name == "sense") transforms.push((token) => Saldo.parse(token)?.toHtml() || token)
142-
else if (name == "lemma") transforms.push((lemma) => lemma.replace(/_/g, " "))
143+
else if (name == "lemma") transforms.push((lemma) => lemma.replace(/_/g, " ").replace(/:\d+$/g, ""))
143144

144145
// TODO This is specific to ASU corpus, move out to config
145146
if (name == "msd_orig") transforms.push((token) => ($("<span>").text(token) as any).outerHTML())

app/translations/locale-eng.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -422,6 +422,7 @@
422422
"not_compound_middle": "not medial part",
423423
"not_prefix": "do not start with",
424424
"not_suffix": "do not end with",
425+
"compound_middle": "medial part",
425426
"prefix": "starts with",
426427
"suffix": "ends with"
427428
}

app/translations/locale-swe.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -421,6 +421,7 @@
421421
"not_compound_middle": "inte mellanled",
422422
"not_prefix": "börjar inte med",
423423
"not_suffix": "slutar inte med",
424+
"compound_middle": "mellanled",
424425
"prefix": "börjar med",
425426
"suffix": "slutar med"
426427
}

0 commit comments

Comments
 (0)