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

HYC-1765 - Duplicate people entries, bootstrap, file upload form (hyrax-4) #1011

Merged
merged 2 commits into from
Oct 2, 2023
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
2 changes: 1 addition & 1 deletion app/assets/javascripts/hyrax/save_work/required_fields.es6
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export class RequiredFields {
let selector = $(elem);
let parentHidden = selector.parent().closest('div.cloning');

if (parentHidden.hasClass('hidden')) {
if (parentHidden.hasClass('d-none')) {
return false;
}

Expand Down
4 changes: 2 additions & 2 deletions app/assets/javascripts/person_objects.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ $(document).on('turbolinks:load', function () {
// stop page from reloading
event.preventDefault();

$(remove_selector).removeClass('hidden');
$(remove_selector).removeClass('d-none');

// Retrieve an index for the new person
var current_index = getNextPersonIndex(person_type);
Expand All @@ -87,7 +87,7 @@ $(document).on('turbolinks:load', function () {

// remove $new_row's id so we don't find it again when looking for blank row to clone
$new_row.removeAttr('id');
$new_row.removeClass('hidden');
$new_row.removeClass('d-none');
$('div#' + person_type).append($new_row);

attachRemovePersonListener(person_type, $new_row);
Expand Down
18 changes: 9 additions & 9 deletions app/assets/javascripts/unc/unc_custom.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ $(function() {

// Remove any currently hidden student work types
$('.all-unc-work-types').on('click', function() {
all_work_types.removeClass('hidden');
all_work_types.removeClass('d-none');
});

// Filter form options based on which button is clicked
Expand All @@ -19,7 +19,7 @@ $(function() {
var regex;

// Clear all hidden forms before hiding current clicked options
all_work_types.removeClass('hidden');
all_work_types.removeClass('d-none');

if (clicked_link === 'student-papers-work-types') {
regex = /MastersPaper|HonorsThesis/;
Expand All @@ -38,7 +38,7 @@ $(function() {
} else {
return regex.test(work_type);
}
}).addClass('hidden');
}).addClass('d-none');
});
}

Expand Down Expand Up @@ -71,7 +71,7 @@ $(function() {

function hideNonRequiredFieldsBtn() {
$('#metadata a.additional-fields').on('click', function () {
$(this).addClass('hidden');
$(this).addClass('d-none');
});
}

Expand All @@ -96,15 +96,15 @@ $(function() {
var less_text = $('.truncated');

$('#collection-description-text-btn').on('click touchstart', function() {
var show_less_text = less_text.hasClass('hidden');
var show_less_text = less_text.hasClass('d-none');
var btn_text = (show_less_text) ? 'Show More' : 'Show Less';

if (show_less_text) {
full_text.addClass('hidden');
less_text.removeClass('hidden');
full_text.addClass('d-none');
less_text.removeClass('d-none');
} else {
full_text.removeClass('hidden');
less_text.addClass('hidden');
full_text.removeClass('d-none');
less_text.addClass('d-none');
}

$(this).text(btn_text);
Expand Down
4 changes: 2 additions & 2 deletions app/assets/javascripts/unc/unc_save_work_control.es6
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,11 @@ export default class UncSaveWorkControl extends SaveWorkControl {
const $cancelBtn = this.uploads.form.find('#file-upload-cancel-btn');

$uploadsEl.bind('fileuploadstart', () => {
$cancelBtn.removeClass('hidden');
$cancelBtn.removeClass('d-none');
});

$uploadsEl.bind('fileuploadstop', () => {
$cancelBtn.addClass('hidden');
$cancelBtn.addClass('d-none');
});
}
}
2 changes: 1 addition & 1 deletion app/views/hyrax/base/_form_progress.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
target: '_blank' %>
</label>
<% else %>
<label class="hidden">
<label class="d-none">
<%= f.input :agreement,
as: :boolean,
checked: f.object.agreement_accepted,
Expand Down
2 changes: 1 addition & 1 deletion app/views/hyrax/base/_form_relationships.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
selected: admin_set_id,
include_blank: true,
collection: admin_set_options,
input_html: { class: 'form-control hidden' },
input_html: { class: 'form-control d-none' },
readonly: true,
label: false %>
<% end%>
Expand Down
16 changes: 8 additions & 8 deletions app/views/hyrax/base/_guts4form.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,15 @@
<!-- Tab panes -->
<div class="tab-content card">
<% (tabs - ['share']).each_with_index do | tab, i | %>
<%# [hyc-override] only show files partial on metadata page %>
<% if tab == 'metadata' %>
<div class="table-responsive">
<%= render 'form_files' %>
</div>
<hr class="file-upload-divider">
<% end %>

<div role="tabpanel" class="tab-pane <% if i == 0 %>show active<% end %>" id="<%= tab %>">
<%# [hyc-override] only show files partial on metadata page %>
<% if tab == 'metadata' %>
<div class="table-responsive">
<%= render 'form_files' %>
</div>
<hr class="file-upload-divider">
<% end %>

<%# [hyc-override] Don't add undisplayable "files" tab text to dom %>
<div class="form-tab-content">
<% # metadata_tab is sometimes provided %>
Expand Down
2 changes: 1 addition & 1 deletion app/views/hyrax/collections/_collection_description.erb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<div class="truncated">
<%= simple_format(auto_link(description.truncate_words(100))) %>
</div>
<div class="full hidden">
<div class="full d-none">
<%= simple_format(auto_link(description)) %>
</div>
<button id="collection-description-text-btn" class="btn btn-default">Show More</button>
Expand Down
2 changes: 1 addition & 1 deletion app/views/records/edit_fields/_language_label.html.erb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<div class="hidden">
<div class="d-none">
<%= f.input :language_label, as: :multi_value %>
</div>
2 changes: 1 addition & 1 deletion app/views/records/edit_fields/_license_label.html.erb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<div class="hidden">
<div class="d-none">
<%= f.input :license_label, as: :multi_value %>
</div>
2 changes: 1 addition & 1 deletion app/views/records/edit_fields/_person.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
</div>
<% end %>

<div class="<%= person_term %> row cloning hidden field-wrapper" id='<%= person_term %>-cloning_row'>
<div class="<%= person_term %> row cloning d-none field-wrapper" id='<%= person_term %>-cloning_row'>
<%= f.fields_for person_key do |person| %>
<% if person.index <= @form.instance_eval(person_key.to_s).count %>
<div class="<%= person_term %> row well">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<div class="hidden">
<div class="d-none">
<%= f.input :rights_statement_label, as: :select %>
</div>