Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
@@ -12,11 +12,24 @@ def random_date():
|
|
12 |
# Function to load and cache the product catalog
|
13 |
@st.cache_data
|
14 |
def load_catalog():
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
20 |
products = {
|
21 |
"Product Name": [
|
22 |
"Notepad++", "WinRAR", "7-Zip", "CCleaner", "TeamViewer",
|
@@ -42,12 +55,12 @@ def load_catalog():
|
|
42 |
"Creative Software", "Creative Software", "Creative Software", "Creative Software", "Creative Software",
|
43 |
"Creative Software", "Creative Software", "Creative Software", "Creative Software", "Creative Software"
|
44 |
],
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
}
|
52 |
return pd.DataFrame(products)
|
53 |
|
|
|
12 |
# Function to load and cache the product catalog
|
13 |
@st.cache_data
|
14 |
def load_catalog():
|
15 |
+
# Generate approval attributes
|
16 |
+
cyber_approved = [random.choice([True, False]) for _ in range(50)]
|
17 |
+
accessibility_approved = [random.choice([True, False]) for _ in range(50)]
|
18 |
+
privacy_approved = [random.choice([True, False]) for _ in range(50)]
|
19 |
+
|
20 |
+
review_statuses = []
|
21 |
+
not_approved_reasons = []
|
22 |
+
for cyber, accessibility, privacy in zip(cyber_approved, accessibility_approved, privacy_approved):
|
23 |
+
if cyber and accessibility and privacy: # All approvals are True
|
24 |
+
review_statuses.append("Approved")
|
25 |
+
not_approved_reasons.append(None)
|
26 |
+
elif not cyber and not accessibility and not privacy: # All approvals are False
|
27 |
+
review_statuses.append("Not Approved")
|
28 |
+
not_approved_reasons.append(random.choice(["Security Concern", "Licensing Issue", "Privacy Issue", "Compliance Requirement"]))
|
29 |
+
else: # Mixed approvals
|
30 |
+
review_statuses.append("Under Review")
|
31 |
+
not_approved_reasons.append(None)
|
32 |
+
|
33 |
products = {
|
34 |
"Product Name": [
|
35 |
"Notepad++", "WinRAR", "7-Zip", "CCleaner", "TeamViewer",
|
|
|
55 |
"Creative Software", "Creative Software", "Creative Software", "Creative Software", "Creative Software",
|
56 |
"Creative Software", "Creative Software", "Creative Software", "Creative Software", "Creative Software"
|
57 |
],
|
58 |
+
"Cyber Approved": cyber_approved,
|
59 |
+
"Accessibility Approved": accessibility_approved,
|
60 |
+
"Privacy Approved": privacy_approved,
|
61 |
+
"Review Date": [random_date() for _ in range(50)],
|
62 |
+
"Review Status": review_statuses,
|
63 |
+
"Not Approved Reason": not_approved_reasons
|
64 |
}
|
65 |
return pd.DataFrame(products)
|
66 |
|