Skip to content
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

shifting makeId to htmlIdGenerator #3129

Merged
merged 15 commits into from
Apr 3, 2020
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@
- Added `Enter` key press functionality to `EuiSuperDatePicker` ([#3048](https://github.com/elastic/eui/pull/3048))
- Added `title` to headers of `EuiTable` in case of truncation ([#3094](https://github.com/elastic/eui/pull/3094))
- Added i18n to `EuiTableHeaderCell` ([#3094](https://github.com/elastic/eui/pull/3094))
- Updated makeId to DEPRECATED, shifted all the calls to htmlIdGenerator
- Added `number` and `string` to `size` type of `EuiImage` for setting custom sizes ([#3012](https://github.com/elastic/eui/pull/3012))
- Improved `EuiButtonEmpty` focus state when the `color` type is `text` ([#3135](https://github.com/elastic/eui/pull/3135))
- Added `EuiLoadingElastic` component ([#3017](https://github.com/elastic/eui/pull/3017))
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@
"classnames": "^2.2.5",
"highlight.js": "^9.12.0",
"html": "^1.0.0",
"install": "^0.13.0",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this required?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess it is some form of merge conflict.
Wait i'll remove it as it is not required by changes I've made

"keymirror": "^0.1.1",
"lodash": "^4.17.11",
"numeral": "^2.0.6",
Expand Down
8 changes: 4 additions & 4 deletions src-docs/src/views/button/button_group.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,16 @@ import {
EuiTitle,
} from '../../../../src/components';

import makeId from '../../../../src/components/form/form_row/make_id';
import { htmlIdGenerator } from '../../../../src/services';
import { EuiPanel } from '../../../../src/components/panel/panel';

export default class extends Component {
constructor(props) {
super(props);

const idPrefix = makeId();
const idPrefix2 = makeId();
const idPrefix3 = makeId();
const idPrefix = htmlIdGenerator()();
const idPrefix2 = htmlIdGenerator()();
const idPrefix3 = htmlIdGenerator()();

this.toggleButtons = [
{
Expand Down
8 changes: 4 additions & 4 deletions src-docs/src/views/form_compressed/complex_example.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,14 @@ import {
EuiSuperSelect,
EuiToolTip,
} from '../../../../src/components';
import makeId from '../../../../src/components/form/form_row/make_id';
import { htmlIdGenerator } from '../../../../src/services';

export default class extends Component {
constructor(props) {
super(props);
const idPrefix = makeId;
const idPrefix2 = makeId;
const idPrefix3 = makeId;
const idPrefix = htmlIdGenerator();
const idPrefix2 = htmlIdGenerator();
const idPrefix3 = htmlIdGenerator();

this.toggleButtons = [
{
Expand Down
4 changes: 2 additions & 2 deletions src-docs/src/views/form_compressed/form_compressed.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@ import {
EuiSpacer,
} from '../../../../src/components';

import makeId from '../../../../src/components/form/form_row/make_id';
import { htmlIdGenerator } from '../../../../src/services';

export default class extends Component {
constructor(props) {
super(props);

const idPrefix = makeId();
const idPrefix = htmlIdGenerator()();

this.state = {
isSwitchChecked: false,
Expand Down
10 changes: 5 additions & 5 deletions src-docs/src/views/form_controls/checkbox.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React, { Component, Fragment } from 'react';

import { EuiCheckbox, EuiSpacer } from '../../../../src/components';

import makeId from '../../../../src/components/form/form_row/make_id';
import { htmlIdGenerator } from '../../../../src/services';

export default class extends Component {
constructor(props) {
Expand Down Expand Up @@ -30,7 +30,7 @@ export default class extends Component {
return (
<Fragment>
<EuiCheckbox
id={makeId()}
id={htmlIdGenerator()()}
label="I am a checkbox"
checked={this.state.checked}
onChange={this.onChange}
Expand All @@ -39,7 +39,7 @@ export default class extends Component {
<EuiSpacer size="m" />

<EuiCheckbox
id={makeId()}
id={htmlIdGenerator()()}
label="I am an indeterminate checkbox"
indeterminate={this.state.indeterminate}
onChange={this.onChangeIndeterminate}
Expand All @@ -48,7 +48,7 @@ export default class extends Component {
<EuiSpacer size="m" />

<EuiCheckbox
id={makeId()}
id={htmlIdGenerator()()}
label="I am a disabled checkbox"
checked={this.state.checked}
onChange={this.onChange}
Expand All @@ -58,7 +58,7 @@ export default class extends Component {
<EuiSpacer size="m" />

<EuiCheckbox
id={makeId()}
id={htmlIdGenerator()()}
label="I am a compressed checkbox"
checked={this.state.checked}
onChange={this.onChange}
Expand Down
4 changes: 2 additions & 2 deletions src-docs/src/views/form_controls/checkbox_group.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ import React, { Component } from 'react';
import { EuiCheckboxGroup } from '../../../../src/components';
import { DisplayToggles } from './display_toggles';

import makeId from '../../../../src/components/form/form_row/make_id';
import { htmlIdGenerator } from '../../../../src/services';

export default class extends Component {
constructor(props) {
super(props);

const idPrefix = makeId();
const idPrefix = htmlIdGenerator()();

this.checkboxes = [
{
Expand Down
8 changes: 4 additions & 4 deletions src-docs/src/views/form_controls/radio.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React, { Component, Fragment } from 'react';

import { EuiRadio, EuiSpacer } from '../../../../src/components';

import makeId from '../../../../src/components/form/form_row/make_id';
import { htmlIdGenerator } from '../../../../src/services';

export default class extends Component {
constructor(props) {
Expand All @@ -23,7 +23,7 @@ export default class extends Component {
return (
<Fragment>
<EuiRadio
id={makeId()}
id={htmlIdGenerator()()}
label="I am a radio"
checked={this.state.checked}
onChange={this.onChange}
Expand All @@ -32,7 +32,7 @@ export default class extends Component {
<EuiSpacer size="m" />

<EuiRadio
id={makeId()}
id={htmlIdGenerator()()}
label="I am a disabled radio"
checked={this.state.checked}
onChange={this.onChange}
Expand All @@ -42,7 +42,7 @@ export default class extends Component {
<EuiSpacer size="m" />

<EuiRadio
id={makeId()}
id={htmlIdGenerator()()}
label="I am a compressed radio"
checked={this.state.checked}
onChange={this.onChange}
Expand Down
4 changes: 2 additions & 2 deletions src-docs/src/views/form_controls/radio_group.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@ import React, { Component } from 'react';

import { EuiRadioGroup } from '../../../../src/components';

import makeId from '../../../../src/components/form/form_row/make_id';
import { htmlIdGenerator } from '../../../../src/services';
import { DisplayToggles } from './display_toggles';

export default class extends Component {
constructor(props) {
super(props);

const idPrefix = makeId();
const idPrefix = htmlIdGenerator()();

this.radios = [
{
Expand Down
4 changes: 2 additions & 2 deletions src-docs/src/views/form_layouts/described_form_group.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@ import {
EuiLink,
} from '../../../../src/components';

import makeId from '../../../../src/components/form/form_row/make_id';
import { htmlIdGenerator } from '../../../../src/services';

export default class extends Component {
constructor(props) {
super(props);

const idPrefix = makeId();
const idPrefix = htmlIdGenerator()();

this.state = {
isSwitchChecked: false,
Expand Down
4 changes: 2 additions & 2 deletions src-docs/src/views/form_layouts/form_rows.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@ import {
EuiText,
} from '../../../../src/components';

import makeId from '../../../../src/components/form/form_row/make_id';
import { htmlIdGenerator } from '../../../../src/services/accessibility';

export default class extends Component {
constructor(props) {
super(props);

const idPrefix = makeId();
const idPrefix = htmlIdGenerator()();

this.state = {
isSwitchChecked: false,
Expand Down
4 changes: 2 additions & 2 deletions src-docs/src/views/form_layouts/inline_popover.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import {
EuiSwitch,
} from '../../../../src/components';

import makeId from '../../../../src/components/form/form_row/make_id';
import { htmlIdGenerator } from '../../../../src/services';

export default class extends Component {
constructor(props) {
Expand Down Expand Up @@ -111,7 +111,7 @@ export default class extends Component {
<EuiForm>
<EuiFormRow>
<EuiSwitch
id={makeId()}
id={htmlIdGenerator()()}
name="popswitch"
label="Isn't this popover form cool?"
checked={this.state.isSwitch2Checked}
Expand Down
6 changes: 3 additions & 3 deletions src-docs/src/views/guidelines/writing.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import {
EuiTab,
} from '../../../../src/components';

import makeId from '../../../../src/components/form/form_row/make_id';
import { htmlIdGenerator } from '../../../../src/services';

const GuideRuleWriting = ({ children, className, ...rest }) => {
const classes = classNames(className);
Expand Down Expand Up @@ -615,7 +615,7 @@ export default () => (
<EuiFormRow>
<EuiCheckbox
onChange={() => {}}
id={makeId()}
id={htmlIdGenerator()()}
label="Combine values in other bucket"
/>
</EuiFormRow>
Expand All @@ -627,7 +627,7 @@ export default () => (
<EuiFormRow>
<EuiCheckbox
onChange={() => {}}
id={makeId()}
id={htmlIdGenerator()()}
label="Combine other"
/>
</EuiFormRow>
Expand Down
4 changes: 2 additions & 2 deletions src-docs/src/views/modal/modal.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import {

import SuperSelectComplexExample from '../super_select/super_select_complex';

import makeId from '../../../../src/components/form/form_row/make_id';
import { htmlIdGenerator } from '../../../../src/services';

export class Modal extends Component {
constructor(props) {
Expand Down Expand Up @@ -54,7 +54,7 @@ export class Modal extends Component {
<EuiForm>
<EuiFormRow>
<EuiSwitch
id={makeId()}
id={htmlIdGenerator()()}
name="popswitch"
label="Isn't this modal form cool?"
checked={this.state.isSwitchChecked}
Expand Down
4 changes: 2 additions & 2 deletions src-docs/src/views/range/dual_range.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React, { Component } from 'react';

import { EuiDualRange } from '../../../../src/components';

import makeId from '../../../../src/components/form/form_row/make_id';
import { htmlIdGenerator } from '../../../../src/services';

export default class extends Component {
constructor(props) {
Expand All @@ -22,7 +22,7 @@ export default class extends Component {
render() {
return (
<EuiDualRange
id={makeId()}
id={htmlIdGenerator()()}
min={-100}
max={200}
step={10}
Expand Down
6 changes: 3 additions & 3 deletions src-docs/src/views/range/input.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React, { Component, Fragment } from 'react';

import { EuiRange, EuiSpacer, EuiDualRange } from '../../../../src/components';

import makeId from '../../../../src/components/form/form_row/make_id';
import { htmlIdGenerator } from '../../../../src/services';

export default class extends Component {
constructor(props) {
Expand Down Expand Up @@ -30,7 +30,7 @@ export default class extends Component {
return (
<Fragment>
<EuiRange
id={makeId()}
id={htmlIdGenerator()()}
value={this.state.value}
onChange={this.onChange}
showInput
Expand All @@ -40,7 +40,7 @@ export default class extends Component {
<EuiSpacer size="xl" />

<EuiDualRange
id={makeId()}
id={htmlIdGenerator()()}
value={this.state.dualValue}
onChange={this.onDualChange}
showInput
Expand Down
6 changes: 3 additions & 3 deletions src-docs/src/views/range/input_only.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { EuiRange, EuiSpacer, EuiDualRange } from '../../../../src/components';

import { DisplayToggles } from '../form_controls/display_toggles';

import makeId from '../../../../src/components/form/form_row/make_id';
import { htmlIdGenerator } from '../../../../src/services';

export default class extends Component {
constructor(props) {
Expand Down Expand Up @@ -46,7 +46,7 @@ export default class extends Component {
<Fragment>
<DisplayToggles canAppend canPrepend>
<EuiRange
id={makeId()}
id={htmlIdGenerator()()}
value={this.state.value}
onChange={this.onChange}
showInput="inputWithPopover"
Expand All @@ -59,7 +59,7 @@ export default class extends Component {

<DisplayToggles canAppend canPrepend canLoading={false}>
<EuiDualRange
id={makeId()}
id={htmlIdGenerator()()}
value={this.state.dualValue}
onChange={this.onDualChange}
showInput="inputWithPopover"
Expand Down
6 changes: 3 additions & 3 deletions src-docs/src/views/range/levels.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
EuiDualRange,
} from '../../../../src/components';

import makeId from '../../../../src/components/form/form_row/make_id';
import { htmlIdGenerator } from '../../../../src/services';

export default class extends Component {
constructor(props) {
Expand Down Expand Up @@ -48,7 +48,7 @@ export default class extends Component {
return (
<Fragment>
<EuiRange
id={makeId()}
id={htmlIdGenerator()()}
value={this.state.value}
onChange={this.onChange}
showTicks
Expand All @@ -64,7 +64,7 @@ export default class extends Component {
<EuiSpacer size="xl" />

<EuiDualRange
id={makeId()}
id={htmlIdGenerator()()}
value={this.state.dualValue}
onChange={this.onDualChange}
showTicks
Expand Down
Loading