Skip to content

Commit

Permalink
[Workplace Search] Remove groups user management and filter (elastic#…
Browse files Browse the repository at this point in the history
…104734)

* Remove TableFilterUsersDropdown

* Update button to point to users and roles

* Remove modal and group users logic

* Remove route

* Remove i18n translations
  • Loading branch information
scottybollinger authored and kibanamachine committed Jul 8, 2021
1 parent 0562f40 commit a1e0c4e
Show file tree
Hide file tree
Showing 17 changed files with 8 additions and 425 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,11 @@ import { GroupDetails, SourcePriority } from '../../../types';
export const mockGroupValues = {
group: {} as GroupDetails,
dataLoading: true,
manageUsersModalVisible: false,
managerModalFormErrors: [],
sharedSourcesModalVisible: false,
confirmDeleteModalVisible: false,
groupNameInputValue: '',
selectedGroupSources: [],
selectedGroupUsers: [],
groupPrioritiesUnchanged: true,
activeSourcePriorities: {} as SourcePriority,
cachedSourcePriorities: {} as SourcePriority,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ import { GroupOverview } from './group_overview';

const deleteGroup = jest.fn();
const showSharedSourcesModal = jest.fn();
const showManageUsersModal = jest.fn();
const showConfirmDeleteModal = jest.fn();
const hideConfirmDeleteModal = jest.fn();
const updateGroupName = jest.fn();
Expand All @@ -39,7 +38,6 @@ describe('GroupOverview', () => {
setMockActions({
deleteGroup,
showSharedSourcesModal,
showManageUsersModal,
showConfirmDeleteModal,
hideConfirmDeleteModal,
updateGroupName,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,14 @@ import {
} from '@elastic/eui';
import { i18n } from '@kbn/i18n';

import { EuiButtonTo } from '../../../../shared/react_router_helpers';
import { TruncatedContent } from '../../../../shared/truncate';
import noSharedSourcesIcon from '../../../assets/share_circle.svg';
import { WorkplaceSearchPageTemplate } from '../../../components/layout';
import { ContentSection } from '../../../components/shared/content_section';
import { SourcesTable } from '../../../components/shared/sources_table';
import { NAV, CANCEL_BUTTON } from '../../../constants';
import { USERS_AND_ROLES_PATH } from '../../../routes';
import { GroupLogic, MAX_NAME_LENGTH } from '../group_logic';

import { GroupUsersTable } from './group_users_table';
Expand Down Expand Up @@ -60,7 +62,7 @@ const MANAGE_SOURCES_BUTTON_TEXT = i18n.translate(
const MANAGE_USERS_BUTTON_TEXT = i18n.translate(
'xpack.enterpriseSearch.workplaceSearch.groups.overview.manageUsersButtonText',
{
defaultMessage: 'Manage users',
defaultMessage: 'Manage users and roles',
}
);
const NAME_SECTION_TITLE = i18n.translate(
Expand Down Expand Up @@ -110,7 +112,6 @@ export const GroupOverview: React.FC = () => {
const {
deleteGroup,
showSharedSourcesModal,
showManageUsersModal,
showConfirmDeleteModal,
hideConfirmDeleteModal,
updateGroupName,
Expand Down Expand Up @@ -165,9 +166,9 @@ export const GroupOverview: React.FC = () => {
</EuiButton>
);
const manageUsersButton = (
<EuiButton color="primary" onClick={showManageUsersModal}>
<EuiButtonTo color="primary" to={USERS_AND_ROLES_PATH}>
{MANAGE_USERS_BUTTON_TEXT}
</EuiButton>
</EuiButtonTo>
);
const sourcesTable = <SourcesTable sources={contentSources} />;

Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import { shallow } from 'enzyme';
import { EuiFieldSearch } from '@elastic/eui';

import { TableFilterSourcesDropdown } from './table_filter_sources_dropdown';
import { TableFilterUsersDropdown } from './table_filter_users_dropdown';
import { TableFilters } from './table_filters';

const setFilterValue = jest.fn();
Expand All @@ -29,7 +28,6 @@ describe('TableFilters', () => {

expect(wrapper.find(EuiFieldSearch)).toHaveLength(1);
expect(wrapper.find(TableFilterSourcesDropdown)).toHaveLength(1);
expect(wrapper.find(TableFilterUsersDropdown)).toHaveLength(1);
});

it('handles search input value change', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ import { i18n } from '@kbn/i18n';
import { GroupsLogic } from '../groups_logic';

import { TableFilterSourcesDropdown } from './table_filter_sources_dropdown';
import { TableFilterUsersDropdown } from './table_filter_users_dropdown';

const FILTER_GROUPS_PLACEHOLDER = i18n.translate(
'xpack.enterpriseSearch.workplaceSearch.groups.filterGroups.placeholder',
Expand Down Expand Up @@ -45,9 +44,6 @@ export const TableFilters: React.FC = () => {
<EuiFlexItem className="user-groups-filters__filter-sources">
<TableFilterSourcesDropdown />
</EuiFlexItem>
<EuiFlexItem>
<TableFilterUsersDropdown />
</EuiFlexItem>
</EuiFlexGroup>
</EuiFlexItem>
</EuiFlexGroup>
Expand Down
Loading

0 comments on commit a1e0c4e

Please sign in to comment.