Skip to content

Commit 5ede8ce

Browse files
committed
group dropdown styling fixes
1 parent 568a2ba commit 5ede8ce

File tree

3 files changed

+22
-6
lines changed

3 files changed

+22
-6
lines changed

UI/web-app/src/components/HRQuerySource/HRQuerySource.base.tsx

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1439,10 +1439,6 @@ const checkType = (value: string, type: string | undefined): string => {
14391439
setGroupingEnabled(true);
14401440
}
14411441

1442-
const dropdownStyles: Partial<IDropdownStyles> = {
1443-
dropdown: { width: 100 },
1444-
};
1445-
14461442
const renderItems = (items: IFilterPart[], isUpDownEnabled: boolean, groupIndex: number, childIndex?: number) => {
14471443
const selection: Selection = new Selection({
14481444
onSelectionChanged: () => handleSelectionChange(selection)
@@ -1481,7 +1477,7 @@ const checkType = (value: string, type: string | undefined): string => {
14811477
onChange={(event, option) => handleGroupOrAndOperatorChange(event, option, parentIndex)}
14821478
selectedKey={group.andOr.charAt(0).toUpperCase() + group.andOr.slice(1).toLowerCase()}
14831479
options={orAndOperatorOptions}
1484-
styles={dropdownStyles}
1480+
styles={group.children && group.children.length > 0 ? { root: classNames.startOfNestedGroupDropdown } : { root: classNames.betweenGroupsDropdown }}
14851481
/>
14861482
</div>
14871483
)}
@@ -1504,7 +1500,7 @@ const checkType = (value: string, type: string | undefined): string => {
15041500
onChange={(event, option) => handleGroupOrAndOperatorChange(event, option, parentIndex, childIndex)}
15051501
selectedKey={childGroup.andOr.charAt(0).toUpperCase() + childGroup.andOr.slice(1).toLowerCase()}
15061502
options={orAndOperatorOptions}
1507-
styles={dropdownStyles}
1503+
styles={parentIndex !== groups.length - 1 && childIndex === children.length - 1 ? { root: classNames.endOfNestedGroupDropdown } : { root: classNames.betweenChildrenDropdown }}
15081504
/>
15091505
</div>
15101506
)}

UI/web-app/src/components/HRQuerySource/HRQuerySource.styles.ts

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,22 @@ export const getStyles = (props: HRQuerySourceStyleProps): HRQuerySourceStyles =
4747
detailsList: {
4848
minWidth: 1200
4949
},
50+
betweenGroupsDropdown: {
51+
width: 100,
52+
marginLeft: 0
53+
},
54+
betweenChildrenDropdown: {
55+
maxWidth: 100,
56+
marginLeft: 70
57+
},
58+
startOfNestedGroupDropdown: {
59+
maxWidth: 100,
60+
marginLeft: 70
61+
},
62+
endOfNestedGroupDropdown: {
63+
maxWidth: 100,
64+
marginLeft: -50
65+
},
5066
detailsListWithBorder: {
5167
minWidth: 1200,
5268
borderStyle: 'solid',

UI/web-app/src/components/HRQuerySource/HRQuerySource.types.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@ export type HRQuerySourceStyles = {
2020
removeButton: IStyle;
2121
error: IStyle;
2222
addAttribute: IStyle;
23+
betweenGroupsDropdown: IStyle;
24+
betweenChildrenDropdown: IStyle;
25+
startOfNestedGroupDropdown: IStyle;
26+
endOfNestedGroupDropdown: IStyle;
2327
};
2428

2529
export type HRQuerySourceStyleProps = {

0 commit comments

Comments
 (0)