-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
(cherry picked from commit 8583568) Signed-off-by: Tyler Ohlsen <[email protected]> Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
- Loading branch information
1 parent
0365306
commit d2e1695
Showing
15 changed files
with
205 additions
and
102 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
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,64 @@ | ||
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
import React, { useState } from 'react'; | ||
import { | ||
EuiBetaBadge, | ||
EuiPopover, | ||
EuiPopoverFooter, | ||
EuiPopoverTitle, | ||
EuiSmallButton, | ||
EuiText, | ||
PopoverAnchorPosition, | ||
} from '@elastic/eui'; | ||
import { GITHUB_FEEDBACK_LINK } from '../../common'; | ||
|
||
interface ExperimentalBadgeProps { | ||
popoverEnabled: boolean; | ||
popoverAnchorPosition?: PopoverAnchorPosition; | ||
} | ||
|
||
/** | ||
* Experimental/beta badge with an optional popover for users to provide feedback | ||
*/ | ||
export function ExperimentalBadge(props: ExperimentalBadgeProps) { | ||
const [popoverOpen, setPopoverOpen] = useState<boolean>(false); | ||
|
||
return props.popoverEnabled ? ( | ||
<EuiPopover | ||
button={ | ||
<EuiBetaBadge | ||
size="m" | ||
label="" | ||
iconType={'beaker'} | ||
onClick={() => setPopoverOpen(!popoverOpen)} | ||
/> | ||
} | ||
isOpen={popoverOpen} | ||
closePopover={() => setPopoverOpen(false)} | ||
panelPaddingSize="s" | ||
anchorPosition={props.popoverAnchorPosition || 'downCenter'} | ||
> | ||
<EuiPopoverTitle>EXPERIMENTAL FEATURE</EuiPopoverTitle> | ||
<EuiText style={{ width: '400px' }}> | ||
{`OpenSearch Flow is experimental and should not be used in a\n | ||
production environment.`} | ||
</EuiText> | ||
<EuiPopoverFooter> | ||
<EuiSmallButton | ||
fill={false} | ||
href={GITHUB_FEEDBACK_LINK} | ||
iconSide="right" | ||
iconType="popout" | ||
target="_blank" | ||
> | ||
Provide feedback on GitHub | ||
</EuiSmallButton> | ||
</EuiPopoverFooter> | ||
</EuiPopover> | ||
) : ( | ||
<EuiBetaBadge label="" iconType={'beaker'} /> | ||
); | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
export { registerPluginCard } from './plugin_card'; |
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,93 @@ | ||
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
import React from 'react'; | ||
import { | ||
EuiSmallButton, | ||
EuiFlexGroup, | ||
EuiFlexItem, | ||
EuiIcon, | ||
EuiTitle, | ||
} 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 pluginIcon from './icon.svg'; | ||
import { ExperimentalBadge } from '../experimental_badge'; | ||
|
||
const HEADER_TEXT = 'Design and test your search solutions with ease'; | ||
const DESCRIPTION_TEXT = | ||
'OpenSearch Flow is a visual editor for creating search AI flows to power advanced search and generative AI solutions.'; | ||
|
||
export const registerPluginCard = ( | ||
contentManagement: ContentManagementPluginStart, | ||
core: CoreStart | ||
) => { | ||
const icon = ( | ||
<EuiIcon size="original" aria-label={HEADER_TEXT} type={pluginIcon} /> | ||
); | ||
|
||
const footer = ( | ||
<EuiFlexGroup justifyContent="flexEnd"> | ||
<EuiFlexItem grow={false}> | ||
<EuiSmallButton | ||
onClick={() => { | ||
core.application.navigateToApp(PLUGIN_ID); | ||
}} | ||
> | ||
{i18n.translate('flowFrameworkDashboards.opensearchFlowCard.footer', { | ||
defaultMessage: 'Try OpenSearch Flow', | ||
})} | ||
</EuiSmallButton> | ||
</EuiFlexItem> | ||
</EuiFlexGroup> | ||
); | ||
|
||
contentManagement.registerContentProvider({ | ||
id: 'opensearch_flow_card', | ||
getContent: () => ({ | ||
id: 'opensearch_flow', | ||
kind: 'card', | ||
order: 20, | ||
getTitle: () => { | ||
return ( | ||
<EuiFlexGroup direction="row" gutterSize="xs"> | ||
<EuiFlexItem grow={false}> | ||
<EuiTitle size="s"> | ||
<h3> | ||
{i18n.translate( | ||
'flowFrameworkDashboards.opensearchFlowCard.title', | ||
{ | ||
defaultMessage: HEADER_TEXT, | ||
} | ||
)} | ||
</h3> | ||
</EuiTitle> | ||
</EuiFlexItem> | ||
<EuiFlexItem grow={false}> | ||
<ExperimentalBadge | ||
popoverEnabled={true} | ||
popoverAnchorPosition="upLeft" | ||
/> | ||
</EuiFlexItem> | ||
</EuiFlexGroup> | ||
); | ||
}, | ||
description: i18n.translate( | ||
'flowFrameworkDashboards.opensearchFlowCard.description', | ||
{ | ||
defaultMessage: DESCRIPTION_TEXT, | ||
} | ||
), | ||
getIcon: () => icon, | ||
cardProps: { | ||
children: footer, | ||
layout: 'horizontal', | ||
}, | ||
}), | ||
getTargetArea: () => 'search_overview/config_evaluate_search', | ||
}); | ||
}; |
71 changes: 0 additions & 71 deletions
71
public/general_components/service_card/search_studio_card.tsx
This file was deleted.
Oops, something went wrong.
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
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
Oops, something went wrong.