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

Feature/index #33

Open
wants to merge 88 commits into
base: main
Choose a base branch
from
Open

Feature/index #33

wants to merge 88 commits into from

Conversation

josihoppe
Copy link
Collaborator

adding an index to the left sidebar with links for navigation

Copy link
Contributor

@henhuy henhuy left a comment

Choose a reason for hiding this comment

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

Here are my suggestions for better maintainability and easier implementation nof index. hope this helps! THx

building_dialouge_webapp/heat/navigation.py Outdated Show resolved Hide resolved
building_dialouge_webapp/heat/navigation.py Outdated Show resolved Hide resolved
building_dialouge_webapp/templates/base_flow.html Outdated Show resolved Hide resolved
building_dialouge_webapp/heat/flows.py Outdated Show resolved Hide resolved
context = super().get_context_data(**kwargs)

index = get_flows()
state_found = False
Copy link
Contributor

Choose a reason for hiding this comment

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

Considering new data structure (see my review in navigation.py) and a flow has a function finished() -> bool (see review in flows.py),
you could loop over each category and each step and call finished() for each flow in step.
then you can mark all categories and steps as "visitied" until latest finished flow.
You get the current url/flow by looking into request.path or similar and compare this to url given in step to set "active" step.

raise FlowError(error_msg)


class Flow(TemplateView):
Copy link
Contributor

Choose a reason for hiding this comment

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

You can add a finished() -> bool function in Flow, which simply runs self.start.set() and checks if results include EndState, then it you can return TrueotherwiseFalse`.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I have a problem with just using the finished() method, to determine wich pages were visited, because some pages (like consumption result for example) are views and don't have a finished method

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.

3 participants