-
Notifications
You must be signed in to change notification settings - Fork 8
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
Update app and issues workflow #4
Conversation
index.js
Outdated
}, | ||
milestones: { | ||
next_patch_milestone: '1.7.4.3', | ||
next_minor_milestone: '1.7.5.0', | ||
next_minor_milestone: '1.7.5.0' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These are very outdated but can be fixed later
@sowbiba Looks good to me. Let's see if @eternoendless has something to add, else it's OK @PierreRambaud and @NeOMakinG can also help to review Javascript |
index.js
Outdated
if (rule != null) { | ||
context.log.info('[Index] Received webhook matches rule ' + rule + ' requirements'); | ||
ruleApplier.applyRule(rule, context); | ||
if (rules != null) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if (rules != null) { | |
if (rules !== null) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also is if(rules) not enough?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't see the change in file 🤔
src/rule-applier.js
Outdated
}) | ||
} | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks so duplicating, wdyt @PierreRambaud ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Then would it be possible to try to do something to avoid duplicate code ? Sometimes it's too overkill but there it looks like not
index.js
Outdated
context.log.info('[Index] Received webhook matches rule ' + rule + ' requirements'); | ||
ruleApplier.applyRule(rule, context); | ||
if (rules != null) { | ||
for (const rule of rules) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The for statement is also done in applyRules
, is it needed to do both?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
src/rule-applier.js
Outdated
|
||
switch (rule) { | ||
case Rule.A1: | ||
this.applyRuleA1(context); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be better to find a way to remove this useless switch, otherwise in few weeks, we'll have a 500 lines only for the switch.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried to do it better
@@ -0,0 +1,3 @@ | |||
/node_modules/ | |||
/tests/ | |||
!.eslintrc.js |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please configure your IDE so it auto-add new line at the end of files!
browser: true, | ||
node: true, | ||
es6: true, | ||
jquery: true, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need this on this project right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You right. It seems not needed. I will check what every parameter is for in env
and globals
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Env is for context, globals is for globals variables.
google: true, | ||
document: true, | ||
navigator: false, | ||
window: true, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need too, it's node side, not client side right ?
name: 'global', | ||
message: 'Use window variable instead.', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's node side, you'll never use window
Co-Authored-By: SZCZUPAK Valentin <valentin.szczupak@prestashop.com>
6243d96
to
0b830cf
Compare
No description provided.