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

YDA-5808 - Added Base DOI and all the versions of the selected datapackage in VAULT space. #345

Merged
merged 4 commits into from
Aug 9, 2024
Merged
Show file tree
Hide file tree
Changes from 2 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
13 changes: 13 additions & 0 deletions vault/static/vault/css/vault.css
Original file line number Diff line number Diff line change
Expand Up @@ -118,3 +118,16 @@ table.dataTable > tbody > tr > td {
color: #444;
padding-left:3px;
}

.meta-content-size {
text-align: justify;
kaur16 marked this conversation as resolved.
Show resolved Hide resolved
}

/* Version */
.version tbody {
font-size: 14px;
}

.highlight td {
background-color: var(--bs-primary-border-subtle);
}
42 changes: 42 additions & 0 deletions vault/static/vault/js/vault.js
Original file line number Diff line number Diff line change
Expand Up @@ -684,6 +684,9 @@ function topInformation (dir, showAlert, rebuildFileBrowser = false) {
const downloadable = data.downloadable
const archive = data.archive
researchGroupAccess = data.research_group_access
const allVersions = data.all_versions
const baseDOI = data.base_doi
const packageDOI = data.package_doi

$('.btn-group button.metadata-form').hide()
$('.top-information').hide()
Expand Down Expand Up @@ -790,6 +793,45 @@ function topInformation (dir, showAlert, rebuildFileBrowser = false) {
$('.alert.is-processing').show()
} else {
metadataInfo(dir)
if (vaultStatus === 'PUBLISHED') {
kaur16 marked this conversation as resolved.
Show resolved Hide resolved
$('.metadata-form-size').addClass('col-lg-8')
$('.meta-title-size').removeClass('col-lg-2').addClass('col-lg-3')
$('.meta-content-size').removeClass('col-lg-10').addClass('col-lg-9')

// List DOIs
const listDOIs = $('.version tbody')
const baseDOISpan = $('.base_doi span')
let ld = ''
let highlight = ''
let bdoi = ''
for (let i = 0; i < allVersions.length; i++) {
if (packageDOI === allVersions[i][1] && allVersions.length > 1) {
highlight = ' class="highlight"'
} else {
highlight = ''
}

ld += '<tr' + highlight + '><td>' +
'<a href="https://doi.org/' + allVersions[i][1] + '">https://doi.org/' + allVersions[i][1] + '</a>' +
'</td><td>' +
'<small title="' + allVersions[i][2] + '">' + allVersions[i][0] + '</small>' +
'</td></tr>'
}
listDOIs.html(ld)
if (baseDOI != null) {
bdoi += '<a href="https://doi.org/' + baseDOI + '">https://doi.org/' + baseDOI + '</a><br>'
baseDOISpan.html(bdoi)
$('.base_doi').show()
} else {
$('.base_doi').hide()
}
$('.version').show()
} else {
$('.metadata-form-size').removeClass('col-lg-8')
$('.meta-title-size').removeClass('col-lg-3').addClass('col-lg-2')
$('.meta-content-size').removeClass('col-lg-9').addClass('col-lg-10')
$('.version').hide()
}
}

// Datamanager sees access buttons in vault.
Expand Down
80 changes: 49 additions & 31 deletions vault/templates/vault/browse.html
Original file line number Diff line number Diff line change
Expand Up @@ -329,38 +329,56 @@ <h5 class="modal-title">Unarchive datapackage from tape</h5>
<section class="metadata-info container hide">
<h3 class="metadata-title"></h3>
<h5 class="metadata-creator mt-3"></h5>
<div class="row">
<div class="col-lg-2">
<strong>Description <i class="fa-solid fa-question-circle" aria-hidden="true" title="Description of this data package"></i></strong>
</div>
<div class="col-lg-10">
<div class="metadata-description"></div>
<button type="button" class="btn read-more-button hide">Read full description...</button>
<button type="button" class="btn read-less-button hide">Collapse description...</button>
</div>
</div>
<div class="row">
<div class="col-lg-2">
<strong>Data classification <i class="fa-solid fa-question-circle" aria-hidden="true" title="Classification of data package with regard to information security policy"></i></strong>
</div>
<div class="col-lg-10">
<span class="metadata-data-classification"></span>
</div>
</div>
<div class="row">
<div class="col-lg-2">
<strong>Data package access <i class="fa-solid fa-question-circle" aria-hidden="true" title="Data package accessibility to third parties"></i></strong>
</div>
<div class="col-lg-10">
<span class="metadata-access"></span>
</div>
</div>
<div class="row">
<div class="col-lg-2">
<strong>License <i class="fa-solid fa-question-circle" aria-hidden="true" title="The license under which this data package is available for use by third parties"></i></strong>
<div class="row pb-4 mb-3">
<div class="metadata-form-size">
<div class="row">
<div class="meta-title-size col-lg-2">
<strong data-toggle="tooltip" data-placement="bottom" title="Description of this data package">Description</strong>
</div>
<div class="meta-content-size col-lg-10">
<div class="metadata-description"></div>
<button type="button" class="btn read-more-button hide">Read full description...</button>
<button type="button" class="btn read-less-button hide">Collapse description...</button>
</div>
</div>
<div class="row">
<div class="meta-title-size col-lg-2">
<strong data-toggle="tooltip" data-placement="bottom" title="Classification of data package with regard to information security policy">Data classification</strong>
</div>
<div class="meta-content-size col-lg-10">
<span class="metadata-data-classification"></span>
</div>
</div>
<div class="row">
<div class="meta-title-size col-lg-2">
<strong data-toggle="tooltip" data-placement="bottom" title="Data package accessibility to third parties">Data package access</strong>
</div>
<div class="meta-content-size col-lg-10">
<span class="metadata-access"></span>
</div>
</div>
<div class="row">
<div class="meta-title-size col-lg-2">
<strong data-toggle="tooltip" data-placement="bottom" title="The license under which this data package is available for use by third parties">License</strong>
</div>
<div class="meta-content-size col-lg-10">
<span class="metadata-license"></span>
</div>
</div>
</div>
<div class="col-lg-10">
<span class="metadata-license"></span>
<div class="version col-lg-4 hide">
<div>
<h6 class="ml-1"><b>Versions</b></h6>
<table class="table table-sm">
<tbody>
</tbody>
</table>
<small class="base_doi hide">
<b>Base DOI: </b>
<span></span>
This DOI represents all versions of this publication and will resolve to the latest publication.
</small>
</div>
</div>
</div>
</section>
Expand Down