Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Workplace Search] Design polish: Groups, Security and Custom source #96870

Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,10 @@ export const SaveCustom: React.FC<SaveCustomProps> = ({
}) => (
<>
{header}
<EuiSpacer />
<EuiFlexGroup direction="row">
<EuiFlexItem grow={2}>
<EuiPanel paddingSize="l">
<EuiPanel paddingSize="l" hasShadow={false} color="subdued">
<EuiFlexGroup direction="column" alignItems="center" responsive={false}>
<EuiFlexItem>
<EuiIcon type="checkInCircleFilled" color="#42CC89" size="xxl" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,12 @@ import { useActions, useValues } from 'kea';
import {
EuiButton,
EuiConfirmModal,
EuiEmptyPrompt,
EuiFieldText,
EuiFlexGroup,
EuiFlexItem,
EuiFormRow,
EuiPanel,
EuiSpacer,
EuiHorizontalRule,
} from '@elastic/eui';
Expand All @@ -24,6 +26,7 @@ import { i18n } from '@kbn/i18n';
import { Loading } from '../../../../shared/loading';
import { TruncatedContent } from '../../../../shared/truncate';
import { AppLogic } from '../../../app_logic';
import noSharedSourcesIcon from '../../../assets/share_circle.svg';
import { ContentSection } from '../../../components/shared/content_section';
import { SourcesTable } from '../../../components/shared/sources_table';
import { ViewContentHeader } from '../../../components/shared/view_content_header';
Expand Down Expand Up @@ -145,6 +148,12 @@ export const GroupOverview: React.FC = () => {
values: { name },
}
);
const GROUP_SOURCES_TITLE = i18n.translate(
'xpack.enterpriseSearch.workplaceSearch.groups.overview.groupSourcesTitle',
{
defaultMessage: 'Group content sources',
}
);
const GROUP_SOURCES_DESCRIPTION = i18n.translate(
'xpack.enterpriseSearch.workplaceSearch.groups.overview.groupSourcesDescription',
{
Expand All @@ -170,15 +179,29 @@ export const GroupOverview: React.FC = () => {

const sourcesSection = (
<ContentSection
title="Group content sources"
description={hasContentSources ? GROUP_SOURCES_DESCRIPTION : EMPTY_SOURCES_DESCRIPTION}
title={GROUP_SOURCES_TITLE}
description={GROUP_SOURCES_DESCRIPTION}
action={manageSourcesButton}
data-test-subj="GroupContentSourcesSection"
>
{hasContentSources && sourcesTable}
{sourcesTable}
</ContentSection>
);

const sourcesEmptyState = (
<>
<EuiPanel paddingSize="none" color="subdued">
<EuiEmptyPrompt
iconType={noSharedSourcesIcon}
title={<h2>{GROUP_SOURCES_TITLE}</h2>}
body={<p>{EMPTY_SOURCES_DESCRIPTION}</p>}
actions={manageSourcesButton}
/>
</EuiPanel>
<EuiSpacer />
</>
);

const usersSection = !isFederatedAuth && (
<ContentSection
title="Group users"
Expand Down Expand Up @@ -252,7 +275,7 @@ export const GroupOverview: React.FC = () => {
<>
<ViewContentHeader title={truncatedName} />
<EuiSpacer />
{sourcesSection}
{hasContentSources ? sourcesSection : sourcesEmptyState}
{usersSection}
{nameSection}
{canDeleteGroup && deleteSection}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ export const Groups: React.FC = () => {
messages[0].description = (
<EuiButtonTo
to={getGroupPath(newGroup.id)}
color="primary"
color="secondary"
data-test-subj="NewGroupManageButton"
>
{i18n.translate('xpack.enterpriseSearch.workplaceSearch.groups.newGroup.action', {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ export const PrivateSourcesTable: React.FC<PrivateSourcesTableProps> = ({
{contentSources.map((source, i) => (
<EuiTableRow key={i}>
<EuiTableRowCell>{source.name}</EuiTableRowCell>
<EuiTableRowCell>
<EuiTableRowCell align="right">
<EuiSwitch
checked={!!source.isEnabled}
disabled={sectionDisabled}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ export const Security: React.FC = () => {
<EuiPanel
paddingSize="none"
hasShadow={false}
color="subdued"
className={classNames({
'euiPanel--disabled': !hasPlatinumLicense,
})}
Expand Down Expand Up @@ -187,9 +188,11 @@ export const Security: React.FC = () => {
messageText={SECURITY_UNSAVED_CHANGES_MESSAGE}
/>
{header}
{allSourcesToggle}
{!hasPlatinumLicense && platinumLicenseCallout}
{sourceTables}
<EuiPanel color="subdued" hasBorder={false}>
{allSourcesToggle}
{!hasPlatinumLicense && platinumLicenseCallout}
{sourceTables}
</EuiPanel>
{confirmModalVisible && confirmModal}
</>
);
Expand Down