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

Use double quotes in CoffeeScript files #1900

Merged
merged 2 commits into from
Mar 5, 2019
Merged

Conversation

javierm
Copy link

@javierm javierm commented Mar 4, 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.

Does this PR need a Backport to CONSUL?

Yes.

Notes

  • CoffeeLint doesn't a have a rule to enforce double quotes, so we won't get warnings when we use single quotes.

Copy link

@voodoorai2000 voodoorai2000 left a comment

Choose a reason for hiding this comment

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

👌

@javierm javierm changed the base branch from coffeelint to master March 5, 2019 17:23
javierm added 2 commits March 5, 2019 18:25
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 coffeescript_quotes branch from 384de2b to 9a1ebdb Compare March 5, 2019 17:25
@@ -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.

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.

_paq.push(['setCustomDimension', customDimensionId = 5, customDimensionValue = district])
_paq.push(["setUserId", current_user_id])
_paq.push(["setCustomDimension", customDimensionId = 1, customDimensionValue = verification_level])
_paq.push(["setCustomDimension", customDimensionId = 2, customDimensionValue = current_user_id])

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 102, max is 100.

_paq.push(['setCustomDimension', customDimensionId = 4, customDimensionValue = age])
_paq.push(['setCustomDimension', customDimensionId = 5, customDimensionValue = district])
_paq.push(["setUserId", current_user_id])
_paq.push(["setCustomDimension", customDimensionId = 1, customDimensionValue = verification_level])

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.

$(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.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.


$(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.

$(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.

@@ -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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants