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

Replace endpoint list filter views with django-filters #704

Merged
merged 18 commits into from
Nov 9, 2022
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
77 changes: 0 additions & 77 deletions frontend/animal/EndpointListTable.js

This file was deleted.

2 changes: 0 additions & 2 deletions frontend/animal/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import EditEndpoint from "./EditEndpoint";
import Endpoint from "./Endpoint";
import startupEndpointForm from "./EndpointForm";
import startupEndpointListApp from "./EndpointListApp";
import EndpointListTable from "./EndpointListTable";
import Experiment from "./Experiment";
import ehvBrowserStartup from "./EhvBrowser";

Expand All @@ -17,7 +16,6 @@ export default {
Endpoint,
startupEndpointForm,
startupEndpointListApp,
EndpointListTable,
Experiment,
ehvBrowserStartup,
};
17 changes: 0 additions & 17 deletions frontend/epi/Outcome.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,23 +97,6 @@ class Outcome {
return $el;
}

buildListRow() {
let link = `<a href="${this.data.url}" target="_blank">${this.data.name}</a>`,
detail = $(
'<i class="fa fa-eye previewModalIcon ml-2" title="preview in a modal">'
).click(() => this.displayAsModal({complete: true})),
outcome = $('<span class="previewModalParent">').append(link, detail);

return [
`<a href=${this.data.study_population.study.url} target="_blank">${this.data.study_population.study.short_citation}</a>`,
`<a href=${this.data.study_population.url} target="_blank">${this.data.study_population.name}</a>`,
outcome,
this.data.system ? this.data.system : "--",
this.data.effect ? this.data.effect : "--",
this.data.diagnostic ? this.data.diagnostic : "--",
];
}

build_breadcrumbs() {
var urls = [
{
Expand Down
37 changes: 0 additions & 37 deletions frontend/epi/OutcomeListTable.js

This file was deleted.

2 changes: 0 additions & 2 deletions frontend/epi/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import ComparisonSet from "./ComparisonSet";
import Exposure from "./Exposure";
import Group from "./Group";
import Outcome from "./Outcome";
import OutcomeListTable from "./OutcomeListTable";
import Result from "./Result";
import StudyPopulation from "./StudyPopulation";

Expand All @@ -11,7 +10,6 @@ export default {
Exposure,
Group,
Outcome,
OutcomeListTable,
Result,
StudyPopulation,
};
18 changes: 0 additions & 18 deletions frontend/epimeta/MetaResult.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,24 +90,6 @@ class MetaResult {
return HAWCUtils.build_breadcrumbs(urls);
}

buildListRow() {
let link = `<a href="${this.data.url}" target="_blank">${this.data.label}</a>`,
detail = $(
'<i class="fa fa-eye previewModalIcon ml-2" title="preview in a modal">'
).click(() => this.displayAsModal({complete: true})),
endpoint = $('<span class="previewModalParent">').append(link, detail);

return [
`<a href=${this.data.protocol.study.url} target="_blank">${this.data.protocol.study.short_citation}</a>`,
endpoint,
`<a href=${this.data.protocol.url} target="_blank">${this.data.protocol.name}</a>`,
this.data.health_outcome ? this.data.health_outcome : "--",
this.data.exposure_name ? this.data.exposure_name : "--",
this.data.ci_units ? `${this.data.ci_units * 100}%` : "--",
this.data.estimateFormatted ? this.data.estimateFormatted : "--",
];
}

displayAsModal() {
var modal = new HAWCModal(),
title = `<h4>${this.build_breadcrumbs()}</h4>`,
Expand Down
34 changes: 0 additions & 34 deletions frontend/epimeta/MetaResultListTable.js

This file was deleted.

6 changes: 0 additions & 6 deletions frontend/epimeta/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,10 @@ import $ from "$";

import MetaProtocol from "./MetaProtocol";
import MetaResult from "./MetaResult";
import MetaResultListTable from "./MetaResultListTable";

export default {
MetaProtocol,
MetaResult,
MetaResultListTable,
startupMetaProtocolPage: (el, config) => MetaProtocol.displayFullPager($(el), config.id),
startupMetaResultPage: (el, config) => MetaResult.displayFullPager($(el), config.id),
startupMetaResultListPage: (el, config) => {
const tbl = new MetaResultListTable(config.items);
$(el).html(tbl.buildTable());
},
};
19 changes: 0 additions & 19 deletions frontend/invitro/IVEndpoint.js
Original file line number Diff line number Diff line change
Expand Up @@ -172,25 +172,6 @@ class IVEndpoint {
return tbl.getTbl();
}

buildListRow() {
let link = `<a href="${this.data.url}" target="_blank">${this.data.name}</a>`,
detail = $(
'<i class="fa fa-eye previewModalIcon ml-2" title="preview in a modal">'
).click(() => this.displayAsModal({complete: true})),
endpoint = $('<span class="previewModalParent">').append(link, detail);

return [
`<a href=${this.data.experiment.study.url} target="_blank">${this.data.experiment.study.short_citation}</a>`,
`<a href=${this.data.experiment.url} target="_blank">${this.data.experiment.name}</a>`,
`<a href=${this.chemical.data.url} target="_blank">${this.chemical.data.name}</a>`,
endpoint,
this.data.effect ? this.data.effect : "--",
this.data.effects.length > 0 ? _.map(this.data.effects, "name").join(", ") : "--",
this.data.experiment.dose_units.name ? this.data.experiment.dose_units.name : "--",
this.data.response_units ? this.data.response_units : "--",
];
}

displayAsModal() {
var modal = new HAWCModal(),
$details = $('<div class="col-md-12">'),
Expand Down
50 changes: 0 additions & 50 deletions frontend/invitro/IVEndpointListTable.js

This file was deleted.

2 changes: 0 additions & 2 deletions frontend/invitro/index.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
import IVCellType from "./IVCellType";
import IVChemical from "./IVChemical";
import IVEndpoint from "./IVEndpoint";
import IVEndpointListTable from "./IVEndpointListTable";
import IVExperiment from "./IVExperiment";

export default {
IVCellType,
IVChemical,
IVEndpoint,
IVEndpointListTable,
IVExperiment,
};
Loading