Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -186,6 +186,13 @@ def generate_outputs(role, supervisor_name, project_id, milestones, reflection):
|
|
186 |
save_to_salesforce(role, project_id, milestones, reflection, checklist, suggestions, quote, supervisor_name)
|
187 |
return checklist, suggestions, quote
|
188 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
189 |
# Interface
|
190 |
def create_interface():
|
191 |
roles = get_roles_from_salesforce()
|
@@ -204,10 +211,12 @@ def create_interface():
|
|
204 |
generate = gr.Button("Generate")
|
205 |
clear = gr.Button("Clear")
|
206 |
refresh = gr.Button("🔄 Refresh Roles")
|
|
|
207 |
|
208 |
checklist_output = gr.Textbox(label="✅ Daily Checklist")
|
209 |
suggestions_output = gr.Textbox(label="💡 Focus Suggestions")
|
210 |
quote_output = gr.Textbox(label="✨ Motivational Quote")
|
|
|
211 |
|
212 |
role.change(fn=lambda r: gr.update(choices=get_supervisor_name_by_role(r)), inputs=role, outputs=supervisor_name)
|
213 |
supervisor_name.change(fn=get_projects_for_supervisor, inputs=supervisor_name, outputs=project_id)
|
@@ -221,6 +230,8 @@ def create_interface():
|
|
221 |
|
222 |
refresh.click(fn=lambda: gr.update(choices=get_roles_from_salesforce()), outputs=role)
|
223 |
|
|
|
|
|
224 |
return demo
|
225 |
|
226 |
if __name__ == "__main__":
|
|
|
186 |
save_to_salesforce(role, project_id, milestones, reflection, checklist, suggestions, quote, supervisor_name)
|
187 |
return checklist, suggestions, quote
|
188 |
|
189 |
+
# Dashboard button function
|
190 |
+
def open_dashboard():
|
191 |
+
# Replace this with your actual Salesforce dashboard URL
|
192 |
+
salesforce_dashboard_url = "https://your-salesforce-instance.lightning.force.com/lightning/page/home"
|
193 |
+
# Return HTML link that opens in a new tab
|
194 |
+
return f'<a href="{salesforce_dashboard_url}" target="_blank" rel="noopener noreferrer" style="font-size:16px;">Open Salesforce Dashboard</a>'
|
195 |
+
|
196 |
# Interface
|
197 |
def create_interface():
|
198 |
roles = get_roles_from_salesforce()
|
|
|
211 |
generate = gr.Button("Generate")
|
212 |
clear = gr.Button("Clear")
|
213 |
refresh = gr.Button("🔄 Refresh Roles")
|
214 |
+
dashboard_btn = gr.Button("Dashboard") # Dashboard button
|
215 |
|
216 |
checklist_output = gr.Textbox(label="✅ Daily Checklist")
|
217 |
suggestions_output = gr.Textbox(label="💡 Focus Suggestions")
|
218 |
quote_output = gr.Textbox(label="✨ Motivational Quote")
|
219 |
+
dashboard_link = gr.HTML("") # For showing the dashboard link
|
220 |
|
221 |
role.change(fn=lambda r: gr.update(choices=get_supervisor_name_by_role(r)), inputs=role, outputs=supervisor_name)
|
222 |
supervisor_name.change(fn=get_projects_for_supervisor, inputs=supervisor_name, outputs=project_id)
|
|
|
230 |
|
231 |
refresh.click(fn=lambda: gr.update(choices=get_roles_from_salesforce()), outputs=role)
|
232 |
|
233 |
+
dashboard_btn.click(fn=open_dashboard, inputs=None, outputs=dashboard_link)
|
234 |
+
|
235 |
return demo
|
236 |
|
237 |
if __name__ == "__main__":
|