Skip to content
This repository was archived by the owner on Feb 21, 2025. It is now read-only.

Commit 148aedf

Browse files
author
pmandrik
committed
simplify JSON menu
1 parent e7a41fb commit 148aedf

File tree

1 file changed

+12
-49
lines changed

1 file changed

+12
-49
lines changed

runregistry_frontend/components/json_portal/configuration/json_configuration/JSONConfiguration.js

Lines changed: 12 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -289,62 +289,25 @@ class Configuration extends Component {
289289
borderRadius: '2px',
290290
}}
291291
>
292-
<div
293-
style={{
294-
width: '10%',
295-
display: 'flex',
296-
alignItems: 'center',
297-
marginLeft: '5px',
298-
height: '48px',
299-
}}
300-
>
301-
<strong>configurations created by me:</strong>
302-
</div>
303-
<div style={{ width: '88%' }}>
304-
<Menu
305-
onClick={({ key }) => this.handleMenuChange(key)}
306-
selectedKeys={[menu_selection]}
307-
mode="horizontal"
308-
>
309-
{json_configurations_array
310-
.filter(
311-
({ created_by }) => created_by === this.props.email
312-
)
313-
.map(({ name }) => (
314-
<Menu.Item key={name}>{name}</Menu.Item>
315-
))}
316-
</Menu>
317-
</div>
318-
</div>
319-
<br />
320-
<div
321-
style={{
322-
display: 'flex',
323-
border: '1px solid #d9d9d9',
324-
borderRadius: '2px',
325-
}}
326-
>
327-
<div
328-
style={{
329-
width: '10%',
330-
display: 'flex',
331-
alignItems: 'center',
332-
marginLeft: '5px',
333-
}}
334-
>
335-
<strong>all configurations:</strong>
336-
</div>
337-
<div style={{ width: '88%', display: 'flex', }}>
292+
//<Menu onClick={({ key }) => this.handleMenuChange(key)} selectedKeys={[menu_selection]} mode="horizontal">
293+
// {json_configurations_array.filter( ({ created_by }) => created_by === this.props.email).map(({ name }) => ( <Menu.Item key={name}>{name}</Menu.Item> ))}
294+
//</Menu>
295+
338296
<Menu onClick={({ key }) => this.handleMenuChange(key)} selectedKeys={[menu_selection]} mode="horizontal">
339-
<Menu.Item key="arbitrary"> arbitrary configuration </Menu.Item>
297+
<Menu.Item key="arbitrary"> New Configuration </Menu.Item>
340298
</Menu>
341299

300+
<Dropdown overlay={ <Menu style={{ overflowY: 'scroll', maxHeight: '300px' }} onClick={({ key }) => this.handleMenuChange(key)} selectedKeys={[menu_selection]}>
301+
{json_configurations_array.filter( ({ created_by }) => created_by === this.props.email).map(({ name }) => ( <Menu.Item key={name}>{name}</Menu.Item> ))}
302+
</Menu> } destroyPopupOnHide={true}>
303+
<a style={{ marginTop: '12px' }} className="ant-dropdown-link" onClick={e => e.preventDefault()}> My Configurations <DownOutlined /> </a>
304+
</Dropdown>
305+
342306
<Dropdown overlay={ <Menu style={{ overflowY: 'scroll', maxHeight: '300px' }} onClick={({ key }) => this.handleMenuChange(key)} selectedKeys={[menu_selection]}>
343307
{json_configurations_array.map(({ name }) => ( <Menu.Item key={name}>{name}</Menu.Item>))}
344308
</Menu> } destroyPopupOnHide={true}>
345-
<a style={{ marginTop: '12px' }} className="ant-dropdown-link" onClick={e => e.preventDefault()}> list of available configurations <DownOutlined /> </a>
309+
<a style={{ marginTop: '12px' }} className="ant-dropdown-link" onClick={e => e.preventDefault()}> All Configurations <DownOutlined /> </a>
346310
</Dropdown>
347-
</div>
348311
</div>
349312
</center>
350313
)}

0 commit comments

Comments
 (0)