Skip to content

Commit 72c7a31

Browse files
committed
merge: hotfix-9.11.2 into master
2 parents 29dfafe + 831b12c commit 72c7a31

File tree

10 files changed

+57
-82
lines changed

10 files changed

+57
-82
lines changed

CHANGELOG.md

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

33
## [Unreleased]
44

5+
## [9.11.2] – 2025-09-24
6+
7+
### Fixed
8+
9+
- Scroll KWIC container, not whole window, to match column
10+
- Glitchy buttons for trend, map and JSON
11+
- Hide sidebar when closing examples tab
12+
513
## [9.11.1] – 2025-09-20
614

715
### Fixed
@@ -537,6 +545,7 @@
537545
- Lots of bug fixes for the sidebar
538546

539547
[unreleased]: https://github.com/spraakbanken/korp-frontend/compare/master...dev
548+
[9.11.2]: https://github.com/spraakbanken/korp-frontend/releases/tag/v9.11.2
540549
[9.11.1]: https://github.com/spraakbanken/korp-frontend/releases/tag/v9.11.1
541550
[9.11.0]: https://github.com/spraakbanken/korp-frontend/releases/tag/v9.11.0
542551
[9.10.1]: https://github.com/spraakbanken/korp-frontend/releases/tag/v9.10.1

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.1</h2>
2+
<h2>Korp version 9.11.2</h2>
33
<span ng-click="clickX()" class="close-x">×</span>
44
</div>
55

