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

[Backport] Use double quotes in CoffeeScript files #3339

Merged
merged 2 commits into from
Mar 6, 2019

Conversation

javierm
Copy link
Member

@javierm javierm commented Mar 5, 2019

References

Objectives

Use double quotes instead of single quotes in CoffeeScript files, just like we do in the rest of the application, in order to make the code more consistent and easier to read.

Notes

@@ -21,10 +21,10 @@ App.WatchFormChanges =
if App.WatchFormChanges.forms().length == 0 || App.WatchFormChanges.msg() == undefined
return

$(document).off('page:before-change').on('page:before-change', (e) -> App.WatchFormChanges.checkChanges(e))
$(document).off("page:before-change").on("page:before-change", (e) -> App.WatchFormChanges.checkChanges(e))

Choose a reason for hiding this comment

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

Line exceeds maximum allowed length. Length is 111, max is 100.

url = $(el).data 'graph'
conf = bindto: el, data: { x: 'x', url: url, mimeType: 'json' }, axis: { x: { type: 'timeseries', tick: { format: '%Y-%m-%d' } } }
url = $(el).data "graph"
conf = bindto: el, data: { x: "x", url: url, mimeType: "json" }, axis: { x: { type: "timeseries", tick: { format: "%Y-%m-%d" } } }

Choose a reason for hiding this comment

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

Line exceeds maximum allowed length. Length is 134, max is 100.

rows = table.find('tr:gt(0)').not('tfoot tr').toArray().sort(App.TableSortable.comparer($(this).index()))
$("table.sortable th").click ->
table = $(this).parents("table").eq(0)
rows = table.find("tr:gt(0)").not("tfoot tr").toArray().sort(App.TableSortable.comparer($(this).index()))

Choose a reason for hiding this comment

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

Line exceeds maximum allowed length. Length is 111, max is 100.

success: (data) ->
e.target.bindPopup(getPopupContent(data)).openPopup()

getPopupContent = (data) ->
content = "<a href='/budgets/#{data['budget_id']}/investments/#{data['investment_id']}'>#{data['investment_title']}</a>"
content = "<a href='/budgets/#{data["budget_id"]}/investments/#{data["investment_id"]}'>#{data["investment_title"]}</a>"

Choose a reason for hiding this comment

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

Line exceeds maximum allowed length. Length is 126, max is 100.

