{pictureUrl ? (
diff --git a/x-pack/plugins/enterprise_search/public/applications/workplace_search/components/shared/user_row/user_row.tsx b/x-pack/plugins/enterprise_search/public/applications/workplace_search/components/shared/user_row/user_row.tsx
index 45866c10a5b21..b9413724db818 100644
--- a/x-pack/plugins/enterprise_search/public/applications/workplace_search/components/shared/user_row/user_row.tsx
+++ b/x-pack/plugins/enterprise_search/public/applications/workplace_search/components/shared/user_row/user_row.tsx
@@ -8,14 +8,14 @@ import React from 'react';
import { EuiTableRow, EuiTableRowCell } from '@elastic/eui';
-import { IUser } from '../../../types';
+import { User } from '../../../types';
-interface IUserRowProps {
- user: IUser;
+interface UserRowProps {
+ user: User;
showEmail?: boolean;
}
-export const UserRow: React.FC
= ({ user: { name, email }, showEmail }) => (
+export const UserRow: React.FC = ({ user: { name, email }, showEmail }) => (
{name}
{showEmail && {email}}
diff --git a/x-pack/plugins/enterprise_search/public/applications/workplace_search/components/shared/view_content_header/view_content_header.tsx b/x-pack/plugins/enterprise_search/public/applications/workplace_search/components/shared/view_content_header/view_content_header.tsx
index 0e2d781020294..c6cf7d4991689 100644
--- a/x-pack/plugins/enterprise_search/public/applications/workplace_search/components/shared/view_content_header/view_content_header.tsx
+++ b/x-pack/plugins/enterprise_search/public/applications/workplace_search/components/shared/view_content_header/view_content_header.tsx
@@ -10,7 +10,7 @@ import { EuiFlexGroup, EuiFlexItem, EuiText, EuiTitle, EuiSpacer } from '@elasti
import { FlexGroupAlignItems } from '@elastic/eui/src/components/flex/flex_group';
-interface IViewContentHeaderProps {
+interface ViewContentHeaderProps {
title: React.ReactNode;
description?: React.ReactNode;
action?: React.ReactNode;
@@ -18,7 +18,7 @@ interface IViewContentHeaderProps {
titleSize?: 's' | 'm' | 'l';
}
-export const ViewContentHeader: React.FC = ({
+export const ViewContentHeader: React.FC = ({
title,
titleSize = 'm',
description,
diff --git a/x-pack/plugins/enterprise_search/public/applications/workplace_search/index.tsx b/x-pack/plugins/enterprise_search/public/applications/workplace_search/index.tsx
index 9875af7889447..311f30a891eb9 100644
--- a/x-pack/plugins/enterprise_search/public/applications/workplace_search/index.tsx
+++ b/x-pack/plugins/enterprise_search/public/applications/workplace_search/index.tsx
@@ -9,7 +9,7 @@ import { Route, Redirect, Switch } from 'react-router-dom';
import { useActions, useValues } from 'kea';
import { WORKPLACE_SEARCH_PLUGIN } from '../../../common/constants';
-import { IInitialAppData } from '../../../common/types';
+import { InitialAppData } from '../../../common/types';
import { KibanaLogic } from '../shared/kibana';
import { HttpLogic } from '../shared/http';
import { AppLogic } from './app_logic';
@@ -24,12 +24,12 @@ import { NotFound } from '../shared/not_found';
import { Overview } from './views/overview';
import { GroupsRouter } from './views/groups';
-export const WorkplaceSearch: React.FC = (props) => {
+export const WorkplaceSearch: React.FC = (props) => {
const { config } = useValues(KibanaLogic);
return !config.host ? : ;
};
-export const WorkplaceSearchConfigured: React.FC = (props) => {
+export const WorkplaceSearchConfigured: React.FC = (props) => {
const { hasInitialized } = useValues(AppLogic);
const { initializeAppData } = useActions(AppLogic);
const { renderHeaderActions } = useValues(KibanaLogic);
diff --git a/x-pack/plugins/enterprise_search/public/applications/workplace_search/types.ts b/x-pack/plugins/enterprise_search/public/applications/workplace_search/types.ts
index 747fba56e060e..8f44fcacc17f6 100644
--- a/x-pack/plugins/enterprise_search/public/applications/workplace_search/types.ts
+++ b/x-pack/plugins/enterprise_search/public/applications/workplace_search/types.ts
@@ -6,12 +6,54 @@
export * from '../../../common/types/workplace_search';
-export type TSpacerSize = 'xs' | 's' | 'm' | 'l' | 'xl' | 'xxl';
+export type SpacerSizeTypes = 'xs' | 's' | 'm' | 'l' | 'xl' | 'xxl';
-export interface ISourcePriority {
- [id: string]: number;
+export interface Group {
+ id: string;
+ name: string;
+ createdAt: string;
+ updatedAt: string;
+ contentSources: ContentSource[];
+ users: User[];
+ usersCount: number;
+ color?: string;
+}
+
+export interface GroupDetails extends Group {
+ contentSources: ContentSourceDetails[];
+ canEditGroup: boolean;
+ canDeleteGroup: boolean;
+}
+
+export interface User {
+ id: string;
+ name: string | null;
+ initials: string;
+ pictureUrl: string | null;
+ color: string;
+ email: string;
+ role?: string;
+ groupIds: string[];
}
-export interface IComponentLoader {
- text?: string;
+export interface ContentSource {
+ id: string;
+ serviceType: string;
+ name: string;
+}
+
+export interface ContentSourceDetails extends ContentSource {
+ status: string;
+ statusMessage: string;
+ documentCount: string;
+ isFederatedSource: boolean;
+ searchable: boolean;
+ supportedByLicense: boolean;
+ errorReason: number;
+ allowsReauth: boolean;
+ boost: number;
+}
+
+export interface SourcePriority {
+ [id: string]: number;
}
diff --git a/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/groups/__mocks__/group_logic.mock.ts b/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/groups/__mocks__/group_logic.mock.ts
index 18e7851485222..3baaa07a9b0e7 100644
--- a/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/groups/__mocks__/group_logic.mock.ts
+++ b/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/groups/__mocks__/group_logic.mock.ts
@@ -4,12 +4,10 @@
* you may not use this file except in compliance with the Elastic License.
*/
-import { IGroupValues } from '../group_logic';
-
-import { IGroupDetails, ISourcePriority } from '../../../types';
+import { GroupDetails, SourcePriority } from '../../../types';
export const mockGroupValues = {
- group: {} as IGroupDetails,
+ group: {} as GroupDetails,
dataLoading: true,
manageUsersModalVisible: false,
managerModalFormErrors: [],
@@ -19,6 +17,6 @@ export const mockGroupValues = {
selectedGroupSources: [],
selectedGroupUsers: [],
groupPrioritiesUnchanged: true,
- activeSourcePriorities: {} as ISourcePriority,
- cachedSourcePriorities: {} as ISourcePriority,
-} as IGroupValues;
+ activeSourcePriorities: {} as SourcePriority,
+ cachedSourcePriorities: {} as SourcePriority,
+};
diff --git a/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/groups/__mocks__/groups_logic.mock.ts b/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/groups/__mocks__/groups_logic.mock.ts
index 0483799b73093..c21cc602967a5 100644
--- a/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/groups/__mocks__/groups_logic.mock.ts
+++ b/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/groups/__mocks__/groups_logic.mock.ts
@@ -4,16 +4,14 @@
* you may not use this file except in compliance with the Elastic License.
*/
-import { IGroupsValues } from '../groups_logic';
-
-import { IContentSource, IUser, IGroup } from '../../../types';
+import { ContentSource, User, Group } from '../../../types';
import { DEFAULT_META } from '../../../../shared/constants';
export const mockGroupsValues = {
- groups: [] as IGroup[],
- contentSources: [] as IContentSource[],
- users: [] as IUser[],
+ groups: [] as Group[],
+ contentSources: [] as ContentSource[],
+ users: [] as User[],
groupsDataLoading: true,
groupListLoading: true,
newGroupModalOpen: false,
@@ -29,4 +27,4 @@ export const mockGroupsValues = {
allGroupUsers: [],
filterValue: '',
groupsMeta: DEFAULT_META,
-} as IGroupsValues;
+};
diff --git a/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/groups/components/filterable_users_list.test.tsx b/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/groups/components/filterable_users_list.test.tsx
index f23a0c8d14042..07fae45b6b714 100644
--- a/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/groups/components/filterable_users_list.test.tsx
+++ b/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/groups/components/filterable_users_list.test.tsx
@@ -15,7 +15,7 @@ import { EuiFieldSearch, EuiFilterSelectItem, EuiCard, EuiPopoverTitle } from '@
import { FilterableUsersList } from './filterable_users_list';
-import { IUser } from '../../../types';
+import { User } from '../../../types';
const mockSetState = jest.fn();
const useStateMock: any = (initState: any) => [initState, mockSetState];
@@ -96,7 +96,7 @@ describe('FilterableUsersList', () => {
});
it('handles hidden users when count is higher than 20', () => {
- const _users = [] as IUser[];
+ const _users = [] as User[];
const NUM_TOTAL_USERS = 30;
const NUM_VISIBLE_USERS = 20;
diff --git a/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/groups/components/filterable_users_list.tsx b/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/groups/components/filterable_users_list.tsx
index a7b5d3e83bee2..02a46125ed8ce 100644
--- a/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/groups/components/filterable_users_list.tsx
+++ b/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/groups/components/filterable_users_list.tsx
@@ -17,7 +17,7 @@ import {
EuiSpacer,
} from '@elastic/eui';
-import { IUser } from '../../../types';
+import { User } from '../../../types';
import { UserOptionItem } from './user_option_item';
@@ -36,8 +36,8 @@ const NO_USERS_FOUND = i18n.translate(
}
);
-interface IFilterableUsersListProps {
- users: IUser[];
+interface FilterableUsersListProps {
+ users: User[];
selectedOptions?: string[];
itemsClickable?: boolean;
isPopover?: boolean;
@@ -46,7 +46,7 @@ interface IFilterableUsersListProps {
removeFilteredUser(userId: string): void;
}
-export const FilterableUsersList: React.FC = ({
+export const FilterableUsersList: React.FC = ({
users,
selectedOptions = [],
itemsClickable,
@@ -59,7 +59,7 @@ export const FilterableUsersList: React.FC = ({
const filterUsers = (userId: string): boolean => {
if (!filterValue) return true;
- const filterUser = users.find(({ id }) => id === userId) as IUser;
+ const filterUser = users.find(({ id }) => id === userId) as User;
const filteredName = filterUser.name || filterUser.email;
return filteredName.toLowerCase().indexOf(filterValue.toLowerCase()) > -1;
};
diff --git a/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/groups/components/filterable_users_popover.tsx b/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/groups/components/filterable_users_popover.tsx
index c9bf03c5d4700..e397d796124ab 100644
--- a/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/groups/components/filterable_users_popover.tsx
+++ b/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/groups/components/filterable_users_popover.tsx
@@ -10,13 +10,13 @@ import { useActions } from 'kea';
import { EuiFilterGroup, EuiPopover } from '@elastic/eui';
-import { IUser } from '../../../types';
+import { User } from '../../../types';
import { GroupsLogic } from '../groups_logic';
import { FilterableUsersList } from './filterable_users_list';
-interface IIFilterableUsersPopoverProps {
- users: IUser[];
+interface FilterableUsersPopoverProps {
+ users: User[];
selectedOptions?: string[];
itemsClickable?: boolean;
isPopoverOpen: boolean;
@@ -26,7 +26,7 @@ interface IIFilterableUsersPopoverProps {
closePopover(): void;
}
-export const FilterableUsersPopover: React.FC = ({
+export const FilterableUsersPopover: React.FC = ({
users,
selectedOptions = [],
itemsClickable,
diff --git a/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/groups/components/group_manager_modal.tsx b/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/groups/components/group_manager_modal.tsx
index c91516edf7b15..11c0430a8b429 100644
--- a/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/groups/components/group_manager_modal.tsx
+++ b/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/groups/components/group_manager_modal.tsx
@@ -28,7 +28,7 @@ import {
import { EuiButton as EuiLinkButton } from '../../../../shared/react_router_helpers';
-import { IGroup } from '../../../types';
+import { Group } from '../../../types';
import { ORG_SOURCES_PATH } from '../../../routes';
import noSharedSourcesIcon from '../../../assets/share_circle.svg';
@@ -67,17 +67,17 @@ const EMPTY_STATE_BODY = i18n.translate(
}
);
-interface IGroupManagerModalProps {
+interface GroupManagerModalProps {
children: React.ReactElement;
label: string;
allItems: object[];
numSelected: number;
- hideModal(group: IGroup): void;
+ hideModal(group: Group): void;
selectAll(allItems: object[]): void;
saveItems(): void;
}
-export const GroupManagerModal: React.FC = ({
+export const GroupManagerModal: React.FC = ({
children,
label,
allItems,
diff --git a/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/groups/components/group_row.tsx b/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/groups/components/group_row.tsx
index 9642d48af55f5..5cebb96d00eb9 100644
--- a/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/groups/components/group_row.tsx
+++ b/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/groups/components/group_row.tsx
@@ -15,7 +15,7 @@ import { EuiTableRow, EuiTableRowCell, EuiIcon } from '@elastic/eui';
import { TruncatedContent } from '../../../../shared/truncate';
import { EuiLink } from '../../../../shared/react_router_helpers';
-import { IGroup } from '../../../types';
+import { Group } from '../../../types';
import { AppLogic } from '../../../app_logic';
import { getGroupPath } from '../../../routes';
@@ -42,7 +42,7 @@ const dateDisplay = (date: string) =>
? moment(date).fromNow()
: moment(date).format('MMMM D, YYYY');
-export const GroupRow: React.FC = ({
+export const GroupRow: React.FC = ({
id,
name,
updatedAt,
diff --git a/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/groups/components/group_row_sources_dropdown.tsx b/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/groups/components/group_row_sources_dropdown.tsx
index c686bc67c5015..eadfd2978872a 100644
--- a/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/groups/components/group_row_sources_dropdown.tsx
+++ b/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/groups/components/group_row_sources_dropdown.tsx
@@ -10,19 +10,19 @@ import { i18n } from '@kbn/i18n';
import { EuiFilterGroup, EuiPopover, EuiPopoverTitle, EuiButtonEmpty } from '@elastic/eui';
-import { IContentSource } from '../../../types';
+import { ContentSource } from '../../../types';
import { SourceOptionItem } from './source_option_item';
-interface IGroupRowSourcesDropdownProps {
+interface GroupRowSourcesDropdownProps {
isPopoverOpen: boolean;
numOptions: number;
- groupSources: IContentSource[];
+ groupSources: ContentSource[];
onButtonClick(): void;
closePopover(): void;
}
-export const GroupRowSourcesDropdown: React.FC = ({
+export const GroupRowSourcesDropdown: React.FC = ({
isPopoverOpen,
numOptions,
groupSources,
diff --git a/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/groups/components/group_row_users_dropdown.tsx b/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/groups/components/group_row_users_dropdown.tsx
index 7ecf01db9c044..660df866ee906 100644
--- a/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/groups/components/group_row_users_dropdown.tsx
+++ b/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/groups/components/group_row_users_dropdown.tsx
@@ -13,7 +13,7 @@ import { EuiLoadingContent, EuiButtonEmpty } from '@elastic/eui';
import { GroupsLogic } from '../groups_logic';
import { FilterableUsersPopover } from './filterable_users_popover';
-interface IGroupRowUsersDropdownProps {
+interface GroupRowUsersDropdownProps {
isPopoverOpen: boolean;
numOptions: number;
groupId: string;
@@ -21,7 +21,7 @@ interface IGroupRowUsersDropdownProps {
closePopover(): void;
}
-export const GroupRowUsersDropdown: React.FC = ({
+export const GroupRowUsersDropdown: React.FC = ({
isPopoverOpen,
numOptions,
groupId,
diff --git a/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/groups/components/group_source_prioritization.tsx b/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/groups/components/group_source_prioritization.tsx
index 4bdff20bde888..8c054ed9abc87 100644
--- a/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/groups/components/group_source_prioritization.tsx
+++ b/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/groups/components/group_source_prioritization.tsx
@@ -32,7 +32,7 @@ import { SourceIcon } from '../../../components/shared/source_icon';
import { GroupLogic } from '../group_logic';
-import { IContentSource } from '../../../types';
+import { ContentSource } from '../../../types';
const HEADER_TITLE = i18n.translate(
'xpack.enterpriseSearch.workplaceSearch.groups.sourceProioritization.headerTitle',
@@ -140,7 +140,7 @@ export const GroupSourcePrioritization: React.FC = () => {
{PRIORITY_TABLE_HEADER}
- {contentSources.map(({ id, name, serviceType }: IContentSource) => (
+ {contentSources.map(({ id, name, serviceType }: ContentSource) => (
diff --git a/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/groups/components/group_sources.test.tsx b/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/groups/components/group_sources.test.tsx
index 38c56aefebafd..8ab3ace7aed93 100644
--- a/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/groups/components/group_sources.test.tsx
+++ b/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/groups/components/group_sources.test.tsx
@@ -16,7 +16,7 @@ import { GroupRowSourcesDropdown } from './group_row_sources_dropdown';
import { SourceIcon } from '../../../components/shared/source_icon';
-import { IContentSourceDetails } from '../../../types';
+import { ContentSourceDetails } from '../../../types';
describe('GroupSources', () => {
it('renders', () => {
@@ -26,7 +26,7 @@ describe('GroupSources', () => {
});
it('handles hidden sources when count is higer than 10', () => {
- const sources = [] as IContentSourceDetails[];
+ const sources = [] as ContentSourceDetails[];
const NUM_TOTAL_SOURCES = 10;
[...Array(NUM_TOTAL_SOURCES)].forEach((_, i) => {
diff --git a/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/groups/components/group_sources.tsx b/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/groups/components/group_sources.tsx
index 7ae9856834443..b7d32a83750c9 100644
--- a/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/groups/components/group_sources.tsx
+++ b/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/groups/components/group_sources.tsx
@@ -9,15 +9,15 @@ import React, { useState } from 'react';
import { SourceIcon } from '../../../components/shared/source_icon';
import { MAX_TABLE_ROW_ICONS } from '../../../constants';
-import { IContentSource } from '../../../types';
+import { ContentSource } from '../../../types';
import { GroupRowSourcesDropdown } from './group_row_sources_dropdown';
-interface IGroupSourcesProps {
- groupSources: IContentSource[];
+interface GroupSourcesProps {
+ groupSources: ContentSource[];
}
-export const GroupSources: React.FC = ({ groupSources }) => {
+export const GroupSources: React.FC = ({ groupSources }) => {
const [popoverOpen, setPopoverOpen] = useState(false);
const closePopover = () => setPopoverOpen(false);
const togglePopover = () => setPopoverOpen(!popoverOpen);
diff --git a/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/groups/components/group_users.test.tsx b/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/groups/components/group_users.test.tsx
index 6a635eacf2585..581486141d0b0 100644
--- a/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/groups/components/group_users.test.tsx
+++ b/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/groups/components/group_users.test.tsx
@@ -11,7 +11,7 @@ import { users } from '../../../__mocks__/users.mock';
import React from 'react';
import { shallow } from 'enzyme';
-import { IUser } from '../../../types';
+import { User } from '../../../types';
import { GroupUsers } from './group_users';
import { GroupRowUsersDropdown } from './group_row_users_dropdown';
@@ -32,7 +32,7 @@ describe('GroupUsers', () => {
});
it('handles hidden users when count is higher than 20', () => {
- const _users = [] as IUser[];
+ const _users = [] as User[];
const NUM_TOTAL_USERS = 20;
[...Array(NUM_TOTAL_USERS)].forEach((_, i) => {
diff --git a/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/groups/components/group_users.tsx b/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/groups/components/group_users.tsx
index 6ce4370ccb8d1..4615c953be791 100644
--- a/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/groups/components/group_users.tsx
+++ b/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/groups/components/group_users.tsx
@@ -9,17 +9,17 @@ import React, { useState } from 'react';
import { UserIcon } from '../../../components/shared/user_icon';
import { MAX_TABLE_ROW_ICONS } from '../../../constants';
-import { IUser } from '../../../types';
+import { User } from '../../../types';
import { GroupRowUsersDropdown } from './group_row_users_dropdown';
-interface IGroupUsersProps {
- groupUsers: IUser[];
+interface GroupUsersProps {
+ groupUsers: User[];
usersCount: number;
groupId: string;
}
-export const GroupUsers: React.FC = ({ groupUsers, usersCount, groupId }) => {
+export const GroupUsers: React.FC = ({ groupUsers, usersCount, groupId }) => {
const [popoverOpen, setPopoverOpen] = useState(false);
const closePopover = () => setPopoverOpen(false);
const togglePopover = () => setPopoverOpen(!popoverOpen);
diff --git a/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/groups/components/group_users_table.test.tsx b/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/groups/components/group_users_table.test.tsx
index 8747a838689c4..479fd5668cf40 100644
--- a/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/groups/components/group_users_table.test.tsx
+++ b/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/groups/components/group_users_table.test.tsx
@@ -12,7 +12,7 @@ import { groups } from '../../../__mocks__/groups.mock';
import React from 'react';
import { shallow } from 'enzyme';
-import { IUser } from '../../../types';
+import { User } from '../../../types';
import { GroupUsersTable } from './group_users_table';
import { TableHeader } from '../../../../shared/table_header';
@@ -38,7 +38,7 @@ describe('GroupUsersTable', () => {
});
it('renders pagination', () => {
- const users = [] as IUser[];
+ const users = [] as User[];
const NUM_TOTAL_USERS = 20;
[...Array(NUM_TOTAL_USERS)].forEach((_, i) => {
diff --git a/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/groups/components/group_users_table.tsx b/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/groups/components/group_users_table.tsx
index 5ab71056aba7e..d29d7f33c706e 100644
--- a/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/groups/components/group_users_table.tsx
+++ b/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/groups/components/group_users_table.tsx
@@ -13,7 +13,7 @@ import { i18n } from '@kbn/i18n';
import { EuiTable, EuiTableBody, EuiTablePagination } from '@elastic/eui';
import { Pager } from '@elastic/eui';
-import { IUser } from '../../../types';
+import { User } from '../../../types';
import { TableHeader } from '../../../../shared/table_header';
import { UserRow } from '../../../components/shared/user_row';
@@ -74,7 +74,7 @@ export const GroupUsersTable: React.FC = () => {
- {users.slice(firstItem, lastItem + 1).map((user: IUser) => (
+ {users.slice(firstItem, lastItem + 1).map((user: User) => (
))}
diff --git a/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/groups/components/source_option_item.tsx b/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/groups/components/source_option_item.tsx
index f6677670f8a88..d537ada886f12 100644
--- a/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/groups/components/source_option_item.tsx
+++ b/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/groups/components/source_option_item.tsx
@@ -11,15 +11,15 @@ import { EuiFlexGroup, EuiFlexItem } from '@elastic/eui';
import { TruncatedContent } from '../../../../shared/truncate';
import { SourceIcon } from '../../../components/shared/source_icon';
-import { IContentSource } from '../../../types';
+import { ContentSource } from '../../../types';
const MAX_LENGTH = 28;
-interface ISourceOptionItemProps {
- source: IContentSource;
+interface SourceOptionItemProps {
+ source: ContentSource;
}
-export const SourceOptionItem: React.FC = ({ source }) => (
+export const SourceOptionItem: React.FC = ({ source }) => (
diff --git a/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/groups/components/sources_list.tsx b/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/groups/components/sources_list.tsx
index e8f9027d98e0d..2644bcb9975d6 100644
--- a/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/groups/components/sources_list.tsx
+++ b/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/groups/components/sources_list.tsx
@@ -8,18 +8,18 @@ import React from 'react';
import { EuiFilterSelectItem } from '@elastic/eui';
-import { IContentSource } from '../../../types';
+import { ContentSource } from '../../../types';
import { SourceOptionItem } from './source_option_item';
-interface ISourcesListProps {
- contentSources: IContentSource[];
+interface SourcesListProps {
+ contentSources: ContentSource[];
filteredSources: string[];
addFilteredSource(sourceId: string): void;
removeFilteredSource(sourceId: string): void;
}
-export const SourcesList: React.FC = ({
+export const SourcesList: React.FC = ({
contentSources,
filteredSources,
addFilteredSource,
diff --git a/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/groups/components/user_option_item.tsx b/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/groups/components/user_option_item.tsx
index 8eb199d67cf92..b9350bc4e2833 100644
--- a/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/groups/components/user_option_item.tsx
+++ b/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/groups/components/user_option_item.tsx
@@ -9,13 +9,13 @@ import React from 'react';
import { EuiFlexGroup, EuiFlexItem } from '@elastic/eui';
import { UserIcon } from '../../../components/shared/user_icon';
-import { IUser } from '../../../types';
+import { User } from '../../../types';
-interface IUserOptionItemProps {
- user: IUser;
+interface UserOptionItemProps {
+ user: User;
}
-export const UserOptionItem: React.FC = ({ user }) => (
+export const UserOptionItem: React.FC = ({ user }) => (
diff --git a/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/groups/group_logic.ts b/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/groups/group_logic.ts
index b895200d3fc22..357f0553c69e1 100644
--- a/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/groups/group_logic.ts
+++ b/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/groups/group_logic.ts
@@ -6,7 +6,6 @@
import { kea, MakeLogicType } from 'kea';
import { isEqual } from 'lodash';
-import { History } from 'history';
import { i18n } from '@kbn/i18n';
import { HttpLogic } from '../../../shared/http';
@@ -20,26 +19,26 @@ import {
} from '../../../shared/flash_messages';
import { GROUPS_PATH } from '../../routes';
-import { IContentSourceDetails, IGroupDetails, IUser, ISourcePriority } from '../../types';
+import { ContentSourceDetails, GroupDetails, User, SourcePriority } from '../../types';
export const MAX_NAME_LENGTH = 40;
-export interface IGroupActions {
- onInitializeGroup(group: IGroupDetails): IGroupDetails;
- onGroupNameChanged(group: IGroupDetails): IGroupDetails;
- onGroupPrioritiesChanged(group: IGroupDetails): IGroupDetails;
+interface GroupActions {
+ onInitializeGroup(group: GroupDetails): GroupDetails;
+ onGroupNameChanged(group: GroupDetails): GroupDetails;
+ onGroupPrioritiesChanged(group: GroupDetails): GroupDetails;
onGroupNameInputChange(groupName: string): string;
addGroupSource(sourceId: string): string;
removeGroupSource(sourceId: string): string;
addGroupUser(userId: string): string;
removeGroupUser(userId: string): string;
- onGroupSourcesSaved(group: IGroupDetails): IGroupDetails;
- onGroupUsersSaved(group: IGroupDetails): IGroupDetails;
+ onGroupSourcesSaved(group: GroupDetails): GroupDetails;
+ onGroupUsersSaved(group: GroupDetails): GroupDetails;
setGroupModalErrors(errors: string[]): string[];
- hideSharedSourcesModal(group: IGroupDetails): IGroupDetails;
- hideManageUsersModal(group: IGroupDetails): IGroupDetails;
- selectAllSources(contentSources: IContentSourceDetails[]): IContentSourceDetails[];
- selectAllUsers(users: IUser[]): IUser[];
+ hideSharedSourcesModal(group: GroupDetails): GroupDetails;
+ hideManageUsersModal(group: GroupDetails): GroupDetails;
+ selectAllSources(contentSources: ContentSourceDetails[]): ContentSourceDetails[];
+ selectAllUsers(users: User[]): User[];
updatePriority(id: string, boost: number): { id: string; boost: number };
resetGroup(): void;
showConfirmDeleteModal(): void;
@@ -55,8 +54,8 @@ export interface IGroupActions {
saveGroupSourcePrioritization(): void;
}
-export interface IGroupValues {
- group: IGroupDetails;
+interface GroupValues {
+ group: GroupDetails;
dataLoading: boolean;
manageUsersModalVisible: boolean;
managerModalFormErrors: string[];
@@ -66,36 +65,36 @@ export interface IGroupValues {
selectedGroupSources: string[];
selectedGroupUsers: string[];
groupPrioritiesUnchanged: boolean;
- activeSourcePriorities: ISourcePriority;
- cachedSourcePriorities: ISourcePriority;
+ activeSourcePriorities: SourcePriority;
+ cachedSourcePriorities: SourcePriority;
}
-export const GroupLogic = kea>({
+export const GroupLogic = kea>({
path: ['enterprise_search', 'workplace_search', 'group'],
actions: {
- onInitializeGroup: (group: IGroupDetails) => group,
- onGroupNameChanged: (group: IGroupDetails) => group,
- onGroupPrioritiesChanged: (group: IGroupDetails) => group,
- onGroupNameInputChange: (groupName: string) => groupName,
- addGroupSource: (sourceId: string) => sourceId,
- removeGroupSource: (sourceId: string) => sourceId,
- addGroupUser: (userId: string) => userId,
- removeGroupUser: (userId: string) => userId,
- onGroupSourcesSaved: (group: IGroupDetails) => group,
- onGroupUsersSaved: (group: IGroupDetails) => group,
- setGroupModalErrors: (errors: string[]) => errors,
- hideSharedSourcesModal: (group: IGroupDetails) => group,
- hideManageUsersModal: (group: IGroupDetails) => group,
- selectAllSources: (contentSources: IContentSourceDetails[]) => contentSources,
- selectAllUsers: (users: IUser[]) => users,
- updatePriority: (id: string, boost: number) => ({ id, boost }),
+ onInitializeGroup: (group) => group,
+ onGroupNameChanged: (group) => group,
+ onGroupPrioritiesChanged: (group) => group,
+ onGroupNameInputChange: (groupName) => groupName,
+ addGroupSource: (sourceId) => sourceId,
+ removeGroupSource: (sourceId) => sourceId,
+ addGroupUser: (userId) => userId,
+ removeGroupUser: (userId) => userId,
+ onGroupSourcesSaved: (group) => group,
+ onGroupUsersSaved: (group) => group,
+ setGroupModalErrors: (errors) => errors,
+ hideSharedSourcesModal: (group) => group,
+ hideManageUsersModal: (group) => group,
+ selectAllSources: (contentSources) => contentSources,
+ selectAllUsers: (users) => users,
+ updatePriority: (id, boost) => ({ id, boost }),
resetGroup: () => true,
showConfirmDeleteModal: () => true,
hideConfirmDeleteModal: () => true,
showSharedSourcesModal: () => true,
showManageUsersModal: () => true,
resetFlashMessages: () => true,
- initializeGroup: (groupId: string, history: History) => ({ groupId, history }),
+ initializeGroup: (groupId) => ({ groupId }),
deleteGroup: () => true,
updateGroupName: () => true,
saveGroupSources: () => true,
@@ -104,13 +103,13 @@ export const GroupLogic = kea>({
},
reducers: {
group: [
- {} as IGroupDetails,
+ {} as GroupDetails,
{
onInitializeGroup: (_, group) => group,
onGroupNameChanged: (_, group) => group,
onGroupSourcesSaved: (_, group) => group,
onGroupUsersSaved: (_, group) => group,
- resetGroup: () => ({} as IGroupDetails),
+ resetGroup: () => ({} as GroupDetails),
},
],
dataLoading: [
@@ -375,8 +374,8 @@ export const GroupLogic = kea>({
}),
});
-const mapPriorities = (contentSources: IContentSourceDetails[]): ISourcePriority => {
- const prioritiesMap = {} as ISourcePriority;
+const mapPriorities = (contentSources: ContentSourceDetails[]): SourcePriority => {
+ const prioritiesMap = {} as SourcePriority;
contentSources.forEach(({ id, boost }) => {
prioritiesMap[id] = boost;
});
diff --git a/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/groups/groups_logic.ts b/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/groups/groups_logic.ts
index 685a2651cb24a..618ca84f825c9 100644
--- a/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/groups/groups_logic.ts
+++ b/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/groups/groups_logic.ts
@@ -15,37 +15,37 @@ import {
setSuccessMessage,
} from '../../../shared/flash_messages';
-import { IContentSource, IGroup, IUser } from '../../types';
+import { ContentSource, Group, User } from '../../types';
import { JSON_HEADER as headers } from '../../../../../common/constants';
import { DEFAULT_META } from '../../../shared/constants';
-import { IMeta } from '../../../../../common/types';
+import { Meta } from '../../../../../common/types';
export const MAX_NAME_LENGTH = 40;
-interface IGroupsServerData {
- contentSources: IContentSource[];
- users: IUser[];
+interface GroupsServerData {
+ contentSources: ContentSource[];
+ users: User[];
}
-interface IGroupsSearchResponse {
- results: IGroup[];
- meta: IMeta;
+interface GroupsSearchResponse {
+ results: Group[];
+ meta: Meta;
}
-export interface IGroupsActions {
- onInitializeGroups(data: IGroupsServerData): IGroupsServerData;
- setSearchResults(data: IGroupsSearchResponse): IGroupsSearchResponse;
+interface GroupsActions {
+ onInitializeGroups(data: GroupsServerData): GroupsServerData;
+ setSearchResults(data: GroupsSearchResponse): GroupsSearchResponse;
addFilteredSource(sourceId: string): string;
removeFilteredSource(sourceId: string): string;
addFilteredUser(userId: string): string;
removeFilteredUser(userId: string): string;
- setGroupUsers(allGroupUsers: IUser[]): IUser[];
+ setGroupUsers(allGroupUsers: User[]): User[];
setAllGroupLoading(allGroupUsersLoading: boolean): boolean;
setFilterValue(filterValue: string): string;
setActivePage(activePage: number): number;
setNewGroupName(newGroupName: string): string;
- setNewGroup(newGroup: IGroup): IGroup;
+ setNewGroup(newGroup: Group): Group;
setNewGroupFormErrors(errors: string[]): string[];
openNewGroupModal(): void;
closeNewGroupModal(): void;
@@ -62,43 +62,43 @@ export interface IGroupsActions {
saveNewGroup(): void;
}
-export interface IGroupsValues {
- groups: IGroup[];
- contentSources: IContentSource[];
- users: IUser[];
+interface GroupsValues {
+ groups: Group[];
+ contentSources: ContentSource[];
+ users: User[];
groupsDataLoading: boolean;
groupListLoading: boolean;
newGroupModalOpen: boolean;
newGroupName: string;
- newGroup: IGroup | null;
+ newGroup: Group | null;
newGroupNameErrors: string[];
filterSourcesDropdownOpen: boolean;
filteredSources: string[];
filterUsersDropdownOpen: boolean;
filteredUsers: string[];
allGroupUsersLoading: boolean;
- allGroupUsers: IUser[];
+ allGroupUsers: User[];
filterValue: string;
- groupsMeta: IMeta;
+ groupsMeta: Meta;
hasFiltersSet: boolean;
}
-export const GroupsLogic = kea>({
+export const GroupsLogic = kea>({
path: ['enterprise_search', 'workplace_search', 'groups'],
actions: {
- onInitializeGroups: (data: IGroupsServerData) => data,
- setSearchResults: (data: IGroupsSearchResponse) => data,
- addFilteredSource: (sourceId: string) => sourceId,
- removeFilteredSource: (sourceId: string) => sourceId,
- addFilteredUser: (userId: string) => userId,
- removeFilteredUser: (userId: string) => userId,
- setGroupUsers: (allGroupUsers: IUser[]) => allGroupUsers,
+ onInitializeGroups: (data) => data,
+ setSearchResults: (data) => data,
+ addFilteredSource: (sourceId) => sourceId,
+ removeFilteredSource: (sourceId) => sourceId,
+ addFilteredUser: (userId) => userId,
+ removeFilteredUser: (userId) => userId,
+ setGroupUsers: (allGroupUsers) => allGroupUsers,
setAllGroupLoading: (allGroupUsersLoading: boolean) => allGroupUsersLoading,
- setFilterValue: (filterValue: string) => filterValue,
- setActivePage: (activePage: number) => activePage,
- setNewGroupName: (newGroupName: string) => newGroupName,
- setNewGroup: (newGroup: IGroup) => newGroup,
- setNewGroupFormErrors: (errors: string[]) => errors,
+ setFilterValue: (filterValue) => filterValue,
+ setActivePage: (activePage) => activePage,
+ setNewGroupName: (newGroupName) => newGroupName,
+ setNewGroup: (newGroup) => newGroup,
+ setNewGroupFormErrors: (errors) => errors,
openNewGroupModal: () => true,
closeNewGroupModal: () => true,
closeFilterSourcesDropdown: () => true,
@@ -109,13 +109,13 @@ export const GroupsLogic = kea>({
resetGroupsFilters: () => true,
resetGroups: () => true,
initializeGroups: () => true,
- getSearchResults: (resetPagination?: boolean) => ({ resetPagination }),
- fetchGroupUsers: (groupId: string) => ({ groupId }),
+ getSearchResults: (resetPagination) => ({ resetPagination }),
+ fetchGroupUsers: (groupId) => ({ groupId }),
saveNewGroup: () => true,
},
reducers: {
groups: [
- [] as IGroup[],
+ [] as Group[],
{
setSearchResults: (_, { results }) => results,
},
diff --git a/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/overview/__mocks__/overview_logic.mock.ts b/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/overview/__mocks__/overview_logic.mock.ts
index c497e51be96a6..9befb67d3e806 100644
--- a/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/overview/__mocks__/overview_logic.mock.ts
+++ b/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/overview/__mocks__/overview_logic.mock.ts
@@ -4,8 +4,6 @@
* you may not use this file except in compliance with the Elastic License.
*/
-import { IOverviewValues } from '../overview_logic';
-
import { setMockValues as setMockKeaValues, setMockActions } from '../../../../__mocks__/kea.mock';
import { DEFAULT_INITIAL_APP_DATA } from '../../../../../../common/__mocks__';
@@ -22,7 +20,7 @@ export const mockOverviewValues = {
personalSourcesCount: 0,
sourcesCount: 0,
dataLoading: true,
-} as IOverviewValues;
+};
export const mockActions = {
initializeOverview: jest.fn(() => ({})),
diff --git a/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/overview/onboarding_card.tsx b/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/overview/onboarding_card.tsx
index 422e9b1276d4f..01539f491357a 100644
--- a/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/overview/onboarding_card.tsx
+++ b/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/overview/onboarding_card.tsx
@@ -22,7 +22,7 @@ import {
import { TelemetryLogic } from '../../../shared/telemetry';
import { getWorkplaceSearchUrl } from '../../../shared/enterprise_search_url';
-interface IOnboardingCardProps {
+interface OnboardingCardProps {
title: React.ReactNode;
icon: React.ReactNode;
description: React.ReactNode;
@@ -32,7 +32,7 @@ interface IOnboardingCardProps {
complete?: boolean;
}
-export const OnboardingCard: React.FC