Skip to content

Commit

Permalink
fix alignment, move icon before fieldName
Browse files Browse the repository at this point in the history
  • Loading branch information
alvarezmelissa87 committed Apr 12, 2023
1 parent ae6e32c commit a44cade
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 27 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,6 @@ export const ExplainLogRateSpikesAnalysis: FC<ExplainLogRateSpikesAnalysisProps>
significantTerms={data.significantTerms}
groupTableItems={groupTableItems}
loading={isRunning}
dataViewId={dataView.id}
dataView={dataView}
timeRangeMs={timeRangeMs}
searchQuery={searchQuery}
Expand All @@ -294,7 +293,6 @@ export const ExplainLogRateSpikesAnalysis: FC<ExplainLogRateSpikesAnalysisProps>
<SpikeAnalysisTable
significantTerms={data.significantTerms}
loading={isRunning}
dataViewId={dataView.id}
dataView={dataView}
timeRangeMs={timeRangeMs}
searchQuery={searchQuery}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,17 +74,15 @@ export function FieldStatsPopover({
button={trigger}
renderHeader={() => <FieldPopoverHeader field={fieldForStats} closePopover={closePopover} />}
renderContent={() => (
<>
<FieldStatsContent
field={fieldForStats}
fieldName={fieldName}
fieldValue={fieldValue}
dataView={dataView}
fieldStatsServices={fieldStatsServices}
timeRangeMs={timeRangeMs}
dslQuery={dslQuery}
/>
</>
<FieldStatsContent
field={fieldForStats}
fieldName={fieldName}
fieldValue={fieldValue}
dataView={dataView}
fieldStatsServices={fieldStatsServices}
timeRangeMs={timeRangeMs}
dslQuery={dslQuery}
/>
)}
/>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ const viewInDiscoverMessage = i18n.translate(

interface SpikeAnalysisTableProps {
significantTerms: SignificantTerm[];
dataViewId?: string;
dataView: DataView;
loading: boolean;
isExpandedRow?: boolean;
Expand All @@ -66,7 +65,6 @@ interface SpikeAnalysisTableProps {

export const SpikeAnalysisTable: FC<SpikeAnalysisTableProps> = ({
significantTerms,
dataViewId,
dataView,
loading,
isExpandedRow,
Expand All @@ -75,6 +73,7 @@ export const SpikeAnalysisTable: FC<SpikeAnalysisTableProps> = ({
}) => {
const euiTheme = useEuiTheme();
const primaryBackgroundColor = useEuiBackgroundColor('primary');
const dataViewId = dataView.id;

const {
pinnedSignificantTerm,
Expand Down Expand Up @@ -165,7 +164,6 @@ export const SpikeAnalysisTable: FC<SpikeAnalysisTableProps> = ({
}),
render: (_, { fieldName, fieldValue }) => (
<>
{fieldName}
<FieldStatsPopover
dataView={dataView}
fieldName={fieldName}
Expand All @@ -174,10 +172,11 @@ export const SpikeAnalysisTable: FC<SpikeAnalysisTableProps> = ({
dslQuery={searchQuery}
timeRangeMs={timeRangeMs}
/>
{fieldName}
</>
),
sortable: true,
valign: 'top',
valign: 'middle',
},
{
'data-test-subj': 'aiopsSpikeAnalysisTableColumnFieldValue',
Expand All @@ -188,7 +187,7 @@ export const SpikeAnalysisTable: FC<SpikeAnalysisTableProps> = ({
render: (_, { fieldValue }) => String(fieldValue),
sortable: true,
textOnly: true,
valign: 'top',
valign: 'middle',
},
{
'data-test-subj': 'aiopsSpikeAnalysisTableColumnLogRate',
Expand Down Expand Up @@ -222,7 +221,7 @@ export const SpikeAnalysisTable: FC<SpikeAnalysisTableProps> = ({
/>
),
sortable: false,
valign: 'top',
valign: 'middle',
},
{
'data-test-subj': 'aiopsSpikeAnalysisTableColumnDocCount',
Expand All @@ -232,7 +231,7 @@ export const SpikeAnalysisTable: FC<SpikeAnalysisTableProps> = ({
defaultMessage: 'Doc count',
}),
sortable: true,
valign: 'top',
valign: 'middle',
},
{
'data-test-subj': 'aiopsSpikeAnalysisTableColumnPValue',
Expand Down Expand Up @@ -260,7 +259,7 @@ export const SpikeAnalysisTable: FC<SpikeAnalysisTableProps> = ({
),
render: (pValue: number | null) => pValue?.toPrecision(3) ?? NOT_AVAILABLE,
sortable: true,
valign: 'top',
valign: 'middle',
},
{
'data-test-subj': 'aiopsSpikeAnalysisTableColumnImpact',
Expand Down Expand Up @@ -291,7 +290,7 @@ export const SpikeAnalysisTable: FC<SpikeAnalysisTableProps> = ({
return label ? <EuiBadge color={label.color}>{label.impact}</EuiBadge> : null;
},
sortable: true,
valign: 'top',
valign: 'middle',
},
{
'data-test-subj': 'aiOpsSpikeAnalysisTableColumnAction',
Expand All @@ -317,7 +316,7 @@ export const SpikeAnalysisTable: FC<SpikeAnalysisTableProps> = ({
},
],
width: ACTIONS_COLUMN_WIDTH,
valign: 'top',
valign: 'middle',
},
];

Expand Down Expand Up @@ -345,7 +344,7 @@ export const SpikeAnalysisTable: FC<SpikeAnalysisTableProps> = ({
return '';
},
sortable: false,
valign: 'top',
valign: 'middle',
});
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ const viewInDiscoverMessage = i18n.translate(
interface SpikeAnalysisTableProps {
significantTerms: SignificantTerm[];
groupTableItems: GroupTableItem[];
dataViewId?: string;
loading: boolean;
searchQuery: estypes.QueryDslQueryContainer;
timeRangeMs: TimeRangeMs;
Expand All @@ -72,7 +71,6 @@ interface SpikeAnalysisTableProps {
export const SpikeAnalysisGroupsTable: FC<SpikeAnalysisTableProps> = ({
significantTerms,
groupTableItems,
dataViewId,
loading,
dataView,
timeRangeMs,
Expand All @@ -92,6 +90,7 @@ export const SpikeAnalysisGroupsTable: FC<SpikeAnalysisTableProps> = ({

const { pinnedGroup, selectedGroup, setPinnedGroup, setSelectedGroup } =
useSpikeAnalysisTableRowContext();
const dataViewId = dataView.id;

const toggleDetails = (item: GroupTableItem) => {
const itemIdToExpandedRowMapValues = { ...itemIdToExpandedRowMap };
Expand All @@ -118,7 +117,6 @@ export const SpikeAnalysisGroupsTable: FC<SpikeAnalysisTableProps> = ({
[]
)}
loading={loading}
dataViewId={dataViewId}
isExpandedRow
dataView={dataView}
timeRangeMs={timeRangeMs}
Expand Down

0 comments on commit a44cade

Please sign in to comment.