-
Notifications
You must be signed in to change notification settings - Fork 0
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
base: main
Are you sure you want to change the base?
Feature/index #33
Conversation
…and building data
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.
Here are my suggestions for better maintainability and easier implementation nof index. hope this helps! THx
context = super().get_context_data(**kwargs) | ||
|
||
index = get_flows() | ||
state_found = False |
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.
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): |
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 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
Trueotherwise
False`.
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 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
adding an index to the left sidebar with links for navigation