Skip to content

Commit 8841a4f

Browse files
author
ci bot
committed
Merge branch 'qa-fix' into 'enterprise'
QA fixes See merge request dkinternal/testgen/dataops-testgen!185
2 parents 216ace3 + 019bfe6 commit 8841a4f

2 files changed

Lines changed: 48 additions & 45 deletions

File tree

testgen/ui/app.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@ def render(log_level: int = logging.INFO):
3636
session.dbschema = db.get_schema()
3737

3838
projects = project_service.get_projects()
39+
if not session.project:
40+
session.project = st.query_params.get("project_code")
3941
if not session.project and len(projects) > 0:
4042
project_service.set_current_project(projects[0]["code"])
4143

testgen/ui/views/project_settings.py

Lines changed: 46 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -45,57 +45,58 @@ def render(self, project_code: str | None = None, **_kwargs) -> None:
4545
self.show_edit_form()
4646

4747
def show_edit_form(self) -> None:
48-
form_container = testgen.card()
48+
form_container = st.container()
4949
status_container = st.container()
5050

5151
with form_container:
52-
name_input = st.text_input(
53-
label="Project Name",
54-
value=self.project["project_name"],
55-
max_chars=30,
56-
key="project_settings:keys:project_name",
57-
)
58-
st.text_input(
59-
label="Observability API URL",
60-
value=self.project["observability_api_url"],
61-
key="project_settings:keys:observability_api_url",
62-
)
63-
st.text_input(
64-
label="Observability API Key",
65-
value=self.project["observability_api_key"],
66-
key="project_settings:keys:observability_api_key",
67-
)
68-
69-
testgen.whitespace(1)
70-
test_button_column, warning_column, save_button_column = st.columns([.4, .3, .3])
71-
testgen.flex_row_start(test_button_column)
72-
testgen.flex_row_end(save_button_column)
73-
74-
with test_button_column:
75-
testgen.button(
76-
type_="stroked",
77-
color="basic",
78-
label="Test Observability Connection",
79-
width=250,
80-
on_click=partial(self._display_connection_status, status_container),
81-
key="project-settings:keys:test-connection",
52+
with testgen.card():
53+
name_input = st.text_input(
54+
label="Project Name",
55+
value=self.project["project_name"],
56+
max_chars=30,
57+
key="project_settings:keys:project_name",
8258
)
83-
84-
with warning_column:
85-
if not name_input:
86-
testgen.text("Project name is required", "color: var(--red)")
87-
elif self.existing_names and name_input in self.existing_names:
88-
testgen.text("Project name in use", "color: var(--red)")
89-
90-
with save_button_column:
91-
testgen.button(
92-
type_="flat",
93-
label="Save",
94-
width=100,
95-
on_click=self.edit_project,
96-
key="project-settings:keys:edit",
59+
st.text_input(
60+
label="Observability API URL",
61+
value=self.project["observability_api_url"],
62+
key="project_settings:keys:observability_api_url",
63+
)
64+
st.text_input(
65+
label="Observability API Key",
66+
value=self.project["observability_api_key"],
67+
key="project_settings:keys:observability_api_key",
9768
)
9869

70+
testgen.whitespace(1)
71+
test_button_column, warning_column, save_button_column = st.columns([.4, .3, .3])
72+
testgen.flex_row_start(test_button_column)
73+
testgen.flex_row_end(save_button_column)
74+
75+
with test_button_column:
76+
testgen.button(
77+
type_="stroked",
78+
color="basic",
79+
label="Test Observability Connection",
80+
width=250,
81+
on_click=partial(self._display_connection_status, status_container),
82+
key="project-settings:keys:test-connection",
83+
)
84+
85+
with warning_column:
86+
if not name_input:
87+
testgen.text("Project name is required", "color: var(--red)")
88+
elif self.existing_names and name_input in self.existing_names:
89+
testgen.text("Project name in use", "color: var(--red)")
90+
91+
with save_button_column:
92+
testgen.button(
93+
type_="flat",
94+
label="Save",
95+
width=100,
96+
on_click=self.edit_project,
97+
key="project-settings:keys:edit",
98+
)
99+
99100
def edit_project(self) -> None:
100101
project = self._get_edited_project()
101102
if project["project_name"] and (not self.existing_names or project["project_name"] not in self.existing_names):

0 commit comments

Comments
 (0)