Skip to content

Commit

Permalink
[Enterprise Search] Remove external_id from UI code (#120143) (#120256
Browse files Browse the repository at this point in the history
)

* [Enterprise Search] Remove `external_id` from UI code

Ports https://github.com/elastic/ent-search/pull/5441 to Kibana. `external_id` was an alias for regular `id` was removed in the Enterprise Search API.

* Add path to logic file

Not really related to this PR, but needed for debugging in the Redux dev tools

* Rename missed argument name

Co-authored-by: Kibana Machine <[email protected]>

Co-authored-by: Kibana Machine <[email protected]>
  • Loading branch information
scottybollinger and kibanamachine authored Dec 2, 2021
1 parent b07e557 commit ba7f9b9
Show file tree
Hide file tree
Showing 8 changed files with 11 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,13 @@ describe('ReindexJobLogic', () => {
fieldCoercionErrors: {
some_erroring_field: [
{
external_id: 'document-1',
id: 'document-1',
error: "Value 'some text' cannot be parsed as a number",
},
],
another_erroring_field: [
{
external_id: 'document-2',
id: 'document-2',
error: "Value '123' cannot be parsed as a date",
},
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@ describe('SchemaErrorsAccordion', () => {
fieldCoercionErrors: {
id: [
{
external_id: 'foo',
id: 'foo',
error: 'this is an error',
},
{
external_id: 'bar',
id: 'bar',
error: 'this is another error',
},
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ import './schema_errors_accordion.scss';
interface Props {
fieldCoercionErrors: FieldCoercionErrors;
schema: Schema;
generateViewPath?(externalId: string): string;
generateViewPath?(id: string): string;
}

export const SchemaErrorsAccordion: React.FC<Props> = ({
Expand Down Expand Up @@ -89,7 +89,7 @@ export const SchemaErrorsAccordion: React.FC<Props> = ({
</EuiTableHeader>
<EuiTableBody>
{errors.map((error) => {
const { external_id: id, error: errorMessage } = error;
const { id, error: errorMessage } = error;
return (
<EuiTableRow key={`schemaErrorDocument-${fieldName}-${id}`}>
<EuiTableRowCell truncateText>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ export interface IndexJob extends IIndexingStatus {
}

export interface FieldCoercionError {
external_id: string;
id: string;
error: string;
}
export type FieldCoercionErrors = Record<string, FieldCoercionError[]>;
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,7 @@ export const exampleResult = {
myLink: 'http://foo',
otherTitle: 'foo',
content_source_id: '60e85e7ea2564c265a88a4f0',
external_id: 'doc-60e85eb7a2564c937a88a4f3',
id: 'doc-60e85eb7a2564c937a88a4f3',
last_updated: '2021-07-09T14:35:35+00:00',
updated_at: '2021-07-09T14:35:35+00:00',
source: 'custom',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ export type CustomAPIFieldValue =
export interface Result {
content_source_id: string;
last_updated: string;
external_id: string;
id: string;
updated_at: string;
source: string;
[key: string]: CustomAPIFieldValue;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ export const defaultSearchResultConfig = {
export const DisplaySettingsLogic = kea<
MakeLogicType<DisplaySettingsValues, DisplaySettingsActions>
>({
path: ['enterprise_search', 'workplace_search', 'display_settings_logic'],
actions: {
onInitializeDisplaySettings: (displaySettingsProps: DisplaySettingsInitialData) =>
displaySettingsProps,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ describe('SchemaLogic', () => {

const fieldCoercionErrors = [
{
external_id: '123',
id: '123',
error: 'error',
},
] as any;
Expand Down

0 comments on commit ba7f9b9

Please sign in to comment.