VEuPathDB / web-monorepo

A monorepo that contains all frontend code for VEuPathDB websites
Apache License 2.0
2 stars 0 forks source link

OrthoMCL - Custom tree-table for OrthoGroup page #904

Open bobular opened 3 months ago

bobular commented 3 months ago

Testing:

There are only a few tree files available on the back end, so only a few orthogroups work. Here's are the valid OGs at the moment:

Run ortho-site locally and access the path /app/record/group/OG6_102443 Back end config for .env is

BASE_PROXY_URL=https://qa.orthomcl.org/
LEGACY_WEB_APP_URL=${BASE_PROXY_URL}/orthomcl
PROJECT_ID=OrthoMCL
yarn && yarn nx start @veupathdb/ortho-site

To do:

UX suggestions

dmfalke commented 1 month ago

I figured out why the section is always collapsed by default: https://github.com/VEuPathDB/web-monorepo/blob/26807b89d8f8a131984a63f67da68a70e83309f2/packages/sites/ortho-site/webapp/wdkCustomization/js/client/store-modules/RecordStoreModule.ts#L19-L29

I don't know why this was done, but I suppose we can remove this entire case.

bobular commented 1 month ago

Brilliant - thanks - yes that will help a lot! @dmfalke

bobular commented 1 month ago

There's nothing left after removing that case.

Should we track down where the reduce is called, or just eviscerate this function and make it no op?

dmfalke commented 1 month ago

There's nothing left after removing that case.

Should we track down where the reduce is called, or just eviscerate this function and make it no op?

I think we can just remove the reduce function.

Not sure why I didn't see this comment sooner... sorry for the delay!

bobular commented 1 month ago

I

There's nothing left after removing that case. Should we track down where the reduce is called, or just eviscerate this function and make it no op?

I think we can just remove the reduce function.

Not sure why I didn't see this comment sooner... sorry for the delay!

Hi @dmfalke - I can't find where that reduce is imported. It's not part of an object. I'm at a dead end, sorry.

dmfalke commented 1 month ago

It's imported here:

https://github.com/VEuPathDB/web-monorepo/blob/26807b89d8f8a131984a63f67da68a70e83309f2/packages/sites/ortho-site/webapp/wdkCustomization/js/client/wrapStoreModules.tsx

I'm pretty sure you can just delete the reduce and don't need to make any other changes.

bobular commented 1 month ago

Ah, thanks, I was missing something fundamental that I get now.

bobular commented 2 days ago

It looks like we can't avoid the "We're sorry, something went wrong." modal being rendered if the wdkService back end call returns a 404. That hook (useWdkService/useOrthoService) doesn't handle errors the same way as the EDA's usePromise.

However, we can avoid asking for a tree when there are too few sequences, thus avoiding some user-facing errors. Will push a commit soon to address this and make sure the regular table still renders.

  const numSequences = mesaRows.length;
  const treeResponse = useOrthoService(
    numSequences > 2
      ? (orthoService) => orthoService.getGroupTree(groupName)
      : () => Promise.resolve(undefined),
    [groupName, numSequences]
  );