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

add search filter criteria for authorized and unauthorized studies #4825

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

jagnathan
Copy link
Contributor

Fix cBioPortal/icebox#468
add search filter criteria for authorized and unauthorized studies

Checks

  • Has tests or has a separate issue that describes the types of test that should be created. If no test is included it should explicitly be mentioned in the PR why there is no test.
  • The commit log is comprehensible. It follows 7 rules of great commit messages. For most PRs a single commit should suffice, in some cases multiple topical commits can be useful. During review it is ok to see tiny commits (e.g. Fix reviewer comments), but right before the code gets merged to master or rc branch, any such commits should be squashed since they are useless to the other developers. Definitely avoid merge commits, use rebase instead.
  • Is this PR adding logic based on one or more clinical attributes? If yes, please make sure validation for this attribute is also present in the data validation / data loading layers (in backend repo) and documented in File-Formats Clinical data section!

Any screenshots or GIFs?

If this is a new visual feature please add a before/after screenshot or gif
here with e.g. Giphy CAPTURE or Peek

Notify reviewers

Read our Pull request merging
policy
. It can help to figure out who worked on the
file before you. Please use git blame <filename> to determine that
and notify them either through slack or by assigning them as a reviewer on the PR

Copy link

netlify bot commented Jan 11, 2024

Deploy Preview for cbioportalfrontend ready!

Name Link
🔨 Latest commit 81484bd
🔍 Latest deploy log https://app.netlify.com/sites/cbioportalfrontend/deploys/65a00433d58bf50008d63969
😎 Deploy Preview https://deploy-preview-4825--cbioportalfrontend.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@@ -1511,6 +1511,16 @@ export class QueryStore {
return new Set(referenceGenomes);
}

@computed get readPermissions(): Set<string> {
const studies = Array.from(this.treeData.map_node_meta.keys()).filter(
s => typeof (s as CancerStudy).readPermission !== 'undefined'
Copy link
Collaborator

Choose a reason for hiding this comment

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

(s:CancerStudy)=>s.readPermission===undefined
should work. You don't need typeof anymore. Possible that you will need to cast with as, but not sure.

s => typeof (s as CancerStudy).readPermission !== 'undefined'
);
const readPermissions = studies.map(n =>
(n as CancerStudy).readPermission.toString()
Copy link
Collaborator

@alisman alisman Apr 15, 2024

Choose a reason for hiding this comment

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

(n:CancerStudy)=>readPermission (probably already a string?)

@@ -129,7 +129,7 @@ export class ListPhrase implements Phrase {
for (const fieldName of this.fields) {
let anyPhraseMatch = false;
const fieldValue = study[fieldName];
if (fieldValue) {
if (typeof fieldValue !== 'undefined') {
Copy link
Collaborator

Choose a reason for hiding this comment

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

fieldValue===undefined

function matchPhraseFull(phrase: string, fullText: string) {
return fullText.toLowerCase() === phrase.toLowerCase();
function matchPhraseFull(phrase: string, toMatch: boolean | string | number) {
return _.toString(toMatch).toLowerCase() === phrase.toLowerCase();
Copy link
Collaborator

Choose a reason for hiding this comment

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

probably don'tneed to use _ (lodash here). just toMatch.toString().toLowerCase()

{}
> {
constructor(props: { ids: String[] }) {
super(props);
this.state = {
Copy link
Collaborator

@alisman alisman Apr 15, 2024

Choose a reason for hiding this comment

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

we try to use mobx state instead of react state. for consistency. just put it as an observable property on the component


<div
style={{
width: '100%',
Copy link
Collaborator

Choose a reason for hiding this comment

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

probably don't need width:100%

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Enhancements to Improved findability of Authorized Studies feature
2 participants