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

Hyrax 5 upgrade fix a few specs #2101

Closed
wants to merge 202 commits into from
Closed

Conversation

jeremyf
Copy link
Contributor

@jeremyf jeremyf commented Dec 21, 2023

🧹 Narrow specificity of CSS selector

cffe41b

The selector was very specific, and with the HTML class changes for
Bootstrap 3 to 4, this almost certainly broke.

Note, there are still underlying issues with two other specs; there
errors are listed below:

1) Admin can select home page theme when a search results theme is
selected updates the search results page with the selected layout view

Failure/Error: super

     ActionView::Template::Error:
       undefined method `with_collection' for nil:NilClass

🧹 Remove specificity of CSS selectors in test

9c3c46a

The hyper specific selectors are not durable for CSS framework upgrades.

orangewolf and others added 30 commits September 20, 2023 23:59
kirkkwang and others added 22 commits December 20, 2023 13:24
Just found one actor that was overriding Hyrax.  This commit will switch
it to a decorator.
…sibility

🧹 Fix `./spec/requests/admin_dashboard_spec.rb` spec
🎁 Upgrade Redis initializer to Hyrax 5's gen version
Adjust paths and keys to look for labels.
The partials rendered in the tested view assume that we've set a
collection type.
…d-collections

🧹 Assigning collection_type
…-selectors

Fixing nav link selectors to new structure
The only big thing in this commit is the appearance_decorator.  I've
added to the spec to show that the decorator should be working as
intended.
…-selectors

Fixing nav link selectors to new structure
…-selectors

Fixing nav link selectors to new structure
The selector was *very* specific, and with the HTML class changes for
Bootstrap 3 to 4, this almost certainly broke.

Note, there are still underlying issues with two other specs; there
errors are listed below:

```
1) Admin can select home page theme when a search results theme is
selected updates the search results page with the selected layout view

Failure/Error: super

     ActionView::Template::Error:
       undefined method `with_collection' for nil:NilClass
```
The hyper specific selectors are not durable for CSS framework upgrades.
allColorInputs.each(function() {
$(this).val($(this).data('default-value'))
})
})

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing semicolon.


allColorInputs.each(function() {
$(this).val($(this).data('default-value'))
})

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing semicolon.

var allColorInputs = $("input[name*='color']")

