Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
@@ -29,10 +29,10 @@ document_type = None
|
|
29 |
document_types = {
|
30 |
"Shred": "Generate an outline of the Project Work Statement (PWS)",
|
31 |
"Pink": "Create a Pink Team document based on the PWS outline",
|
32 |
-
"
|
33 |
"Red": "Generate a Red Team document based on the P.Review",
|
34 |
-
"
|
35 |
-
"
|
36 |
"LOE": "Generate a Level of Effort (LOE) breakdown"
|
37 |
}
|
38 |
|
@@ -63,7 +63,7 @@ app.layout = dbc.Container([
|
|
63 |
html.Div([
|
64 |
dbc.Button(
|
65 |
doc_type,
|
66 |
-
id=f'btn-{doc_type.lower().replace("
|
67 |
color="link",
|
68 |
className="mb-2 w-100 text-left custom-button",
|
69 |
style={'overflow': 'hidden', 'text-overflow': 'ellipsis', 'white-space': 'nowrap'}
|
@@ -168,7 +168,7 @@ Now, generate the {document_type}:
|
|
168 |
@app.callback(
|
169 |
Output('document-preview', 'children'),
|
170 |
Output('loading-output', 'children'),
|
171 |
-
[Input(f'btn-{doc_type.lower().replace("
|
172 |
prevent_initial_call=True
|
173 |
)
|
174 |
def generate_document_preview(*args):
|
@@ -177,7 +177,7 @@ def generate_document_preview(*args):
|
|
177 |
if not ctx.triggered:
|
178 |
raise dash.exceptions.PreventUpdate
|
179 |
button_id = ctx.triggered[0]['prop_id'].split('.')[0]
|
180 |
-
document_type = button_id.replace('btn-', '').replace('-', '
|
181 |
|
182 |
if not uploaded_files:
|
183 |
return html.Div("Please upload project artifacts before generating a document."), ""
|
|
|
29 |
document_types = {
|
30 |
"Shred": "Generate an outline of the Project Work Statement (PWS)",
|
31 |
"Pink": "Create a Pink Team document based on the PWS outline",
|
32 |
+
"P_Review": "Evaluate compliance of the Pink Team document",
|
33 |
"Red": "Generate a Red Team document based on the P.Review",
|
34 |
+
"R_Review": "Evaluate compliance of the Red Team document",
|
35 |
+
"G_Review": "Perform a final compliance review",
|
36 |
"LOE": "Generate a Level of Effort (LOE) breakdown"
|
37 |
}
|
38 |
|
|
|
63 |
html.Div([
|
64 |
dbc.Button(
|
65 |
doc_type,
|
66 |
+
id=f'btn-{doc_type.lower().replace("_", "-")}',
|
67 |
color="link",
|
68 |
className="mb-2 w-100 text-left custom-button",
|
69 |
style={'overflow': 'hidden', 'text-overflow': 'ellipsis', 'white-space': 'nowrap'}
|
|
|
168 |
@app.callback(
|
169 |
Output('document-preview', 'children'),
|
170 |
Output('loading-output', 'children'),
|
171 |
+
[Input(f'btn-{doc_type.lower().replace("_", "-")}', 'n_clicks') for doc_type in document_types.keys()],
|
172 |
prevent_initial_call=True
|
173 |
)
|
174 |
def generate_document_preview(*args):
|
|
|
177 |
if not ctx.triggered:
|
178 |
raise dash.exceptions.PreventUpdate
|
179 |
button_id = ctx.triggered[0]['prop_id'].split('.')[0]
|
180 |
+
document_type = button_id.replace('btn-', '').replace('-', '_').title()
|
181 |
|
182 |
if not uploaded_files:
|
183 |
return html.Div("Please upload project artifacts before generating a document."), ""
|