Skip to content

Commit

Permalink
Merge pull request #121 from Michele-Alberti/development
Browse files Browse the repository at this point in the history
🔙 Improve tables in backend
  • Loading branch information
Michele-Alberti authored Feb 24, 2024
2 parents 45aead6 + b3769b0 commit 01a1cff
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 7 deletions.
18 changes: 17 additions & 1 deletion .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,26 @@ updates:
interval: "weekly"
target-branch: development
open-pull-requests-limit: 25
groups:
pip-minor-deps:
update-types:
- "minor"
- "patch"
pip-major-deps:
update-types:
- "major"

- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
target-branch: development
open-pull-requests-limit: 25
open-pull-requests-limit: 25
groups:
gh-minor-deps:
update-types:
- "minor"
- "patch"
gh-major-deps:
update-types:
- "major"
3 changes: 3 additions & 0 deletions .github/workflows/ci_cd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,9 @@ jobs:
if: github.ref_name == 'development'
runs-on: ubuntu-latest

environment:
name: test-release

steps:
- uses: actions/checkout@v4
with:
Expand Down
26 changes: 20 additions & 6 deletions dlunch/gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
generic_button_height = 45
sidebar_width = 400
sidebar_content_width = sidebar_width - 10
backend_min_height = 500


# CLASS -----------------------------------------------------------------------
Expand Down Expand Up @@ -952,13 +953,17 @@ def __init__(
# User list
self.users_tabulator = pn.widgets.Tabulator(
value=auth.list_users_guests_and_privileges(config),
sizing_mode="stretch_height",
)
# Flags content (use empty dataframe to instantiate)
df_flags = models.Flags.read_as_df(
config=config,
index_col="id",
)
self.flags_content = pn.widgets.Tabulator(value=df_flags)
self.flags_content = pn.widgets.Tabulator(
value=df_flags,
sizing_mode="stretch_height",
)

# BUTTONS
# Exit button
Expand Down Expand Up @@ -1006,42 +1011,51 @@ def __init__(
self.password_widget,
pn.VSpacer(),
self.submit_password_button,
pn.Spacer(height=5),
width=sidebar_width,
sizing_mode="stretch_height",
min_height=backend_min_height,
)
# Create column with user authenthication controls (oauth)
self.add_privileged_user_column = pn.Column(
self.add_privileged_user_widget,
pn.VSpacer(),
self.add_privileged_user_button,
width=sidebar_width,
sizing_mode="stretch_height",
min_height=backend_min_height,
)
# Create for deleting users
# Create column for deleting users
self.delete_user_column = pn.Column(
self.user_eraser,
pn.VSpacer(),
self.delete_user_button,
width=sidebar_width,
sizing_mode="stretch_height",
min_height=backend_min_height,
)
# Create column with flags' list
self.clear_flags_column = pn.Column(
pn.pane.HTML("<b>Flags Table Content</b>"),
self.flags_content,
pn.VSpacer(),
self.clear_flags_button,
width=sidebar_width,
sizing_mode="stretch_height",
min_height=backend_min_height,
)
# Create for deleting users
# Create column for users' list
self.list_user_column = pn.Column(
pn.pane.HTML("<b>Users and Privileges</b>"),
self.users_tabulator,
width=sidebar_width,
sizing_mode="stretch_height",
min_height=backend_min_height,
)

# ROWS
self.backend_controls = pn.Row(
name="Actions",
sizing_mode="stretch_both",
min_height=450,
min_height=backend_min_height,
)
# Add controls only for admin users
if not auth.is_admin(user=pn_user(config), config=config):
Expand Down

0 comments on commit 01a1cff

Please sign in to comment.