Skip to content

Fix mustache replacement in SelectLists #1105

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

Merged
merged 4 commits into from
Nov 9, 2021
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
6 changes: 3 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
"@cypress/code-coverage": "^3.8.1",
"@fortawesome/fontawesome-free": "^5.6.1",
"@panter/vue-i18next": "^0.15.2",
"@processmaker/vue-form-elements": "0.25.5",
"@processmaker/vue-form-elements": "0.26.0",
"@processmaker/vue-multiselect": "^2.2.0",
"@vue/cli-plugin-babel": "^3.6.0",
"@vue/cli-plugin-e2e-cypress": "^4.0.3",
Expand Down Expand Up @@ -85,7 +85,7 @@
},
"peerDependencies": {
"@panter/vue-i18next": "^0.15.0",
"@processmaker/vue-form-elements": "0.25.5",
"@processmaker/vue-form-elements": "0.26.0",
"i18next": "^15.0.8",
"vue": "^2.6.12",
"vuex": "^3.1.1"
Expand Down
4 changes: 2 additions & 2 deletions src/components/inspector/options-list.vue
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@
<small class="form-text text-muted mb-3">{{ $t("Select 'Single Value' to use parts of the selected object. Select 'Object' to use the entire selected value.") }}</small>

<div v-if="dataSource === dataSourceValues.dataConnector">
<div v-if="valueTypeReturned === 'single'">
<div>
<label for="key">{{ $t('Value') }}</label>
<mustache-helper/>
<b-form-input id="key" v-model="key" @change="keyChanged" data-cy="inspector-datasource-value"/>
Expand All @@ -196,7 +196,7 @@
<label for="value">{{ $t('Content') }}</label>
<mustache-helper/>
<b-form-input id="value" v-model="value" @change="valueChanged" data-cy="inspector-datasource-content"/>
<small class="form-text text-muted mb-3">{{ $t('Key name in the selected object to display to the user in the select list. Leave blank to show the entire selected value.') }}</small>
<small class="form-text text-muted mb-3">{{ $t('Content to display to the user in the select list.') }}</small>
</div>

<div v-if="valueTypeReturned === 'single' && dataSource === dataSourceValues.dataObject">
Expand Down
244 changes: 244 additions & 0 deletions tests/e2e/fixtures/select_list_array_data.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,244 @@
{
"type": "screen_package",
"version": "2",
"screens": [
{
"id": 5,
"screen_category_id": "1",
"title": "select list array",
"description": "select list array",
"type": "FORM",
"config": [
{
"name": "select list array",
"items": [
{
"label": "Select List",
"config": {
"icon": "fas fa-angle-double-down",
"name": "form_select_list_1",
"label": "New Select List",
"helper": null,
"options": {
"key": "value",
"value": "content",
"dataName": "response",
"jsonData": "[{\"content\":\"one\",\"value\":\"1\"},{\"content\":\"two\",\"value\":\"2\"}]",
"renderAs": "dropdown",
"editIndex": null,
"pmqlQuery": null,
"dataSource": "provideData",
"optionsList": [
{ "value": "1", "content": "one" },
{ "value": "2", "content": "two" }
],
"removeIndex": null,
"showRenderAs": true,
"showJsonEditor": false,
"showOptionCard": false,
"selectedOptions": [],
"allowMultiSelect": false,
"showRemoveWarning": false,
"valueTypeReturned": "single"
},
"readonly": false,
"validation": [],
"placeholder": null,
"rootElement": "response",
"dataSourceUrl": null,
"dataSourceEndpoint": null
},
"component": "FormSelectList",
"inspector": [
{
"type": "FormInput",
"field": "name",
"config": {
"name": "Variable Name",
"label": "Variable Name",
"helper": "A variable name is a symbolic name to reference information.",
"validation": "regex:/^(?:[A-Za-z])(?:[0-9A-Z_a-z])*(?:\\.[0-9A-Z_a-z]+)*$/|required|not_in:null,break,case,catch,continue,debugger,default,delete,do,else,finally,for,function,if,in,instanceof,new,return,switch,this,throw,try,typeof,var,void,while,with,class,const,enum,export,extends,import,super"
}
},
{
"type": "FormInput",
"field": "label",
"config": {
"label": "Label",
"helper": "The label describes the field's name"
}
},
{
"type": "FormInput",
"field": "placeholder",
"config": {
"label": "Placeholder Text",
"helper": "The placeholder is what is shown in the field when no value is provided yet"
}
},
{
"type": "ValidationSelect",
"field": "validation",
"config": {
"label": "Validation Rules",
"helper": "The validation rules needed for this field"
}
},
{
"type": "FormInput",
"field": "helper",
"config": {
"label": "Helper Text",
"helper": "Help text is meant to provide additional guidance on the field's value"
}
},
{
"type": "OptionsList",
"field": "options",
"config": { "label": null, "helper": null }
},
{
"type": "ColorSelect",
"field": "color",
"config": {
"label": "Text Color",
"helper": "Set the element's text color",
"options": [
{ "value": "text-primary", "content": "primary" },
{ "value": "text-secondary", "content": "secondary" },
{ "value": "text-success", "content": "success" },
{ "value": "text-danger", "content": "danger" },
{ "value": "text-warning", "content": "warning" },
{ "value": "text-info", "content": "info" },
{ "value": "text-light", "content": "light" },
{ "value": "text-dark", "content": "dark" }
]
}
},
{
"type": "ColorSelect",
"field": "bgcolor",
"config": {
"label": "Background Color",
"helper": "Set the element's background color",
"options": [
{ "value": "alert alert-primary", "content": "primary" },
{
"value": "alert alert-secondary",
"content": "secondary"
},
{ "value": "alert alert-success", "content": "success" },
{ "value": "alert alert-danger", "content": "danger" },
{ "value": "alert alert-warning", "content": "warning" },
{ "value": "alert alert-info", "content": "info" },
{ "value": "alert alert-light", "content": "light" },
{ "value": "alert alert-dark", "content": "dark" }
]
}
},
{
"type": {
"props": ["value", "helper"],
"watch": { "value": { "immediate": true } },
"methods": [],
"_scopeId": "data-v-7c18055b",
"computed": { "effectiveValue": [] },
"_compiled": true,
"components": {
"MonacoEditor": {
"name": "monaco-editor",
"_Ctor": [],
"props": { "amdRequire": [] },
"extends": {
"name": "MonacoEditor",
"model": { "event": "change" },
"props": {
"theme": { "default": "vs" },
"value": { "required": true },
"options": [],
"language": [],
"original": [],
"amdRequire": [],
"diffEditor": { "default": false }
},
"watch": {
"options": { "deep": true, "user": true }
},
"methods": []
},
"methods": []
}
},
"staticRenderFns": []
},
"field": "defaultValue",
"config": {
"label": "Default Value",
"helper": "The default value is pre populated using the existing request data. This feature will allow you to modify the value displayed on screen load if needed."
}
},
{
"type": "FormCheckbox",
"field": "readonly",
"config": { "label": "Read Only", "helper": null }
},
{
"type": "FormInput",
"field": "conditionalHide",
"config": {
"label": "Visibility Rule",
"helper": "This control is hidden until this expression is true"
}
},
{
"type": "FormInput",
"field": "customFormatter",
"config": {
"label": "Custom Format String",
"helper": "Use the Mask Pattern format <br> Date ##/##/#### <br> SSN ###-##-#### <br> Phone (###) ###-####",
"validation": null
}
},
{
"type": "FormInput",
"field": "customCssSelector",
"config": {
"label": "CSS Selector Name",
"helper": "Use this in your custom css rules",
"validation": "regex: [-?[_a-zA-Z]+[_-a-zA-Z0-9]*]"
}
}
],
"editor-control": "FormSelectList",
"editor-component": "FormSelectList"
}
]
}
],
"computed": [],
"custom_css": null,
"created_at": "2021-11-08T13:20:07-08:00",
"updated_at": "2021-11-08T13:20:39-08:00",
"status": "ACTIVE",
"key": null,
"watchers": [],
"categories": [
{
"id": 1,
"name": "Uncategorized",
"status": "ACTIVE",
"is_system": 0,
"created_at": "2021-11-08T10:25:46-08:00",
"updated_at": "2021-11-08T10:25:46-08:00",
"pivot": {
"assignable_id": 5,
"category_id": 1,
"category_type": "ProcessMaker\\Models\\ScreenCategory"
}
}
]
}
],
"screen_categories": [],
"scripts": []
}
Loading