Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(jans-cli-tui): TUI fixes #8259

Merged
merged 3 commits into from
Apr 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions jans-cli-tui/cli_tui/plugins/010_auth_server/agama.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,9 @@ def on_page_enter(self) -> None:

def display_config(self, event):

if not self.working_container.all_data:
return

project_data = self.working_container.all_data[self.working_container.selectes]
project_name = project_data['details']['projectMetadata']['projectName']
fdata = SimpleNamespace()
Expand Down
4 changes: 2 additions & 2 deletions jans-cli-tui/cli_tui/plugins/010_auth_server/ssa.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

from cli import config_cli
from utils.multi_lang import _
from utils.utils import DialogUtils
from utils.utils import DialogUtils, fromisoformat
from utils.static import cli_style, common_strings
from wui_components.jans_vetrical_nav import JansVerticalNav
from wui_components.jans_cli_dialog import JansGDialog
Expand Down Expand Up @@ -121,7 +121,7 @@ def save_ssa(self, dialog):
new_data['expiration'] = int(datetime.now().timestamp()) + 1576800000
else:
if self.expire_widget.value:
new_data['expiration'] = int(datetime.fromisoformat(self.expire_widget.value).timestamp())
new_data['expiration'] = int(fromisoformat(self.expire_widget.value).timestamp())

new_data['software_roles'] = new_data['software_roles'].splitlines()

Expand Down
6 changes: 4 additions & 2 deletions jans-cli-tui/cli_tui/plugins/070_users/edit_user_dialog.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
from typing import Optional, Sequence, Callable
import asyncio
import json

from typing import Optional, Sequence, Callable
from functools import partial

from prompt_toolkit import HTML
Expand Down Expand Up @@ -301,7 +303,7 @@ def save_user(self) -> None:
multi_valued = False
key_prop = self.get_claim_properties(key_)

if key_prop.get('dataType') == 'json':
if key_prop.get('dataType') == 'json' and raw_data[key_]:
try:
json.loads(raw_data[key_])
except Exception as e:
Expand Down