Skip to content

Commit

Permalink
Rename visible plugin title (#331)
Browse files Browse the repository at this point in the history
Signed-off-by: Tyler Ohlsen <[email protected]>
  • Loading branch information
ohltyler authored Aug 30, 2024
1 parent 13ef723 commit 7284560
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 23 deletions.
4 changes: 2 additions & 2 deletions common/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
import { MapEntry, QueryPreset, WORKFLOW_STATE } from './interfaces';
import { customStringify } from './utils';

export const PLUGIN_ID = 'flow-framework';
export const SEARCH_STUDIO = 'Search Studio';
export const PLUGIN_ID = 'search-studio';
export const PLUGIN_NAME = 'Search Studio';

/**
* BACKEND FLOW FRAMEWORK APIs
Expand Down
2 changes: 1 addition & 1 deletion public/app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ export const FlowFrameworkDashboardsApp = (props: Props) => {
style={{ width: 190 }}
items={[
{
name: Navigation.FlowFramework,
name: Navigation.PluginName,
id: 0,
items: [
{
Expand Down
2 changes: 1 addition & 1 deletion public/pages/workflow_detail/workflow_detail.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ export function WorkflowDetail(props: WorkflowDetailProps) {
{ text: '' },
]
: [
BREADCRUMBS.FLOW_FRAMEWORK,
BREADCRUMBS.PLUGIN_NAME,
BREADCRUMBS.WORKFLOWS(dataSourceEnabled ? dataSourceId : undefined),
{ text: workflowName },
]
Expand Down
17 changes: 9 additions & 8 deletions public/pages/workflows/workflows.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import { WorkflowList } from './workflow_list';
import { NewWorkflow } from './new_workflow';
import { AppState, searchWorkflows, useAppDispatch } from '../../store';
import { EmptyListMessage } from './empty_list_message';
import { FETCH_ALL_QUERY, SEARCH_STUDIO } from '../../../common';
import { FETCH_ALL_QUERY, PLUGIN_NAME } from '../../../common';
import { ImportWorkflowModal } from './import_workflow';
import { MountPoint } from '../../../../../src/core/public';
import { DataSourceSelectableConfig } from '../../../../../src/plugins/data_source_management/public';
Expand Down Expand Up @@ -131,7 +131,7 @@ export function Workflows(props: WorkflowsProps) {
SHOW_ACTIONS_IN_HEADER
? [BREADCRUMBS.TITLE]
: [
BREADCRUMBS.FLOW_FRAMEWORK,
BREADCRUMBS.PLUGIN_NAME,
BREADCRUMBS.WORKFLOWS(dataSourceEnabled ? dataSourceId : undefined),
]
);
Expand Down Expand Up @@ -204,24 +204,25 @@ export function Workflows(props: WorkflowsProps) {
);
}, [getSavedObjectsClient, getNotifications(), props.setActionMenu]);
}
const description =
'Design, experiment, and prototype your solutions with workflows. Build your search and last mile ingestion flows.';
const DESCRIPTION = `Design, experiment, and prototype your solutions with ${PLUGIN_NAME}. Build your search and last mile
ingestion flows with a visual interface. Experiment with different configurations with prototyping tools and launch them
into your environment.`;

const pageTitleAndDescription = SHOW_ACTIONS_IN_HEADER ? (
<HeaderControl
controls={[
{
description:
'Design, experiment, and prototype your solutions with Search Studio. Build your search and last mile ingestion flows with a visual interface. Experiment different configurations with prototyping tools and launch them into your environment.',
description: DESCRIPTION,
},
]}
setMountPoint={setAppDescriptionControls}
/>
) : (
<EuiFlexGroup direction="column" style={{ margin: '0px' }}>
<EuiTitle size="l">
<h1>{SEARCH_STUDIO}</h1>
<h1>{PLUGIN_NAME}</h1>
</EuiTitle>
<EuiText color="subdued">{description}</EuiText>
<EuiText color="subdued">{DESCRIPTION}</EuiText>
</EuiFlexGroup>
);

Expand Down
6 changes: 3 additions & 3 deletions public/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import {
FlowFrameworkDashboardsPluginSetup,
AppPluginStartDependencies,
} from './types';
import { PLUGIN_ID, SEARCH_STUDIO } from '../common';
import { PLUGIN_ID, PLUGIN_NAME } from '../common';
import {
setCore,
setRouteService,
Expand Down Expand Up @@ -45,7 +45,7 @@ export class FlowFrameworkDashboardsPlugin
// Register the plugin in the side navigation
core.application.register({
id: PLUGIN_ID,
title: 'Flow Framework',
title: PLUGIN_NAME,
category: {
id: 'opensearch',
label: 'OpenSearch plugins',
Expand All @@ -67,7 +67,7 @@ export class FlowFrameworkDashboardsPlugin
core.chrome.navGroup.addNavLinksToGroup(DEFAULT_NAV_GROUPS.search, [
{
id: PLUGIN_ID,
title: SEARCH_STUDIO,
title: PLUGIN_NAME,
category: DEFAULT_APP_CATEGORIES.configure,
showInAllNavGroup: true,
},
Expand Down
7 changes: 4 additions & 3 deletions public/render_app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import { Provider } from 'react-redux';
import { AppMountParameters, CoreStart } from '../../../src/core/public';
import { FlowFrameworkDashboardsApp } from './app';
import { store } from './store';
import { PLUGIN_ID } from '../common';

// styling
import './global-styles.scss';
Expand Down Expand Up @@ -38,14 +39,14 @@ export const renderApp = (
params.element
);

const expectedBasePath = '/app/flow-framework#';
const EXPECTED_BASE_PATH = `/app/${PLUGIN_ID}#`;

const unlistenParentHistory = params.history.listen(() => {
if (
hideInAppSideNavBar &&
window.location.pathname.endsWith('/app/flow-framework')
window.location.pathname.endsWith(`/app/${PLUGIN_ID}`)
) {
window.location.href = `${expectedBasePath}`;
window.location.href = EXPECTED_BASE_PATH;
window.dispatchEvent(new HashChangeEvent('hashchange'));
}
});
Expand Down
10 changes: 5 additions & 5 deletions public/utils/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@

import { constructHrefWithDataSourceId } from './utils';
import { getUISettings } from '../../public/services';
import { SEARCH_STUDIO } from '../../common/constants';
import { PLUGIN_NAME } from '../../common/constants';

export enum Navigation {
FlowFramework = 'Flow Framework',
PluginName = PLUGIN_NAME,
Workflows = 'Workflows',
}

Expand All @@ -19,14 +19,14 @@ export enum APP_PATH {
}

export const BREADCRUMBS = Object.freeze({
FLOW_FRAMEWORK: { text: 'Flow Framework' },
PLUGIN_NAME: { text: PLUGIN_NAME },
WORKFLOWS: (dataSourceId?: string) => ({
text: 'Workflows',
href: constructHrefWithDataSourceId(APP_PATH.WORKFLOWS, dataSourceId),
}),
TITLE: { text: SEARCH_STUDIO },
TITLE: { text: PLUGIN_NAME },
TITLE_WITH_REF: (dataSourceId?: string) => ({
text: SEARCH_STUDIO,
text: PLUGIN_NAME,
href: constructHrefWithDataSourceId(APP_PATH.WORKFLOWS, dataSourceId),
}),
WORKFLOW_NAME: (workflowName: string) => ({
Expand Down

0 comments on commit 7284560

Please sign in to comment.