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

Js/fix eslint #413

Merged
merged 7 commits into from
Nov 22, 2020
Merged

Js/fix eslint #413

merged 7 commits into from
Nov 22, 2020

Conversation

darnuria
Copy link
Contributor

@darnuria darnuria commented Nov 4, 2020

No description provided.

@@ -639,24 +641,22 @@ function impressionTicket(data, response, unit = 'kg', tvaStuff = () => '', sumF
${showPaiement(data.id_moyen)}
<p>Ticket client à conserver.</p>
<p>Date d'édition du ticket : ${moment().format('DD/MM/YYYY - HH:mm')}</p>
${showTickets(data, unit)}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Was never read in showTickets

const item = (data.hasOwnProperty('items') && data.items.length > 0
? `<p>Ventes</p>${dashBreak}${showTicket(data.items, window.OressourceEnv.types_dechet, unit)}`
? `<p>Ventes</p>${dashBreak}${showTicket(data.items, window.OressourceEnv.types_dechet)}`
Copy link
Contributor Author

Choose a reason for hiding this comment

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

unit was passed around and in showTicketlink to fct it wasn't read at all.

}
const showMoyen = (moyens, moyenId) => (
moyens.find(({id}) => id === moyenId).nom || "moyen de paiement inconnu!"
);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

just little trick to remove {} and return since it's an expression.

@@ -385,16 +387,16 @@ function login(onSuccess = undefined) {
const form = new FormData(document.getElementById('formLogin'));
const username = form.get('mail');
const password = form.get('pass');
const fetchPromise = fetch('../moteur/login_post.php', {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

fetchPromise was never read.

@@ -52,7 +45,7 @@ class NumPad {

const div = document.createElement('div');
div.setAttribute('class', 'panel panel-info');
div.innerHTML = stripIndent`
div.innerHTML = `
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Didn't know why I found that cool back in 2015...

// remove the shortest leading indentation from each line
const indent = Math.min(...html[0].match(/^[ \t]*(?=\S)/gm).map(el => el.length));
return html[0].replace(new RegExp('^[ \\t]{' + indent + '}', 'gm'), '');
}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removed it ended up eating CPU in the wild.

La CI n'a jamais été mise en place mais on demandais a des VM
de pop dans le cloud a chaque PR, allez stop le gachi en attendant
d'avoir un vrai setup.
@darnuria darnuria merged commit 387deb2 into master Nov 22, 2020
@darnuria darnuria deleted the js/fix-eslint branch November 22, 2020 21:31
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.

1 participant