Skip to content
This repository has been archived by the owner on Apr 28, 2021. It is now read-only.

feat: set slots in forms #33

Merged
merged 3 commits into from
Nov 12, 2020
Merged

feat: set slots in forms #33

merged 3 commits into from
Nov 12, 2020

Conversation

MatthieuJnon
Copy link
Contributor

No description provided.

@MatthieuJnon MatthieuJnon removed the wip label Oct 27, 2020
@@ -487,7 +497,9 @@ async def validate_prefilled(
prefilled_slots = {}
events = []

for slot_name in self.required_slots(tracker):
requiredSlots = self._requested_slot_without_slot_set(tracker)
Copy link
Contributor

Choose a reason for hiding this comment

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

camelCase is for JS :)

@@ -23,7 +26,11 @@ def get_required_slots(self, tracker, start=None):
for edge in sorted(current_edges, key=lambda e: e.get("condition") is None):
target, condition = edge.get("target"), edge.get("condition")
if self.check_condition(tracker, condition):
required_slots.append(self.nodes.get(target))
targetNode = self.nodes.get(target)
Copy link
Contributor

Choose a reason for hiding this comment

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

camel case

@@ -118,6 +118,32 @@ def required_slots_graph(conjunction="OR", negated=False):
],
}

def required_slots_graph_with_set_slots(conjunction="OR", negated=False):
Copy link
Contributor

Choose a reason for hiding this comment

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

don't copy the test -- just change required_slots_graph and test_required_slots

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Actually I don't want that because I specifically want to test if everything goes well when a graph does not end with a slot set.

Copy link
Contributor

Choose a reason for hiding this comment

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

Then you can add slotset as a parameter of the existing test. I just don't like having two copies of the same 50+ lines.

@pheel pheel self-requested a review November 12, 2020 20:24
@pheel pheel merged commit a02a148 into v11010 Nov 12, 2020
@pheel pheel deleted the feat/set-slot-in-forms branch April 27, 2021 19:12
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants