-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Workplace Search] Migrate Sources Schema tree (#84847)
* Initial copy/paste of component tree Only does linting changes and: - lodash imports - Replace unescaped apostrophes with ' - Fix ternary function call to if block: if (isAdding) { actions.onSchemaSetFormErrors(errors); } else { actions.onSchemaSetError({ flashMessages: { error: errors } }); } * Remove local flash messages from component * Update paths - Adds getReindexJobRoute method to routes - Repalces legacy Rails routes helper with hard-coded paths * Add types and constants * Update paths * Replace local flash message logic with gobal * Update with newly added types Added here: #84822 * Update server routes * Replace Rails http with kibana http * Set percentage to 0 when updating Without this, the IndexingStatus never shows. * Fix route paths * Fix server route validation The empty object was breaking the UI since `schema.object({})` is actually an empty object. This is more explicit and correct. * Add i18n * Make sure i18n key is unique * Lint
- Loading branch information
1 parent
c39d14f
commit 235f786
Showing
9 changed files
with
770 additions
and
6 deletions.
There are no files selected for viewing
9 changes: 9 additions & 0 deletions
9
x-pack/plugins/enterprise_search/public/applications/shared/constants/operations.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License; | ||
* you may not use this file except in compliance with the Elastic License. | ||
*/ | ||
|
||
export const ADD = 'add'; | ||
export const UPDATE = 'update'; | ||
export const REMOVE = 'remove'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
105 changes: 105 additions & 0 deletions
105
...public/applications/workplace_search/views/content_sources/components/schema/constants.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,105 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License; | ||
* you may not use this file except in compliance with the Elastic License. | ||
*/ | ||
import { i18n } from '@kbn/i18n'; | ||
|
||
export const SCHEMA_ERRORS_HEADING = i18n.translate( | ||
'xpack.enterpriseSearch.workplaceSearch.contentSource.schema.errors.heading', | ||
{ | ||
defaultMessage: 'Schema Change Errors', | ||
} | ||
); | ||
|
||
export const SCHEMA_ERRORS_TABLE_FIELD_NAME_HEADER = i18n.translate( | ||
'xpack.enterpriseSearch.workplaceSearch.contentSource.schema.errors.header.fieldName', | ||
{ | ||
defaultMessage: 'Field Name', | ||
} | ||
); | ||
|
||
export const SCHEMA_ERRORS_TABLE_DATA_TYPE_HEADER = i18n.translate( | ||
'xpack.enterpriseSearch.workplaceSearch.contentSource.schema.errors.header.dataType', | ||
{ | ||
defaultMessage: 'Data Type', | ||
} | ||
); | ||
|
||
export const SCHEMA_FIELD_ERRORS_ERROR_MESSAGE = i18n.translate( | ||
'xpack.enterpriseSearch.workplaceSearch.contentSource.schema.errors.message', | ||
{ | ||
defaultMessage: 'Oops, we were not able to find any errors for this Schema.', | ||
} | ||
); | ||
|
||
export const SCHEMA_FIELD_ADDED_MESSAGE = i18n.translate( | ||
'xpack.enterpriseSearch.workplaceSearch.contentSource.schema.fieldAdded.message', | ||
{ | ||
defaultMessage: 'New field added.', | ||
} | ||
); | ||
|
||
export const SCHEMA_UPDATED_MESSAGE = i18n.translate( | ||
'xpack.enterpriseSearch.workplaceSearch.contentSource.schema.updated.message', | ||
{ | ||
defaultMessage: 'Schema updated.', | ||
} | ||
); | ||
|
||
export const SCHEMA_ADD_FIELD_BUTTON = i18n.translate( | ||
'xpack.enterpriseSearch.workplaceSearch.contentSource.schema.addField.button', | ||
{ | ||
defaultMessage: 'Add field', | ||
} | ||
); | ||
|
||
export const SCHEMA_MANAGE_SCHEMA_TITLE = i18n.translate( | ||
'xpack.enterpriseSearch.workplaceSearch.contentSource.schema.manage.title', | ||
{ | ||
defaultMessage: 'Manage source schema', | ||
} | ||
); | ||
|
||
export const SCHEMA_MANAGE_SCHEMA_DESCRIPTION = i18n.translate( | ||
'xpack.enterpriseSearch.workplaceSearch.contentSource.schema.manage.description', | ||
{ | ||
defaultMessage: 'Add new fields or change the types of existing ones', | ||
} | ||
); | ||
|
||
export const SCHEMA_FILTER_PLACEHOLDER = i18n.translate( | ||
'xpack.enterpriseSearch.workplaceSearch.contentSource.schema.filter.placeholder', | ||
{ | ||
defaultMessage: 'Filter schema fields...', | ||
} | ||
); | ||
|
||
export const SCHEMA_UPDATING = i18n.translate( | ||
'xpack.enterpriseSearch.workplaceSearch.contentSource.schema.updating', | ||
{ | ||
defaultMessage: 'Updating schema...', | ||
} | ||
); | ||
|
||
export const SCHEMA_SAVE_BUTTON = i18n.translate( | ||
'xpack.enterpriseSearch.workplaceSearch.contentSource.schema.save.button', | ||
{ | ||
defaultMessage: 'Save schema', | ||
} | ||
); | ||
|
||
export const SCHEMA_EMPTY_SCHEMA_TITLE = i18n.translate( | ||
'xpack.enterpriseSearch.workplaceSearch.contentSource.schema.empty.title', | ||
{ | ||
defaultMessage: 'Content source does not have a schema', | ||
} | ||
); | ||
|
||
export const SCHEMA_EMPTY_SCHEMA_DESCRIPTION = i18n.translate( | ||
'xpack.enterpriseSearch.workplaceSearch.contentSource.schema.empty.description', | ||
{ | ||
defaultMessage: | ||
'A schema is created for you once you index some documents. Click below to create schema fields in advance.', | ||
} | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.