[Workplace Search] Fix Private Dashboard routes (#88985)

* Add index route for personal dashboard

* Fix links to personal source flow

In ent-search, the base route was /sources so the getSourcesPath helper was not needed. In Kibana, we use the ‘/p’ route to differentiate personal from org so the helper is needed and we pass false as the isOrganization flag

* Remove legacy sidebar text

When I first migrated this, I left the sidebar copy in so that it was not aboandoned before the design pass. After talking with John we decided to just use the copy to the right of the sidebar so this drops that legacy copy.

* Remove constants

* Remove legacy sidebar link

* Revert "Remove legacy sidebar text"

This reverts commit 8c8a3fb63c.

* Revert "Remove constants"

This reverts commit a88723ec90.

* Revert "Remove legacy sidebar link"

This reverts commit 5d08a12a7d.

* Update TODO

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
This commit is contained in:
Scotty Bollinger 2021-01-26 13:09:53 -06:00 committed by GitHub
parent ecf512a048
commit 7bb8d3a7b2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 14 additions and 3 deletions

View file

@ -78,6 +78,12 @@ export const WorkplaceSearchConfigured: React.FC<InitialAppData> = (props) => {
<Route exact path="/">
{errorConnecting ? <ErrorState /> : <Overview />}
</Route>
<Route path={PERSONAL_SOURCES_PATH}>
{/* TODO: replace Layout with PrivateSourcesLayout (needs to be created) */}
<Layout navigation={<></>} restrictWidth readOnlyMode={readOnlyMode}>
<SourcesRouter />
</Layout>
</Route>
<Route path={SOURCES_PATH}>
<Layout
navigation={<WorkplaceSearchNav sourcesSubNav={showSourcesSubnav && <SourceSubNav />} />}

View file

@ -12,7 +12,7 @@ import { EuiCallOut, EuiEmptyPrompt, EuiSpacer, EuiPanel } from '@elastic/eui';
import { LicensingLogic } from '../../../../applications/shared/licensing';
import { ADD_SOURCE_PATH } from '../../routes';
import { ADD_SOURCE_PATH, getSourcesPath } from '../../routes';
import noSharedSourcesIcon from '../../assets/share_circle.svg';
@ -74,12 +74,17 @@ export const PrivateSources: React.FC = () => {
sidebarLinks.push({
title: PRIVATE_LINK_TITLE,
iconType: 'plusInCircle',
path: ADD_SOURCE_PATH,
path: getSourcesPath(ADD_SOURCE_PATH, false),
});
}
const headerAction = (
<EuiButtonTo to={ADD_SOURCE_PATH} fill color="primary" data-test-subj="AddSourceButton">
<EuiButtonTo
to={getSourcesPath(ADD_SOURCE_PATH, false)}
fill
color="primary"
data-test-subj="AddSourceButton"
>
{PRIVATE_LINK_TITLE}
</EuiButtonTo>
);