Skip to content

Extract index pattern validation rules into ui/public#22606

Merged
cjcenizal merged 5 commits intoelastic:masterfrom
cjcenizal:chore/extract-index-pattern-rules
Sep 4, 2018
Merged

Extract index pattern validation rules into ui/public#22606
cjcenizal merged 5 commits intoelastic:masterfrom
cjcenizal:chore/extract-index-pattern-rules

Conversation

@cjcenizal
Copy link
Copy Markdown
Contributor

This will allow us to more easily re-use these rules in rollups.

Copy link
Copy Markdown
Contributor

@jen-huang jen-huang left a comment

Choose a reason for hiding this comment

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

Small nitpick, otherwise code LGTM!

* under the License.
*/

export { INDEX_PATTERN_ILLEGAL_CHARACTERS } from 'ui/index_patterns';
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

it's nice to import everything the wizard needs from its own constants file, but I don't love having the same object exported from 2 different places. using

import { INDEX_PATTERN_ILLEGAL_CHARACTERS as ILLEGAL_CHARACTERS } from 'ui/index_patterns';

in step_index_pattern.js instead is not much additional overhead imo

@elasticmachine
Copy link
Copy Markdown
Contributor

💔 Build Failed

@elasticmachine
Copy link
Copy Markdown
Contributor

💔 Build Failed

@cjcenizal
Copy link
Copy Markdown
Contributor Author

These tests have failed on Jenkins but I can only get a couple of them to fail locally:

