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

Generic Assay dropdown: don't show NA when name or description missing (use id instead) #4054

Merged
merged 1 commit into from
Nov 19, 2021

Conversation

dippindots
Copy link
Member

Fix cBioPortal/cbioportal#9041

Describe changes proposed in this pull request:

  • Fix Generic Assay options show NA when name or description missing
  • Add related unit tests

Comment on lines 196 to 200
const name = getGenericAssayMetaPropertyOrDefault(
meta,
COMMON_GENERIC_ASSAY_PROPERTY.NAME
COMMON_GENERIC_ASSAY_PROPERTY.NAME,
meta.stableId
);
Copy link
Member Author

Choose a reason for hiding this comment

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

The reason why it was showing NA:
getGenericAssayMetaPropertyOrDefault will return a default value NA when an genericAssayMetaProperty is missing and when there is no defaultValue.

export function getGenericAssayMetaPropertyOrDefault(
    meta: GenericAssayMeta,
    property: string,
    defaultValue: string = NOT_APPLICABLE_VALUE
): string {
    if (property in meta.genericEntityMetaProperties) {
        return (meta.genericEntityMetaProperties as {
            [property: string]: string;
        })[property];
    } else {
        return defaultValue;
    }
}

@alisman alisman changed the title Fix Generic Assay options show NA when name or description missing Generic Assay dropdown: don't show NA when name or description missing (use id instead) Nov 18, 2021
@dippindots dippindots merged commit 0d3a9d5 into cBioPortal:master Nov 19, 2021
@inodb inodb added the bug label Nov 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
3 participants