Skip to content

Commit

Permalink
feat(jans-cli-tui): replace list by label container for scope claims (#…
Browse files Browse the repository at this point in the history
…6521)

* fix(jans-cli-tui): replace list by label container for scope claims

* fix(jans-cli-tui): fixes after claims label container change

* fix(jans-cli-tui): code smell

* fix(jans-cli-tui): typo

Signed-off-by: Mustafa Baser <mbaser@mail.com>
  • Loading branch information
devrimyatar committed Dec 30, 2023
1 parent a410340 commit 6ce4e70
Show file tree
Hide file tree
Showing 7 changed files with 228 additions and 254 deletions.
2 changes: 1 addition & 1 deletion jans-cli-tui/cli_tui/cli/config_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -1113,7 +1113,7 @@ def help_for(self, op_name):
schema_path_string = '{}{}'.format(mode_suffix, os.path.basename(schema_path))
if ' ' in schema_path_string:
schema_path_string = '\"{}\"'.format(schema_path_string)
print("To get sample schema type {0}{2} --schema <schma>, for example {0}{2} --schema {1}".format(sys.argv[0], schema_path_string, scim_arg))
print("To get sample schema type {0}{2} --schema <schema>, for example {0}{2} --schema {1}".format(sys.argv[0], schema_path_string, scim_arg))

def render_json_entry(self, val):
if isinstance(val, str) and val.startswith('_file '):
Expand Down
2 changes: 2 additions & 0 deletions jans-cli-tui/cli_tui/jans_cli_tui.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@
from utils.multi_lang import _
from utils.static import cli_style, common_strings
from utils.validators import IntegerValidator
from utils import background_tasks
from wui_components.jans_cli_dialog import JansGDialog
from wui_components.jans_nav_bar import JansNavBar
from wui_components.jans_message_dialog import JansMessageDialog
Expand Down Expand Up @@ -418,6 +419,7 @@ def check_available_plugins(self) -> None:
"""Disables plugins when cli object is ready"""

if self.cli_object_ok:
self.create_background_task(background_tasks.get_attributes_coroutine(self))
response = self.cli_requests({'operation_id': 'get-plugins'})
if response.ok:
plugins = response.json()
Expand Down
11 changes: 8 additions & 3 deletions jans-cli-tui/cli_tui/plugins/010_auth_server/attributes.py
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,14 @@ def get_attributes(self,
pattern (str, optional): an optional argument for searching attribute.
"""

async def coroutine():
asyncio.ensure_future(self.get_attributes_coroutine())



async def get_attributes_coroutine(self,
start_index: Optional[int]= 0,
pattern: Optional[str]= '',
) -> None:

endpoint_args ='limit:{},startIndex:{}'.format(self.app.entries_per_page, start_index)
if pattern:
Expand All @@ -280,11 +287,9 @@ async def coroutine():
if not 'entriesCount' in data:
self.app.show_message(_(common_strings.error), HTML(_("Server reterned unexpected data <i>{}</i>").format(data)), tobefocused=self.app.center_container)
return

self.working_container.all_data = data.get('entries', [])
self.update_working_container(pattern=pattern, data=data)

asyncio.ensure_future(coroutine())

def search_attributes(self, tbuffer:Buffer) -> None:
"""This method handel the search for Attributes
Expand Down
Loading

0 comments on commit 6ce4e70

Please sign in to comment.