Skip to content

Commit 96602dc

Browse files
authored
Merge branch 'main' into nmazzite-RHOAIENG-58501-2
2 parents 79c490d + 1c9bfb5 commit 96602dc

40 files changed

Lines changed: 2543 additions & 196 deletions

.coderabbit.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ reviews:
1111
# Baseline already excludes: vendor, node_modules, bin, __pycache__,
1212
# *.sum, *.pb.go, *.generated.go, synced security configs
1313
- "!package-lock.json"
14-
- "!.github/**"
1514
- "!.tekton/**"
1615
- "!**/@mf-types/**"
1716
- "!**/dist/**"

frontend/src/components/TypeaheadSelect.tsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,8 @@ export interface TypeaheadSelectProps extends Omit<SelectProps, 'toggle' | 'onSe
9898
dataTestId?: string;
9999
/** Flag to indicate if showing the description under the toggle */
100100
previewDescription?: boolean;
101+
/** Optional icon rendered inside the text input */
102+
inputIcon?: React.ReactNode;
101103
}
102104

103105
const defaultNoOptionsFoundMessage = (filter: string) => `No results found for "${filter}"`;
@@ -127,6 +129,7 @@ const TypeaheadSelect: React.FunctionComponent<TypeaheadSelectProps> = ({
127129
isRequired = true,
128130
previewDescription = true,
129131
dataTestId,
132+
inputIcon,
130133
...props
131134
}: TypeaheadSelectProps) => {
132135
const [isOpen, setIsOpen] = React.useState(false);
@@ -439,9 +442,11 @@ const TypeaheadSelect: React.FunctionComponent<TypeaheadSelectProps> = ({
439442
autoComplete="off"
440443
innerRef={textInputRef}
441444
placeholder={placeholder}
445+
icon={inputIcon}
442446
{...(activeItemId && { 'aria-activedescendant': activeItemId })}
443447
role="combobox"
444448
isExpanded={isOpen}
449+
className="pf-v6-u-w-100"
445450
/>
446451
</FlexItem>
447452
{selected && selected.selectedLabel && <FlexItem>{selected.selectedLabel}</FlexItem>}

frontend/src/concepts/areas/useIsAreaAvailable.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import * as React from 'react';
22
import { AreaContext } from '#~/concepts/areas/AreaContext';
3-
import { IsAreaAvailableStatus, SupportedArea } from './types';
3+
import { IsAreaAvailableStatus, SupportedAreaType } from './types';
44

5-
const useIsAreaAvailable = (area: SupportedArea): IsAreaAvailableStatus =>
5+
const useIsAreaAvailable = (area: SupportedAreaType): IsAreaAvailableStatus =>
66
React.useContext(AreaContext).areasStatus[area] ?? {
77
status: false,
88
devFlags: null,

frontend/src/concepts/design/CollapsibleSection.tsx

Lines changed: 32 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
import * as React from 'react';
2-
import { Button, Flex, FlexItem, Content, ContentVariants } from '@patternfly/react-core';
2+
import {
3+
Button,
4+
Flex,
5+
FlexItem,
6+
Content,
7+
ContentVariants,
8+
Stack,
9+
StackItem,
10+
} from '@patternfly/react-core';
311
import { AngleDownIcon, AngleRightIcon } from '@patternfly/react-icons';
412

513
interface CollapsibleSectionProps {
@@ -26,45 +34,30 @@ const CollapsibleSection: React.FC<CollapsibleSectionProps> = ({
2634
const titleId = `${localId}-title`;
2735

2836
return (
29-
<>
30-
<Flex
31-
gap={{ default: 'gapMd' }}
32-
alignItems={{ default: 'alignItemsCenter' }}
33-
style={
34-
(open ?? innerOpen) || showChildrenWhenClosed
35-
? {
36-
marginBottom: 'var(--pf-t--global--spacer--md)',
37-
}
38-
: undefined
39-
}
40-
>
41-
<FlexItem>
42-
<Button
43-
icon={open ?? innerOpen ? <AngleDownIcon /> : <AngleRightIcon />}
44-
aria-labelledby={titleId}
45-
aria-expanded={open}
46-
variant="plain"
47-
style={{
48-
paddingLeft: 0,
49-
paddingRight: 0,
50-
fontSize:
51-
titleVariant === ContentVariants.h2
52-
? 'var(--pf-t--global--icon--size--font--heading--h2)'
53-
: 'var(--pf-t--global--icon--size--font--heading--h1)', // Could use icon--size--font--[md|lg|xl] for a smaller icon
54-
}}
55-
onClick={() => (setOpen ? setOpen(!open) : setInnerOpen((prev) => !prev))}
56-
/>
57-
</FlexItem>
58-
<FlexItem>
59-
<Content>
60-
<Content id={titleId} component={titleVariant}>
61-
{title}
37+
<Stack hasGutter>
38+
<StackItem>
39+
<Flex gap={{ default: 'gapMd' }} alignItems={{ default: 'alignItemsCenter' }}>
40+
<FlexItem>
41+
<Button
42+
icon={open ?? innerOpen ? <AngleDownIcon /> : <AngleRightIcon />}
43+
aria-labelledby={titleId}
44+
aria-expanded={open ?? innerOpen}
45+
variant="plain"
46+
className="pf-v6-u-px-0"
47+
onClick={() => (setOpen ? setOpen(!open) : setInnerOpen((prev) => !prev))}
48+
/>
49+
</FlexItem>
50+
<FlexItem>
51+
<Content>
52+
<Content id={titleId} component={titleVariant}>
53+
{title}
54+
</Content>
6255
</Content>
63-
</Content>
64-
</FlexItem>
65-
</Flex>
66-
{(open ?? innerOpen) || showChildrenWhenClosed ? children : null}
67-
</>
56+
</FlexItem>
57+
</Flex>
58+
</StackItem>
59+
{(open ?? innerOpen) || showChildrenWhenClosed ? <StackItem>{children}</StackItem> : null}
60+
</Stack>
6861
);
6962
};
7063

frontend/src/concepts/design/HeaderIcon.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ const HeaderIcon: React.FC<HeaderIconProps> = ({
2525
sectionType,
2626
}) => (
2727
<div
28+
aria-hidden
2829
style={{
2930
display,
3031
width: size,
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
import * as React from 'react';
2+
import {
3+
SectionType,
4+
sectionTypeBackgroundColor,
5+
sectionTypeIconColor,
6+
} from '#~/concepts/design/utils';
7+
8+
type SectionIconProps = {
9+
icon: React.ComponentType<{ style?: React.CSSProperties }>;
10+
sectionType: SectionType;
11+
size?: number;
12+
padding?: number;
13+
display?: string;
14+
};
15+
16+
const SectionIcon: React.FC<SectionIconProps> = ({
17+
icon: IconComponent,
18+
sectionType,
19+
size = 40,
20+
padding = 8,
21+
display = 'inline-block',
22+
}) => (
23+
<div
24+
aria-hidden
25+
style={{
26+
display,
27+
width: size,
28+
height: size,
29+
padding,
30+
borderRadius: size / 2,
31+
background: sectionTypeBackgroundColor(sectionType),
32+
color: sectionTypeIconColor(sectionType),
33+
}}
34+
>
35+
<IconComponent style={{ width: size - padding * 2, height: size - padding * 2 }} />
36+
</div>
37+
);
38+
39+
export default SectionIcon;

frontend/src/concepts/design/TypedObjectIcon.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ import {
3838
McpCatalogIcon,
3939
ModelConnectionRocketIcon,
4040
PromptManagementIcon,
41+
ChecklistIcon,
4142
} from '#~/images/icons';
4243

4344
type TypedObjectIconProps = SVGIconProps & {
@@ -170,6 +171,9 @@ const TypedObjectIcon: React.FC<TypedObjectIconProps> = ({
170171
case ProjectObjectType.mcpCatalog:
171172
Icon = McpCatalogIcon;
172173
break;
174+
case ProjectObjectType.taskAssistant:
175+
Icon = ChecklistIcon;
176+
break;
173177
default:
174178
return null;
175179
}

frontend/src/concepts/design/utils.ts

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ export enum ProjectObjectType {
7777
featureStore = 'feature-store',
7878
promptManagement = 'prompt-management',
7979
mcpCatalog = 'mcp-catalog',
80+
taskAssistant = 'task-assistant',
8081
}
8182

8283
export const typedIconColor = (objectType: ProjectObjectType): string => {
@@ -138,6 +139,8 @@ export const typedIconColor = (objectType: ProjectObjectType): string => {
138139
return 'var(--ai-model-server--IconColor)';
139140
case ProjectObjectType.servingRuntime:
140141
return 'var(--ai-set-up--IconColor)';
142+
case ProjectObjectType.taskAssistant:
143+
return 'var(--ai-general--IconColor)';
141144
default:
142145
return '';
143146
}
@@ -203,6 +206,8 @@ export const typedBackgroundColor = (objectType: ProjectObjectType): string => {
203206
return 'var(--ai-set-up--BackgroundColor)';
204207
case ProjectObjectType.servingRuntime:
205208
return 'var(--ai-set-up--BackgroundColor)';
209+
case ProjectObjectType.taskAssistant:
210+
return 'var(--ai-general--BackgroundColor)';
206211
default:
207212
return '';
208213
}
@@ -377,3 +382,20 @@ export const sectionTypeBorderColor = (sectionType: SectionType): string => {
377382
return '';
378383
}
379384
};
385+
386+
export const sectionTypeLabelColor = (
387+
sectionType: SectionType,
388+
): 'orange' | 'teal' | 'purple' | 'grey' => {
389+
switch (sectionType) {
390+
case SectionType.setup:
391+
case SectionType.organize:
392+
return 'orange';
393+
case SectionType.training:
394+
return 'teal';
395+
case SectionType.serving:
396+
return 'purple';
397+
case SectionType.general:
398+
default:
399+
return 'grey';
400+
}
401+
};
Lines changed: 71 additions & 0 deletions
Loading

0 commit comments

Comments
 (0)