Skip to content

Commit 04d970c

Browse files
Roopan-MicrosoftAjitPadhi-MicrosoftPavan-Microsoftross-p-smithgpickett
authored
fix: merging dev changes to main (#1802)
Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: Ajit Padhi <[email protected]> Co-authored-by: Pavan-Microsoft <[email protected]> Co-authored-by: Ross Smith <[email protected]> Co-authored-by: gpickett <[email protected]> Co-authored-by: Francia Riesco <[email protected]> Co-authored-by: Francia Riesco <[email protected]> Co-authored-by: Prajwal D C <[email protected]> Co-authored-by: Harmanpreet-Microsoft <[email protected]> Co-authored-by: UtkarshMishra-Microsoft <[email protected]> Co-authored-by: Priyanka-Microsoft <[email protected]> Co-authored-by: Prasanjeet-Microsoft <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Kiran-Siluveru-Microsoft <[email protected]> Co-authored-by: Prashant-Microsoft <[email protected]> Co-authored-by: Rohini-Microsoft <[email protected]> Co-authored-by: Avijit-Microsoft <[email protected]> Co-authored-by: RaviKiran-Microsoft <[email protected]> Co-authored-by: Somesh Joshi <[email protected]> Co-authored-by: Himanshi Agrawal <[email protected]> Co-authored-by: pradeepjha-microsoft <[email protected]> Co-authored-by: Harmanpreet Kaur <[email protected]> Co-authored-by: Bangarraju-Microsoft <[email protected]> Co-authored-by: Harsh-Microsoft <[email protected]> Co-authored-by: Kanchan-Microsoft <[email protected]> Co-authored-by: Cristopher Coronado <[email protected]> Co-authored-by: Cristopher Coronado Moreira <[email protected]> Co-authored-by: Vamshi-Microsoft <[email protected]>
1 parent d00b805 commit 04d970c

File tree

8 files changed

+937
-284
lines changed

8 files changed

+937
-284
lines changed

.dockerignore

Lines changed: 162 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,162 @@
1+
# Include any files or directories that you don't want to be copied to your
2+
# container here (e.g., local build artifacts, temporary files, etc.).
3+
#
4+
# For more help, visit the .dockerignore file reference guide at
5+
# https://docs.docker.com/engine/reference/builder/#dockerignore-file
6+
7+
**/.DS_Store
8+
**/__pycache__
9+
**/.venv
10+
**/.classpath
11+
**/.dockerignore
12+
**/.env
13+
**/.git
14+
**/.gitignore
15+
**/.project
16+
**/.settings
17+
**/.toolstarget
18+
**/.vs
19+
**/.vscode
20+
**/*.*proj.user
21+
**/*.dbmdl
22+
**/*.jfm
23+
**/bin
24+
**/charts
25+
**/docker-compose*
26+
**/compose*
27+
**/Dockerfile*
28+
**/*.Dockerfile
29+
**/node_modules
30+
**/npm-debug.log
31+
**/obj
32+
**/secrets.dev.yaml
33+
**/values.dev.yaml
34+
LICENSE
35+
README.md
36+
37+
# Byte-compiled / optimized / DLL files
38+
__pycache__/
39+
*.py[cod]
40+
*$py.class
41+
42+
# C extensions
43+
*.so
44+
45+
# Distribution / packaging
46+
.Python
47+
build/
48+
develop-eggs/
49+
dist/
50+
downloads/
51+
eggs/
52+
lib/
53+
lib64/
54+
parts/
55+
sdist/
56+
var/
57+
*.egg-info/
58+
.installed.cfg
59+
*.egg
60+
61+
# PyInstaller
62+
# Usually these files are written by a python script from a template
63+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
64+
*.manifest
65+
*.spec
66+
67+
# Installer logs
68+
pip-log.txt
69+
pip-delete-this-directory.txt
70+
71+
# Unit test / coverage reports
72+
htmlcov/
73+
.tox/
74+
.nox/
75+
.coverage
76+
.coverage.*
77+
.cache
78+
nosetests.xml
79+
coverage.xml
80+
*.cover
81+
*.log
82+
83+
# Translations
84+
*.mo
85+
*.pot
86+
87+
# Django stuff:
88+
*.log
89+
local_settings.py
90+
db.sqlite3
91+
92+
# Flask stuff:
93+
instance/
94+
.webassets-cache
95+
96+
# Scrapy stuff:
97+
.scrapy
98+
99+
# Sphinx documentation
100+
docs/_build/
101+
102+
# PyBuilder
103+
target/
104+
105+
# Jupyter Notebook
106+
.ipynb_checkpoints
107+
108+
# IPython
109+
profile_default/
110+
ipython_config.py
111+
112+
# pyenv
113+
.python-version
114+
115+
# celery beat schedule file
116+
celerybeat-schedule
117+
118+
# SageMath parsed files
119+
*.sage.py
120+
121+
# Environments
122+
.env
123+
.venv
124+
env/
125+
venv/
126+
ENV/
127+
env.bak/
128+
venv.bak/
129+
130+
# Spyder project settings
131+
.spyderproject
132+
.spyproject
133+
134+
# Rope project settings
135+
.ropeproject
136+
137+
# mkdocs documentation
138+
/site
139+
140+
# mypy
141+
.mypy_cache/
142+
.dmypy.json
143+
dmypy.json
144+
145+
# Pyre type checker
146+
.pyre/
147+
148+
# pytype static type analyzer
149+
.pytype/
150+
151+
# Cython debug symbols
152+
cython_debug/
153+
154+
# VS Code
155+
.vscode/
156+
157+
# Ignore other unnecessary files
158+
*.bak
159+
*.swp
160+
.DS_Store
161+
*.pdb
162+
*.sqlite3

code/backend/pages/04_Configuration.py

Lines changed: 29 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -491,37 +491,43 @@ def validate_documents():
491491
"Configuration saved successfully! Please restart the chat service for these changes to take effect."
492492
)
493493

