Commit 3c5dacf3 authored by Chivy Lim's avatar Chivy Lim

[TASK] Allow required mapping property

refs KIME-5209
parent 6f0524ff
......@@ -40,6 +40,13 @@ final class Mapping {
*/
public $identifier = FALSE;
/**
* Flag if property is handled as required mapping
*
* @var boolean
*/
public $required = FALSE;
/**
* Overwrite the default getter for previews
*
......
......@@ -18,7 +18,14 @@
</f:else>
</f:if>
<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>
</label>
<div>
......@@ -26,10 +33,17 @@
<f:then>
<f:if condition="{columnMapping.mapping.identifier}">
<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: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:if>
</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