Skip to content

Commit

Permalink
Merge branch 'develop' into body-contains-qb
Browse files Browse the repository at this point in the history
  • Loading branch information
vikrantgupta25 authored Sep 25, 2024
2 parents b1fa91e + 35f8e13 commit 0b26ba5
Show file tree
Hide file tree
Showing 7 changed files with 312 additions and 275 deletions.
9 changes: 8 additions & 1 deletion frontend/src/container/GridCardLayout/styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,14 @@ export const Card = styled(CardComponent)<CardProps>`
}
.ant-card-body {
height: calc(100% - 30px);
${({ $panelType }): StyledCSS =>
$panelType === PANEL_TYPES.TABLE
? css`
height: 100%;
`
: css`
height: calc(100% - 30px);
`}
padding: 0;
}
`;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@
height: 40px;
justify-content: end;
padding: 0 8px;
margin-top: 12px;
margin-bottom: 2px;
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,15 @@
.ant-select-item {
display: flex;
align-items: center;
gap: 8px;
}

.rc-virtual-list-holder {
[data-testid='option-ALL'] {
border-bottom: 1px solid var(--bg-slate-400);
padding-bottom: 12px;
margin-bottom: 8px;
}
}

.all-label {
Expand All @@ -56,28 +65,25 @@
}

.dropdown-value {
display: flex;
justify-content: space-between;
align-items: center;
display: grid;
grid-template-columns: 1fr max-content;

.option-text {
max-width: 180px;
padding: 0 8px;
}

.toggle-tag-label {
padding-left: 8px;
right: 40px;
font-weight: normal;
position: absolute;
font-weight: 500;
}
}
}
}

.dropdown-styles {
min-width: 300px;
max-width: 350px;
min-width: 400px;
max-width: 500px;
}

.lightMode {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,14 +62,14 @@ interface VariableItemProps {
const getSelectValue = (
selectedValue: IDashboardVariable['selectedValue'],
variableData: IDashboardVariable,
): string | string[] => {
): string | string[] | undefined => {
if (Array.isArray(selectedValue)) {
if (!variableData.multiSelect && selectedValue.length === 1) {
return selectedValue[0]?.toString() || '';
return selectedValue[0]?.toString();
}
return selectedValue.map((item) => item.toString());
}
return selectedValue?.toString() || '';
return selectedValue?.toString();
};

// eslint-disable-next-line sonarjs/cognitive-complexity
Expand Down Expand Up @@ -300,7 +300,7 @@ function VariableItem({
e.stopPropagation();
e.preventDefault();
const isChecked =
variableData.allSelected || selectValue.includes(ALL_SELECT_VALUE);
variableData.allSelected || selectValue?.includes(ALL_SELECT_VALUE);

if (isChecked) {
handleChange([]);
Expand Down Expand Up @@ -462,6 +462,7 @@ function VariableItem({
<span>+ {omittedValues.length} </span>
</Tooltip>
)}
allowClear
>
{enableSelectAll && (
<Select.Option data-testid="option-ALL" value={ALL_SELECT_VALUE}>
Expand Down Expand Up @@ -500,11 +501,17 @@ function VariableItem({
{...retProps(option as string)}
onClick={(e): void => handleToggle(e as any, option as string)}
>
<Tooltip title={option.toString()} placement="bottomRight">
<Typography.Text ellipsis className="option-text">
{option.toString()}
</Typography.Text>
</Tooltip>
<Typography.Text
ellipsis={{
tooltip: {
placement: variableData.multiSelect ? 'top' : 'right',
autoAdjustOverflow: true,
},
}}
className="option-text"
>
{option.toString()}
</Typography.Text>

{variableData.multiSelect &&
optionState.tag === option.toString() &&
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@
height: 40px;
justify-content: end;
padding: 0 8px;
margin-top: 12px;
margin-bottom: 2px;
}
}

Expand Down
Loading

0 comments on commit 0b26ba5

Please sign in to comment.