Skip to content

Commit b285bbd

Browse files
Mnickiimusale
andauthored
fix: make the dialog actions responsive in collections (#3493)
* fix footer position * fix edit scope * remove commented code * remove fixed container --------- Co-authored-by: Musale Martin <[email protected]>
1 parent cd9fc04 commit b285bbd

File tree

6 files changed

+40
-15
lines changed

6 files changed

+40
-15
lines changed

src/app/views/sidebar/resource-explorer/collection/APICollection.tsx

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ import { useEffect, useState } from 'react';
1919
import { ResourcePath } from '../../../../../types/resources';
2020
import { setQueryResponseStatus } from '../../../../services/slices/query-status.slice';
2121
import { isGeneratedCollectionInCollection } from './upload-collection.util';
22+
import './api-collections.scss';
2223

2324
export interface APICollection {
2425
version: string;
@@ -243,7 +244,7 @@ const APICollection: React.FC<PopupsComponent<APICollection>> = (props) => {
243244
)}
244245

245246
{items && items.length > 0 ?
246-
(<div style={{ height: '80vh' }}>
247+
(<div>
247248
<Paths
248249
resources={items}
249250
columns={columns}
@@ -252,16 +253,13 @@ const APICollection: React.FC<PopupsComponent<APICollection>> = (props) => {
252253
) :
253254
(
254255
<Label
255-
style={{ display: 'flex', width: '100%',
256-
height: '80vh',
257-
justifyContent: 'center',
258-
alignItems: 'center' }}>
256+
className='label'>
259257
{translateMessage('Add queries in the API Explorer and History tab')}
260258
</Label>
261259
)}
262260
<DialogFooter
263261
styles={{
264-
actionsRight: { bottom: 0, justifyContent: 'start' }
262+
actionsRight: { bottom: 0, justifyContent: 'start', position: 'fixed', width: '100%', zIndex: 1 }
265263
}}>
266264
<PrimaryButton onClick={generateCollection} disabled={items.length === 0}>
267265
{translateMessage('Download postman collection')}

src/app/views/sidebar/resource-explorer/collection/CollectionPermissions.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ const CollectionPermissions: FC<PopupsComponent<null>> = (props) => {
102102
{translateMessage('Microsoft Graph permissions reference')}
103103
</Link>
104104
</MessageBar>
105-
<div style={{ height: '80vh', overflowY: 'auto', overflowX: 'hidden' }}>
105+
<div style={{ overflowY: 'auto', overflowX: 'hidden' }}>
106106
<DetailsList
107107
items={permissionsArray}
108108
columns={columns}
@@ -112,7 +112,7 @@ const CollectionPermissions: FC<PopupsComponent<null>> = (props) => {
112112
</div>
113113
{permissions &&
114114
<DialogFooter styles={{
115-
actionsRight: { bottom: 0, justifyContent: 'start' }
115+
actionsRight: { bottom: 0, justifyContent: 'start', position: 'fixed', width: '100%', zIndex: 1 }
116116
}}>
117117
<PrimaryButton onClick={downloadPermissions}>
118118
{translateMessage('Download permissions')}

src/app/views/sidebar/resource-explorer/collection/EditCollectionPanel.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ const EditCollectionPanel: React.FC<EditCollectionPanelProps> = ({closePopup}) =
3636
<span style={{ fontWeight: 'bold' }}>{translateMessage('Delete all selected')}</span>
3737
</MessageBar>
3838
{items && items.length > 0 ? (
39-
<div style={{ height: '80vh' }}>
39+
<div>
4040
<Paths
4141
resources={items}
4242
columns={columns}
@@ -45,7 +45,7 @@ const EditCollectionPanel: React.FC<EditCollectionPanelProps> = ({closePopup}) =
4545
/>
4646
</div>
4747
) : (
48-
<div style={{height: '80vh'}}>
48+
<div>
4949
<Label
5050
style={{
5151
display: 'flex',
@@ -60,7 +60,7 @@ const EditCollectionPanel: React.FC<EditCollectionPanelProps> = ({closePopup}) =
6060
)}
6161
<DialogFooter
6262
styles={{
63-
actionsRight: { bottom: 0, justifyContent: 'start' }
63+
actionsRight: { bottom: 0, justifyContent: 'start', position: 'fixed', width: '100%', zIndex: 1 }
6464
}}>
6565
<PrimaryButton onClick={removeSelectedItems} disabled={selectedItems.length === 0}>
6666
{translateMessage('Delete all selected')}

src/app/views/sidebar/resource-explorer/collection/EditScopePanel.tsx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ const EditScopePanel: React.FC<EditScopePanelProps> = ({ closePopup }) => {
9191
styles={{ dropdown: { width: 200 } }}
9292
/>
9393
</div>
94-
<div style={{ flex: 1, marginBottom: '1px', maxHeight: '80vh' }}>
94+
<div style={{ flex: 1, marginBottom: '1px'}}>
9595
<Paths
9696
resources={items.map(item => pendingChanges.find(change => change.key === item.key) || item)}
9797
columns={columns}
@@ -105,8 +105,10 @@ const EditScopePanel: React.FC<EditScopePanelProps> = ({ closePopup }) => {
105105
actionsRight: {
106106
display: 'flex',
107107
justifyContent: 'flex-start',
108-
padding: '5px'
109-
}
108+
position: 'fixed',
109+
width: '100%',
110+
bottom: 0,
111+
zIndex: 1}
110112
}}>
111113
<PrimaryButton onClick={saveAllScopes} disabled={pendingChanges.length === 0}>
112114
{translateMessage('Save all')}

src/app/views/sidebar/resource-explorer/collection/Paths.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ export default class Paths extends Component<IPathProps> {
8686
public render(): JSX.Element {
8787
const { resources, columns, isSelectable } = this.props;
8888
return (
89-
<div style={{ height: '80vh', overflowY: 'auto', overflowX: 'hidden' }}>
89+
<div style={{overflowY: 'auto', overflowX: 'hidden' }}>
9090
<DetailsList
9191
items={resources}
9292
columns={columns}
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
.label {
2+
display: flex;
3+
width: 100%;
4+
height: 80vh;
5+
justify-content: center;
6+
align-items: center;
7+
}
8+
9+
@media (max-width: 1200px) {
10+
.container, .label {
11+
height: 70vh; /* Adjust height for medium screens */
12+
}
13+
}
14+
15+
@media (max-width: 900px) {
16+
.container, .label {
17+
height: 60vh; /* Adjust height for smaller screens */
18+
}
19+
}
20+
21+
@media (max-width: 700px) {
22+
.container, .label {
23+
height: 50vh; /* Adjust height for very small screens */
24+
}
25+
}

0 commit comments

Comments
 (0)