+ {fieldsConfig.timeZone ? (
+
+ Local Timezone
+ *
+
+ ) : (
+
+ Local Timezone
+
+ )}
+
+ (
+
+ filterFn(option.data, searchText)
+ }
+ value={this.props.values.settings.timeZone || ''}
+ name="timeZone"
+ options={timezoneOptions}
+ required={fieldsConfig.timeZone}
+ validationError="Please enter Local Timezone"
+ />
+ )}
+ />
- ) : (
-
- Normal Working Hours
+
+ )}
+ {(!_.isUndefined(fieldsConfig.workingHourStart) || !_.isUndefined(fieldsConfig.workingHourStart)) && (
+
+ {(fieldsConfig.workingHourStart || fieldsConfig.workingHourStart) ? (
+
+ Normal Working Hours
+ *
+
+ ) : (
+
+ Normal Working Hours
+
+ )}
+
+
- )}
-
-
-
+ )}
{showBackButton && (
@@ -408,15 +414,8 @@ class ProfileSettingsForm extends Component {
}
ProfileSettingsForm.defaultProps = {
- showBusinessEmail: false,
- showAvatar: true,
- showCompanyName: true,
- showTitle: true,
- showBusinessPhone: true,
- isRequiredTimeZone: true,
- isRequiredCountry: false,
- isRequiredWorkingHours: false,
- isRequiredBusinessEmail: true,
+ // default config is same for user profile for any kind of users
+ fieldsConfig: PROFILE_FIELDS_CONFIG.DEFAULT,
showBackButton: false,
submitButton: 'Save settings',
onBack: () => {},
@@ -429,15 +428,19 @@ ProfileSettingsForm.propTypes = {
values: PropTypes.object.isRequired,
saveSettings: PropTypes.func.isRequired,
uploadPhoto: PropTypes.func.isRequired,
- showBusinessEmail: PropTypes.bool,
- showAvatar: PropTypes.bool,
- showCompanyName: PropTypes.bool,
- showTitle: PropTypes.bool,
- showBusinessPhone: PropTypes.bool,
- isRequiredTimeZone: PropTypes.bool,
- isRequiredCountry: PropTypes.bool,
- isRequiredWorkingHours: PropTypes.bool,
- isRequiredBusinessEmail: PropTypes.bool,
+ fieldsConfig: PropTypes.shape({
+ avatar: PropTypes.bool,
+ firstName: PropTypes.bool,
+ lastName: PropTypes.bool,
+ title: PropTypes.bool,
+ companyName: PropTypes.bool,
+ businessPhone: PropTypes.bool,
+ businessEmail: PropTypes.bool,
+ country: PropTypes.bool,
+ timeZone: PropTypes.bool,
+ workingHourStart: PropTypes.bool,
+ workingHourEnd: PropTypes.bool,
+ }).isRequired,
showBackButton: PropTypes.bool,
shouldShowTitle: PropTypes.bool,
shouldDoValidateOnStart: PropTypes.bool,