diff --git a/jans-cli-tui/cli_tui/plugins/010_oxauth/view_property.py b/jans-cli-tui/cli_tui/plugins/010_oxauth/view_property.py index b870789952d..2fd41e49e34 100644 --- a/jans-cli-tui/cli_tui/plugins/010_oxauth/view_property.py +++ b/jans-cli-tui/cli_tui/plugins/010_oxauth/view_property.py @@ -95,10 +95,15 @@ def save(self) -> None: prop_type = self.get_item_data(wid) data = prop_type['value'] - elif (type(self.value)==list and type(self.value[0]) not in [dict,list]): + elif (type(self.value)==list and (type(self.value[0]) not in [dict,list])): + for wid in self.value_content.children: prop_type = self.get_item_data(wid) - data = prop_type['value'].split('\n') + + if self.get_type(prop_type['key']) != 'checkboxlist': + data = prop_type['value'].split('\n') + else: + data = prop_type['value'] elif type(self.value) == dict : for wid in self.value_content.children: @@ -140,24 +145,28 @@ async def coroutine(): def get_type(self,prop): try : - if self.schema.get('properties', {})[prop]['type'] == 'string': + proper = self.schema.get('properties', {})[prop] + + if proper['type'] == 'string': prop_type= 'TitledText' - elif self.schema.get('properties', {})[prop]['type'] == 'integer': + elif proper['type'] == 'integer': prop_type= 'int-TitledText' - elif self.schema.get('properties', {})[prop]['type'] == 'boolean': + elif proper['type'] == 'boolean': prop_type= 'TitledCheckBox' - elif self.schema.get('properties', {})[prop]['type'] == 'object': + elif proper['type'] == 'object': prop_type= 'dict' - elif self.schema.get('properties', {})[prop]['type'] == 'array': - if 'enum' in self.schema.get('properties', {})[prop]: + elif proper['type'] == 'array': + if 'enum' in proper or ('enum' in proper['items']): prop_type= 'checkboxlist' else: if type(self.value[0]) == dict: prop_type= 'list-dict' + elif type(self.value[0]) == list: + prop_type= 'list-list' else: prop_type= 'long-TitledText' except: @@ -165,9 +174,13 @@ def get_type(self,prop): return prop_type - def get_listValues(self,prop): + def get_listValues(self,prop,type=None): try : - list_values= self.schema.get('properties', {})[prop]['enum'] + if type !='nasted': + list_values= self.schema.get('properties', {})[prop]['items']['enum'] + else: + list_values= self.schema.get('properties', {})[prop]['items']['items']['enum'] + except: list_values = [] @@ -206,6 +219,15 @@ def prepare_properties(self): ), ],width=D()) + elif prop_type == 'list-list': + self.value_content= HSplit([ + self.app.getTitledCheckBoxList( + self.property, + name=self.property, + values=self.get_listValues(self.property,'nasted'), + style='class:outh-client-checkboxlist'), + ],width=D()) + elif prop_type == 'checkboxlist': self.value_content= HSplit([ self.app.getTitledCheckBoxList(