494-
with st.popover(":red[Reset configuration to defaults]"):
495-
496-
# Close button with a custom class
497-
if st.button("X", key="close_popup", help="Close popup"):
498-
st.session_state["popup_open"] = False
499-
st.rerun()
500-
501-
st.write(
502-
"**Resetting the configuration cannot be reversed, proceed with caution!**"
503-
)
494+
@st.dialog("Reset Configuration", width="small")
495+
def reset_config_dialog():
496+
st.write("**Resetting the configuration cannot be reversed. Proceed with caution!**")
504497

505498
st.text_input('Enter "reset" to proceed', key="reset_configuration")
506499
if st.button(
507-
":red[Reset]", disabled=st.session_state["reset_configuration"] != "reset"
500+
":red[Reset]",
501+
disabled=st.session_state.get("reset_configuration", "") != "reset",
502+
key="confirm_reset"
508503
):
509-
try:
510-
ConfigHelper.delete_config()
511-
except ResourceNotFoundError:
512-
pass
513-
514-
for key in st.session_state:
515-
del st.session_state[key]
516-
504+
with st.spinner("Resetting Configuration to Default values..."):
505+
try:
506+
ConfigHelper.delete_config()
507+
except ResourceNotFoundError:
508+
pass
509+
510+
ConfigHelper.clear_config()
511+
st.session_state.clear()
517512
st.session_state["reset"] = True
518513
st.session_state["reset_configuration"] = ""
514+
st.session_state["show_reset_dialog"] = False
519515
st.rerun()
520516

521-
if st.session_state.get("reset") is True:
522-
st.success("Configuration reset successfully!")
523-
del st.session_state["reset"]
524-
del st.session_state["reset_configuration"]
517+
# Reset configuration button
518+
if st.button(":red[Reset configuration to defaults]"):
519+
st.session_state["show_reset_dialog"] = True
520+
521+
# Open the dialog if needed
522+
if st.session_state.get("show_reset_dialog"):
523+
reset_config_dialog()
524+
st.session_state["show_reset_dialog"] = False
525+
526+
# After reset success
527+
if st.session_state.get("reset"):
528+
st.success("Configuration reset successfully!")
529+
del st.session_state["reset"]
530+
del st.session_state["reset_configuration"]
525531

526532
except Exception as e:
527533
logger.error(f"Error occurred: {e}")

0 commit comments

Comments
 (0)