Permalink
Browse files

Pass error text and warningText to input fields.

  • Loading branch information...
1 parent 4edc4ce commit fbd36010fc1b0f450e0007fa5ccfcad61be34ae0 @cdujeu cdujeu committed Sep 7, 2016
@@ -6,7 +6,7 @@
</resources>
</client_settings>
<server_settings>
- <param name="PATH" type="string" label="CONF_MESSAGE[Path]" description="CONF_MESSAGE[Real path to the root folder on the server]" mandatory="true"/>
+ <param name="PATH" type="string" label="CONF_MESSAGE[Path]" description="CONF_MESSAGE[Absolute path to the folder on the server. You can use AJXP_DATA_PATH and AJXP_INSTALL_PATH to point to Pydio default data path and root install path.]" mandatory="true"/>
<param name="CREATE" type="boolean" label="CONF_MESSAGE[Create]" description="CONF_MESSAGE[Create folder if it does not exists]" default="true" mandatory="true"/>
<param name="CHMOD_VALUE" type="string" label="CONF_MESSAGE[File Creation Mask]" description="CONF_MESSAGE[Optionnaly apply a chmod operation. Value must be numeric, like 0777, 0644, etc.]" default="0666"/>
<param name="PURGE_AFTER" type="integer" label="CONF_MESSAGE[Purge Days (Hard limit)]" description="CONF_MESSAGE[Option to purge documents after a given number of days (even if shared). This require a manual set up of a CRON task. Leave to 0 if you don't wan't to use this feature.]" default="0"/>
@@ -1552,14 +1552,17 @@
}
var mandatoryMissing = false;
var classLegend = "form-legend";
- if( attributes['mandatory'] && (attributes['mandatory'] === "true" || attributes['mandatory'] === true) ){
+ if(attributes['errorText']) {
+ classLegend = "form-legend mandatory-missing";
+ }else if(attributes['warningText']){
+ classLegend = "form-legend warning-message";
+ }else if( attributes['mandatory'] && (attributes['mandatory'] === "true" || attributes['mandatory'] === true) ){
if(['string', 'textarea', 'image', 'integer'].indexOf(attributes['type']) !== -1 && !values[paramName]){
mandatoryMissing = true;
classLegend = "form-legend mandatory-missing";
}
}
-
var props = {
ref:"formElement",
attributes:attributes,
@@ -1573,13 +1576,13 @@
binary_context:this.props.binary_context,
displayContext:'form',
applyButtonAction:this.applyButtonAction,
- errorText:mandatoryMissing?'Field cannot be empty':null
+ errorText:mandatoryMissing?'Field cannot be empty':(attributes.errorText?attributes.errorText:null)
};
field = (
<div key={paramName} className={'form-entry-' + attributes['type']}>
{PydioForm.createFormElement(props)}
- <div className={classLegend}>{attributes['description']} {helperMark}</div>
+ <div className={classLegend}>{attributes['warningText'] ? attributes['warningText'] : attributes['description']} {helperMark}</div>
</div>
);
}else{
@@ -18,7 +18,9 @@
border-color: @primary-color !important;
}
.mui-text-field .mui-text-field-error{
- right: 0;
+ bottom: auto;
+ line-height: 15px;
+ margin-top: -2px;
}
/*************/
@@ -308,6 +310,9 @@
color: rgba(0, 0, 0, 0.53);
}
}
+ &.warning-message{
+ color: lighten(@primary-color, 0.1);
+ }
}
.form-entry-string .form-legend,
@@ -316,7 +321,7 @@
margin-top: -5px;
transition: margin-top 550ms cubic-bezier(0.23, 1, 0.32, 1) 0ms;
&.mandatory-missing {
- margin-top: 12px;
+ opacity: 0;
}
}
.form-entry-button {
@@ -2788,7 +2788,9 @@
border-color: #009688 !important;
}
.react-mui-context .mui-text-field .mui-text-field-error {
- right: 0;
+ bottom: auto;
+ line-height: 15px;
+ margin-top: -2px;
}
.react-mui-context .main-layout-nav-to-stack,
.react-mui-context .horizontal-layout,
@@ -3061,6 +3063,9 @@
.react-mui-context .pydio-form-panel .form-legend .icon-question-sign:hover {
color: rgba(0, 0, 0, 0.53);
}
+.react-mui-context .pydio-form-panel .form-legend.warning-message {
+ color: #009788;
+}
.react-mui-context .pydio-form-panel .form-entry-string .form-legend,
.react-mui-context .pydio-form-panel .form-entry-integer .form-legend,
.react-mui-context .pydio-form-panel .form-entry-textarea .form-legend {
@@ -3070,7 +3075,7 @@
.react-mui-context .pydio-form-panel .form-entry-string .form-legend.mandatory-missing,
.react-mui-context .pydio-form-panel .form-entry-integer .form-legend.mandatory-missing,
.react-mui-context .pydio-form-panel .form-entry-textarea .form-legend.mandatory-missing {
- margin-top: 12px;
+ opacity: 0;
}
.react-mui-context .pydio-form-panel .form-entry-button {
display: inline-block;

0 comments on commit fbd3601

Please sign in to comment.