Skip to content

Commit

Permalink
[Workplace Search] Migrate additional shared source components (#83850)
Browse files Browse the repository at this point in the history
* Initial copy/paste of components

Changes for pre-commit hooks were:

- Linting
- Lodash imports
- remove `any` type in favor of React.ReactNode
- Move setState to top of component

* Add image

* Update component paths

* Remove reference to ConfirmModal

Since all the legacy component does it wrap the EUI component we decided to drop it.

Legacy:
https://github.com/elastic/ent-search/blob/master/app/javascript/shared/components/ConfirmModal/ConfirmModal.tsx

* Remove local flash messages in favor of global flash messages

* Various type fixes

* Fix image location
  • Loading branch information
scottybollinger authored Nov 19, 2020
1 parent bc49b5b commit 5beb47a
Show file tree
Hide file tree
Showing 9 changed files with 1,104 additions and 8 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,12 @@ export interface ContentSource {
name: string;
}

export interface SourceContentItem {
id: string;
last_updated: string;
[key: string]: string;
}

export interface ContentSourceDetails extends ContentSource {
status: string;
statusMessage: string;
Expand All @@ -105,11 +111,23 @@ interface DescriptionList {
description: string;
}

export interface DocumentSummaryItem {
count: number;
type: string;
}

interface SourceActivity {
details: string[];
event: string;
time: string;
status: string;
}

export interface ContentSourceFullData extends ContentSourceDetails {
activities: object[];
activities: SourceActivity[];
details: DescriptionList[];
summary: object[];
groups: object[];
summary: DocumentSummaryItem[];
groups: Group[];
custom: boolean;
accessToken: string;
key: string;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
*/

import React, { useEffect, useState, ChangeEvent } from 'react';
import noSharedSourcesIcon from 'workplace_search/components/assets/shareCircle.svg';

import { useActions, useValues } from 'kea';

Expand All @@ -18,6 +17,7 @@ import {
EuiPanel,
EuiEmptyPrompt,
} from '@elastic/eui';
import noSharedSourcesIcon from '../../../../assets/share_circle.svg';

import { AppLogic } from '../../../../app_logic';
import { ContentSection } from '../../../../components/shared/content_section';
Expand Down
Loading

0 comments on commit 5beb47a

Please sign in to comment.