Update my_pages/developer_decisions.py
Browse files- my_pages/developer_decisions.py +48 -13
my_pages/developer_decisions.py
CHANGED
|
@@ -1,25 +1,60 @@
|
|
|
|
|
| 1 |
import streamlit as st
|
| 2 |
-
from utils import
|
|
|
|
| 3 |
|
| 4 |
def render():
|
| 5 |
-
# Initialize session state
|
| 6 |
if "active_stage" not in st.session_state:
|
| 7 |
st.session_state.active_stage = None
|
|
|
|
|
|
|
|
|
|
|
|
|
| 8 |
|
| 9 |
st.markdown("<h2 style='text-align: center;'>Developer Decisions Pipeline</h2>", unsafe_allow_html=True)
|
| 10 |
|
| 11 |
-
#
|
| 12 |
-
cols = st.columns(len(
|
| 13 |
-
for idx, stage in enumerate(
|
| 14 |
with cols[idx]:
|
| 15 |
-
if st.button(
|
| 16 |
-
st.session_state.active_stage =
|
|
|
|
|
|
|
| 17 |
|
| 18 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 19 |
|
| 20 |
-
#
|
| 21 |
-
if st.session_state.
|
| 22 |
-
|
| 23 |
-
st.markdown(f"### {
|
| 24 |
-
for q in
|
| 25 |
st.write(f"- {q}")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# pipeline_app.py
|
| 2 |
import streamlit as st
|
| 3 |
+
from utils import go_to
|
| 4 |
+
from utils import pipeline_data
|
| 5 |
|
| 6 |
def render():
|
|
|
|
| 7 |
if "active_stage" not in st.session_state:
|
| 8 |
st.session_state.active_stage = None
|
| 9 |
+
if "active_substage" not in st.session_state:
|
| 10 |
+
st.session_state.active_substage = None
|
| 11 |
+
if "active_subsub" not in st.session_state:
|
| 12 |
+
st.session_state.active_subsub = None
|
| 13 |
|
| 14 |
st.markdown("<h2 style='text-align: center;'>Developer Decisions Pipeline</h2>", unsafe_allow_html=True)
|
| 15 |
|
| 16 |
+
# Level 1: Stages
|
| 17 |
+
cols = st.columns(len(pipeline))
|
| 18 |
+
for idx, stage in enumerate(pipeline.keys()):
|
| 19 |
with cols[idx]:
|
| 20 |
+
if st.button(stage, key=f"stage_{idx}"):
|
| 21 |
+
st.session_state.active_stage = stage
|
| 22 |
+
st.session_state.active_substage = None
|
| 23 |
+
st.session_state.active_subsub = None
|
| 24 |
|
| 25 |
+
# Level 2: Sub-stages
|
| 26 |
+
if st.session_state.active_stage:
|
| 27 |
+
sub_stages = pipeline[st.session_state.active_stage]
|
| 28 |
+
# st.markdown(f"### {st.session_state.active_stage}")
|
| 29 |
+
sub_cols = st.columns(len(sub_stages))
|
| 30 |
+
for idx, sub in enumerate(sub_stages.keys()):
|
| 31 |
+
with sub_cols[idx]:
|
| 32 |
+
if st.button(sub, key=f"sub_{idx}"):
|
| 33 |
+
st.session_state.active_substage = sub
|
| 34 |
+
st.session_state.active_subsub = None
|
| 35 |
+
|
| 36 |
+
# Level 3: Sub-sub-stages
|
| 37 |
+
if st.session_state.active_substage:
|
| 38 |
+
sub_sub_stages = pipeline[st.session_state.active_stage][st.session_state.active_substage]
|
| 39 |
+
# st.markdown(f"#### {st.session_state.active_substage}")
|
| 40 |
+
subsub_cols = st.columns(len(sub_sub_stages))
|
| 41 |
+
for idx, subsub in enumerate(sub_sub_stages.keys()):
|
| 42 |
+
with subsub_cols[idx]:
|
| 43 |
+
if st.button(subsub, key=f"subsub_{idx}"):
|
| 44 |
+
st.session_state.active_subsub = subsub
|
| 45 |
|
| 46 |
+
# Questions
|
| 47 |
+
if st.session_state.active_subsub:
|
| 48 |
+
questions = pipeline[st.session_state.active_stage][st.session_state.active_substage][st.session_state.active_subsub]
|
| 49 |
+
# st.markdown(f"##### {st.session_state.active_subsub}")
|
| 50 |
+
for q in questions:
|
| 51 |
st.write(f"- {q}")
|
| 52 |
+
|
| 53 |
+
st.markdown("---")
|
| 54 |
+
col1, col2, col3, col4 = st.columns([2, 1, 1, 1])
|
| 55 |
+
with col3:
|
| 56 |
+
if st.button("Go Home"):
|
| 57 |
+
go_to("home")
|
| 58 |
+
with col4:
|
| 59 |
+
if st.button("Next"):
|
| 60 |
+
go_to("ica")
|