Continuing work removing legacy functions and implementing UI changes
Build Library / Build Library (push) Failing after 3m58s
Build Library / Build Library (push) Failing after 3m58s
This commit is contained in:
@@ -91,7 +91,7 @@ class PolicySelector(Widget):
|
||||
- Clear Filter button
|
||||
- Confirm Selection button
|
||||
- Policy table displaying available policies
|
||||
- Back and Continue buttons for navigation
|
||||
- Back buttons for navigation
|
||||
"""
|
||||
yield Header(show_clock=True, icon="⚙")
|
||||
title_text = Static(
|
||||
@@ -144,6 +144,11 @@ class PolicySelector(Widget):
|
||||
selected_label.styles.margin = (2, 0, 1, 0)
|
||||
yield selected_label
|
||||
|
||||
cancel_button = Button("← Back", id="back_button")
|
||||
cancel_button.styles.width = "100%"
|
||||
cancel_button.styles.margin = (1, 0, 1, 0)
|
||||
yield cancel_button
|
||||
|
||||
# Right side - Policy table
|
||||
with Vertical() as right_side:
|
||||
right_side.styles.width = "2fr"
|
||||
@@ -158,23 +163,6 @@ class PolicySelector(Widget):
|
||||
policy_table.styles.margin = (1, 0, 1, 0)
|
||||
yield policy_table
|
||||
|
||||
# Bottom buttons
|
||||
with Horizontal() as button_row:
|
||||
button_row.styles.height = "auto"
|
||||
button_row.styles.margin = (1, 0, 0, 0)
|
||||
|
||||
cancel_button = Button("✕ Cancel", id="back_button", variant="error")
|
||||
cancel_button.styles.width = "1fr"
|
||||
yield cancel_button
|
||||
|
||||
continue_button = Button(
|
||||
"▶ Continue",
|
||||
id="continue_button",
|
||||
variant="primary",
|
||||
)
|
||||
continue_button.styles.width = "1fr"
|
||||
continue_button.styles.margin = (0, 0, 0, 1)
|
||||
yield continue_button
|
||||
yield Footer()
|
||||
|
||||
def on_mount(self) -> None:
|
||||
@@ -239,7 +227,6 @@ class PolicySelector(Widget):
|
||||
- filter_button (Apply Filter): Filter policies with wildcard support
|
||||
- clear_filter_button: Clear filter and show all policies
|
||||
- confirm_button: Confirm selection and post message
|
||||
- continue_button: Continue without posting message
|
||||
|
||||
Args:
|
||||
event (Button.Pressed): The button press event.
|
||||
@@ -247,7 +234,8 @@ class PolicySelector(Widget):
|
||||
btn_id = event.button.id
|
||||
|
||||
if btn_id == "back_button":
|
||||
self.app.pop_screen()
|
||||
while len(self.app.screen_stack) > 2:
|
||||
self.app.pop_screen()
|
||||
event.stop()
|
||||
|
||||
elif btn_id == "filter_button":
|
||||
@@ -262,10 +250,6 @@ class PolicySelector(Widget):
|
||||
self._confirm_selection()
|
||||
event.stop()
|
||||
|
||||
elif btn_id == "continue_button":
|
||||
self.app.pop_screen()
|
||||
event.stop()
|
||||
|
||||
def on_data_table_row_selected(self, event: DataTable.RowSelected) -> None:
|
||||
"""
|
||||
Handle row selection in the policy table.
|
||||
|
||||
Reference in New Issue
Block a user