$(document).off('click', '[data-annotation-id]').on('click', '[data-annotation-id]', App.LegislationAnnotatable.onClick)
$(document).off('click', '[data-cancel-annotation]').on('click', '[data-cancel-annotation]', (e) ->
$(document).off("click", "[data-annotation-id]").on("click", "[data-annotation-id]", App.LegislationAnnotatable.onClick)
$(document).off("click", "[data-cancel-annotation]").on("click", "[data-cancel-annotation]", (e) ->

Choose a reason for hiding this comment

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

Line exceeds maximum allowed length. Length is 103, max is 100.

$(data.errorContainer).append(errors)

setPreview: (data) ->
image_preview = '<div class="small-12 column text-center image-preview"><figure><img src="' + data.result.attachment_url + '" class="cached-image"/></figure></div>'
image_preview = "<div class='small-12 column text-center image-preview'><figure><img src='#{data.result.attachment_url}' class='cached-image'></figure></div>"

Choose a reason for hiding this comment

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

Line exceeds maximum allowed length. Length is 162, max is 100.


clearProgressBar: (data) ->
$(data.progressBar).find('.loading-bar').removeClass('complete errors uploading').css('width', "0px")
$(data.progressBar).find(".loading-bar").removeClass("complete errors uploading").css("width", "0px")

Choose a reason for hiding this comment

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

Line exceeds maximum allowed length. Length is 105, max is 100.

$(data.wrapper).find(".attachment-actions").removeClass('small-12').addClass('small-6 float-right')
$(data.wrapper).find(".attachment-actions .action-remove").removeClass('small-3').addClass('small-12')
$(data.wrapper).find(".attachment-actions").removeClass("small-12").addClass("small-6 float-right")
$(data.wrapper).find(".attachment-actions .action-remove").removeClass("small-3").addClass("small-12")

Choose a reason for hiding this comment

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

Line exceeds maximum allowed length. Length is 110, max is 100.

App.Imageable.setFilename(data, data.result.filename)
App.Imageable.clearInputErrors(data)
$(data.addAttachmentLabel).hide()
$(data.wrapper).find(".attachment-actions").removeClass('small-12').addClass('small-6 float-right')
$(data.wrapper).find(".attachment-actions .action-remove").removeClass('small-3').addClass('small-12')
$(data.wrapper).find(".attachment-actions").removeClass("small-12").addClass("small-6 float-right")

Choose a reason for hiding this comment

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

Line exceeds maximum allowed length. Length is 107, max is 100.

$(data.wrapper).find(".attachment-actions").addClass('small-12').removeClass('small-6 float-right')
$(data.wrapper).find(".attachment-actions .action-remove").addClass('small-3').removeClass('small-12')
$(data.wrapper).find(".attachment-actions").addClass("small-12").removeClass("small-6 float-right")
$(data.wrapper).find(".attachment-actions .action-remove").addClass("small-3").removeClass("small-12")

Choose a reason for hiding this comment

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

Line exceeds maximum allowed length. Length is 110, max is 100.

@javierm javierm changed the base branch from backport-coffeelint to master March 6, 2019 10:40
We use it in Ruby, and it will make it easier to change all quotes to
double quotes in CoffeeScript files.
As we do in the rest of the application.

Note we cannot add a rule enforcing double quotes because CoffeeScript
Lint does not have such rule.
@javierm javierm force-pushed the backport-coffeescript_quotes branch from 18ffa20 to b27855c Compare March 6, 2019 10:41
@@ -140,21 +140,21 @@ App.Documentable =
App.Documentable.clearProgressBar(data)

App.Documentable.unlockUploads()
$(data.wrapper).find(".attachment-actions").addClass('small-12').removeClass('small-6 float-right')
$(data.wrapper).find(".attachment-actions .action-remove").addClass('small-3').removeClass('small-12')
$(data.wrapper).find(".attachment-actions").addClass("small-12").removeClass("small-6 float-right")

Choose a reason for hiding this comment

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

Line exceeds maximum allowed length. Length is 107, max is 100.


clearProgressBar: (data) ->
$(data.progressBar).find('.loading-bar').removeClass('complete errors uploading').css('width', "0px")
$(data.progressBar).find(".loading-bar").removeClass("complete errors uploading").css("width", "0px")

Choose a reason for hiding this comment

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

Line exceeds maximum allowed length. Length is 105, max is 100.

$(data.wrapper).find(".attachment-actions").removeClass('small-12').addClass('small-6 float-right')
$(data.wrapper).find(".attachment-actions .action-remove").removeClass('small-3').addClass('small-12')
$(data.wrapper).find(".attachment-actions").removeClass("small-12").addClass("small-6 float-right")
$(data.wrapper).find(".attachment-actions .action-remove").removeClass("small-3").addClass("small-12")

Choose a reason for hiding this comment

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

Line exceeds maximum allowed length. Length is 110, max is 100.

App.Documentable.setFilename(data, data.result.filename)
App.Documentable.clearInputErrors(data)
$(data.addAttachmentLabel).hide()
$(data.wrapper).find(".attachment-actions").removeClass('small-12').addClass('small-6 float-right')
$(data.wrapper).find(".attachment-actions .action-remove").removeClass('small-3').addClass('small-12')
$(data.wrapper).find(".attachment-actions").removeClass("small-12").addClass("small-6 float-right")

Choose a reason for hiding this comment

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

Line exceeds maximum allowed length. Length is 107, max is 100.

input["lockUpload"] = $(nested_document).closest('#nested-documents').find('.document:visible').length >= $('#nested-documents').data('max-documents-allowed')
$("#nested-documents").on "cocoon:after-insert", (e, nested_document) ->
input = $(nested_document).find(".js-document-attachment")
input["lockUpload"] = $(nested_document).closest("#nested-documents").find(".document:visible").length >= $("#nested-documents").data("max-documents-allowed")

Choose a reason for hiding this comment

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

Line exceeds maximum allowed length. Length is 164, max is 100.

@javierm
Copy link
Member Author

javierm commented Mar 6, 2019

Travis failures are due to issues #3312 and AyuntamientoMadrid#1659 and so are not related to this pull request.

@javierm javierm merged commit d80d270 into master Mar 6, 2019
@javierm javierm deleted the backport-coffeescript_quotes branch March 6, 2019 11:36
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.

None yet

4 participants