-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
[Dashboard Navigation] Fix reference extract method #171360
[Dashboard Navigation] Fix reference extract method #171360
Conversation
04e517a
to
10be425
Compare
…enawter/kibana into fix-by-val-to-by-ref-links_2023-11-15
💚 Build Succeeded
Metrics [docs]Async chunks
Page load bundle
History
To update your PR or re-run it, just comment with: cc @Heenawter |
Pinging @elastic/kibana-presentation (Team:Presentation) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This has been a really strange problem, but a shallow clone is a common / acceptable fix even if we can't find exactly what is causing the object to become non-extensible. LGTM!
expect(await dashboardLinks.getNumberOfLinksInPanel()).to.equal(4); | ||
}); | ||
|
||
it('can save by-value links panel to the library', async () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great to see a functional test to cover this.
💚 All backports created successfully
Note: Successful backport PRs will be merged automatically after passing CI. Questions ?Please refer to the Backport tool documentation |
Closes elastic#164212 Closes elastic#171328 ## Summary In `extractReferences`, the links in the `links` array attribute is [not extensible](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Errors/Cant_define_property_object_not_extensible) - this means that we cannot add or delete properties from each individual link directly. Instead, I've had to create a clone of each dashboard link via the spread operator so that we aren't modifying the original link directly. **How to Test** 1. Create a by-value Links panel 2. Refresh the dashboard 3. Save the Links panel to the library via the panel action 4. The panel should be saved successfully **and** the panel title should be updated. [**Flaky Test Runner**](https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/4024) ![image](https://github.com/elastic/kibana/assets/8698078/b8949d44-697d-414a-9e98-14b0a6f67b31) ### Checklist - [x] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios - [x] This was checked for [cross-browser compatibility](https://www.elastic.co/support/matrix#matrix_browsers) ### For maintainers - [ ] This was checked for breaking API changes and was [labeled appropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process) --------- Co-authored-by: kibanamachine <[email protected]> (cherry picked from commit 49b52fe)
…71360) (elastic#171561) # Backport This will backport the following commits from `main` to `8.11`: - [[Dashboard Navigation] Fix reference extract method (elastic#171360)](elastic#171360) <!--- Backport version: 8.9.7 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Hannah Mudge","email":"[email protected]"},"sourceCommit":{"committedDate":"2023-11-20T16:40:07Z","message":"[Dashboard Navigation] Fix reference extract method (elastic#171360)\n\nCloses https://github.com/elastic/kibana/issues/164212\r\nCloses https://github.com/elastic/kibana/issues/171328\r\n\r\n## Summary\r\n\r\nIn `extractReferences`, the links in the `links` array attribute is [not\r\nextensible](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Errors/Cant_define_property_object_not_extensible)\r\n- this means that we cannot add or delete properties from each\r\nindividual link directly. Instead, I've had to create a clone of each\r\ndashboard link via the spread operator so that we aren't modifying the\r\noriginal link directly.\r\n\r\n**How to Test**\r\n1. Create a by-value Links panel\r\n2. Refresh the dashboard\r\n3. Save the Links panel to the library via the panel action\r\n4. The panel should be saved successfully **and** the panel title should\r\nbe updated.\r\n\r\n[**Flaky Test\r\nRunner**](https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/4024)\r\n\r\n\r\n![image](https://github.com/elastic/kibana/assets/8698078/b8949d44-697d-414a-9e98-14b0a6f67b31)\r\n\r\n### Checklist\r\n\r\n- [x] [Unit or functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere updated or added to match the most common scenarios\r\n- [x] This was checked for [cross-browser\r\ncompatibility](https://www.elastic.co/support/matrix#matrix_browsers)\r\n\r\n### For maintainers\r\n\r\n- [ ] This was checked for breaking API changes and was [labeled\r\nappropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\r\n\r\n---------\r\n\r\nCo-authored-by: kibanamachine <[email protected]>","sha":"49b52fe76e480c24673c8e1573346fb279ea965f","branchLabelMapping":{"^v8.12.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["Feature:Dashboard","release_note:fix","Team:Presentation","loe:small","impact:high","backport:prev-minor","Project:Dashboard Navigation","v8.12.0"],"number":171360,"url":"https://github.com/elastic/kibana/pull/171360","mergeCommit":{"message":"[Dashboard Navigation] Fix reference extract method (elastic#171360)\n\nCloses https://github.com/elastic/kibana/issues/164212\r\nCloses https://github.com/elastic/kibana/issues/171328\r\n\r\n## Summary\r\n\r\nIn `extractReferences`, the links in the `links` array attribute is [not\r\nextensible](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Errors/Cant_define_property_object_not_extensible)\r\n- this means that we cannot add or delete properties from each\r\nindividual link directly. Instead, I've had to create a clone of each\r\ndashboard link via the spread operator so that we aren't modifying the\r\noriginal link directly.\r\n\r\n**How to Test**\r\n1. Create a by-value Links panel\r\n2. Refresh the dashboard\r\n3. Save the Links panel to the library via the panel action\r\n4. The panel should be saved successfully **and** the panel title should\r\nbe updated.\r\n\r\n[**Flaky Test\r\nRunner**](https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/4024)\r\n\r\n\r\n![image](https://github.com/elastic/kibana/assets/8698078/b8949d44-697d-414a-9e98-14b0a6f67b31)\r\n\r\n### Checklist\r\n\r\n- [x] [Unit or functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere updated or added to match the most common scenarios\r\n- [x] This was checked for [cross-browser\r\ncompatibility](https://www.elastic.co/support/matrix#matrix_browsers)\r\n\r\n### For maintainers\r\n\r\n- [ ] This was checked for breaking API changes and was [labeled\r\nappropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\r\n\r\n---------\r\n\r\nCo-authored-by: kibanamachine <[email protected]>","sha":"49b52fe76e480c24673c8e1573346fb279ea965f"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v8.12.0","labelRegex":"^v8.12.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/171360","number":171360,"mergeCommit":{"message":"[Dashboard Navigation] Fix reference extract method (elastic#171360)\n\nCloses https://github.com/elastic/kibana/issues/164212\r\nCloses https://github.com/elastic/kibana/issues/171328\r\n\r\n## Summary\r\n\r\nIn `extractReferences`, the links in the `links` array attribute is [not\r\nextensible](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Errors/Cant_define_property_object_not_extensible)\r\n- this means that we cannot add or delete properties from each\r\nindividual link directly. Instead, I've had to create a clone of each\r\ndashboard link via the spread operator so that we aren't modifying the\r\noriginal link directly.\r\n\r\n**How to Test**\r\n1. Create a by-value Links panel\r\n2. Refresh the dashboard\r\n3. Save the Links panel to the library via the panel action\r\n4. The panel should be saved successfully **and** the panel title should\r\nbe updated.\r\n\r\n[**Flaky Test\r\nRunner**](https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/4024)\r\n\r\n\r\n![image](https://github.com/elastic/kibana/assets/8698078/b8949d44-697d-414a-9e98-14b0a6f67b31)\r\n\r\n### Checklist\r\n\r\n- [x] [Unit or functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere updated or added to match the most common scenarios\r\n- [x] This was checked for [cross-browser\r\ncompatibility](https://www.elastic.co/support/matrix#matrix_browsers)\r\n\r\n### For maintainers\r\n\r\n- [ ] This was checked for breaking API changes and was [labeled\r\nappropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\r\n\r\n---------\r\n\r\nCo-authored-by: kibanamachine <[email protected]>","sha":"49b52fe76e480c24673c8e1573346fb279ea965f"}}]}] BACKPORT--> Co-authored-by: Hannah Mudge <[email protected]>
Closes #164212
Closes #171328
Summary
In
extractReferences
, the links in thelinks
array attribute is not extensible - this means that we cannot add or delete properties from each individual link directly. Instead, I've had to create a clone of each dashboard link via the spread operator so that we aren't modifying the original link directly.How to Test
Flaky Test Runner
Checklist
For maintainers