-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
git update changes + better space overview with actions + new profile…
… for osd for real data
- Loading branch information
Showing
9 changed files
with
329 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
{"64e266dfae2b4f34abf0de11ec077e99": {"storage_path": "C:/Users/cedricd/Desktop/test_rocrate_api\\test_rocrate_vliz", "ro_profile": "233ec883a63a4cf8965fb7fab08fe7c5", "uuid": "64e266dfae2b4f34abf0de11ec077e99", "remote_url": "", "workspace_path": "C:\\Users\\cedricd\\Documents\\GitHub\\rocrate-maker-fast-api\\backend\\app\\webtop-work-space\\spaces\\64e266dfae2b4f34abf0de11ec077e99"}, "5c64534759534c869ef98422b4ac2ca8": {"storage_path": "C:/Users/cedric/Desktop/no importante\\testuicrate", "ro_profile": "233ec883a63a4cf8965fb7fab08fe7c5", "uuid": "5c64534759534c869ef98422b4ac2ca8", "remote_url": "", "workspace_path": "C:\\Users\\cedric\\Documents\\GitHub\\rocrate-maker-fast-api\\backend\\app\\webtop-work-space\\spaces\\5c64534759534c869ef98422b4ac2ca8"}} | ||
{"64e266dfae2b4f34abf0de11ec077e99": {"storage_path": "C:/Users/cedricd/Desktop/test_rocrate_api\\test_rocrate_vliz", "ro_profile": "233ec883a63a4cf8965fb7fab08fe7c5", "uuid": "64e266dfae2b4f34abf0de11ec077e99", "remote_url": "", "workspace_path": "C:\\Users\\cedricd\\Documents\\GitHub\\rocrate-maker-fast-api\\backend\\app\\webtop-work-space\\spaces\\64e266dfae2b4f34abf0de11ec077e99"}, "5c64534759534c869ef98422b4ac2ca8": {"storage_path": "C:/Users/cedric/Desktop/no importante\\testuicrate", "ro_profile": "233ec883a63a4cf8965fb7fab08fe7c5", "uuid": "5c64534759534c869ef98422b4ac2ca8", "remote_url": "", "workspace_path": "C:\\Users\\cedric\\Documents\\GitHub\\rocrate-maker-fast-api\\backend\\app\\webtop-work-space\\spaces\\5c64534759534c869ef98422b4ac2ca8"}, "c7837176cc6e47dfb55f38708c4fa24f": {"storage_path": "C:/Users/cedricd/Desktop/test_rocrate_api\\test_osd", "ro_profile": "233ec883a63a4cf8965fb7fab08fe7c5", "uuid": "c7837176cc6e47dfb55f38708c4fa24f", "remote_url": "https://github.com/vliz-be-opsci/test_OSD_datacrate.git", "workspace_path": "C:\\Users\\cedricd\\Documents\\GitHub\\rocrate-maker-fast-api\\backend\\app\\webtop-work-space\\spaces\\c7837176cc6e47dfb55f38708c4fa24f"}, "0ce3f86d9bd649c885d7ef715454bb56": {"storage_path": "C:/Users/cedricd/Desktop/test_rocrate_api\\osd_profile_good_test", "ro_profile": "3b1020e07f6640b4bb97766e62c7708a", "uuid": "0ce3f86d9bd649c885d7ef715454bb56", "remote_url": "https://github.com/vliz-be-opsci/test_OSD_datacrate.git", "workspace_path": "C:\\Users\\cedricd\\Documents\\GitHub\\rocrate-maker-fast-api\\backend\\app\\webtop-work-space\\spaces\\0ce3f86d9bd649c885d7ef715454bb56"}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,127 @@ | ||
//import some css here | ||
import React, {useState, useEffect} from 'react'; | ||
import Badge from '@mui/material/Badge'; | ||
import axios from 'axios'; | ||
import {BASE_URL_SERVER} from '../App.js'; | ||
import ReactLoading from 'react-loading'; | ||
import {Button, OverlayTrigger, Popover} from 'react-bootstrap'; | ||
import {FaFolderOpen, FaGitAlt, FaCog} from 'react-icons/fa'; | ||
import {MdOpenInBrowser} from "react-icons/md"; | ||
|
||
function Datacrate_overview_row(props) { | ||
//constants | ||
const spacedata = props.spacedata; | ||
const [todisplaydata, setTodisplaydata] = useState({}); | ||
const [Loadingrow, setLoadingRow] = useState(true); | ||
console.log(spacedata); | ||
//functions | ||
const popoveropenfilebrowser = ( | ||
<Popover id="popover-open"> | ||
<Popover.Header as="h3">Open File Browser</Popover.Header> | ||
<Popover.Body> | ||
Click this to <b>open</b> a file <b>explorer</b> at the path of the <b>datacrate location</b>. | ||
You can add files/folders here and these will be incorperated in the ROCrate. | ||
Note that the File <b>explorer</b> will <b>not</b> be <b>focussed</b> on <b>automatically</b>. | ||
</Popover.Body> | ||
</Popover> | ||
); | ||
|
||
//function to get shacl data from the spacedata name | ||
const getShaclData = (spacedata) => { | ||
var tosetasdisplaydata = spacedata; | ||
axios.get(BASE_URL_SERVER + 'apiv1/spaces/' + spacedata['name'] + '/annotation/shacl_report') | ||
.then(function (res) { | ||
console.log(res.data); | ||
var shacl_requirements = res.data.shacl_requirements; | ||
console.log(shacl_requirements); | ||
|
||
//get the number of shacl errors that are in shacl_requirements | ||
try{ | ||
var ammount_violations = shacl_requirements[0]["http://www.w3.org/ns/shacl#result"].length; | ||
console.log(ammount_violations); | ||
tosetasdisplaydata['shacl_violations'] = ammount_violations; | ||
} | ||
catch(error){ | ||
console.log(error); | ||
var ammount_violations = 0; | ||
tosetasdisplaydata['shacl_violations'] = ammount_violations; | ||
} | ||
console.log(tosetasdisplaydata); | ||
setTodisplaydata(tosetasdisplaydata); | ||
setLoadingRow(false); | ||
}) | ||
} | ||
|
||
const BadgeFolder = (props) => { | ||
var ShaclErrors = props.ShaclErrors; | ||
if(ShaclErrors > 0){ | ||
return( | ||
<Badge color="error" badgeContent={ShaclErrors}> | ||
<FaFolderOpen size="2em"/> | ||
</Badge> | ||
) | ||
}else{ | ||
return( | ||
<Badge color="success" variant="dot"> | ||
<FaFolderOpen size="2em"/> | ||
</Badge> | ||
) | ||
} | ||
} | ||
|
||
const OpenBrowserSpace = async (spaceid) => { | ||
var spaceid = spaceid; | ||
axios.get(BASE_URL_SERVER+`apiv1/spaces/${spaceid}/content/openexplorer`) | ||
.then(res => { | ||
console.log(res) | ||
}) | ||
} | ||
|
||
|
||
|
||
//useEffect | ||
useEffect(() => { | ||
getShaclData(spacedata); | ||
},[]); | ||
|
||
//return section | ||
if(Loadingrow){ | ||
return( | ||
<></> | ||
) | ||
}else{ | ||
return ( | ||
<> | ||
<tr> | ||
<td><a href={'/spaces/' + todisplaydata.name }><button className='project_name'>{todisplaydata.truespacename}</button></a></td> | ||
<td>{todisplaydata.trueprofilename}</td> | ||
<td> | ||
<OverlayTrigger trigger={['hover', 'focus']} placement="bottom" overlay={popoveropenfilebrowser}> | ||
<button onClick={() => OpenBrowserSpace(todisplaydata.name)}> | ||
<MdOpenInBrowser></MdOpenInBrowser> | ||
</button> | ||
</OverlayTrigger> | ||
<a href={'/spaces/' + todisplaydata.name + '/all_files'}> | ||
<button> | ||
<BadgeFolder ShaclErrors={todisplaydata.shacl_violations}/> | ||
</button> | ||
</a> | ||
<a href={'/spaces/' + todisplaydata.name + '/git'}> | ||
<button> | ||
<FaGitAlt></FaGitAlt> | ||
</button> | ||
</a> | ||
<a href={'/spaces/' + todisplaydata.name + '/settings'}> | ||
<button> | ||
<FaCog></FaCog> | ||
</button> | ||
</a> | ||
</td> | ||
</tr> | ||
</> | ||
) | ||
} | ||
|
||
} | ||
|
||
export default Datacrate_overview_row |
Oops, something went wrong.