-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #500 from UW-GAC/feature/add-associated-data-prep-…
…workspace-tables-on-workspace-detail Add "associated data prep workspace" accordions/tables on some workspace detail pages
- Loading branch information
Showing
8 changed files
with
281 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
# Temporary script to create some test data. | ||
# Run with: python manage.py shell < add_data_prep_example_data.py | ||
|
||
|
||
from primed.cdsa.tests.factories import CDSAWorkspaceFactory | ||
from primed.dbgap.tests.factories import dbGaPWorkspaceFactory | ||
from primed.miscellaneous_workspaces.tests import factories | ||
from primed.primed_anvil.tests.factories import StudyFactory | ||
|
||
# Create a dbGaP workspace. | ||
fhs = StudyFactory.create(short_name="FHS", full_name="Framingham Heart Study") | ||
workspace_dbgap = dbGaPWorkspaceFactory.create( | ||
dbgap_study_accession__dbgap_phs=7, | ||
dbgap_study_accession__studies=[fhs], | ||
dbgap_version=33, | ||
dbgap_participant_set=12, | ||
dbgap_consent_code=1, | ||
dbgap_consent_abbreviation="HMB", | ||
workspace__name="DBGAP_FHS_v33_p12_HMB", | ||
) | ||
|
||
# Create a data prep workspace. | ||
workspace_dbgap_prep = factories.DataPrepWorkspaceFactory.create( | ||
target_workspace=workspace_dbgap.workspace, | ||
workspace__name="DBGAP_FHS_v33_p12_HMB_PREP", | ||
) | ||
|
||
|
||
# Create a CDSA workspace. | ||
workspace_cdsa = CDSAWorkspaceFactory.create( | ||
study__short_name="MESA", | ||
workspace__name="CDSA_MESA_HMB", | ||
) | ||
|
||
# Create a data prep workspace. | ||
factories.DataPrepWorkspaceFactory.create( | ||
target_workspace=workspace_cdsa.workspace, | ||
workspace__name="CDSA_MESA_HMB_PREP_1", | ||
is_active=False, | ||
) | ||
workspace_cdsa_prep = factories.DataPrepWorkspaceFactory.create( | ||
target_workspace=workspace_cdsa.workspace, | ||
workspace__name="CDSA_MESA_HMB_PREP_2", | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
{% load render_table from django_tables2 %} | ||
|
||
<div class="my-3"> | ||
<div class="accordion" id="accordionDataPrepWorkspace"> | ||
<div class="accordion-item"> | ||
<h2 class="accordion-header" id="headingDataPrepWorkspace"> | ||
<button class="accordion-button collapsed" type="button" data-bs-toggle="collapse" data-bs-target="#collapseDataPrepWorkspace" aria-expanded="false" aria-controls="collapseDataPrepWorkspace"> | ||
<span class="fa-solid fa-spinner mx-2"></span> | ||
Associated data prep workspaces | ||
<span class="badge mx-2 bg-{% if is_active %}success{% else %}secondary{% endif %} pill"> {{ table.rows|length }}</span> | ||
</button> | ||
</h2> | ||
<div id="collapseDataPrepWorkspace" class="accordion-collapse collapse" aria-labelledby="headingDataPrepWorkspace" data-bs-parent="#accordionDataPrepWorkspace"> | ||
<div class="accordion-body"> | ||
{% render_table table %} | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</div> |