Skip to content

Commit 054bf14

Browse files
committed
Merged north-tools-config.
1 parent cf9d8cf commit 054bf14

25 files changed

+482
-1953
lines changed

.gitignore

-6
Original file line numberDiff line numberDiff line change
@@ -32,16 +32,10 @@ build/
3232
dist/
3333
setup.json
3434
parser.osio.log
35-
gui/src/metainfo.json
36-
gui/src/searchQuantities.json
37-
gui/src/toolkitMetadata.json
38-
gui/src/unitsData.js
39-
gui/src/parserMetadata.js
4035
examples/workdir/
4136
gunicorn.log.conf
4237
nomad/gitinfo.py
4338
**/node_modules/
4439
jupyterhub_cookie_secret
4540
jupyterhub.sqlite
4641
jupyterhub-proxy.pid
47-
gui/src/parserMetadata.json

.gitmodules

+3-3
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,6 @@
213213
[submodule "dependencies/parsers/asr"]
214214
path = dependencies/parsers/asr
215215
url = https://github.com/nomad-coe/nomad-parser-asr.git
216-
[submodule "ops/images/webtop/north-guacamole-client"]
217-
path = ops/images/webtop/north-guacamole-client
218-
url = https://github.com/nomad-coe/north-guacamole-client.git
216+
[submodule "dependencies/nomad-remote-tools-hub"]
217+
path = dependencies/nomad-remote-tools-hub
218+
url = https://gitlab.mpcdf.mpg.de/nomad-lab/nomad-remote-tools-hub.git

dependencies/nomad-remote-tools-hub

Submodule nomad-remote-tools-hub added at e8003e4

generate_gui_artifacts.sh

+2-1
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,5 @@ python -m nomad.cli dev metainfo > gui/src/metainfo.json
33
python -m nomad.cli dev search-quantities > gui/src/searchQuantities.json
44
python -m nomad.cli dev toolkit-metadata > gui/src/toolkitMetadata.json
55
python -m nomad.cli dev units > gui/src/unitsData.js
6-
python -m nomad.cli dev parser-metadata > gui/src/parserMetadata.json
6+
python -m nomad.cli dev parser-metadata > gui/src/parserMetadata.json
7+
cp dependencies/nomad-remote-tools-hub/tools.json gui/src/northTools.json

gui/.gitignore

+5
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,11 @@ public/metainfo/
1414
public/meta.json
1515

1616
src/toolkitMetadata.json
17+
src/northTools.json
18+
src/metainfo.json
19+
src/searchQuantities.json
20+
src/unitsData.js
21+
src/parserMetadata.json
1722

1823
# misc
1924
.DS_Store

gui/public/jupyter_logo.svg

+90
Loading

gui/src/components/datatable/Datatable.js

+12-5
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,8 @@ const DatatableHeader = React.memo(function DatatableHeader({actions}) {
229229
onSelectedChanged,
230230
shownColumns,
231231
pagination,
232-
onPaginationChanged
232+
onPaginationChanged,
233+
multiple
233234
} = useDatatableContext()
234235
const columns = shownColumns
235236
const {order, order_by} = pagination
@@ -256,13 +257,13 @@ const DatatableHeader = React.memo(function DatatableHeader({actions}) {
256257

257258
return <TableHead>
258259
<TableRow>
259-
{withSelectionFeature && <TableCell padding="checkbox" classes={{stickyHeader: classes.stickyHeader}}>
260-
<Checkbox
260+
<TableCell padding="checkbox" classes={{stickyHeader: classes.stickyHeader}}>
261+
{(withSelectionFeature && multiple) && <Checkbox
261262
indeterminate={selected.length > 0 && selected !== 'all'}
262263
checked={selected === 'all'}
263264
onChange={handleSelectAllChanged}
264-
/>
265-
</TableCell>}
265+
/>}
266+
</TableCell>
266267
{columns.map(column => (
267268
<TableCell
268269
classes={{stickyHeader: classes.stickyHeader}}
@@ -721,6 +722,8 @@ Datatable.propTypes = {
721722
PropTypes.oneOf(['all']),
722723
PropTypes.arrayOf(PropTypes.object)
723724
]),
725+
/** Whether multiple values can be selected or not */
726+
multiple: PropTypes.bool,
724727
/** Optional callback for selection changes. Takes either "all" or new array of
725728
* selected row objects as parameter. */
726729
onSelectedChanged: PropTypes.func,
@@ -730,3 +733,7 @@ Datatable.propTypes = {
730733
PropTypes.node
731734
])
732735
}
736+
737+
Datatable.defaultProps = {
738+
multiple: true
739+
}

gui/src/components/nav/Routes.js

+14-1
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ import UserdataPage, { help as userdataHelp } from '../UserdataPage'
3333
import APIs from '../APIs'
3434
import SearchPageEntries, {help as searchEntriesHelp} from '../search/SearchPageEntries'
3535
import SearchPageMaterials, {help as searchMaterialsHelp} from '../search/SearchPageMaterials'
36+
import NORTHMainPage, {help as NORTHHelp} from '../north/NORTHMainPage'
3637
import { aitoolkitEnabled, appBase, oasis, encyclopediaBase } from '../../config'
3738
import EntryQuery from '../entry/EntryQuery'
3839
import ResolvePID from '../entry/ResolvePID'
@@ -286,7 +287,19 @@ export const routes = [
286287
path: 'reproduce',
287288
title: 'Artificial Intelligence Toolkit',
288289
component: ReproducePage
289-
}
290+
},
291+
{
292+
path: 'north',
293+
menu: 'NOMAD Remote Tools Hub',
294+
tooltip: 'Browse the list of available remote tools.',
295+
breadcrumb: 'NOMAD Remote Tools Hub',
296+
help: {
297+
title: 'NOMAD Remote Tools help page',
298+
content: NORTHHelp
299+
},
300+
component: NORTHMainPage
301+
},
302+
toolkitRoute
290303
]
291304
},
292305
{
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
/* eslint-disable quotes */
2+
/*
3+
* Copyright The NOMAD Authors.
4+
*
5+
* This file is part of NOMAD. See https://nomad-lab.eu for further info.
6+
*
7+
* Licensed under the Apache License, Version 2.0 (the "License");
8+
* you may not use this file except in compliance with the License.
9+
* You may obtain a copy of the License at
10+
*
11+
* http://www.apache.org/licenses/LICENSE-2.0
12+
*
13+
* Unless required by applicable law or agreed to in writing, software
14+
* distributed under the License is distributed on an "AS IS" BASIS,
15+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16+
* See the License for the specific language governing permissions and
17+
* limitations under the License.
18+
*/
19+
import React from 'react'
20+
import PropTypes from 'prop-types'
21+
import { Button } from '@material-ui/core'
22+
import { northBase } from '../../config'
23+
24+
const NORTHLaunchButton = React.memo(({
25+
name,
26+
path,
27+
disabled,
28+
children
29+
}) => {
30+
return <Button
31+
component="a"
32+
href={`${northBase}/user-redirect/${name}/${path || ''}`}
33+
target="_blank"
34+
color="primary"
35+
variant="contained"
36+
disabled={disabled}
37+
>{children}</Button>
38+
})
39+
40+
NORTHLaunchButton.propTypes = {
41+
name: PropTypes.string.isRequired, // The unique identitifier for this tool
42+
path: PropTypes.string, // Path to add to container url
43+
disabled: PropTypes.bool, // Whether the button is disabled
44+
children: PropTypes.node
45+
}
46+
47+
export default NORTHLaunchButton

0 commit comments

Comments
 (0)