allColorInputs.each(function() {
$(this).val($(this).data('default-value'))

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing semicolon.

$('.panel-footer a.restore-all-default-colors').click(function(e) {
e.preventDefault()

var allColorInputs = $("input[name*='color']")

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing semicolon.

})

$('.panel-footer a.restore-all-default-colors').click(function(e) {
e.preventDefault()

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing semicolon.

var input = $("input[name='admin_appearance["+ defaultTarget +"]']")

input.val(input.data('default-value'))
})

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing semicolon.

var defaultTarget = $(e.target).data('default-target')
var input = $("input[name='admin_appearance["+ defaultTarget +"]']")

input.val(input.data('default-value'))

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing semicolon.

e.preventDefault()

var defaultTarget = $(e.target).data('default-target')
var input = $("input[name='admin_appearance["+ defaultTarget +"]']")

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing semicolon.

$('div.defaultable-colors a.restore-default-color').click(function(e) {
e.preventDefault()

var defaultTarget = $(e.target).data('default-target')

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing semicolon.

@@ -0,0 +1,20 @@
$(document).on('turbolinks:load', function() {
$('div.defaultable-colors a.restore-default-color').click(function(e) {
e.preventDefault()

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing semicolon.

allColorInputs.each(function() {
$(this).val($(this).data('default-value'))
})
})

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing semicolon.


allColorInputs.each(function() {
$(this).val($(this).data('default-value'))
})

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing semicolon.

var allColorInputs = $("input[name*='color']")

allColorInputs.each(function() {
$(this).val($(this).data('default-value'))

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing semicolon.

$('.panel-footer a.restore-all-default-colors').click(function(e) {
e.preventDefault()

var allColorInputs = $("input[name*='color']")

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing semicolon.

})

$('.panel-footer a.restore-all-default-colors').click(function(e) {
e.preventDefault()

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing semicolon.

var input = $("input[name='admin_appearance["+ defaultTarget +"]']")

input.val(input.data('default-value'))
})

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing semicolon.

var defaultTarget = $(e.target).data('default-target')
var input = $("input[name='admin_appearance["+ defaultTarget +"]']")

input.val(input.data('default-value'))

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing semicolon.

e.preventDefault()

var defaultTarget = $(e.target).data('default-target')
var input = $("input[name='admin_appearance["+ defaultTarget +"]']")

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing semicolon.

$('div.defaultable-colors a.restore-default-color').click(function(e) {
e.preventDefault()

var defaultTarget = $(e.target).data('default-target')

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing semicolon.

@@ -0,0 +1,20 @@
$(document).on('turbolinks:load', function() {
$('div.defaultable-colors a.restore-default-color').click(function(e) {
e.preventDefault()

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing semicolon.

allColorInputs.each(function() {
$(this).val($(this).data('default-value'))
})
})

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing semicolon.


allColorInputs.each(function() {
$(this).val($(this).data('default-value'))
})

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing semicolon.

var allColorInputs = $("input[name*='color']")

allColorInputs.each(function() {
$(this).val($(this).data('default-value'))

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing semicolon.

$('.panel-footer a.restore-all-default-colors').click(function(e) {
e.preventDefault()

var allColorInputs = $("input[name*='color']")

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing semicolon.

})

$('.panel-footer a.restore-all-default-colors').click(function(e) {
e.preventDefault()

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing semicolon.

$('div.defaultable-colors a.restore-default-color').click(function(e) {
e.preventDefault()

var defaultTarget = $(e.target).data('default-target')

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing semicolon.

@@ -0,0 +1,20 @@
$(document).on('turbolinks:load', function() {
$('div.defaultable-colors a.restore-default-color').click(function(e) {
e.preventDefault()

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing semicolon.

// Grab the data from the ul div
var series_data = new Array();
var pointer_lookup = new Array();
var x_ticks = new Array();

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The array literal notation [] is preferable.

if (domDependenciesMet()) {
// Grab the data from the ul div
var series_data = new Array();
var pointer_lookup = new Array();

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The array literal notation [] is preferable.

//flot loaded? And canvas element supported.
if (domDependenciesMet()) {
// Grab the data from the ul div
var series_data = new Array();

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The array literal notation [] is preferable.

allColorInputs.each(function() {
$(this).val($(this).data('default-value'))
})
})

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing semicolon.


allColorInputs.each(function() {
$(this).val($(this).data('default-value'))
})

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing semicolon.

var allColorInputs = $("input[name*='color']")

allColorInputs.each(function() {
$(this).val($(this).data('default-value'))

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing semicolon.

$('.panel-footer a.restore-all-default-colors').click(function(e) {
e.preventDefault()

var allColorInputs = $("input[name*='color']")

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing semicolon.

})

$('.panel-footer a.restore-all-default-colors').click(function(e) {
e.preventDefault()

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing semicolon.

@@ -0,0 +1,20 @@
$(document).on('turbolinks:load', function() {
$('div.defaultable-colors a.restore-default-color').click(function(e) {
e.preventDefault()

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing semicolon.

// Grab the data from the ul div
var series_data = new Array();
var pointer_lookup = new Array();
var x_ticks = new Array();

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The array literal notation [] is preferable.

if (domDependenciesMet()) {
// Grab the data from the ul div
var series_data = new Array();
var pointer_lookup = new Array();

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The array literal notation [] is preferable.

//flot loaded? And canvas element supported.
if (domDependenciesMet()) {
// Grab the data from the ul div
var series_data = new Array();

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The array literal notation [] is preferable.

};

global.BlacklightRangeLimit = BlacklightRangeLimit;
}(this);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Expected an assignment or function call and instead saw an expression.

allColorInputs.each(function() {
$(this).val($(this).data('default-value'))
})
})

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing semicolon.


allColorInputs.each(function() {
$(this).val($(this).data('default-value'))
})

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing semicolon.

var allColorInputs = $("input[name*='color']")

allColorInputs.each(function() {
$(this).val($(this).data('default-value'))

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing semicolon.

$('.panel-footer a.restore-all-default-colors').click(function(e) {
e.preventDefault()

var allColorInputs = $("input[name*='color']")

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing semicolon.

})

$('.panel-footer a.restore-all-default-colors').click(function(e) {
e.preventDefault()

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing semicolon.

if (domDependenciesMet()) {
// Grab the data from the ul div
var series_data = new Array();
var pointer_lookup = new Array();

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The array literal notation [] is preferable.

//flot loaded? And canvas element supported.
if (domDependenciesMet()) {
// Grab the data from the ul div
var series_data = new Array();

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The array literal notation [] is preferable.

};

global.BlacklightRangeLimit = BlacklightRangeLimit;
}(this);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Expected an assignment or function call and instead saw an expression.

max = BlacklightRangeLimit.parseNum($(range_element).find(".max").first().text());
}

return [min, max]

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing semicolon.




var min = max = BlacklightRangeLimit.parseNum(current_limit.find(".single").text())

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing semicolon.
You might be leaking a variable (max) here.

// set as sniffed from HTML. Pass in a DOM element for a div.range
// Will return NaN as min or max in case of error or other weirdness.
function min_max(range_element) {
var current_limit = $(range_element).closest(".limit_content.range_limit").find(".current")

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing semicolon.


if (plot && slider_el) {
slider_el.width(plot.width());
slider_el.css("display", "block")

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing semicolon.

placeholder_input.slider("setValue", values);
});

end_el.change( function() {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'end_el' used out of scope.

begin_el.val(min);
end_el.val(max);

begin_el.change( function() {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'begin_el' used out of scope.

}

begin_el.val(min);
end_el.val(max);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'end_el' used out of scope.

});
}

begin_el.val(min);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'begin_el' used out of scope.


// Slider change should update text input values.
var parent = $(this).parent();
var form = $(parent).closest(".limit_content").find("form.range_limit");

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'form' is already defined.


if (plot && slider_el) {
slider_el.width(plot.width());
slider_el.css("display", "block")

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing semicolon.

if (isInt(min) && isInt(max)) {
$(this).contents().wrapAll('<div style="display:none" />');

var range_element = $(this);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'range_element' is already defined.

@jeremyf jeremyf closed this Dec 21, 2023
@jeremyf jeremyf deleted the hyrax-5-upgrade-fix-a-few-specs branch December 22, 2023 14:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants