Skip to content

Commit

Permalink
update IrodsDataRequest path display (#1749)
Browse files Browse the repository at this point in the history
  • Loading branch information
mikkonie committed Sep 1, 2023
1 parent 311a526 commit 16eb806
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 24 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,8 @@ Changed
- Hide internal fields from ISA-Tab templates (#1698, #1733)
- Refactor ``IrodsDataRequest`` model and tests (#1706)
- Update ``get_sheets_url()`` helper to only handle ``Project`` objects (#1771)
- Display full path under assay for iRODS data requests in UI (#1749)
- Return full path under assay from ``IrodsDataRequest.get_short_path()`` (#1749)
- **Taskflowbackend**
- Move iRODS object helpers from ``LandingZoneTaskflowMixin`` (#1699)
- Move iRODS test cleanup to ``TaskflowTestMixin.clear_irods_test_data()`` (#1722)
Expand Down
13 changes: 9 additions & 4 deletions samplesheets/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -1421,14 +1421,19 @@ def is_collection(self):
return irods.collections.exists(self.path)

def get_short_path(self):
"""Return shortened layout-friendly path"""
return '/'.join(self.path.split('/')[-2:])
"""
Return shortened layout-friendly path, omitting the full path to the
assay root.
"""
irods_backend = get_backend_api('omics_irods')
pp_len = len(irods_backend.get_projects_path().split('/'))
# NOTE: This only works for assays, needs to be changed if studies are
# supported
return '/'.join(self.path.split('/')[pp_len + 5 :])

def get_assay(self):
"""Return Assay object for request path or None if not found"""
irods_backend = get_backend_api('omics_irods')
if not irods_backend:
return None
a_uuid = irods_backend.get_uuid_from_path(self.path, 'assay')
return Assay.objects.filter(sodar_uuid=a_uuid).first()

Expand Down
36 changes: 16 additions & 20 deletions samplesheets/templates/samplesheets/irods_requests.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,38 +18,33 @@
table#sodar-ss-request-table tbody tr td:nth-child(4) {
white-space: nowrap;
}

table#sodar-ss-request-table thead tr th:nth-child(3),
table#sodar-ss-request-table tbody tr td:nth-child(3) {
width: 150px;
}

table#sodar-ss-request-table thead tr th:nth-child(4),
table#sodar-ss-request-table tbody tr td:nth-child(4) {
width: 120px;
}

table#sodar-ss-request-table thead tr th:nth-child(5),
table#sodar-ss-request-table tbody tr td:nth-child(5) {
width: 75px;
width: 75px;
}

/* Date column */
@media screen and (max-width: 900px) {
table#sodar-ss-request-table thead tr th:nth-child(3),
table#sodar-ss-request-table tbody tr td:nth-child(3) {
display: none;
}
}

/* User column */
@media screen and (max-width: 700px) {
table#sodar-ss-request-table thead tr th:nth-child(2),
table#sodar-ss-request-table tbody tr td:nth-child(2) {
display: none;
}
}

/* Status column */
@media screen and (max-width: 550px) {
table#sodar-ss-request-table thead tr th:nth-child(4),
Expand Down Expand Up @@ -127,9 +122,13 @@ <h3>iRODS Delete Requests</h3>
{% for irods_request in object_list %}
<tr class="sodar-ss-request-item">
<td>
<span class="sodar-ss-request-item-path"
title="Assay: {{ irods_request.get_assay.get_display_name }}"
data-toggle="tooltip">
<a href="{{ irods_request.get_assay.get_url }}"
title="{{ irods_request.get_assay.get_display_name }}"
class="sodar-ss-request-item-assay-link"
data-tooltip="tooltip" data-placement="top">
<i class="iconify text-danger" data-icon="mdi:table-large"></i>
</a>
<span class="sodar-ss-request-item-path">
{{ irods_request.get_short_path }}
</span>
{% if irods_request.description %}
Expand Down Expand Up @@ -232,7 +231,6 @@ <h3>iRODS Delete Requests</h3>
{# Tour content #}
<script type="text/javascript">
tourEnabled = true;

tour.addStep('irods_req_info', {
title: 'iRODS Delete Requests',
text: 'In this view you can manage requests for deleting specific ' +
Expand All @@ -241,7 +239,6 @@ <h3>iRODS Delete Requests</h3>
advanceOn: '.docs-link click',
showCancelLink: true
});

tour.addStep('irods_req_contributor', {
title: 'As Project Contributor',
text: 'As a project contributor, you can see your own requests along ' +
Expand All @@ -252,7 +249,6 @@ <h3>iRODS Delete Requests</h3>
advanceOn: '.docs-link click',
showCancelLink: true
});

tour.addStep('irods_req_owner', {
title: 'As Project Owner or Delegate',
text: 'As a project owner or delegate, you see a list of all active ' +
Expand All @@ -264,8 +260,15 @@ <h3>iRODS Delete Requests</h3>
advanceOn: '.docs-link click',
showCancelLink: true
});

if ($('.sodar-ss-request-item').length) {
tour.addStep('irods_req_assay', {
title: 'Request assay',
text: 'This icon displays the assay for the request and links to ' +
'it in the main sample sheets view.',
attachTo: '.sodar-ss-request-item-assay-link right',
advanceOn: '.docs-link click',
showCancelLink: true
});
tour.addStep('irods_req_path', {
title: 'Request Path',
text: 'The partial path of the request is displayed here, ' +
Expand All @@ -277,7 +280,6 @@ <h3>iRODS Delete Requests</h3>
advanceOn: '.docs-link click',
showCancelLink: true
});

if ($('.sodar-ss-request-item-description').length) {
tour.addStep('irods_req_desc', {
title: 'Request Description',
Expand All @@ -289,15 +291,13 @@ <h3>iRODS Delete Requests</h3>
showCancelLink: true
});
}

tour.addStep('irods_req_status', {
title: 'Request Status',
text: 'The current status of the request is displayed here.',
attachTo: '.sodar-ss-request-item-status left',
advanceOn: '.docs-link click',
showCancelLink: true
});

tour.addStep('irods_req_dropdown', {
title: 'Request Dropdown',
text: 'This dropdown contains links to actions the user is ' +
Expand All @@ -306,7 +306,6 @@ <h3>iRODS Delete Requests</h3>
advanceOn: '.docs-link click',
showCancelLink: true
});

if ($('.sodar-ss-request-item-check').length) {
tour.addStep('irods_req_check', {
title: 'Batch Accepting or Rejecting Requests',
Expand All @@ -323,7 +322,6 @@ <h3>iRODS Delete Requests</h3>
});
}
}

tour.addStep('irods_req_ops_dropdown', {
title: 'Request Operations Dropdown',
text: 'This dropdown lists operations you can perform on requests. ' +
Expand All @@ -334,7 +332,6 @@ <h3>iRODS Delete Requests</h3>
advanceOn: '.docs-link click',
showCancelLink: true
});

tour.addStep('sheets_btn_back', {
title: 'Back to Project Sample Sheets',
text: 'Click on this button to return to the project sample sheets.',
Expand All @@ -343,5 +340,4 @@ <h3>iRODS Delete Requests</h3>
showCancelLink: true
});
</script>

{% endblock javascript %}

0 comments on commit 16eb806

Please sign in to comment.