Skip to content

[backport] PR #8721 to 5.x#8722

Merged
Bargs merged 1 commit into5.xfrom
jasper/backport/8721/5.x
Oct 17, 2016
Merged

[backport] PR #8721 to 5.x#8722
Bargs merged 1 commit into5.xfrom
jasper/backport/8721/5.x

Conversation

@elastic-jasper
Copy link
Contributor

Backport PR #8721

Commit 1:
Stop Discover's Visualize button from loading incorrect URL

When App state is read from the url, it is accessed via
$location.search(). It turns out that the result of
$location.search() is a mutable object that allows you to modify the
results of $location.search() without actually modifying the URL. When
a user clicks a field in the Discover sidebar, it executes the scope
method vizLocation to get the href value for the "Visualize" button.
As an unintended side effect, vizLocation was modifying the object
returned from $location.search(). This change would ultimately be read
when the Visualize app loaded instead of the param in the actual URL
since there's no full page load from Discover -> Visualize.

To make things more complicated, I believe there was a race condition
partially masking this issue. Since vizLocation is used in an Angular
string template, the data binding causes it to execute on every digest
cycle. This is why the incorrect value continued to be written to
$location.search() even after visLocation ran for the correct field.
It also meant that the result of $location.search() was totally
dependent on which field vizLocation ran for most recently before the
user clicked Visualize.

Fixes #8718

---------

**Commit 1:**
Stop Discover's Visualize button from loading incorrect URL

When App state is read from the url, it is accessed via
`$location.search()`. It turns out that the result of
`$location.search()` is a mutable object that allows you to modify the
results of `$location.search()` without actually modifying the URL. When
a user clicks a field in the Discover sidebar, it executes the scope
method `vizLocation` to get the href value for the "Visualize" button.
As an unintended side effect, `vizLocation` was modifying the object
returned from `$location.search()`. This change would ultimately be read
when the Visualize app loaded instead of the param in the actual URL
since there's no full page load from Discover -> Visualize.

To make things more complicated, I believe there was a race condition
partially masking this issue. Since `vizLocation` is used in an Angular
string template, the data binding causes it to execute on every digest
cycle. This is why the incorrect value continued to be written to
`$location.search()` even after `visLocation` ran for the correct field.
It also meant that the result of `$location.search()` was totally
dependent on which field `vizLocation` ran for most recently before the
user clicked Visualize.

Fixes #8718

* Original sha: d0d926b
* Authored by Matthew Bargar <mbargar@gmail.com> on 2016-10-17T21:07:11Z
@elastic-jasper elastic-jasper added the backport This PR is a backport of another PR label Oct 17, 2016
@Bargs Bargs merged commit 39a4f3b into 5.x Oct 17, 2016
@Bargs Bargs deleted the jasper/backport/8721/5.x branch October 17, 2016 22:58
airow pushed a commit to airow/kibana that referenced this pull request Feb 16, 2017
weronikaolejniczak added a commit that referenced this pull request Jun 3, 2025
`@elastic/eslint-plugin-eui`: `0.2.0` ⏩ `1.0.0`

