From 094702f8c324b21e0a42304318f2ddb73d1d65f0 Mon Sep 17 00:00:00 2001 From: Charles Grimont Date: Fri, 20 Dec 2024 16:11:54 +0100 Subject: [PATCH] ref convertigo/C8oForms/issues/832 --- _c8oProject/mobilePages/BrowseTables.yaml | 6 +- ...disabled_formssource_GetSelectDataOld.yaml | 530 +++++++++++ ..._disabled_formssource_GetTableDataOld.yaml | 886 ++++++++++++++++++ .../sequences/formssource_GetFieldValues.yaml | 2 +- .../sequences/formssource_GetSelectData.yaml | 104 +- .../sequences/formssource_GetTableData.yaml | 690 ++++---------- c8oProject.yaml | 4 +- project.md | 103 +- 8 files changed, 1824 insertions(+), 501 deletions(-) create mode 100644 _c8oProject/sequences/_disabled_formssource_GetSelectDataOld.yaml create mode 100644 _c8oProject/sequences/_disabled_formssource_GetTableDataOld.yaml diff --git a/_c8oProject/mobilePages/BrowseTables.yaml b/_c8oProject/mobilePages/BrowseTables.yaml index 3b31a89..8e7760c 100644 --- a/_c8oProject/mobilePages/BrowseTables.yaml +++ b/_c8oProject/mobilePages/BrowseTables.yaml @@ -3817,7 +3817,11 @@ title: First page window["t"] = page; page.local.type = "table"; page.local.target = "table"; - if(page.navParams.data.type == "select" || page.navParams.data.type == "checkbox" || page.navParams.data.type == "radio"){ + if(page.navParams.data.target == "table"){ + page.local.type = "table"; + page.local.target = "table"; + } + else if(page.navParams.data.type == "select" || page.navParams.data.type == "checkbox" || page.navParams.data.type == "radio"){ page.local.type = "select"; page.local.target = "select"; } diff --git a/_c8oProject/sequences/_disabled_formssource_GetSelectDataOld.yaml b/_c8oProject/sequences/_disabled_formssource_GetSelectDataOld.yaml new file mode 100644 index 0000000..f65d6c0 --- /dev/null +++ b/_c8oProject/sequences/_disabled_formssource_GetSelectDataOld.yaml @@ -0,0 +1,530 @@ +accessibility: Hidden +comment: | + '{ + "en": { + "displayName": "Get Data", + "comment": "Get data from a Baserow table. You will be able to choose the Baserow columns for the names to be displayed in the select dropdown list and the column for the values of each name." + }, + "fr": { + "displayName": "Récupérer les données", + "comment": "Récupérez des données à partir d''une table Baserow. Vous pourrez choisir les colonnes de Baserow pour les noms à afficher dans la liste déroulante et la colonne pour les valeurs de chaque nom." + }, + "es": { + "displayName": "Obtener datos", + "comment": "Obtener datos de una tabla de Baserow. Podrá elegir las columnas de Baserow para que los nombres se muestren en la lista desplegable y la columna para los valores de cada nombre." + }, + "it": { + "displayName": "Ottenere dati", + "comment": "Ottieni dati da una tabella di Baserow. Sarai in grado di scegliere le colonne di Baserow per i nomi da visualizzare nel menu a discesa e la colonna per i valori di ogni nome." + }, + "types": ["select", "checkbox", "radio", "checkbox_group", "radio_group"] + }' +↓Call_Sequence2 [steps.SequenceStep-1734701111116]: + sourceSequence: lib_BaseRow.formscommon_CheckConfig + ↓forms_config [variables.StepVariable-1734701111119]: + description: configure=lib_BaseRow/DisplayObjects/mobile/BrowseTables + required: true +↓IfError [steps.IfExistStep-1734701111122]: + condition: IfError + sourceDefinition: + - xmlizable: + - ↑classname: com.twinsoft.convertigo.beans.common.XMLVector + - com.twinsoft.convertigo.beans.common.XMLVector: + - java.lang.String: + - ↑value: 1734701111116 + - java.lang.String: + - ↑value: ./document/error + ↓Copy [steps.XMLCopyStep-1734701111125]: + sourceDefinition: + - xmlizable: + - ↑classname: com.twinsoft.convertigo.beans.common.XMLVector + - com.twinsoft.convertigo.beans.common.XMLVector: + - java.lang.String: + - ↑value: 1734701111116 + - java.lang.String: + - ↑value: ./document/error + ↓Return [steps.ReturnStep-1734701111128]: +↓ParseConfig [steps.SimpleStep-1734701111131]: + expression: | + 'jConfig = JSON.parse(forms_config); + table_id = jConfig.table_id; + view_id = jConfig.view_id ? jConfig.view_id : null; + + if (jConfig.columns) { + include_fields =""; + jConfig.columns.forEach(col => include_fields += col +",") + include_fields = include_fields.substring(0, include_fields.lastIndexOf('','')); + } + var displayValue = jConfig.displayValue != undefined ? jConfig.displayValue: jConfig.column; + var value = jConfig.value != undefined ? jConfig.value : jConfig.line; + + filterExpression = forms_Filter; // This is the Constructed Fiter API for baserow. + + log.warn("form_filter is :" + forms_filter.length) + + if (forms_filter.length > 3) // This is the full text search API filed for baserow + search= forms_filter + + let describeStructure = false; + + if (model == "true") { + log.warn("Forms Model True") + size = "1"; + filterExpression = null; + describeStructure = true; + } + let verbsByType = { + text: [ + "equal", + "not_equal", + "contains", + "contains_not", + "length_is_lower_than", + "empty", + "not_empty" + ], + long_text: [ + "equal", + "not_equal", + "contains", + "contains_not", + "length_is_lower_than", + "empty", + "not_empty" + ], + link_row: [ + "link_row_has", + "link_row_has_not", + "link_row_contains", + "link_row_not_contains", + "empty", + "not_empty" + ], + number: [ + "equal", + "not_equal", + "contains", + "contains_not", + "higher_than", + "lower_than", + "empty", + "not_empty", + ], + rating : [ + "equal", + "not_equal", + "higher_than", + "lower_than", + ], + boolean:[ + "boolean", + "empty", + "not_empty", + ], + date:[ + "date_equal", + "date_equal", + "date_not_equal", + "date_equals_today", + "date_before_today", + "date_after_today", + "date_equals_days_ago", + "date_equals_months_ago", + "date_equals_years_ago", + "date_equals_week", + "date_equals_month", + "date_equals_month", + "date_equals_year", + "date_equals_day_of_month", + "date_before", + "date_after", + "contains", + "contains_not", + "empty", + "not_empty" + ], + last_modified:[ + "date_equal", + "date_equal", + "date_not_equal", + "date_equals_today", + "date_before_today", + "date_after_today", + "date_equals_days_ago", + "date_equals_months_ago", + "date_equals_years_ago", + "date_equals_week", + "date_equals_month", + "date_equals_month", + "date_equals_year", + "date_equals_day_of_month", + "date_before", + "date_after", + "contains", + "contains_not", + "empty", + "not_empty" + ], + created_on:[ + "date_equal", + "date_equal", + "date_not_equal", + "date_equals_today", + "date_before_today", + "date_after_today", + "date_equals_days_ago", + "date_equals_months_ago", + "date_equals_years_ago", + "date_equals_week", + "date_equals_month", + "date_equals_month", + "date_equals_year", + "date_equals_day_of_month", + "date_before", + "date_after", + "contains", + "contains_not", + "empty", + "not_empty" + ], + url:[ + "equal", + "not_equal", + "contains", + "contains_not", + "length_is_lower_than", + "empty", + "not_empty" + ], + email:[ + "equal", + "not_equal", + "contains", + "contains_not", + "length_is_lower_than", + "empty", + "not_empty" + ], + file:[ + "filename_contains", + "has_file_type", + "empty", + "not_empty" + ], + single_select:[ + "single_select_equal", + "single_select_not_equal", + "contains", + "contains_not", + "empty", + "not_empty" + ], + multiple_select:[ + "multiple_select_has", + "multiple_select_has_not", + "contains", + "contains_not", + "empty", + "not_empty" + ], + phone_number: [ + "equal", + "not_equal", + "contains", + "contains_not", + "length_is_lower_than", + "empty", + "not_empty" + ] + } + + + ' +↓Input_variables [steps.InputVariablesStep-1734701111134]: +↓Call_Sequence1 [steps.SequenceStep-1734701111137]: + sourceSequence: lib_BaseRow.TableGetData + ↓exclude [variables.StepVariable-1734701111140]: + comment: 'All the fields are included in the response by default. You can select a subset of fields by providing the exclude query parameter. If you for example provide the following GET parameter `exclude=field_1,field_2` then the fields with id `1` and id `2` are going to be excluded from the selection and response. If the `user_field_names` parameter is provided then instead exclude should be a comma separated list of the actual field names. For field names with commas you should surround the name with quotes like so: `exclude=My Field,"Field With , "`. A backslash can be used to escape field names which contain double quotes like so: `exclude=My Field,Field with \"`.' + description: exclude + ↓include_fields [variables.StepVariable-1734701111143]: + comment: 'All the fields are included in the response by default. You can select a subset of fields by providing the include query parameter. If you for example provide the following GET parameter `include=field_1,field_2` then only the fields withid `1` and id `2` are going to be selected and included in the response. If the `user_field_names` parameter is provided then instead include should be a comma separated list of the actual field names. For field names with commas you should surround the name with quotes like so: `include=My Field,"Field With , "`. A backslash can be used to escape field names which contain double quotes like so: `include=My Field,Field with \"`.' + description: include + ↓order_by [variables.StepVariable-1734701111146]: + comment: 'Optionally the rows can be ordered by provided field ids separated by comma. By default a field is ordered in ascending (A-Z) order, but by prepending the field with a ''-'' it can be ordered descending (Z-A). If the `user_field_names` parameter is provided then instead order_by should be a comma separated list of the actual field names. For field names with commas you should surround the name with quotes like so: `order_by=My Field,"Field With , "`. A backslash can be used to escape field names which contain double quotes like so: `order_by=My Field,Field with \"`.' + description: order_by + ↓page [variables.StepVariable-1734701111149]: + comment: Defines which page of rows should be returned. + description: page + ↓search [variables.StepVariable-1734701111152]: + comment: If provided only rows with data that matches the search query are going to be returned. + description: search + ↓size [variables.StepVariable-1734701111155]: + comment: Defines how many rows should be returned per page. + description: size + ↓table_id [variables.StepVariable-1734701111158]: + comment: Returns the rows of the table related to the provided value. + description: table_id + required: true + ↓view_id [variables.StepVariable-1734701111161]: + comment: Includes all the filters and sorts of the provided view. + description: view_id + ↓filterExpression [variables.StepVariable-1734701111164]: + ↓describeStructure [variables.StepVariable-1734701111167]: +↓IfExist [steps.IfExistStep-1734701111170]: + sourceDefinition: + - xmlizable: + - ↑classname: com.twinsoft.convertigo.beans.common.XMLVector + - com.twinsoft.convertigo.beans.common.XMLVector: + - java.lang.String: + - ↑value: 1734701111137 + - java.lang.String: + - ↑value: ./document/error + ↓Error_structure [steps.XMLErrorStep-1734701111173]: + ↓Return [steps.ReturnStep-1734701111176]: +↓myVariable1 [steps.JsonSourceStep-1734701111179]: + sourceDefinition: + - xmlizable: + - ↑classname: com.twinsoft.convertigo.beans.common.XMLVector + - com.twinsoft.convertigo.beans.common.XMLVector: + - java.lang.String: + - ↑value: 1734701111137 + - java.lang.String: + - ↑value: ./document/results/object + variableName: res +↓myVariable [steps.JsonSourceStep-1734701111182]: + sourceDefinition: + - xmlizable: + - ↑classname: com.twinsoft.convertigo.beans.common.XMLVector + - com.twinsoft.convertigo.beans.common.XMLVector: + - java.lang.String: + - ↑value: 1734701111137 + - java.lang.String: + - ↑value: ./document/structure/object + variableName: structure +↓computeValue [steps.SimpleStep-1734701111185]: + expression: | + 'if ("res" in this) { + if (!(Array.isArray(res))) { + res = [res]; + } + if (jConfig.displayValue) { + res = res.map((x) => { + return { + displayValue: x[displayValue], + value: x[value] + } + }) + } + else if (jConfig.column) { + res = res.map((x) => { + return { + column: x[displayValue], + line: x[value] + } + }) + + } + } + else { + res = []; + } + + // Now fiter is done on the backend using the search API, so no use for the next lines... + /* + if(forms_filter != undefined && forms_filter != ""){ + res = res.filter((z)=>{ + return z.displayValue.toLowerCase().indexOf(forms_filter.toLowerCase()) != -1; + }) + } + */' +↓object [steps.JsonToXmlStep-1734701111188]: + jsonObject: + - xmlizable: + - ↑classname: com.twinsoft.convertigo.beans.steps.SmartType + - SmartType: + - ↑mode: JS + - →→: res + key: + - xmlizable: + - ↑classname: com.twinsoft.convertigo.beans.steps.SmartType + - SmartType: + - ↑mode: PLAIN + - →→: value +↓jIf [steps.IfStep-1734701111191]: + condition: model == "true" && "structure" in this + ↓Sequence_JS [steps.SimpleStep-1734701111194]: + expression: | + 'let data = [{}]; + structure.forEach((e)=>{ + if(jConfig.columns.indexOf(e.name) != -1){ + e.filterHide = false; + // if target is formula use it''s formula_type + var cType = e.type; + if(cType == "formula"){ + cType = e.formula_type; + } + e.filterCompletion = verbsByType[cType]; + if(e.filterCompletion == null){ + e.filterCompletion = []; + } + data[0][e.name] = e; + } + + })' + ↓data [steps.JsonToXmlStep-1734701111197]: + jsonObject: + - xmlizable: + - ↑classname: com.twinsoft.convertigo.beans.steps.SmartType + - SmartType: + - ↑mode: JS + - →→: data + key: + - xmlizable: + - ↑classname: com.twinsoft.convertigo.beans.steps.SmartType + - SmartType: + - ↑mode: PLAIN + - →→: data +↓forms_filter [variables.RequestableVariable-1734701111200]: + comment: | + Filters + + description: + required: true + value: +↓forms_config [variables.RequestableVariable-1734701111203]: + comment: | + '{ + "en": { + "comment": "Choose a table in Baserow", + "displayName": "Configuration" + }, + "fr": { + "comment": "Choisissez une table dans Baserow", + "displayName":"Configuration" + }, + "es": { + "comment": "Elija una tabla en Baserow", + "displayName": "Configuración" + }, + "it": { + "comment": "Scegli una tabella in Baserow", + "displayName": "Configurazione" + } + }' + description: configure=lib_BaseRow/DisplayObjects/mobile/BrowseTables/select + required: true + value: +↓forms_Filter [variables.RequestableVariable-1734701111206]: + comment: | + '{ + "en": { + "comment": "Define a filter to apply to Baserow table", + "displayName": "Filter" + }, + "fr": { + "comment": "Définir un filtre à appliquer à la table Baserow", + "displayName": "Filtre" + }, + "es": { + "comment": "Definir un filtro para aplicar a la tabla de Baserow", + "displayName": "Filtro" + }, + "it": { + "comment": "Definire un filtro da applicare alla tabella di Baserow", + "displayName": "Filtro" + } + }' + description: filter + required: true + value: +↓model [variables.RequestableVariable-1734701111209]: + comment: If true, just return one line of data so that No Code studio can compte the table model +↓TestWithFilter [core.TestCase]: + ↓forms_config [variables.TestCaseVariable-1734701111213]: + comment: The Table ID you want to get data from + description: configure=lib_BaseRow/DisplayObjects/mobile/selecttable + required: true + value: | + '{ + "table_id": "77", + "columns": ["Number"] + } + ' + ↓forms_tableFilter [variables.TestCaseVariable-1734701111216]: + description: + required: true + value: 100 +↓TestWithLinkedFileds [core.TestCase]: + ↓forms_config [variables.TestCaseVariable-1734701111220]: + comment: The Table ID you want to get data from + description: configure=lib_BaseRow/DisplayObjects/mobile/selecttable + required: true + value: | + '{ + "table_id": "661", + "columns": ["Code", "Customer name"] + } + ' +↓TestWithLinkedFiledsAndOneCol [core.TestCase]: + ↓forms_config [variables.TestCaseVariable-1734701111224]: + comment: The Table ID you want to get data from + description: configure=lib_BaseRow/DisplayObjects/mobile/selecttable + required: true + value: | + '{ + "table_id": "661", + "columns": ["Customer name"] + } + ' +↓TestWithNoFilter [core.TestCase]: + ↓forms_config [variables.TestCaseVariable-1734701111228]: + comment: The Table ID you want to get data from + description: configure=lib_BaseRow/DisplayObjects/mobile/selecttable + required: true + value: | + '{ + "table_id": "660", + "columns": ["Number"] + } + ' +↓TestWithNoFilterWith2Cols [core.TestCase]: + ↓forms_config [variables.TestCaseVariable-1734701111232]: + comment: The Table ID you want to get data from + description: configure=lib_BaseRow/DisplayObjects/mobile/selecttable + required: true + value: | + '{ + "table_id": "660", + "columns": ["Number", "Accommodates"] + } + ' +↓TestWithNoFilterWithCustomFilter [core.TestCase]: + ↓forms_config [variables.TestCaseVariable-1734701111236]: + comment: The Table ID you want to get data from + description: configure=lib_BaseRow/DisplayObjects/mobile/selecttable + required: true + value: | + '{ + "table_id": "660", + "columns": ["Number", "Accommodates"] + } + ' + ↓forms_tableFilter [variables.TestCaseVariable-1734701111239]: + description: + required: true + value: + ↓forms_Filter [variables.TestCaseVariable-1734701111242]: + description: + required: true + value: | + '{ + "mode": "AND", + "filters": [ + { + "field": "Number", + "op": "contains", + "value": "100" + } + ] + } + ' \ No newline at end of file diff --git a/_c8oProject/sequences/_disabled_formssource_GetTableDataOld.yaml b/_c8oProject/sequences/_disabled_formssource_GetTableDataOld.yaml new file mode 100644 index 0000000..58860f4 --- /dev/null +++ b/_c8oProject/sequences/_disabled_formssource_GetTableDataOld.yaml @@ -0,0 +1,886 @@ +accessibility: Hidden +comment: | + '{ + "en": { + "displayName": "Get data", + "comment": "Get data from a Baserow table for a data grid. Each column of the Baserow table will be displayed as the same column in the data grid" + }, + "fr": { + "displayName": "Récupérer les données", + "comment": "Récupérez les données d''une table Baserow pour une grille de données. Chaque colonne de la table Baserow sera affichée comme la même colonne dans la grille de données" + }, + "es": { + "displayName": "Obtener datos", + "comment": "Obtenga datos de una tabla de Baserow para una cuadrícula de datos. Cada columna de la tabla de Baserow se mostrará como la misma columna en la cuadrícula de datos" + }, + "it": { + "displayName": "Ottenere dati", + "comment": "Ottieni dati da una tabella di Baserow per una griglia di dati. Ogni colonna della tabella di Baserow verrà visualizzata come la stessa colonna nella griglia di dati" + }, + "types": ["grid", "chart", "map"] + }' +↓Call_Sequence1 [steps.SequenceStep-1729157466231]: + sourceSequence: lib_BaseRow.formscommon_CheckConfig + ↓forms_config [variables.StepVariable-1729157466233]: + description: configure=lib_BaseRow/DisplayObjects/mobile/BrowseTables + required: true +↓IfError [steps.IfExistStep-1729157599546]: + condition: IfError + sourceDefinition: + - xmlizable: + - ↑classname: com.twinsoft.convertigo.beans.common.XMLVector + - com.twinsoft.convertigo.beans.common.XMLVector: + - java.lang.String: + - ↑value: 1729157466231 + - java.lang.String: + - ↑value: ./document/error + ↓Copy [steps.XMLCopyStep-1729157599549]: + sourceDefinition: + - xmlizable: + - ↑classname: com.twinsoft.convertigo.beans.common.XMLVector + - com.twinsoft.convertigo.beans.common.XMLVector: + - java.lang.String: + - ↑value: 1729157466231 + - java.lang.String: + - ↑value: ./document/error + ↓Return [steps.ReturnStep-1729157599552]: +↓ParseConfig [steps.SimpleStep-1666429506760]: + expression: | + 'jConfig = JSON.parse(forms_config); + table_id = jConfig.table_id; + view_id = jConfig.view_id ? jConfig.view_id : null; + let describeStructure = false; + let verbsByType = { + text: [ + "equal", + "not_equal", + "contains", + "contains_not", + "length_is_lower_than", + "empty", + "not_empty" + ], + long_text: [ + "equal", + "not_equal", + "contains", + "contains_not", + "length_is_lower_than", + "empty", + "not_empty" + ], + link_row: [ + "link_row_has", + "link_row_has_not", + "link_row_contains", + "link_row_not_contains", + "empty", + "not_empty" + ], + number: [ + "equal", + "not_equal", + "contains", + "contains_not", + "higher_than", + "lower_than", + "empty", + "not_empty", + ], + rating : [ + "equal", + "not_equal", + "higher_than", + "lower_than", + ], + boolean:[ + "boolean", + "empty", + "not_empty", + ], + date:[ + "date_equal", + "date_equal", + "date_not_equal", + "date_equals_today", + "date_before_today", + "date_after_today", + "date_equals_days_ago", + "date_equals_months_ago", + "date_equals_years_ago", + "date_equals_week", + "date_equals_month", + "date_equals_month", + "date_equals_year", + "date_equals_day_of_month", + "date_before", + "date_after", + "contains", + "contains_not", + "empty", + "not_empty" + ], + last_modified:[ + "date_equal", + "date_equal", + "date_not_equal", + "date_equals_today", + "date_before_today", + "date_after_today", + "date_equals_days_ago", + "date_equals_months_ago", + "date_equals_years_ago", + "date_equals_week", + "date_equals_month", + "date_equals_month", + "date_equals_year", + "date_equals_day_of_month", + "date_before", + "date_after", + "contains", + "contains_not", + "empty", + "not_empty" + ], + created_on:[ + "date_equal", + "date_equal", + "date_not_equal", + "date_equals_today", + "date_before_today", + "date_after_today", + "date_equals_days_ago", + "date_equals_months_ago", + "date_equals_years_ago", + "date_equals_week", + "date_equals_month", + "date_equals_month", + "date_equals_year", + "date_equals_day_of_month", + "date_before", + "date_after", + "contains", + "contains_not", + "empty", + "not_empty" + ], + url:[ + "equal", + "not_equal", + "contains", + "contains_not", + "length_is_lower_than", + "empty", + "not_empty" + ], + email:[ + "equal", + "not_equal", + "contains", + "contains_not", + "length_is_lower_than", + "empty", + "not_empty" + ], + file:[ + "filename_contains", + "has_file_type", + "empty", + "not_empty" + ], + single_select:[ + "single_select_equal", + "single_select_not_equal", + "contains", + "contains_not", + "empty", + "not_empty" + ], + multiple_select:[ + "multiple_select_has", + "multiple_select_has_not", + "contains", + "contains_not", + "empty", + "not_empty" + ], + phone_number: [ + "equal", + "not_equal", + "contains", + "contains_not", + "length_is_lower_than", + "empty", + "not_empty" + ] + } + + // For each column provider in the configuration, compute the lits of fields we wloud like to retriev + // With the BaseRow API. + if (jConfig.columns) { + include_fields =""; + jConfig.columns.forEach(col => include_fields += col +",") + include_fields = include_fields.substring(0, include_fields.lastIndexOf('','')); + } + + // The Filter Expression is provided directly in the form_fitler variable. + filterExpression = forms_tableFilter; + + // If Forms asks us for a model, just return the 5 First lines, ignoring all filters + if (model == "true") { + size = "1"; + filterExpression = null; + describeStructure = true; + } + ' +↓Input_variables [steps.InputVariablesStep-1665402570169]: +↓Call_Sequence [steps.SequenceStep-1665402300413]: + sourceSequence: lib_BaseRow.TableGetData + ↓exclude [variables.StepVariable-1665402300415]: + comment: 'All the fields are included in the response by default. You can select a subset of fields by providing the exclude query parameter. If you for example provide the following GET parameter `exclude=field_1,field_2` then the fields with id `1` and id `2` are going to be excluded from the selection and response. If the `user_field_names` parameter is provided then instead exclude should be a comma separated list of the actual field names. For field names with commas you should surround the name with quotes like so: `exclude=My Field,"Field With , "`. A backslash can be used to escape field names which contain double quotes like so: `exclude=My Field,Field with \"`.' + description: exclude + ↓include_fields [variables.StepVariable-1665402300421]: + comment: 'All the fields are included in the response by default. You can select a subset of fields by providing the include query parameter. If you for example provide the following GET parameter `include=field_1,field_2` then only the fields withid `1` and id `2` are going to be selected and included in the response. If the `user_field_names` parameter is provided then instead include should be a comma separated list of the actual field names. For field names with commas you should surround the name with quotes like so: `include=My Field,"Field With , "`. A backslash can be used to escape field names which contain double quotes like so: `include=My Field,Field with \"`.' + description: include + ↓order_by [variables.StepVariable-1665402300423]: + comment: 'Optionally the rows can be ordered by provided field ids separated by comma. By default a field is ordered in ascending (A-Z) order, but by prepending the field with a ''-'' it can be ordered descending (Z-A). If the `user_field_names` parameter is provided then instead order_by should be a comma separated list of the actual field names. For field names with commas you should surround the name with quotes like so: `order_by=My Field,"Field With , "`. A backslash can be used to escape field names which contain double quotes like so: `order_by=My Field,Field with \"`.' + description: order_by + ↓page [variables.StepVariable-1665402300425]: + comment: Defines which page of rows should be returned. + description: page + ↓search [variables.StepVariable-1665402300427]: + comment: If provided only rows with data that matches the search query are going to be returned. + description: search + ↓size [variables.StepVariable-1665402300429]: + comment: Defines how many rows should be returned per page. + description: size + ↓table_id [variables.StepVariable-1665402300431]: + comment: Returns the rows of the table related to the provided value. + description: table_id + required: true + ↓view_id [variables.StepVariable-1665402300433]: + comment: Includes all the filters and sorts of the provided view. + description: view_id + ↓filterExpression [variables.StepVariable-1665915671261]: + ↓describeStructure [variables.StepVariable-1680617375032]: +↓IfExist [steps.IfExistStep-1665402674584]: + sourceDefinition: + - xmlizable: + - ↑classname: com.twinsoft.convertigo.beans.common.XMLVector + - com.twinsoft.convertigo.beans.common.XMLVector: + - java.lang.String: + - ↑value: 1665402300413 + - java.lang.String: + - ↑value: ./document/error + ↓Error_structure [steps.XMLErrorStep-1665402703369]: + message: + - xmlizable: + - ↑classname: com.twinsoft.convertigo.beans.steps.SmartType + - SmartType: + - ↑mode: SOURCE + - com.twinsoft.convertigo.beans.common.XMLVector: + - java.lang.String: + - ↑value: 1665402300413 + - java.lang.String: + - ↑value: ./document/error/message/text() + ↓Return [steps.ReturnStep-1665402714329]: +↓myVariable [steps.JsonSourceStep-1680617809832]: + sourceDefinition: + - xmlizable: + - ↑classname: com.twinsoft.convertigo.beans.common.XMLVector + - com.twinsoft.convertigo.beans.common.XMLVector: + - java.lang.String: + - ↑value: 1665402300413 + - java.lang.String: + - ↑value: ./document/structure/object + variableName: structure +↓Array [steps.JsonArrayStep-1665402723840]: + key: + - xmlizable: + - ↑classname: com.twinsoft.convertigo.beans.steps.SmartType + - SmartType: + - ↑mode: PLAIN + - →→: data + ↓Iterator [steps.IteratorStep-1665402736681]: + sourceDefinition: + - xmlizable: + - ↑classname: com.twinsoft.convertigo.beans.common.XMLVector + - com.twinsoft.convertigo.beans.common.XMLVector: + - java.lang.String: + - ↑value: 1665402300413 + - java.lang.String: + - ↑value: ./document/results/object + ↓Object [steps.JsonObjectStep-1665406203249]: + comment: The data object + key: + - xmlizable: + - ↑classname: com.twinsoft.convertigo.beans.steps.SmartType + - SmartType: + - ↑mode: PLAIN + - →→: Object + output: false + ↓Iterator [steps.IteratorStep-1665403182897]: + comment: Ignore id as this is a technical id not to be displayed + sourceDefinition: + - xmlizable: + - ↑classname: com.twinsoft.convertigo.beans.common.XMLVector + - com.twinsoft.convertigo.beans.common.XMLVector: + - java.lang.String: + - ↑value: 1665402736681 + - java.lang.String: + - ↑value: ./* + ↓InitHtmEntry [steps.SimpleStep-1665407550205]: + comment: Start a DIV HTML with styling + expression: | + 'jHtml = ` +
+ + ` + + colors = { + "light-green" : "#e6fff1", + "light-blue" : "#ebf7ff", + "light-orange" : "#fff6e6", + "light-red" : "#ffe8e6", + "light-gray" : "#f5f5f5", + + "green" : "#bdffdc", + "blue" : "#b5dbf5", + "orange" : "#ffe9c2", + "red" : "#ffbfb8", + "gray" : "#d9dbde", + + "dark-green" : "#9bf2c4", + "dark-blue" : "#83c3eb", + "dark-orange" : "#ffe0ab", + "dark-red" : "#f7a499", + "dark-gray" : "#b4bac2" + } + + ' + ↓jSimpleSource [steps.SimpleSourceStep-1665875996794]: + sourceDefinition: + - xmlizable: + - ↑classname: com.twinsoft.convertigo.beans.common.XMLVector + - com.twinsoft.convertigo.beans.common.XMLVector: + - java.lang.String: + - ↑value: 1665403182897 + - java.lang.String: + - ↑value: ./@originalKeyName + variableName: jOriginalKeyName + ↓jSimpleSource1 [steps.SimpleSourceStep-1665876065904]: + sourceDefinition: + - xmlizable: + - ↑classname: com.twinsoft.convertigo.beans.common.XMLVector + - com.twinsoft.convertigo.beans.common.XMLVector: + - java.lang.String: + - ↑value: 1665403182897 + - java.lang.String: + - ↑value: name(.) + variableName: jKeyName + ↓Object [steps.JsonObjectStep-1665407248434]: + comment: Create entry + key: + - xmlizable: + - ↑classname: com.twinsoft.convertigo.beans.steps.SmartType + - SmartType: + - ↑mode: JS + - →→: 'jOriginalKeyName ? jOriginalKeyName : jKeyName' + output: false + ↓IfExistThenElse [steps.IfExistThenElseStep-1665406758754]: + comment: Handle multivalued + sourceDefinition: + - xmlizable: + - ↑classname: com.twinsoft.convertigo.beans.common.XMLVector + - com.twinsoft.convertigo.beans.common.XMLVector: + - java.lang.String: + - ↑value: 1665403182897 + - java.lang.String: + - ↑value: .[@type = 'array'] + ↓jThen [steps.ThenStep-1665406759518]: + ↓InitValueArray [steps.SimpleStep-1667889960531]: + expression: | + jValues = []; + + ↓Iterator [steps.IteratorStep-1665407450731]: + sourceDefinition: + - xmlizable: + - ↑classname: com.twinsoft.convertigo.beans.common.XMLVector + - com.twinsoft.convertigo.beans.common.XMLVector: + - java.lang.String: + - ↑value: 1665403182897 + - java.lang.String: + - ↑value: ./object + ↓IfExistThenElse [steps.IfExistThenElseStep-1665684721073]: + sourceDefinition: + - xmlizable: + - ↑classname: com.twinsoft.convertigo.beans.common.XMLVector + - com.twinsoft.convertigo.beans.common.XMLVector: + - java.lang.String: + - ↑value: 1665407450731 + - java.lang.String: + - ↑value: ./value + ↓jThen [steps.ThenStep-1665684723422]: + ↓JsonSource [steps.JsonSourceStep-1668099201803]: + sourceDefinition: + - xmlizable: + - ↑classname: com.twinsoft.convertigo.beans.common.XMLVector + - com.twinsoft.convertigo.beans.common.XMLVector: + - java.lang.String: + - ↑value: 1665407450731 + - java.lang.String: + - ↑value: . + variableName: jMyEntry + ↓AddEntry [steps.SimpleStep-1665407618555]: + expression: | + 'log.debug("______" + JSON.stringify(jMyEntry)) + + if (jMyEntry["value"] != undefined) { + jHtml += + "
" + + jMyEntry["value"] + + "
" + } else { + jHtml += "

" + jMyEntry + "

" + } + jValues.push(jMyEntry); + ' + ↓jElse [steps.ElseStep-1665684723424]: + ↓jSimpleSource [steps.SimpleSourceStep-1665685771320]: + sourceDefinition: + - xmlizable: + - ↑classname: com.twinsoft.convertigo.beans.common.XMLVector + - com.twinsoft.convertigo.beans.common.XMLVector: + - java.lang.String: + - ↑value: 1665407450731 + - java.lang.String: + - ↑value: ./url/text() + variableName: jURL + ↓isImage [steps.SimpleSourceStep-1665684886493]: + sourceDefinition: + - xmlizable: + - ↑classname: com.twinsoft.convertigo.beans.common.XMLVector + - com.twinsoft.convertigo.beans.common.XMLVector: + - java.lang.String: + - ↑value: 1665407450731 + - java.lang.String: + - ↑value: ./is_image/text() + variableName: bIsImage + ↓jIfThenElse [steps.IfThenElseStep-1665685010861]: + condition: bIsImage == 'true' + ↓jThen [steps.ThenStep-1665685010863]: + ↓AddImageEnttry [steps.SimpleStep-1665685016539]: + expression: | + jHtml += "" + jValues.push(jURL); + + ↓jElse [steps.ElseStep-1665685010865]: + ↓jSimpleSource [steps.SimpleSourceStep-1665685737366]: + sourceDefinition: + - xmlizable: + - ↑classname: com.twinsoft.convertigo.beans.common.XMLVector + - com.twinsoft.convertigo.beans.common.XMLVector: + - java.lang.String: + - ↑value: 1665407450731 + - java.lang.String: + - ↑value: ./visible_name/text() + variableName: jVisibleName + ↓AddFileEntry [steps.SimpleStep-1665685031623]: + expression: | + jHtml += "

" + jVisibleName + "

" + jValues.push(jURL); + + ↓JSON_to_XML [steps.JsonToXmlStep-1667927327885]: + jsonObject: + - xmlizable: + - ↑classname: com.twinsoft.convertigo.beans.steps.SmartType + - SmartType: + - ↑mode: JS + - →→: jValues + key: + - xmlizable: + - ↑classname: com.twinsoft.convertigo.beans.steps.SmartType + - SmartType: + - ↑mode: PLAIN + - →→: value + output: false + ↓jElse [steps.ElseStep-1665406759520]: + ↓JsonSource [steps.JsonSourceStep-1667989605906]: + sourceDefinition: + - xmlizable: + - ↑classname: com.twinsoft.convertigo.beans.common.XMLVector + - com.twinsoft.convertigo.beans.common.XMLVector: + - java.lang.String: + - ↑value: 1665403182897 + - java.lang.String: + - ↑value: . + variableName: jData + ↓AddData [steps.SimpleStep-1665857204666]: + expression: | + 'function computeHtml() { + if (jData["value"] != undefined) { + log.debug("************** JData has a Value Key"); + if (jData["color"] != undefined) { + jHtml += + "
" + + jData["value"] + + "
" + } + return + } + + log.debug("************** jData is simple string "); + jHtml += jData; + } + + log.debug("**************" + JSON.stringify(jData)); + if (jData != null) computeHtml(); + ' + ↓JSON_to_XML [steps.JsonToXmlStep-1667927358648]: + jsonObject: + - xmlizable: + - ↑classname: com.twinsoft.convertigo.beans.steps.SmartType + - SmartType: + - ↑mode: JS + - →→: jData + key: + - xmlizable: + - ↑classname: com.twinsoft.convertigo.beans.steps.SmartType + - SmartType: + - ↑mode: PLAIN + - →→: value + output: false + ↓Field [steps.JsonFieldStep-1665407340859]: + key: + - xmlizable: + - ↑classname: com.twinsoft.convertigo.beans.steps.SmartType + - SmartType: + - ↑mode: PLAIN + - →→: type + output: false + value: + - xmlizable: + - ↑classname: com.twinsoft.convertigo.beans.steps.SmartType + - SmartType: + - ↑mode: PLAIN + - →→: html + ↓Field1 [steps.JsonFieldStep-1665407353362]: + key: + - xmlizable: + - ↑classname: com.twinsoft.convertigo.beans.steps.SmartType + - SmartType: + - ↑mode: PLAIN + - →→: displayValue + output: false + value: + - xmlizable: + - ↑classname: com.twinsoft.convertigo.beans.steps.SmartType + - SmartType: + - ↑mode: JS + - →→: jHtml + ↓Field2 [steps.JsonFieldStep-1665689221993]: + key: + - xmlizable: + - ↑classname: com.twinsoft.convertigo.beans.steps.SmartType + - SmartType: + - ↑mode: PLAIN + - →→: displayName + output: false + value: + - xmlizable: + - ↑classname: com.twinsoft.convertigo.beans.steps.SmartType + - SmartType: + - ↑mode: JS + - →→: 'jOriginalKeyName ? jOriginalKeyName : jKeyName' + ↓Log [steps.LogStep-1666371057521]: + expression: | + '"***" + jKeyName + " : " + (jKeyName == ''id'' || jKeyName == ''order'') + "**" + jOriginalKeyName + + ' + isEnabled: false + level: WARN + ↓jIf [steps.IfStep-1666370491964]: + condition: | + jKeyName == 'id'|| + jKeyName == 'order' || + (jConfig.hidden ? + jConfig.hidden.includes(jOriginalKeyName ?jOriginalKeyName: jKeyName):false + ) + + ↓Field [steps.JsonFieldStep-1666370538855]: + key: + - xmlizable: + - ↑classname: com.twinsoft.convertigo.beans.steps.SmartType + - SmartType: + - ↑mode: PLAIN + - →→: hidden + output: false + type: bool + value: + - xmlizable: + - ↑classname: com.twinsoft.convertigo.beans.steps.SmartType + - SmartType: + - ↑mode: PLAIN + - →→: true + ↓jIf1 [steps.IfStep-1680617618286]: + condition: model == "true" && "structure" in this + ↓ComputeCompletionAndHideForFilters [steps.SimpleStep-1680617788099]: + expression: | + 'let cName = jOriginalKeyName ? jOriginalKeyName : jKeyName; + let cTargetCompletion = []; + let cHideFromFiltering = true; + log.warn("cName " + cName); + log.warn("jConfig.columns " + JSON.stringify(jConfig.columns)); + if(jConfig.columns.indexOf(cName) != -1){ + let cTarget = structure.filter((x)=>{ + return x.name == cName + })[0]; + // if target is formula use it''s formula_type + let cType = cTarget != undefined ? cTarget.type : null; + if(cType == "formula"){ + cType = cTarget.formula_type; + } + cTargetCompletion = verbsByType[cType]; + cHideFromFiltering = false; + if(cTargetCompletion == undefined){ + cTargetCompletion = []; + cHideFromFiltering = true; + } + } + ' + ↓filterCompletion [steps.JsonToXmlStep-1680623987414]: + jsonObject: + - xmlizable: + - ↑classname: com.twinsoft.convertigo.beans.steps.SmartType + - SmartType: + - ↑mode: JS + - →→: cTargetCompletion + key: + - xmlizable: + - ↑classname: com.twinsoft.convertigo.beans.steps.SmartType + - SmartType: + - ↑mode: PLAIN + - →→: filterCompletion + output: false + ↓filterHide [steps.JsonToXmlStep-1680624024529]: + jsonObject: + - xmlizable: + - ↑classname: com.twinsoft.convertigo.beans.steps.SmartType + - SmartType: + - ↑mode: JS + - →→: cHideFromFiltering + key: + - xmlizable: + - ↑classname: com.twinsoft.convertigo.beans.steps.SmartType + - SmartType: + - ↑mode: PLAIN + - →→: filterHide + output: false + ↓FinishHtmlEntry [steps.SimpleStep-1665833852150]: + expression: jHtml += "
" + ↓jRow [steps.JsonSourceStep-1726918591667]: + sourceDefinition: + - xmlizable: + - ↑classname: com.twinsoft.convertigo.beans.common.XMLVector + - com.twinsoft.convertigo.beans.common.XMLVector: + - java.lang.String: + - ↑value: 1665406203249 + - java.lang.String: + - ↑value: . + variableName: jRow + ↓ReorderColumns [steps.SimpleStep-1726918802256]: + expression: | + 'jReorderedRow = {}; + jReorderedRow["id"] = jRow["id"]; + jReorderedRow["order"] = jRow["order"]; + + jConfig.columns.forEach((col) => { + if (jRow.hasOwnProperty(col)) { + jReorderedRow[col] = jRow[col]; + } + }); + ' + ↓Object1 [steps.JsonToXmlStep-1726918640824]: + jsonObject: + - xmlizable: + - ↑classname: com.twinsoft.convertigo.beans.steps.SmartType + - SmartType: + - ↑mode: JS + - →→: jReorderedRow + key: + - xmlizable: + - ↑classname: com.twinsoft.convertigo.beans.steps.SmartType + - SmartType: + - ↑mode: PLAIN + - →→: Object +↓forms_config [variables.RequestableVariable-1665402317348]: + comment: | + '{ + "en": { + "comment": "Choose a table in Baserow", + "displayName": "Configuration" + }, + "fr": { + "comment": "Choisissez une table dans Baserow", + "displayName":"Configuration" + }, + "es": { + "comment": "Elija una tabla en Baserow", + "displayName": "Configuración" + }, + "it": { + "comment": "Scegli una tabella in Baserow", + "displayName": "Configurazione" + } + }' + description: configure=lib_BaseRow/DisplayObjects/mobile/BrowseTables/table + required: true + value: +↓forms_tableFilter [variables.RequestableVariable-1665911494442]: + comment: | + '{ + "en": { + "comment": "Define a filter to apply to Baserow table", + "displayName": "Filter" + }, + "fr": { + "comment": "Définir un filtre à appliquer à la table Baserow", + "displayName": "Filtre" + }, + "es": { + "comment": "Definir un filtro para aplicar a la tabla de Baserow", + "displayName": "Filtro" + }, + "it": { + "comment": "Definire un filtro da applicare alla tabella di Baserow", + "displayName": "Filtro" + } + }' + description: filter +↓model [variables.RequestableVariable-1671813057661]: + comment: If true, just return one line of data so that No Code studio can compte the table model +↓TestWithFilters [core.TestCase]: + ↓forms_config [variables.TestCaseVariable-1666432854743]: + description: configure=lib_BaseRow/DisplayObjects/mobile/BrowseTables + required: true + value: | + '{ + "table_id": "384" + } + ' + ↓forms_tableFilter [variables.TestCaseVariable-1666432865700]: + description: + required: true + value: | + '{ + "mode": "AND", + "filters": [ + { + "field": "Nom", + "op": "contains", + "value": "Ada" + } + ] + } + ' +↓TestWithFilters1 [core.TestCase]: + ↓forms_config [variables.TestCaseVariable-1666806571769]: + description: configure=lib_BaseRow/DisplayObjects/mobile/BrowseTables + required: true + value: '{"table_id":"110211", "columns":["Last name", "First name", "Photo", "Department"]}' + ↓forms_tableFilter [variables.TestCaseVariable-1666806571772]: + description: + required: true + value: '{ "mode": "AND", "filters": [ { "field": "Last name", "op": "contains", "value":"" }, { "field": "Department", "op": "contains", "value":"" }]}' +↓TestWithFilters2 [core.TestCase]: + ↓forms_config [variables.TestCaseVariable-1669786915409]: + description: configure=lib_BaseRow/DisplayObjects/mobile/BrowseTables + required: true + value: | + '{ + "table_id": "118056" + } + ' + ↓forms_tableFilter [variables.TestCaseVariable-1669786915412]: + description: + required: true + value: | + '{"mode":"AND","filters":[{"field":"name","op":"equal","value":"Fulton Airport"}]} + + ' +↓TestWithFiltersAndModel [core.TestCase]: + ↓forms_config [variables.TestCaseVariable-1680617453967]: + description: configure=lib_BaseRow/DisplayObjects/mobile/BrowseTables + required: true + value: | + '{ + "table_id": "715" + } + ' + ↓model [variables.TestCaseVariable-1680617465191]: + value: true +↓TestWithInlcude [core.TestCase]: + ↓forms_config [variables.TestCaseVariable-1666430403998]: + description: configure=lib_BaseRow/DisplayObjects/mobile/BrowseTables + required: true + value: | + '{ + "table_id": "109863", + "columns": ["Name", "Picture", "Position", "SingleSelect", "Phone number", "Email"], + "hidden": ["Name", "Picture", "Position", "SingleSelect", "Phone number", "Email"] + } + ' +↓TestWithLinks [core.TestCase]: + ↓forms_config [variables.TestCaseVariable-1667890317848]: + description: configure=lib_BaseRow/DisplayObjects/mobile/BrowseTables + required: true + value: '{"table_id":"109861", "columns":["Last name", "First name", "Photo", "Department"]}' +↓TestWithModel [core.TestCase]: + ↓forms_config [variables.TestCaseVariable-1671813368531]: + description: configure=lib_BaseRow/DisplayObjects/mobile/BrowseTables + required: true + value: | + ' + {"table_id":416,"columns":["No de Code à barre","Notes","Actif","Transporteur","No Récépissé","No de colis","Date/Heure Saisie","Utilisateur","Dépot","Activité"],"hidden":["Notes","Actif","Utilisateur","Dépot","Activité"]}' + ↓forms_tableFilter [variables.TestCaseVariable-1671813384059]: + description: + ↓model [variables.TestCaseVariable-1671813384061]: + value: true +↓TestWithView [core.TestCase]: + ↓forms_config [variables.TestCaseVariable-1666431067846]: + description: configure=lib_BaseRow/DisplayObjects/mobile/BrowseTables + required: true + value: | + '{ + "table_id": "351", + "view_id": "1424" + } + ' \ No newline at end of file diff --git a/_c8oProject/sequences/formssource_GetFieldValues.yaml b/_c8oProject/sequences/formssource_GetFieldValues.yaml index cb67a2e..f8ba332 100644 --- a/_c8oProject/sequences/formssource_GetFieldValues.yaml +++ b/_c8oProject/sequences/formssource_GetFieldValues.yaml @@ -169,7 +169,7 @@ comment: | "displayName": "Configurazione" } }' - description: configure=lib_BaseRow/DisplayObjects/mobile/BrowseTables + description: configure=lib_BaseRow/DisplayObjects/mobile/BrowseTables/table required: true value: ↓TestBedType [core.TestCase]: diff --git a/_c8oProject/sequences/formssource_GetSelectData.yaml b/_c8oProject/sequences/formssource_GetSelectData.yaml index 4a0152a..85ceed3 100644 --- a/_c8oProject/sequences/formssource_GetSelectData.yaml +++ b/_c8oProject/sequences/formssource_GetSelectData.yaml @@ -303,15 +303,103 @@ comment: | variableName: structure ↓computeValue [steps.SimpleStep-1680712348539]: expression: | - 'if ("res" in this) { + 'var colors = { + "light-green" : "#e6fff1", + "light-blue" : "#ebf7ff", + "light-orange" : "#fff6e6", + "light-red" : "#ffe8e6", + "light-gray" : "#f5f5f5", + + "green" : "#bdffdc", + "blue" : "#b5dbf5", + "orange" : "#ffe9c2", + "red" : "#ffbfb8", + "gray" : "#d9dbde", + + "dark-green" : "#9bf2c4", + "dark-blue" : "#83c3eb", + "dark-orange" : "#ffe0ab", + "dark-red" : "#f7a499", + "dark-gray" : "#b4bac2" + } + var base_html = "
"; + var close_html = ''
''; + var get_base_array_html = (value, color)=>{ + return "
" + + value + + "
"; + } + var get_base_btn_html = (url, label, color)=>{ + return "
" + + "" + label + ""+ + "
"; + } + var get_base_array_image_html = (url)=>{ + return ""; + } + var get_base_array_link_html = (url, visibleName)=>{ + return "

" + visibleName + "

" + } + var computeAnyType = (element)=>{ + var value; + var innerHtml = ""; + if(Array.isArray(element)){ + value = []; + element.forEach((arrayItem)=>{ + var result = computeAnyType(arrayItem); + value.push(result.value); + innerHtml += result.innerHtml; + }); + innerHtml += close_html; + } + else if(typeof element == "object"){ + if(element.value != undefined && typeof element.value == "object"){ + var result = computeAnyType(element.value); + innerHtml = result.innerHtml; + value = result.value; + } + else if(element.value != undefined){ + innerHtml = get_base_array_html(element.value, element.color) + close_html; + value = element; + } + else if(element.name != undefined && element.is_image == undefined && element.url == undefined) { + innerHtml = get_base_array_html(element.name, element.color) + close_html; + value = element; + } + else if(element.url != undefined && element.label != undefined && element.is_image == undefined){ + innerHtml = get_base_btn_html(element.url, element.label, "light-blue") + close_html; + value = element; + } + else if(element.is_image != undefined){ + if(element.is_image == true){ + innerHtml = get_base_array_image_html(element.url) + close_html; + } + else{ + innerHtml = get_base_array_link_html(element.url, arrayItem.visible_name) + close_html; + } + value = element; + } + else{ + log.warn("toto"); + } + } + else{ + innerHtml = element + close_html; + value = element; + } + return {innerHtml: innerHtml, value: value}; + } + var base_html = "
"; + if ("res" in this) { if (!(Array.isArray(res))) { res = [res]; } if (jConfig.displayValue) { res = res.map((x) => { return { - displayValue: x[displayValue], - value: x[value] + displayValue: base_html + computeAnyType(x[displayValue]).innerHtml, + value: computeAnyType(x[value]).value, + type: "html" } }) } @@ -328,15 +416,7 @@ comment: | else { res = []; } - - // Now fiter is done on the backend using the search API, so no use for the next lines... - /* - if(forms_filter != undefined && forms_filter != ""){ - res = res.filter((z)=>{ - return z.displayValue.toLowerCase().indexOf(forms_filter.toLowerCase()) != -1; - }) - } - */' + ' ↓object [steps.JsonToXmlStep-1680712764673]: jsonObject: - xmlizable: diff --git a/_c8oProject/sequences/formssource_GetTableData.yaml b/_c8oProject/sequences/formssource_GetTableData.yaml index 58860f4..5e3fbf0 100644 --- a/_c8oProject/sequences/formssource_GetTableData.yaml +++ b/_c8oProject/sequences/formssource_GetTableData.yaml @@ -19,32 +19,32 @@ comment: | }, "types": ["grid", "chart", "map"] }' -↓Call_Sequence1 [steps.SequenceStep-1729157466231]: +↓Call_Sequence1 [steps.SequenceStep-1734686735705]: sourceSequence: lib_BaseRow.formscommon_CheckConfig - ↓forms_config [variables.StepVariable-1729157466233]: + ↓forms_config [variables.StepVariable-1734686735708]: description: configure=lib_BaseRow/DisplayObjects/mobile/BrowseTables required: true -↓IfError [steps.IfExistStep-1729157599546]: +↓IfError [steps.IfExistStep-1734686735711]: condition: IfError sourceDefinition: - xmlizable: - ↑classname: com.twinsoft.convertigo.beans.common.XMLVector - com.twinsoft.convertigo.beans.common.XMLVector: - java.lang.String: - - ↑value: 1729157466231 + - ↑value: 1734686735705 - java.lang.String: - ↑value: ./document/error - ↓Copy [steps.XMLCopyStep-1729157599549]: + ↓Copy [steps.XMLCopyStep-1734686735714]: sourceDefinition: - xmlizable: - ↑classname: com.twinsoft.convertigo.beans.common.XMLVector - com.twinsoft.convertigo.beans.common.XMLVector: - java.lang.String: - - ↑value: 1729157466231 + - ↑value: 1734686735705 - java.lang.String: - ↑value: ./document/error - ↓Return [steps.ReturnStep-1729157599552]: -↓ParseConfig [steps.SimpleStep-1666429506760]: + ↓Return [steps.ReturnStep-1734686735717]: +↓ParseConfig [steps.SimpleStep-1734686735720]: expression: | 'jConfig = JSON.parse(forms_config); table_id = jConfig.table_id; @@ -233,46 +233,46 @@ comment: | describeStructure = true; } ' -↓Input_variables [steps.InputVariablesStep-1665402570169]: -↓Call_Sequence [steps.SequenceStep-1665402300413]: +↓Input_variables [steps.InputVariablesStep-1734686735723]: +↓Call_Sequence [steps.SequenceStep-1734686735726]: sourceSequence: lib_BaseRow.TableGetData - ↓exclude [variables.StepVariable-1665402300415]: + ↓exclude [variables.StepVariable-1734686735729]: comment: 'All the fields are included in the response by default. You can select a subset of fields by providing the exclude query parameter. If you for example provide the following GET parameter `exclude=field_1,field_2` then the fields with id `1` and id `2` are going to be excluded from the selection and response. If the `user_field_names` parameter is provided then instead exclude should be a comma separated list of the actual field names. For field names with commas you should surround the name with quotes like so: `exclude=My Field,"Field With , "`. A backslash can be used to escape field names which contain double quotes like so: `exclude=My Field,Field with \"`.' description: exclude - ↓include_fields [variables.StepVariable-1665402300421]: + ↓include_fields [variables.StepVariable-1734686735732]: comment: 'All the fields are included in the response by default. You can select a subset of fields by providing the include query parameter. If you for example provide the following GET parameter `include=field_1,field_2` then only the fields withid `1` and id `2` are going to be selected and included in the response. If the `user_field_names` parameter is provided then instead include should be a comma separated list of the actual field names. For field names with commas you should surround the name with quotes like so: `include=My Field,"Field With , "`. A backslash can be used to escape field names which contain double quotes like so: `include=My Field,Field with \"`.' description: include - ↓order_by [variables.StepVariable-1665402300423]: + ↓order_by [variables.StepVariable-1734686735735]: comment: 'Optionally the rows can be ordered by provided field ids separated by comma. By default a field is ordered in ascending (A-Z) order, but by prepending the field with a ''-'' it can be ordered descending (Z-A). If the `user_field_names` parameter is provided then instead order_by should be a comma separated list of the actual field names. For field names with commas you should surround the name with quotes like so: `order_by=My Field,"Field With , "`. A backslash can be used to escape field names which contain double quotes like so: `order_by=My Field,Field with \"`.' description: order_by - ↓page [variables.StepVariable-1665402300425]: + ↓page [variables.StepVariable-1734686735738]: comment: Defines which page of rows should be returned. description: page - ↓search [variables.StepVariable-1665402300427]: + ↓search [variables.StepVariable-1734686735741]: comment: If provided only rows with data that matches the search query are going to be returned. description: search - ↓size [variables.StepVariable-1665402300429]: + ↓size [variables.StepVariable-1734686735744]: comment: Defines how many rows should be returned per page. description: size - ↓table_id [variables.StepVariable-1665402300431]: + ↓table_id [variables.StepVariable-1734686735747]: comment: Returns the rows of the table related to the provided value. description: table_id required: true - ↓view_id [variables.StepVariable-1665402300433]: + ↓view_id [variables.StepVariable-1734686735750]: comment: Includes all the filters and sorts of the provided view. description: view_id - ↓filterExpression [variables.StepVariable-1665915671261]: - ↓describeStructure [variables.StepVariable-1680617375032]: -↓IfExist [steps.IfExistStep-1665402674584]: + ↓filterExpression [variables.StepVariable-1734686735753]: + ↓describeStructure [variables.StepVariable-1734686735756]: +↓IfExist [steps.IfExistStep-1734686735759]: sourceDefinition: - xmlizable: - ↑classname: com.twinsoft.convertigo.beans.common.XMLVector - com.twinsoft.convertigo.beans.common.XMLVector: - java.lang.String: - - ↑value: 1665402300413 + - ↑value: 1734686735726 - java.lang.String: - ↑value: ./document/error - ↓Error_structure [steps.XMLErrorStep-1665402703369]: + ↓Error_structure [steps.XMLErrorStep-1734686735762]: message: - xmlizable: - ↑classname: com.twinsoft.convertigo.beans.steps.SmartType @@ -280,468 +280,188 @@ comment: | - ↑mode: SOURCE - com.twinsoft.convertigo.beans.common.XMLVector: - java.lang.String: - - ↑value: 1665402300413 + - ↑value: 1734686735726 - java.lang.String: - ↑value: ./document/error/message/text() - ↓Return [steps.ReturnStep-1665402714329]: -↓myVariable [steps.JsonSourceStep-1680617809832]: + ↓Return [steps.ReturnStep-1734686735765]: +↓myVariable [steps.JsonSourceStep-1734686735768]: sourceDefinition: - xmlizable: - ↑classname: com.twinsoft.convertigo.beans.common.XMLVector - com.twinsoft.convertigo.beans.common.XMLVector: - java.lang.String: - - ↑value: 1665402300413 + - ↑value: 1734686735726 - java.lang.String: - ↑value: ./document/structure/object variableName: structure -↓Array [steps.JsonArrayStep-1665402723840]: +↓myVariable1 [steps.JsonSourceStep-1734686735771]: + sourceDefinition: + - xmlizable: + - ↑classname: com.twinsoft.convertigo.beans.common.XMLVector + - com.twinsoft.convertigo.beans.common.XMLVector: + - java.lang.String: + - ↑value: 1734686735726 + - java.lang.String: + - ↑value: ./document/results + variableName: results +↓ComputeData [steps.SimpleStep-1734686735777]: + expression: | + 'var colors = { + "light-green" : "#e6fff1", + "light-blue" : "#ebf7ff", + "light-orange" : "#fff6e6", + "light-red" : "#ffe8e6", + "light-gray" : "#f5f5f5", + + "green" : "#bdffdc", + "blue" : "#b5dbf5", + "orange" : "#ffe9c2", + "red" : "#ffbfb8", + "gray" : "#d9dbde", + + "dark-green" : "#9bf2c4", + "dark-blue" : "#83c3eb", + "dark-orange" : "#ffe0ab", + "dark-red" : "#f7a499", + "dark-gray" : "#b4bac2" + } + var base_html = "
"; + var close_html = ''
''; + var get_base_array_html = (value, color)=>{ + return "
" + + value + + "
"; + } + var get_base_btn_html = (url, label, color)=>{ + return "
" + + "" + label + ""+ + "
"; + } + var get_base_array_image_html = (url)=>{ + return ""; + } + var get_base_array_link_html = (url, visibleName)=>{ + return "

" + visibleName + "

" + } + var computeAnyType = (element)=>{ + var value; + var innerHtml = ""; + if(Array.isArray(element)){ + value = []; + element.forEach((arrayItem)=>{ + var result = computeAnyType(arrayItem); + value.push(result.value); + innerHtml += result.innerHtml; + }); + html += close_html; + } + else if(typeof element == "object"){ + if(element.value != undefined && typeof element.value == "object"){ + var result = computeAnyType(element.value); + innerHtml = result.innerHtml; + value = result.value; + } + else if(element.value != undefined){ + innerHtml = get_base_array_html(element.value, element.color) + close_html; + value = element; + } + else if(element.name != undefined && element.is_image == undefined && element.url == undefined) { + innerHtml = get_base_array_html(element.name, element.color) + close_html; + value = element; + } + else if(element.url != undefined && element.label != undefined && element.is_image == undefined){ + innerHtml = get_base_btn_html(element.url, element.label, "light-blue") + close_html; + value = element; + } + else if(element.is_image != undefined){ + if(element.is_image == true){ + innerHtml = get_base_array_image_html(element.url) + close_html; + } + else{ + innerHtml = get_base_array_link_html(element.url, arrayItem.visible_name) + close_html; + } + value = element; + } + else{ + log.warn("toto"); + } + } + else{ + innerHtml = element + close_html; + value = element; + } + return {innerHtml: innerHtml, value: value}; + } + + var data = []; + for(var elem of results){ + var obj = {}; + var cpt = 0; + for(var key in elem){ + var html = "" + base_html; + var current = elem[key]; + if(current != null){ + obj[key] = {"displayName": key, "type": "html", value:""}; + var result = computeAnyType(current); + html += result.innerHtml; + obj[key].value = result.value; + if(key == "id" || key == "order" || (jConfig.hidden ? jConfig.hidden.includes(key) : false)){ + obj[key].hidden = true; + } + obj[key].displayValue = html; + } + else{ + obj[key] = {"displayName": key, "type": "html", value:null}; + } + if(model == "true" && "structure" in this){ + let cTargetCompletion = []; + let cHideFromFiltering = true; + if(jConfig.columns.indexOf(key) != -1){ + let cTarget = structure.filter((x)=>{ + return x.name == key + })[0]; + // if target is formula use it''s formula_type + let cType = cTarget != undefined ? cTarget.type : null; + if(cType == "formula"){ + cType = cTarget.formula_type; + } + cTargetCompletion = verbsByType[cType]; + cHideFromFiltering = false; + if(cTargetCompletion == undefined){ + cTargetCompletion = []; + cHideFromFiltering = true; + } + } + obj["filterCompletion"] = cTargetCompletion; + obj["filterHide"] = cHideFromFiltering; + + } + } + jReorderedRow = {}; + jReorderedRow["id"] = obj["id"]; + jReorderedRow["order"] = obj["order"]; + jConfig.columns.forEach((col) => { + if (obj.hasOwnProperty(col)) { + jReorderedRow[col] = obj[col]; + } + }); + data.push(jReorderedRow); + } + ' +↓object [steps.JsonToXmlStep-1734686735780]: + jsonObject: + - xmlizable: + - ↑classname: com.twinsoft.convertigo.beans.steps.SmartType + - SmartType: + - ↑mode: JS + - →→: data key: - xmlizable: - ↑classname: com.twinsoft.convertigo.beans.steps.SmartType - SmartType: - ↑mode: PLAIN - →→: data - ↓Iterator [steps.IteratorStep-1665402736681]: - sourceDefinition: - - xmlizable: - - ↑classname: com.twinsoft.convertigo.beans.common.XMLVector - - com.twinsoft.convertigo.beans.common.XMLVector: - - java.lang.String: - - ↑value: 1665402300413 - - java.lang.String: - - ↑value: ./document/results/object - ↓Object [steps.JsonObjectStep-1665406203249]: - comment: The data object - key: - - xmlizable: - - ↑classname: com.twinsoft.convertigo.beans.steps.SmartType - - SmartType: - - ↑mode: PLAIN - - →→: Object - output: false - ↓Iterator [steps.IteratorStep-1665403182897]: - comment: Ignore id as this is a technical id not to be displayed - sourceDefinition: - - xmlizable: - - ↑classname: com.twinsoft.convertigo.beans.common.XMLVector - - com.twinsoft.convertigo.beans.common.XMLVector: - - java.lang.String: - - ↑value: 1665402736681 - - java.lang.String: - - ↑value: ./* - ↓InitHtmEntry [steps.SimpleStep-1665407550205]: - comment: Start a DIV HTML with styling - expression: | - 'jHtml = ` -
- - ` - - colors = { - "light-green" : "#e6fff1", - "light-blue" : "#ebf7ff", - "light-orange" : "#fff6e6", - "light-red" : "#ffe8e6", - "light-gray" : "#f5f5f5", - - "green" : "#bdffdc", - "blue" : "#b5dbf5", - "orange" : "#ffe9c2", - "red" : "#ffbfb8", - "gray" : "#d9dbde", - - "dark-green" : "#9bf2c4", - "dark-blue" : "#83c3eb", - "dark-orange" : "#ffe0ab", - "dark-red" : "#f7a499", - "dark-gray" : "#b4bac2" - } - - ' - ↓jSimpleSource [steps.SimpleSourceStep-1665875996794]: - sourceDefinition: - - xmlizable: - - ↑classname: com.twinsoft.convertigo.beans.common.XMLVector - - com.twinsoft.convertigo.beans.common.XMLVector: - - java.lang.String: - - ↑value: 1665403182897 - - java.lang.String: - - ↑value: ./@originalKeyName - variableName: jOriginalKeyName - ↓jSimpleSource1 [steps.SimpleSourceStep-1665876065904]: - sourceDefinition: - - xmlizable: - - ↑classname: com.twinsoft.convertigo.beans.common.XMLVector - - com.twinsoft.convertigo.beans.common.XMLVector: - - java.lang.String: - - ↑value: 1665403182897 - - java.lang.String: - - ↑value: name(.) - variableName: jKeyName - ↓Object [steps.JsonObjectStep-1665407248434]: - comment: Create entry - key: - - xmlizable: - - ↑classname: com.twinsoft.convertigo.beans.steps.SmartType - - SmartType: - - ↑mode: JS - - →→: 'jOriginalKeyName ? jOriginalKeyName : jKeyName' - output: false - ↓IfExistThenElse [steps.IfExistThenElseStep-1665406758754]: - comment: Handle multivalued - sourceDefinition: - - xmlizable: - - ↑classname: com.twinsoft.convertigo.beans.common.XMLVector - - com.twinsoft.convertigo.beans.common.XMLVector: - - java.lang.String: - - ↑value: 1665403182897 - - java.lang.String: - - ↑value: .[@type = 'array'] - ↓jThen [steps.ThenStep-1665406759518]: - ↓InitValueArray [steps.SimpleStep-1667889960531]: - expression: | - jValues = []; - - ↓Iterator [steps.IteratorStep-1665407450731]: - sourceDefinition: - - xmlizable: - - ↑classname: com.twinsoft.convertigo.beans.common.XMLVector - - com.twinsoft.convertigo.beans.common.XMLVector: - - java.lang.String: - - ↑value: 1665403182897 - - java.lang.String: - - ↑value: ./object - ↓IfExistThenElse [steps.IfExistThenElseStep-1665684721073]: - sourceDefinition: - - xmlizable: - - ↑classname: com.twinsoft.convertigo.beans.common.XMLVector - - com.twinsoft.convertigo.beans.common.XMLVector: - - java.lang.String: - - ↑value: 1665407450731 - - java.lang.String: - - ↑value: ./value - ↓jThen [steps.ThenStep-1665684723422]: - ↓JsonSource [steps.JsonSourceStep-1668099201803]: - sourceDefinition: - - xmlizable: - - ↑classname: com.twinsoft.convertigo.beans.common.XMLVector - - com.twinsoft.convertigo.beans.common.XMLVector: - - java.lang.String: - - ↑value: 1665407450731 - - java.lang.String: - - ↑value: . - variableName: jMyEntry - ↓AddEntry [steps.SimpleStep-1665407618555]: - expression: | - 'log.debug("______" + JSON.stringify(jMyEntry)) - - if (jMyEntry["value"] != undefined) { - jHtml += - "
" + - jMyEntry["value"] + - "
" - } else { - jHtml += "

" + jMyEntry + "

" - } - jValues.push(jMyEntry); - ' - ↓jElse [steps.ElseStep-1665684723424]: - ↓jSimpleSource [steps.SimpleSourceStep-1665685771320]: - sourceDefinition: - - xmlizable: - - ↑classname: com.twinsoft.convertigo.beans.common.XMLVector - - com.twinsoft.convertigo.beans.common.XMLVector: - - java.lang.String: - - ↑value: 1665407450731 - - java.lang.String: - - ↑value: ./url/text() - variableName: jURL - ↓isImage [steps.SimpleSourceStep-1665684886493]: - sourceDefinition: - - xmlizable: - - ↑classname: com.twinsoft.convertigo.beans.common.XMLVector - - com.twinsoft.convertigo.beans.common.XMLVector: - - java.lang.String: - - ↑value: 1665407450731 - - java.lang.String: - - ↑value: ./is_image/text() - variableName: bIsImage - ↓jIfThenElse [steps.IfThenElseStep-1665685010861]: - condition: bIsImage == 'true' - ↓jThen [steps.ThenStep-1665685010863]: - ↓AddImageEnttry [steps.SimpleStep-1665685016539]: - expression: | - jHtml += "" - jValues.push(jURL); - - ↓jElse [steps.ElseStep-1665685010865]: - ↓jSimpleSource [steps.SimpleSourceStep-1665685737366]: - sourceDefinition: - - xmlizable: - - ↑classname: com.twinsoft.convertigo.beans.common.XMLVector - - com.twinsoft.convertigo.beans.common.XMLVector: - - java.lang.String: - - ↑value: 1665407450731 - - java.lang.String: - - ↑value: ./visible_name/text() - variableName: jVisibleName - ↓AddFileEntry [steps.SimpleStep-1665685031623]: - expression: | - jHtml += "

" + jVisibleName + "

" - jValues.push(jURL); - - ↓JSON_to_XML [steps.JsonToXmlStep-1667927327885]: - jsonObject: - - xmlizable: - - ↑classname: com.twinsoft.convertigo.beans.steps.SmartType - - SmartType: - - ↑mode: JS - - →→: jValues - key: - - xmlizable: - - ↑classname: com.twinsoft.convertigo.beans.steps.SmartType - - SmartType: - - ↑mode: PLAIN - - →→: value - output: false - ↓jElse [steps.ElseStep-1665406759520]: - ↓JsonSource [steps.JsonSourceStep-1667989605906]: - sourceDefinition: - - xmlizable: - - ↑classname: com.twinsoft.convertigo.beans.common.XMLVector - - com.twinsoft.convertigo.beans.common.XMLVector: - - java.lang.String: - - ↑value: 1665403182897 - - java.lang.String: - - ↑value: . - variableName: jData - ↓AddData [steps.SimpleStep-1665857204666]: - expression: | - 'function computeHtml() { - if (jData["value"] != undefined) { - log.debug("************** JData has a Value Key"); - if (jData["color"] != undefined) { - jHtml += - "
" + - jData["value"] + - "
" - } - return - } - - log.debug("************** jData is simple string "); - jHtml += jData; - } - - log.debug("**************" + JSON.stringify(jData)); - if (jData != null) computeHtml(); - ' - ↓JSON_to_XML [steps.JsonToXmlStep-1667927358648]: - jsonObject: - - xmlizable: - - ↑classname: com.twinsoft.convertigo.beans.steps.SmartType - - SmartType: - - ↑mode: JS - - →→: jData - key: - - xmlizable: - - ↑classname: com.twinsoft.convertigo.beans.steps.SmartType - - SmartType: - - ↑mode: PLAIN - - →→: value - output: false - ↓Field [steps.JsonFieldStep-1665407340859]: - key: - - xmlizable: - - ↑classname: com.twinsoft.convertigo.beans.steps.SmartType - - SmartType: - - ↑mode: PLAIN - - →→: type - output: false - value: - - xmlizable: - - ↑classname: com.twinsoft.convertigo.beans.steps.SmartType - - SmartType: - - ↑mode: PLAIN - - →→: html - ↓Field1 [steps.JsonFieldStep-1665407353362]: - key: - - xmlizable: - - ↑classname: com.twinsoft.convertigo.beans.steps.SmartType - - SmartType: - - ↑mode: PLAIN - - →→: displayValue - output: false - value: - - xmlizable: - - ↑classname: com.twinsoft.convertigo.beans.steps.SmartType - - SmartType: - - ↑mode: JS - - →→: jHtml - ↓Field2 [steps.JsonFieldStep-1665689221993]: - key: - - xmlizable: - - ↑classname: com.twinsoft.convertigo.beans.steps.SmartType - - SmartType: - - ↑mode: PLAIN - - →→: displayName - output: false - value: - - xmlizable: - - ↑classname: com.twinsoft.convertigo.beans.steps.SmartType - - SmartType: - - ↑mode: JS - - →→: 'jOriginalKeyName ? jOriginalKeyName : jKeyName' - ↓Log [steps.LogStep-1666371057521]: - expression: | - '"***" + jKeyName + " : " + (jKeyName == ''id'' || jKeyName == ''order'') + "**" + jOriginalKeyName - - ' - isEnabled: false - level: WARN - ↓jIf [steps.IfStep-1666370491964]: - condition: | - jKeyName == 'id'|| - jKeyName == 'order' || - (jConfig.hidden ? - jConfig.hidden.includes(jOriginalKeyName ?jOriginalKeyName: jKeyName):false - ) - - ↓Field [steps.JsonFieldStep-1666370538855]: - key: - - xmlizable: - - ↑classname: com.twinsoft.convertigo.beans.steps.SmartType - - SmartType: - - ↑mode: PLAIN - - →→: hidden - output: false - type: bool - value: - - xmlizable: - - ↑classname: com.twinsoft.convertigo.beans.steps.SmartType - - SmartType: - - ↑mode: PLAIN - - →→: true - ↓jIf1 [steps.IfStep-1680617618286]: - condition: model == "true" && "structure" in this - ↓ComputeCompletionAndHideForFilters [steps.SimpleStep-1680617788099]: - expression: | - 'let cName = jOriginalKeyName ? jOriginalKeyName : jKeyName; - let cTargetCompletion = []; - let cHideFromFiltering = true; - log.warn("cName " + cName); - log.warn("jConfig.columns " + JSON.stringify(jConfig.columns)); - if(jConfig.columns.indexOf(cName) != -1){ - let cTarget = structure.filter((x)=>{ - return x.name == cName - })[0]; - // if target is formula use it''s formula_type - let cType = cTarget != undefined ? cTarget.type : null; - if(cType == "formula"){ - cType = cTarget.formula_type; - } - cTargetCompletion = verbsByType[cType]; - cHideFromFiltering = false; - if(cTargetCompletion == undefined){ - cTargetCompletion = []; - cHideFromFiltering = true; - } - } - ' - ↓filterCompletion [steps.JsonToXmlStep-1680623987414]: - jsonObject: - - xmlizable: - - ↑classname: com.twinsoft.convertigo.beans.steps.SmartType - - SmartType: - - ↑mode: JS - - →→: cTargetCompletion - key: - - xmlizable: - - ↑classname: com.twinsoft.convertigo.beans.steps.SmartType - - SmartType: - - ↑mode: PLAIN - - →→: filterCompletion - output: false - ↓filterHide [steps.JsonToXmlStep-1680624024529]: - jsonObject: - - xmlizable: - - ↑classname: com.twinsoft.convertigo.beans.steps.SmartType - - SmartType: - - ↑mode: JS - - →→: cHideFromFiltering - key: - - xmlizable: - - ↑classname: com.twinsoft.convertigo.beans.steps.SmartType - - SmartType: - - ↑mode: PLAIN - - →→: filterHide - output: false - ↓FinishHtmlEntry [steps.SimpleStep-1665833852150]: - expression: jHtml += "
" - ↓jRow [steps.JsonSourceStep-1726918591667]: - sourceDefinition: - - xmlizable: - - ↑classname: com.twinsoft.convertigo.beans.common.XMLVector - - com.twinsoft.convertigo.beans.common.XMLVector: - - java.lang.String: - - ↑value: 1665406203249 - - java.lang.String: - - ↑value: . - variableName: jRow - ↓ReorderColumns [steps.SimpleStep-1726918802256]: - expression: | - 'jReorderedRow = {}; - jReorderedRow["id"] = jRow["id"]; - jReorderedRow["order"] = jRow["order"]; - - jConfig.columns.forEach((col) => { - if (jRow.hasOwnProperty(col)) { - jReorderedRow[col] = jRow[col]; - } - }); - ' - ↓Object1 [steps.JsonToXmlStep-1726918640824]: - jsonObject: - - xmlizable: - - ↑classname: com.twinsoft.convertigo.beans.steps.SmartType - - SmartType: - - ↑mode: JS - - →→: jReorderedRow - key: - - xmlizable: - - ↑classname: com.twinsoft.convertigo.beans.steps.SmartType - - SmartType: - - ↑mode: PLAIN - - →→: Object -↓forms_config [variables.RequestableVariable-1665402317348]: +↓forms_config [variables.RequestableVariable-1734686735912]: comment: | '{ "en": { @@ -764,7 +484,7 @@ comment: | description: configure=lib_BaseRow/DisplayObjects/mobile/BrowseTables/table required: true value: -↓forms_tableFilter [variables.RequestableVariable-1665911494442]: +↓forms_tableFilter [variables.RequestableVariable-1734686735915]: comment: | '{ "en": { @@ -785,10 +505,10 @@ comment: | } }' description: filter -↓model [variables.RequestableVariable-1671813057661]: +↓model [variables.RequestableVariable-1734686735918]: comment: If true, just return one line of data so that No Code studio can compte the table model ↓TestWithFilters [core.TestCase]: - ↓forms_config [variables.TestCaseVariable-1666432854743]: + ↓forms_config [variables.TestCaseVariable-1734686735922]: description: configure=lib_BaseRow/DisplayObjects/mobile/BrowseTables required: true value: | @@ -796,7 +516,7 @@ comment: | "table_id": "384" } ' - ↓forms_tableFilter [variables.TestCaseVariable-1666432865700]: + ↓forms_tableFilter [variables.TestCaseVariable-1734686735925]: description: required: true value: | @@ -812,16 +532,16 @@ comment: | } ' ↓TestWithFilters1 [core.TestCase]: - ↓forms_config [variables.TestCaseVariable-1666806571769]: + ↓forms_config [variables.TestCaseVariable-1734686735929]: description: configure=lib_BaseRow/DisplayObjects/mobile/BrowseTables required: true value: '{"table_id":"110211", "columns":["Last name", "First name", "Photo", "Department"]}' - ↓forms_tableFilter [variables.TestCaseVariable-1666806571772]: + ↓forms_tableFilter [variables.TestCaseVariable-1734686735932]: description: required: true value: '{ "mode": "AND", "filters": [ { "field": "Last name", "op": "contains", "value":"" }, { "field": "Department", "op": "contains", "value":"" }]}' ↓TestWithFilters2 [core.TestCase]: - ↓forms_config [variables.TestCaseVariable-1669786915409]: + ↓forms_config [variables.TestCaseVariable-1734686735936]: description: configure=lib_BaseRow/DisplayObjects/mobile/BrowseTables required: true value: | @@ -829,7 +549,7 @@ comment: | "table_id": "118056" } ' - ↓forms_tableFilter [variables.TestCaseVariable-1669786915412]: + ↓forms_tableFilter [variables.TestCaseVariable-1734686735939]: description: required: true value: | @@ -837,7 +557,7 @@ comment: | ' ↓TestWithFiltersAndModel [core.TestCase]: - ↓forms_config [variables.TestCaseVariable-1680617453967]: + ↓forms_config [variables.TestCaseVariable-1734686735943]: description: configure=lib_BaseRow/DisplayObjects/mobile/BrowseTables required: true value: | @@ -845,10 +565,10 @@ comment: | "table_id": "715" } ' - ↓model [variables.TestCaseVariable-1680617465191]: + ↓model [variables.TestCaseVariable-1734686735946]: value: true ↓TestWithInlcude [core.TestCase]: - ↓forms_config [variables.TestCaseVariable-1666430403998]: + ↓forms_config [variables.TestCaseVariable-1734686735950]: description: configure=lib_BaseRow/DisplayObjects/mobile/BrowseTables required: true value: | @@ -859,23 +579,23 @@ comment: | } ' ↓TestWithLinks [core.TestCase]: - ↓forms_config [variables.TestCaseVariable-1667890317848]: + ↓forms_config [variables.TestCaseVariable-1734686735954]: description: configure=lib_BaseRow/DisplayObjects/mobile/BrowseTables required: true value: '{"table_id":"109861", "columns":["Last name", "First name", "Photo", "Department"]}' ↓TestWithModel [core.TestCase]: - ↓forms_config [variables.TestCaseVariable-1671813368531]: + ↓forms_config [variables.TestCaseVariable-1734686735958]: description: configure=lib_BaseRow/DisplayObjects/mobile/BrowseTables required: true value: | ' {"table_id":416,"columns":["No de Code à barre","Notes","Actif","Transporteur","No Récépissé","No de colis","Date/Heure Saisie","Utilisateur","Dépot","Activité"],"hidden":["Notes","Actif","Utilisateur","Dépot","Activité"]}' - ↓forms_tableFilter [variables.TestCaseVariable-1671813384059]: + ↓forms_tableFilter [variables.TestCaseVariable-1734686735961]: description: - ↓model [variables.TestCaseVariable-1671813384061]: + ↓model [variables.TestCaseVariable-1734686735964]: value: true ↓TestWithView [core.TestCase]: - ↓forms_config [variables.TestCaseVariable-1666431067846]: + ↓forms_config [variables.TestCaseVariable-1734686735968]: description: configure=lib_BaseRow/DisplayObjects/mobile/BrowseTables required: true value: | diff --git a/c8oProject.yaml b/c8oProject.yaml index 46f3ac7..4b756e5 100644 --- a/c8oProject.yaml +++ b/c8oProject.yaml @@ -14,9 +14,11 @@ contextTimeout: ${lib_baserow.context_timout=3600} corsOrigin: =Origin httpSessionTimeout: ${lib_baserow.session_timout=3600} - version: 1.1.4 + version: 1.1.5 ↓Baserow_API_spec [connectors.HttpConnector]: 🗏 connectors/Baserow_API_spec.yaml ↓MediaConnector [connectors.HttpConnector]: 🗏 connectors/MediaConnector.yaml + ↓_disabled_formssource_GetSelectDataOld [sequences.GenericSequence]: 🗏 sequences/_disabled_formssource_GetSelectDataOld.yaml + ↓_disabled_formssource_GetTableDataOld [sequences.GenericSequence]: 🗏 sequences/_disabled_formssource_GetTableDataOld.yaml ↓AdminLogin [sequences.GenericSequence]: 🗏 sequences/AdminLogin.yaml ↓AdminUserCreate [sequences.GenericSequence]: 🗏 sequences/AdminUserCreate.yaml ↓AdminUserDelete [sequences.GenericSequence]: 🗏 sequences/AdminUserDelete.yaml diff --git a/project.md b/project.md index 1f609ab..65509b6 100644 --- a/project.md +++ b/project.md @@ -12,7 +12,7 @@ This is the Baserow No Code connector for Convertigo. Use this connector to exch ## ![](https://github.com/convertigo/convertigo/blob/develop/engine/src/com/twinsoft/convertigo/beans/references/images/ProjectSchemaReference_16x16.png?raw=true "ProjectSchemaReference") C8Oforms -see [readme](https://github.com/convertigo/C8oForms/tree/NGX#readme) +see [readme](https://github.com/convertigo/C8oForms/tree/hotfix/2.0.4#readme)

CouchDb_schema

@@ -14457,6 +14457,107 @@ comment

Sequences

+

_disabled_formssource_GetSelectDataOld : Get data from a Baserow table

+ + +## ![](https://github.com/convertigo/convertigo/blob/develop/engine/src/com/twinsoft/convertigo/beans/sequences/images/genericsequence_color_16x16.png?raw=true "GenericSequence") _disabled_formssource_GetSelectDataOld + +Get data from a Baserow table. You will be able to choose the Baserow columns for the names to be displayed in the select dropdown list and the column for the values of each name. + +Variables + + + + + + + + + + + + + + + + + + + + + + +
+name + +comment +
+RequestableVariable forms_config + +Choose a table in Baserow +
+RequestableVariable forms_filter + +Filters + +
+RequestableVariable forms_Filter + +Define a filter to apply to Baserow table +
+RequestableVariable model + +If true, just return one line of data so that No Code studio can compte the table model +
+ +

+ +
_disabled_formssource_GetTableDataOld : Get data from a Baserow table for a data grid

+ + +## ![](https://github.com/convertigo/convertigo/blob/develop/engine/src/com/twinsoft/convertigo/beans/sequences/images/genericsequence_color_16x16.png?raw=true "GenericSequence") _disabled_formssource_GetTableDataOld + +Get data from a Baserow table for a data grid. Each column of the Baserow table will be displayed as the same column in the data grid + +Variables + + + + + + + + + + + + + + + + + + +
+name + +comment +
+RequestableVariable forms_config + +Choose a table in Baserow +
+RequestableVariable forms_tableFilter + +Define a filter to apply to Baserow table +
+RequestableVariable model + +If true, just return one line of data so that No Code studio can compte the table model +
+ +

+
AdminLogin : Establishes a session with Baserow