Skip to content

Commit

Permalink
Merge pull request #1399 from hubmapconsortium/collectionsUI
Browse files Browse the repository at this point in the history
Collections UI
  • Loading branch information
yuanzhou authored May 3, 2024
2 parents 9b83763 + 92d2071 commit d6efc52
Show file tree
Hide file tree
Showing 5 changed files with 140 additions and 171 deletions.
20 changes: 11 additions & 9 deletions src/src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -217,14 +217,16 @@ export function App (props){


function clearAuths() {
console.debug('%c◉ clearAuths start ', 'color:#00ff7b' );
return new Promise((resolve) => {
setTimeout(() => { // Give it a chance to cleaer the local storage
localStorage.removeItem("info");
localStorage.removeItem("isAuthenticated");
resolve();
}, 2000);
});
if(process.env.REACT_APP_URL == "http://localhost:8585"){
console.debug('%c◉ clearAuths start ', 'color:#00ff7b' );
return new Promise((resolve) => {
setTimeout(() => { // Give it a chance to cleaer the local storage
localStorage.removeItem("info");
localStorage.removeItem("isAuthenticated");
resolve();
}, 2000);
});
}
}

function Logout(){
Expand Down Expand Up @@ -516,7 +518,7 @@ export function App (props){
<Route path="/dataset/:uuid" element={<RenderDataset reportError={reportError} dataTypeList={dataTypeList} handleCancel={handleCancel} allGroups={allGroups} status="view"/>} />
<Route path="/upload/:uuid" element={<RenderUpload reportError={reportError} handleCancel={handleCancel} status="view" allGroups={allGroups}/>} />
<Route path="/publication/:uuid" element={<RenderPublication reportError={reportError} handleCancel={handleCancel} status="view" />} />
<Route path="/collection/:uuid" element={<RenderCollection groupsToken={groupsToken} dtl_all={dataTypeListAll} onUpdated={(response) => updateSuccess(response)} reportError={reportError} handleCancel={handleCancel} status="view" />} />
<Route path="/collection/:uuid" element={<RenderCollection groupsToken={groupsToken} dataGroups={userDataGroups} dtl_all={dataTypeListAll} onUpdated={(response) => updateSuccess(response)} reportError={reportError} handleCancel={handleCancel} status="view" />} />

<Route path="/bulk/donors" exact element={<RenderBulk reportError={reportError} bulkType="donors" />} />
<Route path="/bulk/samples" exact element={<RenderBulk reportError={reportError} bulkType="samples" />} />
Expand Down
8 changes: 4 additions & 4 deletions src/src/components/collections.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@ export const RenderCollection = (props) => {
// let reportError = ;

useEffect(() => {
const entityUUID = uuid.uuid
var authSet = JSON.parse(localStorage.getItem("info"));
console.debug('%c◉ entityUUID ', 'color:#00ff7b', entityUUID);
if (entityUUID) {
if (!newForm && uuid) {
const entityUUID = uuid.uuid
var authSet = JSON.parse(localStorage.getItem("info"));
console.debug('%c◉ entityUUID ', 'color:#00ff7b', entityUUID);
entity_api_get_entity(entityUUID, authSet.groups_token)
.then((response) => {
console.debug('%c◉ response ', 'color:#00ff7b', response);
Expand Down
Loading

0 comments on commit d6efc52

Please sign in to comment.