Commit 70fce878 authored by Chhengleap Soem's avatar Chhengleap Soem

Merge branch 'KIME-5209' into 'master'

[TASK] Allow required mapping property

See merge request !23
parents 6f0524ff 3c5dacf3
...@@ -40,6 +40,13 @@ final class Mapping { ...@@ -40,6 +40,13 @@ final class Mapping {
*/ */
public $identifier = FALSE; public $identifier = FALSE;
/**
* Flag if property is handled as required mapping
*
* @var boolean
*/
public $required = FALSE;
/** /**
* Overwrite the default getter for previews * Overwrite the default getter for previews
* *
......
...@@ -18,7 +18,14 @@ ...@@ -18,7 +18,14 @@
</f:else> </f:else>
</f:if> </f:if>
<f:if condition="{columnMapping.mapping.identifier}"> <f:if condition="{columnMapping.mapping.identifier}">
<span class="require"> * </span> <f:then>
<span class="require"> * </span>
</f:then>
<f:else>
<f:if condition="{columnMapping.mapping.required}">
<span class="require"> * </span>
</f:if>
</f:else>
</f:if> </f:if>
</label> </label>
<div> <div>
...@@ -26,10 +33,17 @@ ...@@ -26,10 +33,17 @@
<f:then> <f:then>
<f:if condition="{columnMapping.mapping.identifier}"> <f:if condition="{columnMapping.mapping.identifier}">
<f:then> <f:then>
<f:form.select name="{property}" options="{spreadsheetColumns}" prependOptionLabel="{f:translate(id: 'label.please_select')}" value="{columnMapping.column}" additionalAttributes="{required: 1}" /> <f:form.select class="form-control select-mapping-column" name="{property}" options="{spreadsheetColumns}" prependOptionLabel="{f:translate(id: 'label.please_choose')}" value="{columnMapping.column}" additionalAttributes="{required: 1}" />
</f:then> </f:then>
<f:else> <f:else>
<f:form.select name="{property}" options="{spreadsheetColumns}" prependOptionLabel="{f:translate(id: 'label.please_select')}" value="{columnMapping.column}" /> <f:if condition="{columnMapping.mapping.required}">
<f:then>
<f:form.select class="form-control select-mapping-column" name="{property}" options="{spreadsheetColumns}" prependOptionLabel="{f:translate(id: 'label.please_choose')}" value="{columnMapping.column}" additionalAttributes="{required: 1}" />
</f:then>
<f:else>
<f:form.select class="form-control select-mapping-column" name="{property}" options="{spreadsheetColumns}" prependOptionLabel="{f:translate(id: 'label.please_choose')}" value="{columnMapping.column}" />
</f:else>
</f:if>
</f:else> </f:else>
</f:if> </f:if>
</f:then> </f:then>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment