Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -85,32 +85,71 @@ def filter_catalog(catalog, search_query=None, selected_category=None, cyber_app
|
|
| 85 |
catalog = load_catalog()
|
| 86 |
|
| 87 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 88 |
|
| 89 |
|
| 90 |
|
| 91 |
# Streamlit app layout
|
| 92 |
-
st.
|
| 93 |
-
st.
|
| 94 |
|
| 95 |
|
| 96 |
|
| 97 |
# Sidebar for Advanced Search and Filtering
|
| 98 |
with st.sidebar:
|
| 99 |
-
st.
|
| 100 |
search_query = st.text_input("Search by Any Attribute", key='search_query')
|
| 101 |
selected_category = st.selectbox("Select Category", ['All'] + list(catalog["Category"].unique()), key='search_category')
|
| 102 |
cyber_approved = st.checkbox("Cyber Approved", key='cyber_approved')
|
| 103 |
accessibility_approved = st.checkbox("Accessibility Approved", key='accessibility_approved')
|
| 104 |
privacy_approved = st.checkbox("Privacy Approved", key='privacy_approved')
|
| 105 |
-
|
| 106 |
-
# Dropdown for selecting review status
|
| 107 |
review_status_options = ['All', 'Approved', 'Under Review', 'Not Approved']
|
| 108 |
review_status = st.selectbox("Select Review Status", options=review_status_options, key='review_status')
|
| 109 |
|
|
|
|
| 110 |
# Apply the enhanced filter based on user input
|
| 111 |
filtered_catalog = filter_catalog(catalog, search_query, selected_category, cyber_approved, accessibility_approved, privacy_approved, review_status)
|
| 112 |
|
| 113 |
|
|
|
|
| 114 |
# Display the filtered product catalog
|
| 115 |
-
st.
|
| 116 |
-
st.dataframe(filtered_catalog)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 85 |
catalog = load_catalog()
|
| 86 |
|
| 87 |
|
| 88 |
+
st.markdown("""
|
| 89 |
+
<style>
|
| 90 |
+
.custom-header {
|
| 91 |
+
font-size: 24px;
|
| 92 |
+
font-weight: bold;
|
| 93 |
+
color: #4f8bf9;
|
| 94 |
+
margin-bottom: 10px;
|
| 95 |
+
}
|
| 96 |
+
.custom-text {
|
| 97 |
+
font-size: 16px;
|
| 98 |
+
margin-bottom: 20px;
|
| 99 |
+
}
|
| 100 |
+
.custom-button {
|
| 101 |
+
margin: 5px;
|
| 102 |
+
}
|
| 103 |
+
.stButton>button {
|
| 104 |
+
border: 2px solid #4f8bf9;
|
| 105 |
+
border-radius: 20px;
|
| 106 |
+
color: #4f8bf9;
|
| 107 |
+
}
|
| 108 |
+
.stDataFrame {
|
| 109 |
+
font-size: 14px;
|
| 110 |
+
}
|
| 111 |
+
</style>
|
| 112 |
+
""", unsafe_allow_html=True)
|
| 113 |
|
| 114 |
|
| 115 |
|
| 116 |
# Streamlit app layout
|
| 117 |
+
st.markdown('<p class="custom-header">Enterprise Software Product Catalog</p>', unsafe_allow_html=True)
|
| 118 |
+
st.markdown('<p class="custom-text">This is the source of truth for app approval statuses within the enterprise.</p>', unsafe_allow_html=True)
|
| 119 |
|
| 120 |
|
| 121 |
|
| 122 |
# Sidebar for Advanced Search and Filtering
|
| 123 |
with st.sidebar:
|
| 124 |
+
st.markdown('<p class="custom-header">Advanced Search Options</p>', unsafe_allow_html=True)
|
| 125 |
search_query = st.text_input("Search by Any Attribute", key='search_query')
|
| 126 |
selected_category = st.selectbox("Select Category", ['All'] + list(catalog["Category"].unique()), key='search_category')
|
| 127 |
cyber_approved = st.checkbox("Cyber Approved", key='cyber_approved')
|
| 128 |
accessibility_approved = st.checkbox("Accessibility Approved", key='accessibility_approved')
|
| 129 |
privacy_approved = st.checkbox("Privacy Approved", key='privacy_approved')
|
|
|
|
|
|
|
| 130 |
review_status_options = ['All', 'Approved', 'Under Review', 'Not Approved']
|
| 131 |
review_status = st.selectbox("Select Review Status", options=review_status_options, key='review_status')
|
| 132 |
|
| 133 |
+
|
| 134 |
# Apply the enhanced filter based on user input
|
| 135 |
filtered_catalog = filter_catalog(catalog, search_query, selected_category, cyber_approved, accessibility_approved, privacy_approved, review_status)
|
| 136 |
|
| 137 |
|
| 138 |
+
|
| 139 |
# Display the filtered product catalog
|
| 140 |
+
st.markdown('<p class="custom-header">Product Catalog</p>', unsafe_allow_html=True)
|
| 141 |
+
st.dataframe(filtered_catalog.style.applymap(lambda x: "background-color: #e6f7ff"))
|
| 142 |
+
|
| 143 |
+
for index, row in filtered_catalog.iterrows():
|
| 144 |
+
with st.expander(f"{row['Product Name']}"):
|
| 145 |
+
st.markdown(f"""
|
| 146 |
+
<div>
|
| 147 |
+
<p><b>Category:</b> {row['Category']}</p>
|
| 148 |
+
<p><b>Cyber Approved:</b> {'Yes' if row['Cyber Approved'] else 'No'}</p>
|
| 149 |
+
<p><b>Accessibility Approved:</b> {'Yes' if row['Accessibility Approved'] else 'No'}</p>
|
| 150 |
+
<p><b>Privacy Approved:</b> {'Yes' if row['Privacy Approved'] else 'No'}</p>
|
| 151 |
+
<p><b>Review Date:</b> {row['Review Date']}</p>
|
| 152 |
+
<p><b>Review Status:</b> {row['Review Status']}</p>
|
| 153 |
+
{'<p><b>Not Approved Reason:</b> '+row['Not Approved Reason']+'</p>' if row['Review Status'] == 'Not Approved' else ''}
|
| 154 |
+
</div>
|
| 155 |
+
""", unsafe_allow_html=True)
|