mirror of https://github.com/buster-so/buster.git
no items test
This commit is contained in:
parent
0b37b96377
commit
3f8a733def
|
@ -208,52 +208,3 @@ export const NoShortcuts: Story = {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
export const CustomPrompts: Story = {
|
|
||||||
args: {
|
|
||||||
defaultValue: '',
|
|
||||||
onSubmit: fn(),
|
|
||||||
onStop: fn(),
|
|
||||||
submitting: false,
|
|
||||||
disabled: false,
|
|
||||||
shortcuts: mockShortcuts,
|
|
||||||
suggestedPrompts: {
|
|
||||||
report: [
|
|
||||||
'Create a detailed financial summary for stakeholders',
|
|
||||||
'Generate monthly performance metrics report',
|
|
||||||
'Analyze year-over-year growth trends',
|
|
||||||
'Compile customer satisfaction survey results',
|
|
||||||
'Prepare executive dashboard summary',
|
|
||||||
],
|
|
||||||
dashboard: [
|
|
||||||
'Build an interactive sales performance dashboard',
|
|
||||||
'Create a real-time inventory monitoring dashboard',
|
|
||||||
'Design customer analytics dashboard',
|
|
||||||
'Set up operational KPI dashboard',
|
|
||||||
'Develop marketing campaign performance dashboard',
|
|
||||||
],
|
|
||||||
visualization: [
|
|
||||||
'Show revenue trends by product category',
|
|
||||||
'Create geographic sales distribution map',
|
|
||||||
'Visualize customer journey funnel',
|
|
||||||
'Display seasonal demand patterns',
|
|
||||||
'Chart employee productivity metrics',
|
|
||||||
],
|
|
||||||
help: [
|
|
||||||
'What data visualization options are available?',
|
|
||||||
'How do I create custom metrics?',
|
|
||||||
'What are the best practices for dashboard design?',
|
|
||||||
'Can you explain predictive analytics features?',
|
|
||||||
'How do I share reports with my team?',
|
|
||||||
],
|
|
||||||
},
|
|
||||||
},
|
|
||||||
parameters: {
|
|
||||||
docs: {
|
|
||||||
description: {
|
|
||||||
story:
|
|
||||||
'Chat input with custom suggested prompts - demonstrates how the component handles larger sets of suggestions (ensures 4 unique samples are selected).',
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
};
|
|
||||||
|
|
|
@ -109,7 +109,7 @@ export const BusterChatInputButtons = React.memo(
|
||||||
)}
|
)}
|
||||||
<AppTooltip
|
<AppTooltip
|
||||||
delayDuration={disableSubmit ? 500 : 0}
|
delayDuration={disableSubmit ? 500 : 0}
|
||||||
title={disableSubmit ? 'Please type something...' : 'Submit'}
|
title={disableSubmit ? 'Please type something...' : submitting ? null : 'Submit'}
|
||||||
>
|
>
|
||||||
<Button
|
<Button
|
||||||
rounding={'large'}
|
rounding={'large'}
|
||||||
|
|
|
@ -39,34 +39,39 @@ export const useCreateShortcutsMentionsSuggestions = (
|
||||||
trigger: SHORTCUT_MENTION_TRIGGER,
|
trigger: SHORTCUT_MENTION_TRIGGER,
|
||||||
items: ({ defaultQueryMentionsFilter, editor, query }) => {
|
items: ({ defaultQueryMentionsFilter, editor, query }) => {
|
||||||
const shortcuts = currentItemsRef.current;
|
const shortcuts = currentItemsRef.current;
|
||||||
const allItems: MentionInputTriggerItem[] = [
|
const allItems: MentionInputTriggerItem[] = [];
|
||||||
{
|
if (shortcuts.length > 0) {
|
||||||
|
allItems.push({
|
||||||
type: 'group',
|
type: 'group',
|
||||||
items: shortcuts.map((s) => createShortcutForMention(s, editor)),
|
items: shortcuts.map((s) => createShortcutForMention(s, editor)),
|
||||||
className: 'max-h-[300px] overflow-y-auto',
|
className: 'max-h-[300px] overflow-y-auto',
|
||||||
},
|
});
|
||||||
{ type: 'separator' as const },
|
allItems.push({ type: 'separator' as const });
|
||||||
{
|
}
|
||||||
value: 'manageShortcuts',
|
allItems.push(
|
||||||
label: 'Manage shortcuts',
|
...[
|
||||||
icon: <PenWriting />,
|
{
|
||||||
doNotAddPipeOnSelect: true,
|
value: 'manageShortcuts',
|
||||||
onSelect: () => {
|
label: 'Manage shortcuts',
|
||||||
navigate({
|
icon: <PenWriting />,
|
||||||
to: '/app/home/shortcuts',
|
doNotAddPipeOnSelect: true,
|
||||||
});
|
onSelect: () => {
|
||||||
|
navigate({
|
||||||
|
to: '/app/home/shortcuts',
|
||||||
|
});
|
||||||
|
},
|
||||||
},
|
},
|
||||||
},
|
{
|
||||||
{
|
value: 'createShortcut',
|
||||||
value: 'createShortcut',
|
label: 'Create shortcut',
|
||||||
label: 'Create shortcut',
|
icon: <Plus />,
|
||||||
icon: <Plus />,
|
doNotAddPipeOnSelect: true,
|
||||||
doNotAddPipeOnSelect: true,
|
onSelect: () => {
|
||||||
onSelect: () => {
|
setOpenCreateShortcutModal(true);
|
||||||
setOpenCreateShortcutModal(true);
|
},
|
||||||
},
|
},
|
||||||
},
|
]
|
||||||
];
|
);
|
||||||
return defaultQueryMentionsFilter(query, allItems);
|
return defaultQueryMentionsFilter(query, allItems);
|
||||||
},
|
},
|
||||||
popoverContent: ShortcutPopoverContent,
|
popoverContent: ShortcutPopoverContent,
|
||||||
|
|
Loading…
Reference in New Issue