-
Notifications
You must be signed in to change notification settings - Fork 91
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
ETQ admin je peux créer une règle de routage de plusieurs lignes #9604
ETQ admin je peux créer une règle de routage de plusieurs lignes #9604
Conversation
6245eb3
to
450e18b
Compare
63f54e8
to
450cbfd
Compare
3a5d3d0
to
dc2d2fb
Compare
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.
première passe
@@ -1,11 +1,6 @@ | |||
class TypesDeChampEditor::ConditionsComponent < ApplicationComponent | |||
class Conditions::ConditionsComponent < ApplicationComponent |
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.
super classe ce découpage
- if rows.blank? | ||
%tr | ||
%td.far-left= far_left_tag(0) | ||
%td.target= left_operand_tag(empty, 0) | ||
%td.operator= operator_tag(EmptyOperator.name, empty, 0) | ||
%td.value= right_operand_tag(empty, empty, 0) | ||
%td.delete-column= delete_condition_tag(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.
je pense qu'on peut dégager ce cas en initiant avec une condtion EmptyOperator(empty, empty) dans le cas ou le le groupe instructeur n'a pas de routing rule
def targeted_champ_changed? | ||
targeted_champ != groupe_instructeur.routing_rule&.left | ||
end | ||
|
||
def targeted_champ | ||
Logic.from_json(params[:targeted_champ]) | ||
end | ||
|
||
def operator_name | ||
params[:operator_name] | ||
end | ||
|
||
def value | ||
Logic.from_json(params[:value]) | ||
end | ||
|
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.
est ce qu'on a besoin de ces methodes ?
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.
Bien vu, on en a plus besoin, je les enlève 👍
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.
Du pinaillage et une interrogation sur une possible mutualisation de logique de regle valide, mais sinon, super taff ! 👏
@@ -106,18 +114,24 @@ def other_groupe_instructeurs | |||
|
|||
private | |||
|
|||
def routing_rule_matches_tdc? | |||
routing_tdc = procedure.active_revision.types_de_champ.find_by(stable_id: routing_rule.left.stable_id) | |||
def routing_rule_matches_tdc?(rule) |
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.
je ne suis pas sur que cette méthode doit être ici : j'ai l'impression qu'elle sert à savoir si la règle est valide. Or on a besoin de ce même genre de vérification ds les conditions de type de champs. Il doit y avoir de la mutualisation à faire.
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.
En effet ! Je crois bien que la même logique de validation est déjà implementée dans les méthodes #errors(types_de_champ)
des classes du namespace Logic
ça fait un bon bout de code en moins :-) -> 6c959d9
3bc9267
to
9d74711
Compare
…onent inherit from conditions_component
9d74711
to
3e2e5a0
Compare
74a0051
to
6c959d9
Compare
Dans cette PR :
ConditionsComponent
Avant
Après (exemple à ne pas reproduire dans sa démarche ;-) c'est pour donner une idée des possibilités)