Skip to content

Commit f0f6054

Browse files
authored
Merge branch 'dev' into fix/refresh-token
2 parents 4a455e7 + 2a2c3a9 commit f0f6054

File tree

9 files changed

+68
-53
lines changed

9 files changed

+68
-53
lines changed

.github/policies/resourceManagement.yml

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,6 @@ configuration:
8989
- isOpen
9090
- not:
9191
and:
92-
- isAssignedToSomeone
9392
- isLabeled
9493
then:
9594
- addLabel:
@@ -98,7 +97,17 @@ configuration:
9897
- payloadType: Issues
9998
- and:
10099
- isOpen
101-
- isAssignedToSomeone
100+
- isLabeled
101+
- not:
102+
and:
103+
- isAssignedToSomeone
104+
then:
105+
- addLabel:
106+
label: 'Triaged-Unassigned'
107+
- if:
108+
- payloadType: Issues
109+
- and:
110+
- isOpen
102111
- isLabeled
103112
then:
104113
- removeLabel:

src/app/services/actions/autocomplete-action-creators.spec.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,8 @@ const mockState: ApplicationState = {
4747
samples: {
4848
queries: [],
4949
pending: false,
50-
error: null
50+
error: null,
51+
hasAutoSelectedDefault: false
5152
},
5253
scopes: {
5354
pending: { isSpecificPermissions: false, isFullPermissions: false },
@@ -123,7 +124,8 @@ store.getState = () => ({
123124
samples: {
124125
queries: [],
125126
pending: false,
126-
error: null
127+
error: null,
128+
hasAutoSelectedDefault: false
127129
}
128130
})
129131

src/app/services/actions/permissions-action-creator.spec.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,8 @@ const mockState: ApplicationState = {
6868
samples: {
6969
queries: [],
7070
pending: false,
71-
error: null
71+
error: null,
72+
hasAutoSelectedDefault: false
7273
},
7374
scopes: {
7475
pending: { isSpecificPermissions: false, isFullPermissions: false },

src/app/services/actions/resource-explorer-action-creators.spec.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,8 @@ const mockState: ApplicationState = {
4343
samples: {
4444
queries: [],
4545
pending: false,
46-
error: null
46+
error: null,
47+
hasAutoSelectedDefault: false
4748
},
4849
permissionGrants: {
4950
permissions: [],

src/app/services/slices/samples.slice.ts

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,14 @@ interface SamplesState {
99
queries: ISampleQuery[];
1010
pending: boolean;
1111
error: object | null | string;
12+
hasAutoSelectedDefault: boolean;
1213
}
1314

1415
const initialState: SamplesState = {
1516
queries: [],
1617
pending: false,
17-
error: null
18+
error: null,
19+
hasAutoSelectedDefault: false
1820
};
1921

2022
export const fetchSamples = createAsyncThunk<ISampleQuery[], void, { rejectValue: ISampleQuery[] }>(
@@ -52,7 +54,11 @@ export const fetchSamples = createAsyncThunk<ISampleQuery[], void, { rejectValue
5254
const samplesSlice = createSlice({
5355
name: 'samples',
5456
initialState,
55-
reducers: {},
57+
reducers: {
58+
setHasAutoSelectedDefault: (state, action) => {
59+
state.hasAutoSelectedDefault = action.payload;
60+
}
61+
},
5662
extraReducers: (builder) => {
5763
builder
5864
.addCase(fetchSamples.pending, (state) => {
@@ -73,4 +79,5 @@ const samplesSlice = createSlice({
7379
}
7480
});
7581

82+
export const { setHasAutoSelectedDefault } = samplesSlice.actions;
7683
export default samplesSlice.reducer;

src/app/views/layout/LayoutStyles.tsx

Lines changed: 17 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,20 @@ export const SIDEBAR_SIZE_CSS_VAR = '--sidebar-size';
44

55
export const useLayoutResizeStyles = makeResetStyles({
66
[SIDEBAR_SIZE_CSS_VAR]: '23%'
7-
})
7+
});
88

99
export const useLayoutStyles = makeStyles({
1010
container: {
1111
display: 'flex',
1212
flexDirection: 'column',
13-
padding: tokens.spacingHorizontalS,
14-
height: 'clamp(100vh, auto, 200vh)',
15-
overflow: 'hidden'
13+
height: '100vh',
14+
overflow: 'hidden',
15+
padding: tokens.spacingHorizontalS
1616
},
1717
content: {
1818
display: 'flex',
1919
flex: 1,
20-
overflowY: 'hidden',
20+
overflow: 'hidden',
2121
minWidth: 0
2222
},
2323
sidebar: {
@@ -43,36 +43,27 @@ export const useLayoutStyles = makeStyles({
4343
flex: 1,
4444
display: 'flex',
4545
flexDirection: 'column',
46-
minWidth: '300px',
47-
minHeight: 'calc(100vh - 98px)',
48-
overflow: 'hidden'
46+
overflow: 'hidden',
47+
minWidth: 0,
48+
minHeight: 0
4949
},
5050
requestResponseArea: {
51-
flex: '1 1 auto',
51+
flex: 1,
5252
display: 'flex',
5353
flexDirection: 'column',
54-
height: '60vh',
55-
minHeight: '550px',
56-
overflow: 'hidden'
54+
minHeight: 0,
55+
overflowY: 'auto',
56+
overflowX: 'hidden'
5757
},
58-
responseArea: {
59-
flex: '1 1 auto',
60-
display: 'flex',
61-
flexDirection: 'column',
62-
minHeight: '300px',
63-
height: 'auto',
64-
maxHeight: '100%',
58+
requestArea: {
59+
flex: 1,
60+
minHeight: '200px',
6561
overflow: 'auto',
6662
borderRadius: tokens.borderRadiusMedium,
6763
padding: tokens.spacingHorizontalS
6864
},
69-
requestArea: {
70-
flex: '1 1 40%',
71-
display: 'flex',
72-
flexDirection: 'column',
73-
minHeight: '200px',
74-
height:'auto',
75-
maxHeight: '40%',
65+
responseArea: {
66+
flex: 1,
7667
overflow: 'auto',
7768
borderRadius: tokens.borderRadiusMedium,
7869
padding: tokens.spacingHorizontalS

src/app/views/query-runner/request/Request.tsx

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,14 +38,15 @@ interface IRequestProps {
3838

3939
const useStyles = makeStyles({
4040
container: {
41-
height: '-webkit-fill-available',
4241
display: 'flex',
43-
flexDirection: 'column'
42+
flexDirection: 'column',
43+
width: '100%',
44+
height: '100%',
45+
overflow: 'hidden'
4446
},
4547
tabContainer: {
4648
display: 'flex',
47-
flexShrink: 0,
48-
overflowX: 'hidden'
49+
flexShrink: 0
4950
},
5051
tabList: {
5152
padding: '5px 5px'
@@ -60,7 +61,7 @@ const useStyles = makeStyles({
6061
marginTop: tokens.spacingHorizontalS,
6162
backgroundColor: tokens.colorNeutralBackground1,
6263
minHeight: '0',
63-
overflow: 'auto'
64+
overflow: 'hidden'
6465
},
6566
menuButton: {
6667
alignSelf: 'center'

src/app/views/sidebar/sample-queries/SampleQueries.styles.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ export const useStyles = makeStyles({
1414
maxWidth: '50px'
1515
},
1616
disabled: {
17-
backgroundColor: tokens.colorSubtleBackgroundHover,
1817
'&:hover': {
1918
cursor: 'not-allowed'
2019
}

src/app/views/sidebar/sample-queries/SampleQueries.tsx

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -358,29 +358,33 @@ const Samples: React.FC<SamplesProps> = ({ queries, groups, searchValue }) => {
358358
const styles = useStyles();
359359
const [openItems, setOpenItems] = React.useState<Set<TreeItemValue>>(new Set());
360360
const [selectedQueryKey, setSelectedQueryKey] = useState<string | null>(null);
361-
const [hasAutoSelected, setHasAutoSelected] = useState(false);
361+
const hasAutoSelectedGlobally = useAppSelector(state => state.samples.hasAutoSelectedDefault) ?? false;
362+
const [hasAutoSelected, setHasAutoSelected] = useState(hasAutoSelectedGlobally);
362363
const mobileScreen = useAppSelector((state) => state.sidebarProperties.mobileScreen);
363364

364365
useEffect(() => {
365366
if (!searchValue && queries.length === 0) {
366367
dispatch(fetchSamples());
367368
} else {
368369
setSampleQueries(queries);
369-
if (!mobileScreen && !hasAutoSelected && queries.length > 0) {
370-
const defaultSample = queries.find(q =>
371-
q.method === 'GET' && q.humanName.toLowerCase().includes('my profile')
372-
);
373-
374-
if (defaultSample) {
375-
const defaultKey = defaultSample.id ?? `${defaultSample.method}-${defaultSample.requestUrl}`;
376-
setSelectedQueryKey(defaultKey);
377-
sampleQueryItemSelected(defaultSample);
378-
setHasAutoSelected(true);
379-
}
380-
}
381370
}
382371
}, [queries]);
383372

373+
useEffect(() => {
374+
if (!mobileScreen && !hasAutoSelected && queries.length > 0) {
375+
const defaultSample = queries.find(q =>
376+
q.method === 'GET' && q.humanName.toLowerCase().includes('my profile')
377+
);
378+
379+
if (defaultSample) {
380+
const defaultKey = defaultSample.id ?? `${defaultSample.method}-${defaultSample.requestUrl}`;
381+
setSelectedQueryKey(defaultKey);
382+
sampleQueryItemSelected(defaultSample);
383+
setHasAutoSelected(true);
384+
dispatch({ type: 'samples/setHasAutoSelectedDefault', payload: true });
385+
}
386+
}
387+
}, [mobileScreen, queries, hasAutoSelected, dispatch]);
384388
useEffect(() => {
385389
if (groups && groups.length > 0) {
386390
setOpenItems(prev => {

0 commit comments

Comments
 (0)