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

fix: removes htmlEncode function for phenogrid #474

Merged
merged 1 commit into from
Dec 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
5 changes: 2 additions & 3 deletions components/Gene/HumanDiseases/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import { fetchAPI } from "@/api-service";
import { GeneDisease } from "@/models/gene";
import { sectionWithErrorBoundary } from "@/hoc/sectionWithErrorBoundary";
import { DownloadData, SectionHeader } from "@/components";
import { isIframeLoaded, htmlEncode } from "@/utils";
import { isIframeLoaded } from "@/utils";
import { SortType } from "@/models";

type ScaleProps = {
Expand Down Expand Up @@ -69,8 +69,7 @@ const PhenoGridEl = ({ rowDiseasePhenotypes, data }) => {
.filter(({ phenodigmScore }) => phenodigmScore > 0)
.map(({ modelPhenotypes, modelDescription, phenodigmScore }) => {
const mousePhenotypes = processPhenotypes(modelPhenotypes.join());
// send HTML encode the id to get correct labels in tooltip. Downside: the labels on top are not readable.
const id = htmlEncode(modelDescription);
const id = modelDescription;
const label = `${phenodigmScore.toFixed(2)}-${id}`;
const phenotypes = mousePhenotypes.map((item) => item.id);

Expand Down
5 changes: 0 additions & 5 deletions utils/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -440,8 +440,3 @@ export const isIframeLoaded = (iframe: HTMLIFrameElement) => {
iframe.addEventListener("error", () => reject("Error loading iframe"));
});
};

// Generic htmlEncoder
export const htmlEncode = (id: string) => {
return id.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;");
};