Skip to content

Commit

Permalink
Removing contributor tab from peer review #1650
Browse files Browse the repository at this point in the history
  • Loading branch information
user committed Jun 3, 2024
1 parent a08898e commit 184f048
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 59 deletions.
6 changes: 2 additions & 4 deletions dataedit/static/peer_review/opr_contributor.js
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,6 @@ function getCategoryToTabIdMapping() {
'temporal': 'spatiotemporal-tab',
'source': 'source-tab',
'license': 'license-tab',
'contributor': 'contributor-tab',
};
return mapping;
}
Expand Down Expand Up @@ -678,7 +677,7 @@ function updateSubmitButtonColor() {


function updateTabProgressIndicatorClasses() {
const tabNames = ['general', 'spatiotemporal', 'source', 'license', 'contributor'];
const tabNames = ['general', 'spatiotemporal', 'source', 'license'];

for (let i = 0; i < tabNames.length; i++) {
let tabName = tabNames[i];
Expand All @@ -699,7 +698,7 @@ function updateTabProgressIndicatorClasses() {


function updateTabClasses() {
const tabNames = ['general', 'spatiotemporal', 'source', 'license', 'contributor'];
const tabNames = ['general', 'spatiotemporal', 'source', 'license'];
for (let i = 0; i < tabNames.length; i++) {
let tabName = tabNames[i];
let tab = document.getElementById(tabName + '-tab');
Expand Down Expand Up @@ -740,7 +739,6 @@ document.addEventListener('DOMContentLoaded', function() {
document.getElementById('spatiotemporal-tab'),
document.getElementById('source-tab'),
document.getElementById('license-tab'),
document.getElementById('contributor-tab'),
];
const reviewContent = document.querySelector(".review__content");

Expand Down
6 changes: 2 additions & 4 deletions dataedit/static/peer_review/opr_reviewer.js
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,6 @@ function getCategoryToTabIdMapping() {
'temporal': 'spatiotemporal-tab',
'source': 'source-tab',
'license': 'license-tab',
'contributor': 'contributor-tab',
};
return mapping;
}
Expand Down Expand Up @@ -837,11 +836,10 @@ const otherTabs = [
document.getElementById('spatiotemporal-tab'),
document.getElementById('source-tab'),
document.getElementById('license-tab'),
document.getElementById('contributor-tab'),
];
const reviewContent = document.querySelector(".review__content");
function updateTabClasses() {
const tabNames = ['general', 'spatiotemporal', 'source', 'license', 'contributor'];
const tabNames = ['general', 'spatiotemporal', 'source', 'license'];
for (let i = 0; i < tabNames.length; i++) {
let tabName = tabNames[i];
let tab = document.getElementById(tabName + '-tab');
Expand Down Expand Up @@ -896,7 +894,7 @@ function updatePercentageDisplay() {


function updateTabProgressIndicatorClasses() {
const tabNames = ['general', 'spatiotemporal', 'source', 'license', 'contributor'];
const tabNames = ['general', 'spatiotemporal', 'source', 'license'];

for (let i = 0; i < tabNames.length; i++) {
let tabName = tabNames[i];
Expand Down
23 changes: 1 addition & 22 deletions dataedit/templates/dataedit/opr_contributor.html
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,7 @@ <h5 class="modal-title" id="exampleModalLabel">The Open Peer Review process</h5>
<li class="nav-item" role="presentation">
<button class="nav-link" id="license-tab" data-bs-toggle="tab" data-bs-target="#license" type="button" role="tab" aria-controls="license" aria-selected="false">License</button>
</li>
<li class="nav-item" role="presentation">
<button class="nav-link" id="contributor-tab" data-bs-toggle="tab" data-bs-target="#contributor" type="button" role="tab" aria-controls="contributor" aria-selected="false">Contributor</button>
</li>

<li class="nav-item" role="presentation">
<button class="nav-link" id="summary-tab" data-bs-toggle="tab" data-bs-target="#summary" type="button" role="tab" aria-controls="summary" aria-selected="false">Summary</button>
</li>
Expand Down Expand Up @@ -209,25 +207,6 @@ <h5 class="modal-title" id="exampleModalLabel">The Open Peer Review process</h5>
{% endfor %}
</div>
</div>
<div class="tab-pane fade" id="contributor" role="tabpanel" aria-labelledby="contributor-tab">
<div class="review__items">
{% for item in meta.contributor %}
<div id="field_{{item.field}}" class="field review__item" data-category="contributor" onclick="click_field('{{item.field}}', '{{ item.value }}', 'contributor');">
<p class="review__item-content">
{% if item.field is Null %}
<span class="key">{{item.field}}</span>
<span class="value">{{ item.value }}</span>
{% else %}
<span class="key">{{item.field}}</span>
<span class="value">{{ item.newValue|default:item.value }}</span>
<span id="reviewerSuggestion_{{item.field}}" class="suggestion suggestion--highlight">{{ item.reviewer_suggestion }}</span>
<span class="comment suggestion--comment"> {{ item.suggestion_comment }}</span>
{% endif %}
</p>
</div>
{% endfor %}
</div>
</div>

<div class="tab-pane fade" id="summary" role="tabpanel" aria-labelledby="summary-tab">
</div>
Expand Down
22 changes: 0 additions & 22 deletions dataedit/templates/dataedit/opr_review.html
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,6 @@ <h5 class="modal-title" id="exampleModalLabel">The Open Peer Review process</h5>
<li class="nav-item" role="presentation">
<button class="nav-link" id="license-tab" data-bs-toggle="tab" data-bs-target="#license" type="button" role="tab" aria-controls="license" aria-selected="false">License</button>
</li>
<li class="nav-item" role="presentation">
<button class="nav-link" id="contributor-tab" data-bs-toggle="tab" data-bs-target="#contributor" type="button" role="tab" aria-controls="contributor" aria-selected="false">Contributor</button>
</li>
<li class="nav-item" role="presentation">
<button class="nav-link" id="summary-tab" data-bs-toggle="tab" data-bs-target="#summary" type="button" role="tab" aria-controls="summary" aria-selected="false">Summary</button>
</li>
Expand Down Expand Up @@ -206,25 +203,6 @@ <h5 class="modal-title" id="exampleModalLabel">The Open Peer Review process</h5>
{% endfor %}
</div>
</div>
<div class="tab-pane fade" id="contributor" role="tabpanel" aria-labelledby="contributor-tab">
<div class="review__items">
{% for item in meta.contributor %}
<div id="field_{{item.field}}" class="field review__item" data-category="contributor" onclick="click_field('{{item.field}}', '{{ item.value }}', 'contributor');">
<p class="review__item-content">
{% if item.field is Null %}
<span class="key">{{item.field}}</span>
<span class="value">{{ item.value }}</span>
{% else %}
<span class="key">{{item.field}}</span>
<span class="value">{{ item.newValue|default:item.value }}</span>
<span id="reviewerSuggestion_{{item.field}}" class="suggestion suggestion--highlight">{{ item.reviewer_suggestion }}</span>
<span class="comment suggestion--comment"> {{ item.suggestion_comment }}</span>
{% endif %}
</p>
</div>
{% endfor %}
</div>
</div>
<div class="tab-pane fade" id="resource" role="tabpanel" aria-labelledby="resource-tab">
<div class="review__items">
{% for item in meta.resource %}
Expand Down
8 changes: 1 addition & 7 deletions dataedit/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -1968,7 +1968,6 @@ def sort_in_category(self, schema, table, oemetadata):
"temporal": [...],
"source": [...],
"license": [...],
"contributor": [...],
}
"""
Expand All @@ -1979,7 +1978,6 @@ def sort_in_category(self, schema, table, oemetadata):
temporal_key_list = []
source_key_list = []
license_key_list = []
contributor_key_list = []

for i in val:
fieldKey = list(i.values())[0]
Expand All @@ -1991,8 +1989,7 @@ def sort_in_category(self, schema, table, oemetadata):
source_key_list.append(i)
elif fieldKey.split(".")[0] == "licenses":
license_key_list.append(i)
elif fieldKey.split(".")[0] == "contributors":
contributor_key_list.append(i)

elif (
fieldKey.split(".")[0] == "name"
or fieldKey.split(".")[0] == "title"
Expand All @@ -2012,7 +2009,6 @@ def sort_in_category(self, schema, table, oemetadata):
"temporal": temporal_key_list,
"source": source_key_list,
"license": license_key_list,
"contributor": contributor_key_list,
}

return meta
Expand Down Expand Up @@ -2107,7 +2103,6 @@ def get(self, request, schema, table, review_id=None):
"temporal",
"source",
"license",
"contributor",
]
state_dict = process_review_data(
review_data=existing_review, metadata=metadata, categories=categories
Expand Down Expand Up @@ -2302,7 +2297,6 @@ def get(self, request, schema, table, review_id):
"temporal",
"source",
"license",
"contributor",
]
state_dict = process_review_data(
review_data=review_data, metadata=metadata, categories=categories
Expand Down

0 comments on commit 184f048

Please sign in to comment.