app/scripts/components/kwic/kwic.ts

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import { KwicWordScope } from "./kwic-word"
1010
import { SelectWordEvent } from "@/statemachine/types"
1111
import { ApiKwic, Token } from "@/backend/types"
1212
import { StoreService } from "@/services/store"
13-
import { QueryParamSort } from "@/backend/types/query"
13+
import { QueryParamSort, QueryResponse } from "@/backend/types/query"
1414
import { CorpusTransformed } from "@/settings/config-transformed.types"
1515
import { JQueryExtended, JQueryStaticExtended } from "@/jquery.types"
1616
import { loc } from "@/i18n"
@@ -30,6 +30,7 @@ type KwicController = IController & {
3030
pageEvent: (page: number) => void
3131
hitsPerPage: number
3232
params: any
33+
response?: QueryResponse
3334
corpusOrder: string[]
3435
/** Current page of results. */
3536
kwicInput: ApiKwic[]
@@ -218,14 +219,16 @@ angular.module("korpApp").component("kwic", {
218219
</p>
219220
</div>
220221
</div>
222+
221223
<kwic-pager
222224
ng-if="$ctrl.hits"
223225
total-hits="$ctrl.hits"
224226
current-page="$ctrl.page"
225227
page-change="$ctrl.pageEvent(page)"
226228
hits-per-page="$ctrl.hitsPerPage"
227229
></kwic-pager>
228-
<div ng-if="!$ctrl.loading">
230+
231+
<div ng-if="!$ctrl.loading" class="flex gap-4 justify-end">
229232
<select id="download-links" ng-if="$ctrl._settings['enable_backend_kwic_download']"></select>
230233
<select
231234
id="frontendDownloadLinks"
@@ -242,6 +245,7 @@ angular.module("korpApp").component("kwic", {
242245
target="_self"
243246
style="display: none;"
244247
></a>
248+
<json-button ng-if="$ctrl.response" endpoint="query" data="$ctrl.response"></json-button>
245249
</div>
246250
</div>
247251
`,
@@ -260,6 +264,7 @@ angular.module("korpApp").component("kwic", {
260264
corpusOrder: "<",
261265
kwicInput: "<",
262266
corpusHits: "<",
267+
response: "<",
263268
showSearchOptions: "<",
264269
onUpdateSearch: "&",
265270
},
@@ -342,6 +347,10 @@ angular.module("korpApp").component("kwic", {
342347
if ("context" in changeObj) $scope.context = !!$ctrl.context
343348
}
344349

350+
$ctrl.$onDestroy = () => {
351+
statemachine.send("DESELECT_WORD")
352+
}
353+
345354
$ctrl.onKwicClick = (event) => {
346355
if (!event.target) return
347356
const target = event.target as HTMLElement
@@ -541,8 +550,11 @@ angular.module("korpApp").component("kwic", {
541550
$ctrl.parallelSelected = []
542551
}
543552

553+
/** Scroll KWIC container to center the match column. */
544554
function centerScrollbar() {
545-
$element.find(".match").get(0)?.scrollIntoView({ inline: "center" })
555+
// Type assertion needed because `container` is non-standard.
556+
const options = { inline: "center", container: "nearest" } as ScrollIntoViewOptions
557+
$element.find(".match").get(0)?.scrollIntoView(options)
546558
}
547559

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

app/scripts/components/kwic/results-hits.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,10 @@ angular.module("korpApp").component("resultsHits", {
5656
hits-per-page="hitsPerPage"
5757
params="proxy.params"
5858
corpus-order="corpusOrder"
59+
response="proxy.response"
5960
show-search-options="true"
6061
on-update-search="onUpdateSearch()"
6162
></kwic>
62-
<json-button endpoint="query" data="proxy.response"></json-button>
6363
</div>
6464
`,
6565
bindings: {

app/scripts/components/statistics/results-statistics.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import settings from "@/settings"
33
import statsProxyFactory, { StatsProxy } from "@/backend/proxy/stats-proxy"
44
import { Dataset, SearchParams } from "@/statistics/statistics.types"
55
import { html } from "@/util"
6-
import "@/components/util/json_button"
76
import "@/components/util/korp-error"
87
import "./statistics"
98
import { processStatisticsResult } from "@/statistics/statistics"
@@ -43,12 +42,12 @@ angular.module("korpApp").component("resultsStatistics", {
4342
loading="$ctrl.loading"
4443
on-update-search="onUpdateSearch()"
4544
params="proxy.params"
45+
response="proxy.response"
4646
row-count="rowCount"
4747
search-params="searchParams"
4848
warning="warning"
4949
></statistics>
5050
<korp-error ng-if="error" message="{{error}}"></korp-error>
51-
<json-button ng-if="data && !loading && !warning" endpoint="count" data="proxy.response"></json-button>
5251
`,
5352
bindings: {
5453
isActive: "<",
@@ -98,7 +97,6 @@ angular.module("korpApp").component("resultsStatistics", {
9897

9998
s.resetView = () => {
10099
$("myGrid").empty()
101-
$("#exportStatsSection").show()
102100
$("#exportButton").attr({
103101
download: null,
104102
href: null,

app/scripts/components/statistics/statistics.ts

Lines changed: 21 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,11 @@ import { locObj } from "@/i18n"
66
import { expandCqp } from "@/cqp_parser/cqp"
77
import "./corpus-distribution-chart"
88
import "./reduce-select"
9+
import "@/components/util/json_button"
910
import { RootScope } from "@/root-scope.types"
1011
import { JQueryExtended } from "@/jquery.types"
1112
import { AbsRelSeq, Dataset, isTotalRow, Row, SearchParams } from "@/statistics/statistics.types"
12-
import { CountParams } from "@/backend/types/count"
13+
import { CountParams, CountResponse } from "@/backend/types/count"
1314
import { corpusListing, corpusSelection } from "@/corpora/corpus_listing"
1415
import { AttributeOption } from "@/corpora/corpus-set"
1516
import { getTimeData } from "@/backend/timedata"
@@ -36,6 +37,7 @@ type StatisticsController = IController & {
3637
error: boolean
3738
loading: boolean
3839
params: CountParams
40+
response: CountResponse
3941
rowCount: number
4042
searchParams: SearchParams
4143
warning?: string
@@ -84,37 +86,16 @@ angular.module("korpApp").component("statistics", {
8486
</div>
8587
8688
<div ng-show="!$ctrl.warning && !$ctrl.aborted">
87-
<div class="stats_header">
89+
<div class="flex my-2 gap-4">
8890
<button
89-
class="btn btn-sm btn-default show-graph-btn"
91+
class="btn btn-sm btn-default"
9092
ng-click="$ctrl.onGraphClick()"
9193
ng-disabled="$ctrl.loading || !$ctrl.graphEnabled"
9294
uib-tooltip="{{'material_warn' | loc:$root.lang}}"
9395
tooltip-placement="right"
9496
tooltip-enable="!$ctrl.graphEnabled"
9597
>
96-
<span class="graph_btn_icon">
97-
<svg
98-
height="24"
99-
version="1.1"
100-
width="33"
101-
xmlns="http://www.w3.org/2000/svg"
102-
style="overflow: hidden; position: relative"
103-
>
104-
<desc style="-webkit-tap-highlight-color: rgba(0, 0, 0, 0)">
105-
Created with Raphaël 2.1.0
106-
</desc>
107-
<defs style="-webkit-tap-highlight-color: rgba(0, 0, 0, 0)"></defs>
108-
<path
109-
fill="#666666"
110-
stroke="none"
111-
d="M3.625,25.062C3.086,24.947000000000003,2.74,24.416,2.855,23.875L2.855,23.875L6.51,6.584L8.777,15.843L10.7,10.655000000000001L14.280999999999999,14.396L18.163999999999998,1.293000000000001L21.098,13.027000000000001L23.058,11.518L28.329,23.258000000000003C28.555,23.762000000000004,28.329,24.353,27.824,24.579000000000004L27.824,24.579000000000004C27.319000000000003,24.806000000000004,26.728,24.579000000000004,26.502000000000002,24.075000000000003L26.502000000000002,24.075000000000003L22.272000000000002,14.647000000000002L19.898000000000003,16.473000000000003L18.002000000000002,8.877000000000002L15.219000000000003,18.270000000000003L11.465000000000003,14.346000000000004L8.386,22.66L6.654999999999999,15.577L4.811999999999999,24.288C4.710999999999999,24.76,4.297,25.082,3.8329999999999993,25.082L3.8329999999999993,25.082C3.765,25.083,3.695,25.076,3.625,25.062L3.625,25.062Z"
112-
transform="matrix(0.6,0,0,0.6,6.2499,5.275)"
113-
stroke-width="1.6666666666666667"
114-
style="-webkit-tap-highlight-color: rgba(0, 0, 0, 0)"
115-
></path>
116-
</svg>
117-
</span>
98+
<i class="fa-solid fa-chart-line mr-1"></i>
11899
{{'show_diagram' | loc:$root.lang}}
119100
</button>
120101
<div
@@ -131,7 +112,9 @@ angular.module("korpApp").component("statistics", {
131112
tooltip-placement="right"
132113
tooltip-enable="!$ctrl.mapAttributes.length"
133114
>
134-
{{'show_map' | loc:$root.lang}}<span class="caret"></span>
115+
<i class="fa-regular fa-map mr-1"></i>
116+
{{'show_map' | loc:$root.lang}}
117+
<span class="caret"></span>
135118
</button>
136119
<div uib-dropdown-menu>
137120
<h3 class="map-settings-title">{{'select_attribute' | loc:$root.lang}}</h3>
@@ -173,7 +156,6 @@ angular.module("korpApp").component("statistics", {
173156
{{'no_row_selected_map' | loc:$root.lang}}
174157
</span>
175158
</div>
176-
<div id="showBarPlot"></div>
177159
</div>
178160
<div ng-if="!$ctrl.loading" style="margin-bottom: 5px">
179161
{{'total_rows' | loc:$root.lang}} {{$ctrl.data.length - 1 | prettyNumber:$root.lang}}
@@ -186,15 +168,17 @@ angular.module("korpApp").component("statistics", {
186168
</span>
187169
</div>
188170
<div id="myGrid"></div>
189-
<div id="exportStatsSection">
190-
<br /><br />
191-
<select id="kindOfFormat">
192-
<option value="csv">{{ 'statstable_exp_csv' | loc:$root.lang }}</option>
193-
<option value="tsv">{{ 'statstable_exp_tsv' | loc:$root.lang }}</option>
194-
</select>
195-
<a id="generateExportButton" ng-click="$ctrl.generateExport()">
196-
<button class="btn btn-sm btn-default">{{'statstable_gen_export' | loc:$root.lang}}</button>
197-
</a>
171+
<div ng-show="$ctrl.data && !$ctrl.loading && !$ctrl.warning" class="mt-4 flex gap-4 justify-end">
172+
<div class="flex">
173+
<select id="kindOfFormat">
174+
<option value="csv">{{ 'statstable_exp_csv' | loc:$root.lang }}</option>
175+
<option value="tsv">{{ 'statstable_exp_tsv' | loc:$root.lang }}</option>
176+
</select>
177+
<a id="generateExportButton" ng-click="$ctrl.generateExport()">
178+
<button class="btn btn-sm btn-default">{{'statstable_gen_export' | loc:$root.lang}}</button>
179+
</a>
180+
</div>
181+
<json-button endpoint="count" data="$ctrl.response"></json-button>
198182
</div>
199183
</div>
200184
</div>
@@ -206,6 +190,7 @@ angular.module("korpApp").component("statistics", {
206190
loading: "<",
207191
onUpdateSearch: "&",
208192
params: "<",
193+
response: "<",
209194
rowCount: "<",
210195
searchParams: "<",
211196
warning: "<",

app/scripts/components/util/json_button.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ type JsonButtonScope = IScope & {
1212

1313
angular.module("korpApp").component("jsonButton", {
1414
template: html`
15-
<button ng-click="openJson()" class="btn btn-default btn-sm float-right mx-2">
15+
<button ng-click="openJson()" class="btn btn-default btn-sm">
1616
<i class="fa-solid fa-download mr-1"></i>
1717
JSON
1818
</button>

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

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,13 @@ angular.module("korpApp").component("resultsWordPicture", {
7474
<p>{{'word_pic_result_description' | loc:$root.lang}}</p>
7575
</help-box>
7676
77-
<json-button ng-if="!warning && !error" endpoint="relations" data="proxy.response"></json-button>
77+
<div class="mt-4 flex gap-4 justify-end">
78+
<json-button
79+
ng-if="!$ctrl.loading && data && !warning && !error"
80+
endpoint="relations"
81+
data="proxy.response"
82+
></json-button>
83+
</div>
7884
`,
7985
bindings: {
8086
isActive: "<",

app/styles/styles.scss

Lines changed: 0 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -682,14 +682,6 @@ table {
682682
background-color: #ffddd8;
683683
}
684684

685-
#download-links {
686-
float: right;
687-
}
688-
689-
#frontendDownloadLinks {
690-
float: right;
691-
}
692-
693685
.download_link {
694686
img {
695687
border: 0px;
@@ -1204,10 +1196,6 @@ slider {
12041196
}
12051197
}
12061198

1207-
#showBarPlot {
1208-
display: none;
1209-
}
1210-
12111199
.korp-warning {
12121200
max-width: 500px;
12131201
@extend .bs-callout;
@@ -1307,14 +1295,6 @@ slider {
13071295
margin-left: 4px;
13081296
}
13091297

1310-
.graph_btn_icon {
1311-
svg {
1312-
margin-top: -6px;
1313-
margin-bottom: -6px;
1314-
margin-left: -8px;
1315-
}
1316-
}
1317-
13181298
.chart_container {
13191299
position: relative;
13201300
.preloader {
@@ -1346,14 +1326,6 @@ slider {
13461326
min-height: 430px;
13471327
}
13481328

1349-
.stats_header {
1350-
margin-bottom: 1em;
1351-
> * {
1352-
display: inline-block;
1353-
vertical-align: top;
1354-
}
1355-
}
1356-
13571329
.rickshaw_graph {
13581330
.empty_area {
13591331
background-color: #999;
@@ -1450,9 +1422,6 @@ line.tick {
14501422
#myGrid * {
14511423
box-sizing: content-box;
14521424
}
1453-
.loading .exportStatsSection {
1454-
display: none;
1455-
}
14561425

14571426
#myGrid .parameter-column {
14581427
background-color: #f1f7ff;
@@ -1804,10 +1773,6 @@ line.tick {
18041773
}
18051774

18061775
.map-settings-container {
1807-
margin-left: 20px;
1808-
.caret {
1809-
margin-left: 10px;
1810-
}
18111776
ul {
18121777
margin: 0;
18131778
padding: 2px;

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "korp-frontend",
3-
"version": "9.11.1",
3+
"version": "9.11.2",
44
"dependencies": {
55
"@fontsource/source-sans-pro": "^5.1.0",
66
"@fortawesome/fontawesome-free": "6.2.1",

0 commit comments

Comments
 (0)