diff --git a/mapping_workbench/frontend/src/components/app/list/list-file-collection-actions.js b/mapping_workbench/frontend/src/components/app/list/list-file-collection-actions.js index a14e50e3..f8b8acd7 100644 --- a/mapping_workbench/frontend/src/components/app/list/list-file-collection-actions.js +++ b/mapping_workbench/frontend/src/components/app/list/list-file-collection-actions.js @@ -52,7 +52,7 @@ export const ListFileCollectionActions = (props) => { } /> import("src/sections/app/mapping-package/resources")); const MappingPackageRulesView = dynamic(() => import("src/sections/app/mapping-package/mapping-package-rules-view")); @@ -31,7 +31,7 @@ const StatesView = const tabs = [ {label: 'Details', value: 'details'}, - {label: 'Resources', value: 'resources'}, + {label: 'Assets', value: 'assets'}, {label: 'Mapping Rules', value: 'mappingRules'}, {label: 'Triple Map Fragments', value: 'tripleMapFragments'}, {label: 'States', value: 'states'} @@ -127,8 +127,8 @@ const Page = () => { {currentTab === 'details' && ( )} - {currentTab === 'resources' && ( - + {currentTab === 'assets' && ( + )} {currentTab === "mappingRules" && ( diff --git a/mapping_workbench/frontend/src/pages/app/ontology-files/index.js b/mapping_workbench/frontend/src/pages/app/ontology-files/index.js index b3db0962..99723565 100644 --- a/mapping_workbench/frontend/src/pages/app/ontology-files/index.js +++ b/mapping_workbench/frontend/src/pages/app/ontology-files/index.js @@ -9,7 +9,6 @@ import {Box} from "@mui/system"; import Stack from '@mui/material/Stack'; import Button from '@mui/material/Button'; import Dialog from "@mui/material/Dialog"; -import SvgIcon from '@mui/material/SvgIcon'; import {useTheme} from "@mui/material/styles"; import Grid from '@mui/material/Unstable_Grid2'; import DialogTitle from "@mui/material/DialogTitle"; @@ -51,9 +50,7 @@ const Page = () => { const handleDiscover = () => { const toastId = toastLoad('Discovering terms ...') ontologyTermsApi.discoverTerms() - .then(res => { - toastSuccess(`${res.task_name} successfully started.`, toastId) - }) + .then(res => toastSuccess(`${res.task_name} successfully started.`, toastId)) .catch(err => toastError(`Discovering terms failed: ${err.message}.`, toastId)) }; diff --git a/mapping_workbench/frontend/src/pages/app/test-data-suites/[id]/resource-manager/[fid]/edit.js b/mapping_workbench/frontend/src/pages/app/test-data-suites/[id]/resource-manager/[fid]/edit.js index 717867cc..269f8c38 100644 --- a/mapping_workbench/frontend/src/pages/app/test-data-suites/[id]/resource-manager/[fid]/edit.js +++ b/mapping_workbench/frontend/src/pages/app/test-data-suites/[id]/resource-manager/[fid]/edit.js @@ -1,13 +1,14 @@ -import * as React from 'react'; import {useCallback, useEffect, useState} from "react"; import {useFormik} from "formik"; -import ArrowLeftIcon from '@untitled-ui/icons-react/build/esm/ArrowLeft'; +import ArrowBackIcon from '@mui/icons-material/ArrowBack'; + import Chip from '@mui/material/Chip'; import Link from '@mui/material/Link'; import Stack from '@mui/material/Stack'; import Paper from "@mui/material/Paper"; import SvgIcon from '@mui/material/SvgIcon'; +import Divider from "@mui/material/Divider"; import Checkbox from "@mui/material/Checkbox"; import Grid from "@mui/material/Unstable_Grid2"; import Typography from '@mui/material/Typography'; @@ -25,10 +26,7 @@ import CodeMirrorDefault from "src/components/app/form/codeMirrorDefault"; import {ForItemDataState} from "src/contexts/app/section/for-item-data-state"; import {FileResourceEditForm} from 'src/sections/app/file-manager/file-resource-edit-form'; import {testDataFileResourcesApi as sectionApi} from 'src/api/test-data-suites/file-resources'; -import { - MappingPackageFormSelect -} from '../../../../../../sections/app/mapping-package/components/mapping-package-form-select'; -import Divider from "@mui/material/Divider"; +import {MappingPackageFormSelect} from 'src/sections/app/mapping-package/components/mapping-package-form-select'; const useItem = (sectionApi, id) => { @@ -158,7 +156,7 @@ const Page = () => { underline="hover" > - + {sectionApi.SECTION_TITLE} diff --git a/mapping_workbench/frontend/src/pages/app/test-data-suites/[id]/resource-manager/create.js b/mapping_workbench/frontend/src/pages/app/test-data-suites/[id]/resource-manager/create.js index 75b06c0c..ee99bdaf 100644 --- a/mapping_workbench/frontend/src/pages/app/test-data-suites/[id]/resource-manager/create.js +++ b/mapping_workbench/frontend/src/pages/app/test-data-suites/[id]/resource-manager/create.js @@ -1,7 +1,9 @@ -import ArrowLeftIcon from '@untitled-ui/icons-react/build/esm/ArrowLeft'; +import ArrowBackIcon from '@mui/icons-material/ArrowBack'; + import Link from '@mui/material/Link'; import Stack from '@mui/material/Stack'; import SvgIcon from '@mui/material/SvgIcon'; +import Grid from "@mui/material/Unstable_Grid2"; import Typography from '@mui/material/Typography'; import {paths} from 'src/paths'; @@ -10,12 +12,10 @@ import {useRouter} from "src/hooks/use-router"; import {Layout as AppLayout} from 'src/layouts/app'; import {usePageView} from 'src/hooks/use-page-view'; import {RouterLink} from 'src/components/router-link'; +import {FormTextField} from "src/components/app/form/text-field"; import {ForItemCreateForm} from "src/contexts/app/section/for-item-form"; import {FileResourceEditForm} from 'src/sections/app/file-manager/file-resource-edit-form'; import {testDataFileResourcesApi as sectionApi} from 'src/api/test-data-suites/file-resources'; -import * as React from "react"; -import Grid from "@mui/material/Unstable_Grid2"; -import {FormTextField} from "../../../../../components/app/form/text-field"; const ExtraForm = (props) => { const { @@ -72,7 +72,7 @@ const Page = () => { underline="hover" > - + {sectionApi.SECTION_TITLE} diff --git a/mapping_workbench/frontend/src/pages/app/test-data-suites/[id]/resource-manager/index.js b/mapping_workbench/frontend/src/pages/app/test-data-suites/[id]/resource-manager/index.js index a652e51b..93e41b0f 100644 --- a/mapping_workbench/frontend/src/pages/app/test-data-suites/[id]/resource-manager/index.js +++ b/mapping_workbench/frontend/src/pages/app/test-data-suites/[id]/resource-manager/index.js @@ -1,12 +1,11 @@ -import {useEffect, useMemo, useState} from 'react'; +import {useEffect, useState} from 'react'; -import Plus from '@untitled-ui/icons-react/build/esm/Plus'; -import Upload01Icon from '@untitled-ui/icons-react/build/esm/Upload01'; +import AddIcon from '@mui/icons-material/Add'; +import UploadIcon from '@mui/icons-material/Upload'; import Link from "@mui/material/Link"; import Stack from '@mui/material/Stack'; import Button from '@mui/material/Button'; -import SvgIcon from '@mui/material/SvgIcon'; import Typography from '@mui/material/Typography'; import Breadcrumbs from "@mui/material/Breadcrumbs"; @@ -17,72 +16,14 @@ import {useRouter} from "src/hooks/use-router"; import {Layout as AppLayout} from 'src/layouts/app'; import {usePageView} from 'src/hooks/use-page-view'; import {RouterLink} from "src/components/router-link"; +import useItemsSearch from 'src/hooks/use-items-search'; import {ItemList} from 'src/sections/app/file-manager/item-list'; -import {ItemDrawer} from 'src/sections/app/file-manager/item-drawer'; -import {ItemSearch} from 'src/sections/app/file-manager/item-search'; +import {ItemSearch} from 'src/sections/app/files-form/item-search'; import {testDataSuitesApi as sectionApi} from 'src/api/test-data-suites'; import {FileUploader} from 'src/sections/app/file-manager/file-uploader'; import {BreadcrumbsSeparator} from "src/components/breadcrumbs-separator"; import {testDataFileResourcesApi as fileResourcesApi} from 'src/api/test-data-suites/file-resources'; -const useItemsSearch = () => { - const [state, setState] = useState({ - filters: { - query: undefined - }, - page: sectionApi.DEFAULT_PAGE, - rowsPerPage: sectionApi.DEFAULT_ROWS_PER_PAGE, - sortBy: 'createdAt', - sortDir: 'desc' - }); - - const handleFiltersChange = filters => { - setState(prevState => ({ - ...prevState, - filters - })); - } - - const handleSortChange = sortDir => { - setState(prevState => ({ - ...prevState, - sortDir - })); - } - - const handlePageChange = (event, page) => { - setState(prevState => ({ - ...prevState, - page - })); - } - - const handleRowsPerPageChange = event => { - setState(prevState => ({ - ...prevState, - rowsPerPage: parseInt(event.target.value, 10) - })); - } - - return { - handleFiltersChange, - handleSortChange, - handlePageChange, - handleRowsPerPageChange, - state - }; -}; - -const useCurrentItem = (items, itemId) => { - return useMemo(() => { - if (!itemId) { - return undefined; - } - - return items.find((item) => item.id === itemId); - }, [items, itemId]); -}; - const Page = () => { const [view, setView] = useState('grid'); const [state, setState] = useState({ @@ -92,10 +33,8 @@ const Page = () => { }); const uploadDialog = useDialog(); - const detailsDialog = useDialog(); - const itemsSearch = useItemsSearch(); + const itemsSearch = useItemsSearch(state.items, sectionApi, ['title']); - const currentItem = useCurrentItem(state.items, detailsDialog.data); const router = useRouter(); const {id} = router.query; @@ -105,7 +44,7 @@ const Page = () => { useEffect(() => { id && handleItemsGet(); // eslint-disable-next-line react-hooks/exhaustive-deps - }, [itemsSearch.state, id]); + }, [id]); const handleItemsGet = async () => { try { @@ -133,7 +72,7 @@ const Page = () => { > - {`Resource Manager: ${state.collection.title}`} + {`Assets Manager: ${state.collection.title}`} }> @@ -157,7 +96,7 @@ const Page = () => { color="text.secondary" variant="subtitle2" > - Resource Manager + Assets Manager @@ -168,23 +107,14 @@ const Page = () => { > + color="info"> + Assets + + color="success"> + Edit + ); diff --git a/mapping_workbench/frontend/src/sections/app/file-manager/item-list-card.js b/mapping_workbench/frontend/src/sections/app/file-manager/item-list-card.js index 4a309ade..e6c2a461 100644 --- a/mapping_workbench/frontend/src/sections/app/file-manager/item-list-card.js +++ b/mapping_workbench/frontend/src/sections/app/file-manager/item-list-card.js @@ -1,11 +1,12 @@ import PropTypes from 'prop-types'; -import DotsVerticalIcon from '@untitled-ui/icons-react/build/esm/DotsVertical'; + +import MoreVertIcon from '@mui/icons-material/MoreVert'; + import Box from '@mui/material/Box'; import Card from '@mui/material/Card'; +import Stack from '@mui/material/Stack'; import Divider from '@mui/material/Divider'; import IconButton from '@mui/material/IconButton'; -import Stack from '@mui/material/Stack'; -import SvgIcon from '@mui/material/SvgIcon'; import Typography from '@mui/material/Typography'; import {usePopover} from 'src/hooks/use-popover'; @@ -70,9 +71,7 @@ export const ItemListCard = (props) => { onClick={popover.handleOpen} ref={popover.anchorRef} > - - - + diff --git a/mapping_workbench/frontend/src/sections/app/mapping-package/components/mapping-packages-bulk-actions.js b/mapping_workbench/frontend/src/sections/app/mapping-package/components/mapping-packages-bulk-actions.js index 8204b74c..b6d5eb4a 100644 --- a/mapping_workbench/frontend/src/sections/app/mapping-package/components/mapping-packages-bulk-actions.js +++ b/mapping_workbench/frontend/src/sections/app/mapping-package/components/mapping-packages-bulk-actions.js @@ -105,7 +105,7 @@ export const MappingPackagesBulkActions = (props) => { onChange={e => setCleanUpProject(e.target.checked)} /> } - label="Cleanup Project Resources" + label="Cleanup Project Assets" value="cleanup_project" /> } diff --git a/mapping_workbench/frontend/src/sections/app/mapping-package/edit-form.js b/mapping_workbench/frontend/src/sections/app/mapping-package/edit-form.js index f0a85f38..b521859e 100644 --- a/mapping_workbench/frontend/src/sections/app/mapping-package/edit-form.js +++ b/mapping_workbench/frontend/src/sections/app/mapping-package/edit-form.js @@ -17,6 +17,7 @@ import {paths} from 'src/paths'; import {sessionApi} from "src/api/session"; import {useRouter} from 'src/hooks/use-router'; import {RouterLink} from 'src/components/router-link'; +import {testDataSuitesApi} from 'src/api/test-data-suites'; import {shaclTestSuitesApi} from "src/api/shacl-test-suites"; import {FormTextArea} from "src/components/app/form/text-area"; import {sparqlTestSuitesApi} from "src/api/sparql-test-suites"; @@ -24,7 +25,6 @@ import {FormTextField} from "src/components/app/form/text-field"; import {resourceCollectionsApi} from "src/api/resource-collections"; import {toastError, toastLoad, toastSuccess} from "src/components/app-toast"; import {ListSelectorSelect as ResourceListSelector} from "src/components/app/list-selector/select"; -import {testDataSuitesApi} from '../../../api/test-data-suites'; export const EditForm = (props) => { @@ -107,9 +107,9 @@ export const EditForm = (props) => { {!itemctx.isNew && setCurrentTab(v)}> - + value='tabEdit'/> + } {currentTab === 'tabEdit' && diff --git a/mapping_workbench/frontend/src/sections/app/mapping-package/list-table.js b/mapping_workbench/frontend/src/sections/app/mapping-package/list-table.js index 0cf061be..effa975d 100644 --- a/mapping_workbench/frontend/src/sections/app/mapping-package/list-table.js +++ b/mapping_workbench/frontend/src/sections/app/mapping-package/list-table.js @@ -188,7 +188,7 @@ const MappingPackageRowFragment = (props) => { }} /> } - label="Cleanup Project Resources" + label="Cleanup Project Assets" value="cleanup_project" /> } @@ -203,8 +203,7 @@ export const ListTable = (props) => { const { count = 0, items = [], - onPageChange = () => { - }, + onPageChange = () => {}, onRowsPerPageChange, page = 0, rowsPerPage = 0, diff --git a/mapping_workbench/frontend/src/sections/app/mapping-package/package-importer.js b/mapping_workbench/frontend/src/sections/app/mapping-package/package-importer.js index b85ae04f..059f795e 100644 --- a/mapping_workbench/frontend/src/sections/app/mapping-package/package-importer.js +++ b/mapping_workbench/frontend/src/sections/app/mapping-package/package-importer.js @@ -2,7 +2,7 @@ import {useCallback, useEffect, useState} from 'react'; import PropTypes from 'prop-types'; import nProgress from 'nprogress'; -import XIcon from '@untitled-ui/icons-react/build/esm/X'; +import CloseIcon from '@mui/icons-material/Close'; import Stack from '@mui/material/Stack'; import Dialog from '@mui/material/Dialog'; @@ -23,7 +23,6 @@ import {toastError, toastLoad, toastSuccess} from "src/components/app-toast"; import Divider from "@mui/material/Divider"; - export const PackageImporter = (props) => { const {onClose, open = false, sectionApi} = props; @@ -100,9 +99,7 @@ export const PackageImporter = (props) => { color="inherit" onClick={onClose} > - - - + @@ -116,11 +113,13 @@ export const PackageImporter = (props) => { sx={{mb: 2}} > {Object.keys(PACKAGE_TYPE).map((key) => ( - {PACKAGE_TYPE[key]} + {PACKAGE_TYPE[key]} ))} - - After Import + + After Import { }} /> } - label="Cleanup Project Resources" + label="Cleanup Project Assets" value="cleanup_project" /> { checked={triggerPackageProcessing} onChange={e => setTriggerPackageProcessing(e.target.checked)} name="trigger_package_processing" - /> - } + />} label="Process Package" /> diff --git a/mapping_workbench/frontend/src/sections/app/technical-mappings/index.js b/mapping_workbench/frontend/src/sections/app/technical-mappings/index.js index 19c95a22..c101c3d3 100644 --- a/mapping_workbench/frontend/src/sections/app/technical-mappings/index.js +++ b/mapping_workbench/frontend/src/sections/app/technical-mappings/index.js @@ -1,5 +1,6 @@ import Tab from '@mui/material/Tab'; import Tabs from '@mui/material/Tabs'; + import {useRouter} from 'next/router'; import {paths} from '../../../paths'; @@ -10,7 +11,7 @@ const TABS = [ id: 'triple_map_fragments_tab' }, { - label: 'Mapping Resources', + label: 'Vocabulary Resources', value: paths.app.value_mapping_resources.index, id: 'value_mapping_resources_tab' }]