Skip to content

Commit

Permalink
Refresh turbo frame for turboFrameIdValue
Browse files Browse the repository at this point in the history
  • Loading branch information
gabrielgiroe1 committed Jan 24, 2024
1 parent ba63972 commit f07f760
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions app/javascript/js/controllers/has_many_refresh_controller.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,18 @@
import { Controller } from "@hotwired/stimulus";

Check failure on line 1 in app/javascript/js/controllers/has_many_refresh_controller.js

View workflow job for this annotation

GitHub Actions / lint / runner / eslint

[eslint] reported by reviewdog 🐶 Strings must use singlequote. Raw Output: {"ruleId":"quotes","severity":2,"message":"Strings must use singlequote.","line":1,"column":28,"nodeType":"Literal","endLine":1,"endColumn":48,"fix":{"range":[27,47],"text":"'@hotwired/stimulus'"}}

Check failure on line 1 in app/javascript/js/controllers/has_many_refresh_controller.js

View workflow job for this annotation

GitHub Actions / lint / runner / eslint

[eslint] reported by reviewdog 🐶 Extra semicolon. Raw Output: {"ruleId":"semi","severity":2,"message":"Extra semicolon.","line":1,"column":48,"nodeType":"ImportDeclaration","endLine":1,"endColumn":49,"fix":{"range":[27,56],"text":"\"@hotwired/stimulus\"\n\nexport"}}

export default class extends Controller {
connect() {
console.log("Heeere!!!");
static values = {
turboFrameId: String,
};

refresh() {
var element = document.getElementById(this.turboFrameIdValue);

Check failure on line 9 in app/javascript/js/controllers/has_many_refresh_controller.js

View workflow job for this annotation

GitHub Actions / lint / runner / eslint

[eslint] reported by reviewdog 🐶 Unexpected var, use let or const instead. Raw Output: {"ruleId":"no-var","severity":2,"message":"Unexpected var, use let or const instead.","line":9,"column":5,"nodeType":"VariableDeclaration","endLine":9,"endColumn":67,"fix":{"range":[162,165],"text":"let"}}

Check failure on line 9 in app/javascript/js/controllers/has_many_refresh_controller.js

View workflow job for this annotation

GitHub Actions / lint / runner / eslint

[eslint] reported by reviewdog 🐶 Extra semicolon. Raw Output: {"ruleId":"semi","severity":2,"message":"Extra semicolon.","line":9,"column":66,"nodeType":"VariableDeclaration","endLine":9,"endColumn":67,"fix":{"range":[222,231],"text":")\n if"}}
if (element) {
element.reload();

Check failure on line 11 in app/javascript/js/controllers/has_many_refresh_controller.js

View workflow job for this annotation

GitHub Actions / lint / runner / eslint

[eslint] reported by reviewdog 🐶 Extra semicolon. Raw Output: {"ruleId":"semi","severity":2,"message":"Extra semicolon.","line":11,"column":23,"nodeType":"ExpressionStatement","endLine":11,"endColumn":24,"fix":{"range":[265,273],"text":")\n }"}}
} else {
console.error(

Check warning on line 13 in app/javascript/js/controllers/has_many_refresh_controller.js

View workflow job for this annotation

GitHub Actions / lint / runner / eslint

[eslint] reported by reviewdog 🐶 Unexpected console statement. Raw Output: {"ruleId":"no-console","severity":1,"message":"Unexpected console statement.","line":13,"column":7,"nodeType":"MemberExpression","messageId":"unexpected","endLine":13,"endColumn":20}
"Element with ID '" + this.turboFrameIdValue + "' not found."

Check failure on line 14 in app/javascript/js/controllers/has_many_refresh_controller.js

View workflow job for this annotation

GitHub Actions / lint / runner / eslint

[eslint] reported by reviewdog 🐶 Unexpected string concatenation. Raw Output: {"ruleId":"prefer-template","severity":2,"message":"Unexpected string concatenation.","line":14,"column":9,"nodeType":"BinaryExpression","endLine":14,"endColumn":70,"fix":{"range":[310,371],"text":"`Element with ID '${ this.turboFrameIdValue }' not found.`"}}

Check failure on line 14 in app/javascript/js/controllers/has_many_refresh_controller.js

View workflow job for this annotation

GitHub Actions / lint / runner / eslint

[eslint] reported by reviewdog 🐶 Missing trailing comma. Raw Output: {"ruleId":"comma-dangle","severity":2,"message":"Missing trailing comma.","line":14,"column":70,"nodeType":"BinaryExpression","messageId":"missing","endLine":15,"endColumn":1,"fix":{"range":[371,371],"text":","}}
);

Check failure on line 15 in app/javascript/js/controllers/has_many_refresh_controller.js

View workflow job for this annotation

GitHub Actions / lint / runner / eslint

[eslint] reported by reviewdog 🐶 Extra semicolon. Raw Output: {"ruleId":"semi","severity":2,"message":"Extra semicolon.","line":15,"column":8,"nodeType":"ExpressionStatement","endLine":15,"endColumn":9,"fix":{"range":[378,386],"text":")\n }"}}
}
}
}

0 comments on commit f07f760

Please sign in to comment.