[Questions? Please see our Kibana upgrade
FAQ.](https://github.com/elastic/eui/blob/main/wiki/eui-team-processes/upgrading-kibana.md#faq-for-kibana-teams)

## Changes

This PR updates the `@elastic/eslint-plugin-eui` version to latest:
[v1.0.0](https://www.npmjs.com/package/@elastic/eslint-plugin-eui/v/1.0.0).

## Package updates

### `@elastic/eslint-plugin-eui`

- Changed the `prefer-css-prop-for-static-styles` rule message (formerly
`prefer-css-attribute-for-eui-components`)
([#8722](elastic/eui#8722))

**Breaking changes**

- Renamed the rule from `prefer-css-attribute-for-eui-components` to
`prefer-css-prop-for-static-styles` to align with Emotion's best
practice guidelines ([#8722](elastic/eui#8722))

**Dependency updates**

- Updated `typescript` to v5.8.3
([#8669](elastic/eui#8669))
- Updated `@typescript-eslint/eslint-plugin` to v8.31.1
([#8669](elastic/eui#8669))
- Updated `@typescript-eslint/parser` to v8.31.1
([#8669](elastic/eui#8669))
- Updated `@typescript-eslint/rule-tester` to v8.31.1
([#8669](elastic/eui#8669))
- Updated `@typescript-eslint/typescript-estree` to v8.31.1
([#8669](elastic/eui#8669))
- Updated `@typescript-eslint/utils` to v8.31.1
([#8669](elastic/eui#8669))
zacharyparikh pushed a commit to zacharyparikh/kibana that referenced this pull request Jun 4, 2025
`@elastic/eslint-plugin-eui`: `0.2.0` ⏩ `1.0.0`

[Questions? Please see our Kibana upgrade
FAQ.](https://github.com/elastic/eui/blob/main/wiki/eui-team-processes/upgrading-kibana.md#faq-for-kibana-teams)

## Changes

This PR updates the `@elastic/eslint-plugin-eui` version to latest:
[v1.0.0](https://www.npmjs.com/package/@elastic/eslint-plugin-eui/v/1.0.0).

## Package updates

### `@elastic/eslint-plugin-eui`

- Changed the `prefer-css-prop-for-static-styles` rule message (formerly
`prefer-css-attribute-for-eui-components`)
([elastic#8722](elastic/eui#8722))

**Breaking changes**

- Renamed the rule from `prefer-css-attribute-for-eui-components` to
`prefer-css-prop-for-static-styles` to align with Emotion's best
practice guidelines ([elastic#8722](elastic/eui#8722))

**Dependency updates**

- Updated `typescript` to v5.8.3
([elastic#8669](elastic/eui#8669))
- Updated `@typescript-eslint/eslint-plugin` to v8.31.1
([elastic#8669](elastic/eui#8669))
- Updated `@typescript-eslint/parser` to v8.31.1
([elastic#8669](elastic/eui#8669))
- Updated `@typescript-eslint/rule-tester` to v8.31.1
([elastic#8669](elastic/eui#8669))
- Updated `@typescript-eslint/typescript-estree` to v8.31.1
([elastic#8669](elastic/eui#8669))
- Updated `@typescript-eslint/utils` to v8.31.1
([elastic#8669](elastic/eui#8669))
nickpeihl pushed a commit to nickpeihl/kibana that referenced this pull request Jun 12, 2025
`@elastic/eslint-plugin-eui`: `0.2.0` ⏩ `1.0.0`

[Questions? Please see our Kibana upgrade
FAQ.](https://github.com/elastic/eui/blob/main/wiki/eui-team-processes/upgrading-kibana.md#faq-for-kibana-teams)

## Changes

This PR updates the `@elastic/eslint-plugin-eui` version to latest:
[v1.0.0](https://www.npmjs.com/package/@elastic/eslint-plugin-eui/v/1.0.0).

## Package updates

### `@elastic/eslint-plugin-eui`

- Changed the `prefer-css-prop-for-static-styles` rule message (formerly
`prefer-css-attribute-for-eui-components`)
([elastic#8722](elastic/eui#8722))

**Breaking changes**

- Renamed the rule from `prefer-css-attribute-for-eui-components` to
`prefer-css-prop-for-static-styles` to align with Emotion's best
practice guidelines ([elastic#8722](elastic/eui#8722))

**Dependency updates**

- Updated `typescript` to v5.8.3
([elastic#8669](elastic/eui#8669))
- Updated `@typescript-eslint/eslint-plugin` to v8.31.1
([elastic#8669](elastic/eui#8669))
- Updated `@typescript-eslint/parser` to v8.31.1
([elastic#8669](elastic/eui#8669))
- Updated `@typescript-eslint/rule-tester` to v8.31.1
([elastic#8669](elastic/eui#8669))
- Updated `@typescript-eslint/typescript-estree` to v8.31.1
([elastic#8669](elastic/eui#8669))
- Updated `@typescript-eslint/utils` to v8.31.1
([elastic#8669](elastic/eui#8669))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport This PR is a backport of another PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants