Skip to content

Commit

Permalink
Fix formatting issues with Prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
0xAstraea committed May 20, 2024
1 parent c84b97e commit dd300b4
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 8 deletions.
18 changes: 14 additions & 4 deletions assets/javascripts/discourse/components/custom-modal.hbs
Original file line number Diff line number Diff line change
@@ -1,12 +1,22 @@
<DModal @title={{html-safe (concat "Socratic Bot " (d-icon "socratic-icon"))}} @closeModal={{@closeModal}}>
<DModal
@title={{html-safe (concat "Socratic Bot " (d-icon "socratic-icon"))}}
@closeModal={{@closeModal}}
>
<:body>
<p>By proceeding, you'll be redirected to a third-party application. Here, you can critically analyze your post to identify any fallacies or biases, ensuring your content is clear and impactful.</p>
<p>By proceeding, you'll be redirected to a third-party application. Here,
you can critically analyze your post to identify any fallacies or biases,
ensuring your content is clear and impactful.</p>
<p> <b>Your text:</b> {{@model.textValue}}</p>
</:body>
<:footer>
<a class="btn btn-icon-text btn-primary create" href={{@model.Url}} target="_blank" rel="noopener noreferrer">
<a
class="btn btn-icon-text btn-primary create"
href={{@model.Url}}
target="_blank"
rel="noopener noreferrer"
>
Proceed
</a>
<DModalCancel @close={{@closeModal}} />
</:footer>
</DModal>
</DModal>
Original file line number Diff line number Diff line change
Expand Up @@ -42,16 +42,16 @@ function initializeWithApi(api) {
function getTextAreaValue(api) {
// Select the textarea element with the specified classes
const textarea = document.querySelector(
".ember-text-area.ember-view.d-editor-input"
".ember-text-area.ember-view.d-editor-input",
);

// Check if textarea is found
if (textarea) {
// Retrieve the value of the textarea
const textValue = textarea.value;
const test = encodeURIComponent(textValue);
//Replace with actual URL
//TO DO: Considerar pass the base URL as param or with .env, could be fun !
//Replace with actual URL
//TO DO: Considerar pass the base URL as param or with .env, could be fun !
const encodedTextValue = `https://www.google.com/search?q=${test}`;

// Open the modal
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
"@discourse/lint-configs": "^1.3.5",
"ember-template-lint": "^5.13.0",
"eslint": "^8.56.0",
"prettier": "^2.8.8"
"prettier": "^3.2.5"
}
}
5 changes: 5 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2844,6 +2844,11 @@ prettier@^2.8.3, prettier@^2.8.8:
resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.8.8.tgz#e8c5d7e98a4305ffe3de2e1fc4aca1a71c28b1da"
integrity sha512-tdN8qQGvNjw4CHbY+XXk0JgCXn9QiF21a55rBe5LJAU+kDyC4WQn4+awm2Xfk2lQMk5fKup9XgzTZtGkjBdP9Q==

prettier@^3.2.5:
version "3.2.5"
resolved "https://registry.yarnpkg.com/prettier/-/prettier-3.2.5.tgz#e52bc3090586e824964a8813b09aba6233b28368"
integrity sha512-3/GWa9aOC0YeD7LUfvOG2NiDyhOWRvt1k+rcKhOuYnMY24iiCphgneUfJDyFXd6rZCAnuLBv6UeAULtrhT/F4A==

promise-map-series@^0.2.1:
version "0.2.3"
resolved "https://registry.yarnpkg.com/promise-map-series/-/promise-map-series-0.2.3.tgz#c2d377afc93253f6bd03dbb77755eb88ab20a847"
Expand Down

0 comments on commit dd300b4

Please sign in to comment.