Skip to content

Commit

Permalink
[Workplace Search] Fix button order and remove extra source name label (
Browse files Browse the repository at this point in the history
#114899) (#114925)

* Remove extra source title from Personal dashboard

* Change button order to match other views

We typically have the right-most button the Save button and the reset button to the left

* Fix typo

* Fix failing test

EUI requires the name but we don’t want to dispaly it, so sending an empty string

* Remove Synchronization nav items from Custom Source

* Hide syncTriggerCallout for custom sources

Co-authored-by: Scotty Bollinger <[email protected]>
  • Loading branch information
kibanamachine and scottybollinger authored Oct 14, 2021
1 parent b35bc8c commit fbe1b58
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,10 @@ export const PrivateSourcesSidebar = () => {
: PRIVATE_VIEW_ONLY_PAGE_DESCRIPTION;

const {
contentSource: { id = '', name = '' },
contentSource: { id = '' },
} = useValues(SourceLogic);

const navItems = [{ id, name, items: useSourceSubNav() }];
const navItems = [{ id, name: '', items: useSourceSubNav() }];

return (
<>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ export const Overview: React.FC = () => {
const [isModalVisible, setIsModalVisible] = useState(false);
const closeModal = () => setIsModalVisible(false);
const handleSyncClick = () => setIsModalVisible(true);
const showSyncTriggerCallout = !custom && isIndexedSource && isOrganization;

const onSyncConfirm = () => {
initializeSourceSynchronization(id);
Expand Down Expand Up @@ -491,7 +492,7 @@ export const Overview: React.FC = () => {
<EuiText size="s">
<FormattedMessage
id="xpack.enterpriseSearch.workplaceSearch.sources.synchronizationCallout"
defaultMessage="Configure {syncFrequencyLink} or permissions {blockTimeWindowsLink}."
defaultMessage="Configure {syncFrequencyLink} or {blockTimeWindowsLink}."
values={{
syncFrequencyLink: (
<EuiLinkTo to={getContentSourcePath(SYNC_FREQUENCY_PATH, id, isOrganization)}>
Expand Down Expand Up @@ -586,7 +587,7 @@ export const Overview: React.FC = () => {
)}
</>
)}
{isIndexedSource && isOrganization && syncTriggerCallout}
{showSyncTriggerCallout && syncTriggerCallout}
</EuiFlexGroup>
</EuiFlexItem>
</EuiFlexGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export const useSourceSubNav = () => {
if (!id) return undefined;

const isCustom = serviceType === CUSTOM_SERVICE_TYPE;
const showSynchronization = isIndexedSource && isOrganization;
const showSynchronization = isIndexedSource && isOrganization && !isCustom;

const navItems: Array<EuiSideNavItemType<unknown>> = [
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,6 @@ export const Security: React.FC = () => {
};

const headerActions = [
<EuiButtonEmpty disabled={!unsavedChanges || dataLoading} onClick={resetState}>
{RESET_BUTTON}
</EuiButtonEmpty>,
<EuiButton
disabled={!hasPlatinumLicense || !unsavedChanges || dataLoading}
onClick={showConfirmModal}
Expand All @@ -86,6 +83,9 @@ export const Security: React.FC = () => {
>
{SAVE_SETTINGS_BUTTON}
</EuiButton>,
<EuiButtonEmpty disabled={!unsavedChanges || dataLoading} onClick={resetState}>
{RESET_BUTTON}
</EuiButtonEmpty>,
];

const allSourcesToggle = (
Expand Down

0 comments on commit fbe1b58

Please sign in to comment.