21:16:54 Summary of all failing tests
21:16:54  FAIL  src/core_plugins/kibana/public/management/sections/indices/create_index_pattern_wizard/components/step_time_field/__tests__/step_time_field.test.js
21:16:54   ● Test suite failed to run
21:16:54 
21:16:54     TypeError: Cannot redefine property: prototype
21:16:54         at Function.defineProperties (<anonymous>)
21:16:54 
21:16:54       43 | 
21:16:54       44 |     return this;
21:16:54     > 45 |   })
21:16:54       46 | };
21:16:54       47 | 
21:16:54       48 | /**
21:16:54       
21:16:54       at Function.<anonymous> (src/ui/public/utils/legacy_class.js:45:12)
21:16:54       at Object.<anonymous> (src/ui/public/errors.js:65:48)
21:16:54       at Object.<anonymous> (src/ui/public/index_patterns/index_patterns.js:8:15)
21:16:54       at Object.<anonymous> (src/ui/public/index_patterns/index.js:7:23)
21:16:54       at Object.<anonymous> (src/core_plugins/kibana/public/management/sections/indices/create_index_pattern_wizard/constants/index.js:7:23)
21:16:54       at Object.<anonymous> (src/core_plugins/kibana/public/management/sections/indices/create_index_pattern_wizard/lib/get_matched_indices.js:8:18)
21:16:54       at Object.<anonymous> (src/core_plugins/kibana/public/management/sections/indices/create_index_pattern_wizard/lib/index.js:34:28)
21:16:54       at Object.<anonymous> (src/core_plugins/kibana/public/management/sections/indices/create_index_pattern_wizard/components/step_time_field/step_time_field.js:16:12)
21:16:54       at Object.<anonymous> (src/core_plugins/kibana/public/management/sections/indices/create_index_pattern_wizard/components/step_time_field/__tests__/step_time_field.test.js:35:24)
21:16:54 
21:16:54  FAIL  src/core_plugins/kibana/public/management/sections/indices/create_index_pattern_wizard/components/step_index_pattern/__tests__/step_index_pattern.test.js
21:16:54   ● Test suite failed to run
21:16:54 
21:16:54     TypeError: Cannot redefine property: prototype
21:16:54         at Function.defineProperties (<anonymous>)
21:16:54 
21:16:54       43 | 
21:16:54       44 |     return this;
21:16:54     > 45 |   })
21:16:54       46 | };
21:16:54       47 | 
21:16:54       48 | /**
21:16:54       
21:16:54       at Function.<anonymous> (src/ui/public/utils/legacy_class.js:45:12)
21:16:54       at Object.<anonymous> (src/ui/public/errors.js:65:48)
21:16:54       at Object.<anonymous> (src/ui/public/index_patterns/index_patterns.js:8:15)
21:16:54       at Object.<anonymous> (src/ui/public/index_patterns/index.js:7:23)
21:16:54       at Object.<anonymous> (src/core_plugins/kibana/public/management/sections/indices/create_index_pattern_wizard/constants/index.js:7:23)
21:16:54       at Object.<anonymous> (src/core_plugins/kibana/public/management/sections/indices/create_index_pattern_wizard/components/step_index_pattern/step_index_pattern.js:16:18)
21:16:54       at Object.<anonymous> (src/core_plugins/kibana/public/management/sections/indices/create_index_pattern_wizard/components/step_index_pattern/__tests__/step_index_pattern.test.js:46:27)
21:16:54 
21:16:54  FAIL  src/core_plugins/kibana/public/management/sections/indices/create_index_pattern_wizard/__tests__/create_index_pattern_wizard.test.js
21:16:54   ● Test suite failed to run
21:16:54 
21:16:54     TypeError: Cannot redefine property: prototype
21:16:54         at Function.defineProperties (<anonymous>)
21:16:54 
21:16:54       43 | 
21:16:54       44 |     return this;
21:16:54     > 45 |   })
21:16:54       46 | };
21:16:54       47 | 
21:16:54       48 | /**
21:16:54       
21:16:54       at Function.<anonymous> (src/ui/public/utils/legacy_class.js:45:12)
21:16:54       at Object.<anonymous> (src/ui/public/errors.js:65:48)
21:16:54       at Object.<anonymous> (src/ui/public/index_patterns/index_patterns.js:8:15)
21:16:54       at Object.<anonymous> (src/ui/public/index_patterns/index.js:7:23)
21:16:54       at Object.<anonymous> (src/core_plugins/kibana/public/management/sections/indices/create_index_pattern_wizard/constants/index.js:7:23)
21:16:54       at Object.<anonymous> (src/core_plugins/kibana/public/management/sections/indices/create_index_pattern_wizard/lib/get_matched_indices.js:8:18)
21:16:54       at Object.<anonymous> (src/core_plugins/kibana/public/management/sections/indices/create_index_pattern_wizard/lib/index.js:34:28)
21:16:54       at Object.<anonymous> (src/core_plugins/kibana/public/management/sections/indices/create_index_pattern_wizard/create_index_pattern_wizard.js:16:12)
21:16:54       at Object.<anonymous> (src/core_plugins/kibana/public/management/sections/indices/create_index_pattern_wizard/__tests__/create_index_pattern_wizard.test.js:39:36)
21:16:54 
21:16:54  FAIL  src/core_plugins/kibana/public/management/sections/indices/create_index_pattern_wizard/components/step_index_pattern/components/indices_list/__tests__/indices_list.test.js
21:16:54   ● Test suite failed to run
21:16:54 
21:16:54     TypeError: Cannot redefine property: prototype
21:16:54         at Function.defineProperties (<anonymous>)
21:16:54 
21:16:54       43 | 
21:16:54       44 |     return this;
21:16:54     > 45 |   })
21:16:54       46 | };
21:16:54       47 | 
21:16:54       48 | /**
21:16:54       
21:16:54       at Function.<anonymous> (src/ui/public/utils/legacy_class.js:45:12)
21:16:54       at Object.<anonymous> (src/ui/public/errors.js:65:48)
21:16:54       at Object.<anonymous> (src/ui/public/index_patterns/index_patterns.js:8:15)
21:16:54       at Object.<anonymous> (src/ui/public/index_patterns/index.js:7:23)
21:16:54       at Object.<anonymous> (src/core_plugins/kibana/public/management/sections/indices/create_index_pattern_wizard/constants/index.js:7:23)
21:16:54       at Object.<anonymous> (src/core_plugins/kibana/public/management/sections/indices/create_index_pattern_wizard/components/step_index_pattern/components/indices_list/indices_list.js:16:18)
21:16:54       at Object.<anonymous> (src/core_plugins/kibana/public/management/sections/indices/create_index_pattern_wizard/components/step_index_pattern/components/indices_list/__tests__/indices_list.test.js:7:21)
21:16:54 
21:16:54  FAIL  src/core_plugins/kibana/public/management/sections/indices/create_index_pattern_wizard/__tests__/render.test.js
21:16:54   ● Test suite failed to run
21:16:54 
21:16:54     TypeError: Cannot redefine property: prototype
21:16:54         at Function.defineProperties (<anonymous>)
21:16:54 
21:16:54       43 | 
21:16:54       44 |     return this;
21:16:54     > 45 |   })
21:16:54       46 | };
21:16:54       47 | 
21:16:54       48 | /**
21:16:54       
21:16:54       at Function.<anonymous> (src/ui/public/utils/legacy_class.js:45:12)
21:16:54       at Object.<anonymous> (src/ui/public/errors.js:65:48)
21:16:54       at Object.<anonymous> (src/ui/public/index_patterns/index_patterns.js:8:15)
21:16:54       at Object.<anonymous> (src/ui/public/index_patterns/index.js:7:23)
21:16:54       at Object.<anonymous> (src/core_plugins/kibana/public/management/sections/indices/create_index_pattern_wizard/constants/index.js:7:23)
21:16:54       at Object.<anonymous> (src/core_plugins/kibana/public/management/sections/indices/create_index_pattern_wizard/lib/get_matched_indices.js:8:18)
21:16:54       at Object.<anonymous> (src/core_plugins/kibana/public/management/sections/indices/create_index_pattern_wizard/lib/index.js:34:28)
21:16:54       at Object.<anonymous> (src/core_plugins/kibana/public/management/sections/indices/create_index_pattern_wizard/create_index_pattern_wizard.js:16:12)
21:16:54       at Object.<anonymous> (src/core_plugins/kibana/public/management/sections/indices/create_index_pattern_wizard/render.js:15:36)
21:16:54       at Object.<anonymous> (src/core_plugins/kibana/public/management/sections/indices/create_index_pattern_wizard/__tests__/render.test.js:31:146)
21:16:54 
21:16:54 
21:16:54 Test Suites: 5 failed, 1 skipped, 465 passed, 470 of 471 total

@elasticmachine
Copy link
Copy Markdown
Contributor

💚 Build Succeeded

@elasticmachine
Copy link
Copy Markdown
Contributor

💚 Build Succeeded

@cjcenizal cjcenizal merged commit bcb7938 into elastic:master Sep 4, 2018
@cjcenizal cjcenizal deleted the chore/extract-index-pattern-rules branch September 4, 2018 18:27
cjcenizal added a commit that referenced this pull request Sep 5, 2018
* Rename containsInvalidCharacters to containsIllegalCharacters and return a value which accurately reflects the name.
* Move illegal index pattern characters from Management into ui/public/index_patterns.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants