Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Collections UI #1399

Merged
merged 4 commits into from
May 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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"){
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@BirdMachine is this for your local testing?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Essentially. Added here Figuring out the Re Rendering that was getting in my way involved a lot of alt tabbed research (Especially since the 'bug' was also causing my React Dev Tools to Crash. The Timeout is short and having to log in each time a local or a dev tab was left open for a bit complicates things.
Will touch base on slack for a possibly slicker solution

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
Loading