Commit 0758240
# Backport
This will backport the following commits from `main` to `8.9`:
- [[controls] fix Dashboard getting stuck at loading in Kibana when
Controls is used and mapping changed from integer to keyword
(#163529)](#163529)
<!--- Backport version: 8.9.7 -->
### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)
<!--BACKPORT [{"author":{"name":"Nathan
Reese","email":"reese.nathan@elastic.co"},"sourceCommit":{"committedDate":"2023-08-11T19:58:19Z","message":"[controls]
fix Dashboard getting stuck at loading in Kibana when Controls is used
and mapping changed from integer to keyword (#163529)\n\nCloses
https://github.com/elastic/kibana/issues/162474\r\n\r\n### Changes\r\n*
RangeSliderEmbeddable - call setInitializationFinished
when\r\nrunRangeSliderQuery throws. This fixes the issue\r\n*
Investigated if OptionsListEmbeddable is vulnerable to the same
issue.\r\nIt's not because it uses its own REST API that has a service
wrapper\r\n`OptionsListService`. `OptionsListService` handles REST API
errors.\r\n* Add unit test verifying
OptionsListService.runOptionsListRequest does\r\nnot throw when there
are REST API errors and always returns a response.\r\n* Add unit tests
ensuring setInitializationFinished is called for
both\r\nRangeSliderEmbeddable and OptionsListEmbeddable in all
cases\r\n* Other clean up\r\n* Fix uses of `dataViewsService.get`.
`dataViewsService.get` throws when\r\ndata view is not found. It does
not return undefined. PR updates\r\nOptionsListEmbeddable,
RangeSliderEmbeddable, and mocked data service\r\n* Fix uses of
`dataView.getFieldByName`. `dataView.getFieldByName`\r\nreturns
undefined when field is not found and never throws. PR
updates\r\nOptionsListEmbeddable and RangeSliderEmbeddable\r\n * Remove
`resp` wrapper around mocked `fetch` results.\r\n\r\n### Test
instructions\r\n1) In console run \r\n ```\r\n PUT test1\r\n\r\n PUT
test1/_mapping\r\n {\r\n \"properties\": {\r\n \"value\": {\r\n
\"type\": \"integer\"\r\n }\r\n }\r\n }\r\n\r\n PUT test1/_doc/1\r\n
{\r\n \"value\" : 1\r\n }\r\n\r\n PUT test1/_doc/2\r\n {\r\n \"value\" :
10\r\n }\r\n ```\r\n2) create data view `test*`\r\n3) create dashboard
with range slider control on test*.value.\r\n4) select a range in the
range slider\r\n5) save dashboard\r\n6) run the following in console\r\n
```\r\n PUT test2\r\n\r\n PUT test2/_mapping\r\n {\r\n \"properties\":
{\r\n \"value\": {\r\n \"type\": \"keyword\"\r\n }\r\n }\r\n }\r\n\r\n
PUT test2/_doc/1\r\n {\r\n \"value\" : \"foo\"\r\n }\r\n\r\n DELETE
test1\r\n ```\r\n7) Open dashboard saved above. Verify dashboard opens
and control\r\ndisplays an error message about being unable to run
aggregation on\r\nkeyword field.\r\n\r\n---------\r\n\r\nCo-authored-by:
kibanamachine
<42973632+kibanamachine@users.noreply.github.com>\r\nCo-authored-by:
Devon Thomson
<devon.thomson@elastic.co>","sha":"0a74fa03a028e7002b5fdebdbfa7dc0c7283aa75","branchLabelMapping":{"^v8.10.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:fix","Feature:Input
Control","Team:Presentation","v8.10.0","v8.9.2"],"number":163529,"url":"https://github.com/elastic/kibana/pull/163529","mergeCommit":{"message":"[controls]
fix Dashboard getting stuck at loading in Kibana when Controls is used
and mapping changed from integer to keyword (#163529)\n\nCloses
https://github.com/elastic/kibana/issues/162474\r\n\r\n### Changes\r\n*
RangeSliderEmbeddable - call setInitializationFinished
when\r\nrunRangeSliderQuery throws. This fixes the issue\r\n*
Investigated if OptionsListEmbeddable is vulnerable to the same
issue.\r\nIt's not because it uses its own REST API that has a service
wrapper\r\n`OptionsListService`. `OptionsListService` handles REST API
errors.\r\n* Add unit test verifying
OptionsListService.runOptionsListRequest does\r\nnot throw when there
are REST API errors and always returns a response.\r\n* Add unit tests
ensuring setInitializationFinished is called for
both\r\nRangeSliderEmbeddable and OptionsListEmbeddable in all
cases\r\n* Other clean up\r\n* Fix uses of `dataViewsService.get`.
`dataViewsService.get` throws when\r\ndata view is not found. It does
not return undefined. PR updates\r\nOptionsListEmbeddable,
RangeSliderEmbeddable, and mocked data service\r\n* Fix uses of
`dataView.getFieldByName`. `dataView.getFieldByName`\r\nreturns
undefined when field is not found and never throws. PR
updates\r\nOptionsListEmbeddable and RangeSliderEmbeddable\r\n * Remove
`resp` wrapper around mocked `fetch` results.\r\n\r\n### Test
instructions\r\n1) In console run \r\n ```\r\n PUT test1\r\n\r\n PUT
test1/_mapping\r\n {\r\n \"properties\": {\r\n \"value\": {\r\n
\"type\": \"integer\"\r\n }\r\n }\r\n }\r\n\r\n PUT test1/_doc/1\r\n
{\r\n \"value\" : 1\r\n }\r\n\r\n PUT test1/_doc/2\r\n {\r\n \"value\" :
10\r\n }\r\n ```\r\n2) create data view `test*`\r\n3) create dashboard
with range slider control on test*.value.\r\n4) select a range in the
range slider\r\n5) save dashboard\r\n6) run the following in console\r\n
```\r\n PUT test2\r\n\r\n PUT test2/_mapping\r\n {\r\n \"properties\":
{\r\n \"value\": {\r\n \"type\": \"keyword\"\r\n }\r\n }\r\n }\r\n\r\n
PUT test2/_doc/1\r\n {\r\n \"value\" : \"foo\"\r\n }\r\n\r\n DELETE
test1\r\n ```\r\n7) Open dashboard saved above. Verify dashboard opens
and control\r\ndisplays an error message about being unable to run
aggregation on\r\nkeyword field.\r\n\r\n---------\r\n\r\nCo-authored-by:
kibanamachine
<42973632+kibanamachine@users.noreply.github.com>\r\nCo-authored-by:
Devon Thomson
<devon.thomson@elastic.co>","sha":"0a74fa03a028e7002b5fdebdbfa7dc0c7283aa75"}},"sourceBranch":"main","suggestedTargetBranches":["8.9"],"targetPullRequestStates":[{"branch":"main","label":"v8.10.0","labelRegex":"^v8.10.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/163529","number":163529,"mergeCommit":{"message":"[controls]
fix Dashboard getting stuck at loading in Kibana when Controls is used
and mapping changed from integer to keyword (#163529)\n\nCloses
https://github.com/elastic/kibana/issues/162474\r\n\r\n### Changes\r\n*
RangeSliderEmbeddable - call setInitializationFinished
when\r\nrunRangeSliderQuery throws. This fixes the issue\r\n*
Investigated if OptionsListEmbeddable is vulnerable to the same
issue.\r\nIt's not because it uses its own REST API that has a service
wrapper\r\n`OptionsListService`. `OptionsListService` handles REST API
errors.\r\n* Add unit test verifying
OptionsListService.runOptionsListRequest does\r\nnot throw when there
are REST API errors and always returns a response.\r\n* Add unit tests
ensuring setInitializationFinished is called for
both\r\nRangeSliderEmbeddable and OptionsListEmbeddable in all
cases\r\n* Other clean up\r\n* Fix uses of `dataViewsService.get`.
`dataViewsService.get` throws when\r\ndata view is not found. It does
not return undefined. PR updates\r\nOptionsListEmbeddable,
RangeSliderEmbeddable, and mocked data service\r\n* Fix uses of
`dataView.getFieldByName`. `dataView.getFieldByName`\r\nreturns
undefined when field is not found and never throws. PR
updates\r\nOptionsListEmbeddable and RangeSliderEmbeddable\r\n * Remove
`resp` wrapper around mocked `fetch` results.\r\n\r\n### Test
instructions\r\n1) In console run \r\n ```\r\n PUT test1\r\n\r\n PUT
test1/_mapping\r\n {\r\n \"properties\": {\r\n \"value\": {\r\n
\"type\": \"integer\"\r\n }\r\n }\r\n }\r\n\r\n PUT test1/_doc/1\r\n
{\r\n \"value\" : 1\r\n }\r\n\r\n PUT test1/_doc/2\r\n {\r\n \"value\" :
10\r\n }\r\n ```\r\n2) create data view `test*`\r\n3) create dashboard
with range slider control on test*.value.\r\n4) select a range in the
range slider\r\n5) save dashboard\r\n6) run the following in console\r\n
```\r\n PUT test2\r\n\r\n PUT test2/_mapping\r\n {\r\n \"properties\":
{\r\n \"value\": {\r\n \"type\": \"keyword\"\r\n }\r\n }\r\n }\r\n\r\n
PUT test2/_doc/1\r\n {\r\n \"value\" : \"foo\"\r\n }\r\n\r\n DELETE
test1\r\n ```\r\n7) Open dashboard saved above. Verify dashboard opens
and control\r\ndisplays an error message about being unable to run
aggregation on\r\nkeyword field.\r\n\r\n---------\r\n\r\nCo-authored-by:
kibanamachine
<42973632+kibanamachine@users.noreply.github.com>\r\nCo-authored-by:
Devon Thomson
<devon.thomson@elastic.co>","sha":"0a74fa03a028e7002b5fdebdbfa7dc0c7283aa75"}},{"branch":"8.9","label":"v8.9.2","labelRegex":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->
Co-authored-by: Nathan Reese <reese.nathan@elastic.co>
1 parent b177676 commit 0758240
12 files changed
Lines changed: 471 additions & 104 deletions
File tree
- src/plugins
- controls/public
- options_list/embeddable
- range_slider/embeddable
- services
- data_views
- data
- options_list
- presentation_util/public/__stories__/fixtures
- x-pack/plugins/translations/translations
Lines changed: 108 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
Lines changed: 12 additions & 23 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
245 | 245 | | |
246 | 246 | | |
247 | 247 | | |
248 | | - | |
249 | | - | |
250 | | - | |
251 | | - | |
252 | | - | |
253 | | - | |
254 | | - | |
255 | 248 | | |
256 | 249 | | |
257 | 250 | | |
| |||
260 | 253 | | |
261 | 254 | | |
262 | 255 | | |
263 | | - | |
264 | | - | |
265 | | - | |
266 | | - | |
267 | | - | |
268 | | - | |
269 | | - | |
270 | | - | |
271 | | - | |
272 | | - | |
273 | | - | |
274 | | - | |
275 | | - | |
276 | | - | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
277 | 267 | | |
278 | | - | |
279 | 268 | | |
280 | 269 | | |
281 | | - | |
| 270 | + | |
282 | 271 | | |
283 | 272 | | |
284 | 273 | | |
| |||
Lines changed: 211 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
0 commit comments