Skip to content

Commit

Permalink
fix: fix automated analysis view in recording table
Browse files Browse the repository at this point in the history
  • Loading branch information
tthvo committed Aug 8, 2024
1 parent 0cb9ea7 commit cf70dbe
Show file tree
Hide file tree
Showing 3 changed files with 107 additions and 79 deletions.
93 changes: 55 additions & 38 deletions src/app/Recordings/ActiveRecordingsTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,11 @@ import {
ToolbarContent,
ToolbarGroup,
ToolbarItem,
Divider,
Panel,
PanelHeader,
PanelMain,
PanelMainBody,
} from '@patternfly/react-core';
import { EllipsisVIcon, RedoIcon } from '@patternfly/react-icons';
import { ExpandableRowContent, SortByDirection, Tbody, Td, Tr } from '@patternfly/react-table';
Expand Down Expand Up @@ -1019,44 +1024,56 @@ export const ActiveRecordingRow: React.FC<ActiveRecordingRowProps> = ({
<Tr key={`${index}_child`} isExpanded={isExpanded}>
<Td key={`active-ex-expand-${index}`} dataLabel={'Content Details'} colSpan={tableColumns.length + 3}>
<ExpandableRowContent>
<Title headingLevel={'h5'}>
<Button
variant="plain"
size="sm"
isDisabled={loadingAnalysis}
onClick={handleLoadAnalysis}
icon={<RedoIcon />}
/>
Automated analysis
</Title>
<Grid>
{loadingAnalysis ? (
<Bullseye>
<Spinner />
</Bullseye>
) : (
analyses.map(([topic, evaluations]) => {
return (
<GridItem className="automated-analysis-grid-item" span={2} key={`gridItem-${topic}`}>
<LabelGroup
className="automated-analysis-topic-label-groups"
categoryName={topic}
isVertical
numLabels={2}
isCompact
key={topic}
>
{evaluations.map((evaluation) => {
return (
<ClickableAutomatedAnalysisLabel result={evaluation} key={clickableAutomatedAnalysisKey} />
);
})}
</LabelGroup>
</GridItem>
);
})
)}
</Grid>
<Panel>
<PanelHeader>
<Title headingLevel={'h5'}>
Automated analysis
<Button
variant="plain"
size="sm"
isDisabled={loadingAnalysis}
onClick={handleLoadAnalysis}
icon={<RedoIcon />}
/>
</Title>
</PanelHeader>
<Divider />
<PanelMain>
<PanelMainBody>
<Grid>
{loadingAnalysis ? (
<Bullseye>
<Spinner />
</Bullseye>
) : (
analyses.map(([topic, evaluations]) => {
return (
<GridItem className="automated-analysis-grid-item" span={2} key={`gridItem-${topic}`}>
<LabelGroup
className="automated-analysis-topic-label-groups"
categoryName={topic}
isVertical
numLabels={2}
isCompact
key={topic}
>
{evaluations.map((evaluation) => {
return (
<ClickableAutomatedAnalysisLabel
result={evaluation}
key={clickableAutomatedAnalysisKey}
/>
);
})}
</LabelGroup>
</GridItem>
);
})
)}
</Grid>
</PanelMainBody>
</PanelMain>
</Panel>
</ExpandableRowContent>
</Td>
</Tr>
Expand Down
75 changes: 46 additions & 29 deletions src/app/Recordings/ArchivedRecordingsTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,11 @@ import {
DropdownList,
MenuToggle,
MenuToggleElement,
PanelHeader,
Divider,
Panel,
PanelMain,
PanelMainBody,
} from '@patternfly/react-core';
import { UploadIcon, EllipsisVIcon } from '@patternfly/react-icons';
import { Tbody, Tr, Td, ExpandableRowContent, Table, SortByDirection } from '@patternfly/react-table';
Expand Down Expand Up @@ -942,35 +947,47 @@ export const ArchivedRecordingRow: React.FC<ArchivedRecordingRowProps> = ({
<Tr key={`${index}_child`} isExpanded={isExpanded}>
<Td key={`archived-ex-expand-${index}`} dataLabel={'Content Details'} colSpan={tableColumns.length + 3}>
<ExpandableRowContent>
<Title headingLevel={'h5'}>Automated analysis</Title>
<Grid>
{loadingAnalysis ? (
<Bullseye>
<Spinner />
</Bullseye>
) : (
analyses.map(([topic, evaluations]) => {
return (
<GridItem className="automated-analysis-grid-item" span={2} key={`gridItem-${topic}`}>
<LabelGroup
className="automated-analysis-topic-label-groups"
categoryName={topic}
isVertical
numLabels={2}
isCompact
key={topic}
>
{evaluations.map((evaluation) => {
return (
<ClickableAutomatedAnalysisLabel result={evaluation} key={clickableAutomatedAnalysisKey} />
);
})}
</LabelGroup>
</GridItem>
);
})
)}
</Grid>
<Panel>
<PanelHeader>
<Title headingLevel={'h5'}>Automated analysis</Title>
</PanelHeader>
<Divider />
<PanelMain>
<PanelMainBody>
<Grid>
{loadingAnalysis ? (
<Bullseye>
<Spinner />
</Bullseye>
) : (
analyses.map(([topic, evaluations]) => {
return (
<GridItem className="automated-analysis-grid-item" span={2} key={`gridItem-${topic}`}>
<LabelGroup
className="automated-analysis-topic-label-groups"
categoryName={topic}
isVertical
numLabels={2}
isCompact
key={topic}
>
{evaluations.map((evaluation) => {
return (
<ClickableAutomatedAnalysisLabel
result={evaluation}
key={clickableAutomatedAnalysisKey}
/>
);
})}
</LabelGroup>
</GridItem>
);
})
)}
</Grid>
</PanelMainBody>
</PanelMain>
</Panel>
</ExpandableRowContent>
</Td>
</Tr>
Expand Down
18 changes: 6 additions & 12 deletions src/app/app.css
Original file line number Diff line number Diff line change
Expand Up @@ -280,26 +280,20 @@ html, body, #root {
color: var(--pf-v5-global--danger-color--100);
}

.automated-analysis-grid-item .pf-v5-c-label-group__main {
.automated-analysis-grid-item .pf-v5-c-label-group {
width: 100%;
height: 100%;
background-color: var(--pf-v5-global--BackgroundColor--light-300) !important;
}

.automated-analysis-grid-item .pf-v5-c-label-group__list {
width: 100%;
:is(.pf-v5-theme-dark) .automated-analysis-grid-item .pf-v5-c-label-group {
background-color: var(--pf-v5-global--BackgroundColor--light-300) !important;
}

.automated-analysis-grid-item .pf-v5-c-label-group__list-item {
.automated-analysis-grid-item .pf-v5-c-label-group__main {
width: 100%;
}

.automated-analysis-grid-item .pf-v5-c-label.pf-v5-m-compact {
max-width: 100%;
}

:is(.pf-v5-theme-dark) .automated-analysis-grid-item .pf-v5-c-label {
--pf-v5-c-label--BackgroundColor: var(--pf-v5-global--BackgroundColor--dark-100);
}

.automated-analysis-grid-item .pf-v5-c-label-group__label {
font-weight: bold;
max-width: 100%;
Expand Down

0 comments on commit cf70dbe

Please sign in to comment.