forked from opensearch-project/dashboards-flow-framework
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding Search Studio card in Search Overview Page (opensearch-project…
…#349) Signed-off-by: saimedhi <[email protected]>
- Loading branch information
Showing
5 changed files
with
127 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
67 changes: 67 additions & 0 deletions
67
public/general_components/service_card/search_studio_card.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
import React from 'react'; | ||
import { EuiButton, EuiFlexGroup, EuiFlexItem, EuiIcon } from '@elastic/eui'; | ||
import { i18n } from '@osd/i18n'; | ||
import { PLUGIN_ID } from '../../../common'; | ||
import { ContentManagementPluginStart } from '../../../../../src/plugins/content_management/public'; | ||
import { CoreStart } from '../../../../../src/core/public'; | ||
import searchStudioIcon from './icon.svg'; | ||
|
||
export const registerSearchStudioCard = ( | ||
contentManagement: ContentManagementPluginStart, | ||
core: CoreStart | ||
) => { | ||
const icon = ( | ||
<EuiIcon | ||
size="original" | ||
aria-label="Design and test your search solutions with ease" | ||
type={searchStudioIcon} | ||
/> | ||
); | ||
|
||
const footer = ( | ||
<EuiFlexGroup justifyContent="flexEnd"> | ||
<EuiFlexItem grow={false}> | ||
<EuiButton | ||
size="s" | ||
onClick={() => { | ||
core.application.navigateToApp(PLUGIN_ID); | ||
}} | ||
> | ||
{i18n.translate('flowFrameworkDashboards.searchStudioCard.footer', { | ||
defaultMessage: 'Try OpenSearch Studio', | ||
})} | ||
</EuiButton> | ||
</EuiFlexItem> | ||
</EuiFlexGroup> | ||
); | ||
|
||
contentManagement.registerContentProvider({ | ||
id: 'search_studio_card', | ||
getContent: () => ({ | ||
id: 'search_studio', | ||
kind: 'card', | ||
order: 20, | ||
title: i18n.translate('flowFrameworkDashboards.searchStudioCard.title', { | ||
defaultMessage: 'Design and test your search solutions with ease', | ||
}), | ||
description: i18n.translate( | ||
'flowFrameworkDashboards.searchStudioCard.description', | ||
{ | ||
defaultMessage: | ||
'OpenSearch Studio is a visual editor for creating search AI flows to power advanced search and generative AI solutions.', | ||
} | ||
), | ||
getIcon: () => icon, | ||
cardProps: { | ||
children: footer, | ||
layout: 'horizontal', | ||
}, | ||
}), | ||
getTargetArea: () => 'search_overview/config_evaluate_search', | ||
}); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters