Merge pull request #3485 from dawoe/temp-3434

V8 - #3434 - change checkboxes on property type settings to toggle
This commit is contained in:
Niels Lyngsø
2019-02-04 10:19:25 +01:00
committed by GitHub
5 changed files with 81 additions and 21 deletions

View File

@@ -29,6 +29,12 @@
vm.submit = submit;
vm.close = close;
vm.toggleAllowCultureVariants = toggleAllowCultureVariants;
vm.toggleValidation = toggleValidation;
vm.toggleShowOnMemberProfile = toggleShowOnMemberProfile;
vm.toggleMemberCanEdit = toggleMemberCanEdit;
vm.toggleIsSensitiveData = toggleIsSensitiveData;
function onInit() {
userService.getCurrentUser().then(function(user) {
@@ -232,6 +238,30 @@
}
function toggleValue(settingValue) {
return !settingValue;
}
function toggleAllowCultureVariants() {
$scope.model.property.allowCultureVariant = toggleValue($scope.model.property.allowCultureVariant);
}
function toggleValidation() {
$scope.model.property.validation.mandatory = toggleValue($scope.model.property.validation.mandatory);
}
function toggleShowOnMemberProfile() {
$scope.model.property.showOnMemberProfile = toggleValue($scope.model.property.showOnMemberProfile);
}
function toggleMemberCanEdit() {
$scope.model.property.memberCanEdit = toggleValue($scope.model.property.memberCanEdit);
}
function toggleIsSensitiveData() {
$scope.model.property.isSensitiveData = toggleValue($scope.model.property.isSensitiveData);
}
onInit();
}

View File

@@ -84,10 +84,19 @@
<h5><localize key="validation_validation"></localize></h5>
<label class="checkbox no-indent">
<input type="checkbox" ng-model="model.property.validation.mandatory" focus-when="{{vm.focusOnMandatoryField}}" />
<label>
<localize key="validation_fieldIsMandatory"></localize>
</label>
<umb-toggle data-element="validation_mandatory"
checked="model.property.validation.mandatory"
on-click="vm.toggleValidation()"
>
</umb-toggle>
<label class="mt3">
<localize key="validation_customValidation"></localize>
</label>
<select class="umb-dropdown" ng-options="validationType.name for validationType in vm.validationTypes" ng-model="vm.selectedValidationType" ng-change="vm.changeValidationType(vm.selectedValidationType)">
<option value=""><localize key="validation_noValidation">No validation</localize></option>
@@ -106,38 +115,52 @@
</div>
<div class="umb-control-group clearfix" ng-if="model.contentType === 'documentType' && model.contentTypeAllowCultureVariant">
<h5>Property Type Variation</h5>
<label class="checkbox no-indent">
<input type="checkbox" ng-model="model.property.allowCultureVariant" />
Allow varying by Culture
</label>
<h5><localize key="contentTypeEditor_variantsHeading" /></h5>
<umb-toggle data-element="permissions-allow-culture-variant"
checked="model.property.allowCultureVariant"
on-click="vm.toggleAllowCultureVariants()"
>
</umb-toggle>
</div>
<div class="umb-control-group clearfix" ng-if="model.contentType === 'memberType'">
<h5><localize key="general_options"></localize></h5>
<label class="checkbox no-indent">
<input type="checkbox" ng-model="model.property.showOnMemberProfile">
<label class="mt3">
<localize key="contentTypeEditor_showOnMemberProfile"></localize>
<small><localize key="contentTypeEditor_showOnMemberProfileDescription"></localize></small>
</label>
<label class="checkbox no-indent">
<input type="checkbox" ng-model="model.property.memberCanEdit">
<umb-toggle data-element="settings_show_member_on_profile"
checked="model.property.showOnMemberProfile"
on-click="vm.toggleShowOnMemberProfile()">
</umb-toggle>
<label class="mt3">
<localize key="contentTypeEditor_memberCanEdit"></localize>
<small><localize key="contentTypeEditor_memberCanEditDescription"></localize></small>
</label>
<label ng-if="vm.showSensitiveData" class="checkbox no-indent">
<input type="checkbox" ng-model="model.property.isSensitiveData">
<umb-toggle data-element="settings_member_can_edit"
checked="model.property.memberCanEdit"
on-click="vm.toggleMemberCanEdit()">
</umb-toggle>
<label class="mt3" ng-if="vm.showSensitiveData">
<localize key="contentTypeEditor_isSensitiveData"></localize>
<small><localize key="contentTypeEditor_isSensitiveDataDescription"></localize></small>
</label>
<umb-toggle ng-if="vm.showSensitiveData" data-element="settings_is_sensitive_data"
checked="model.property.isSensitiveData"
on-click="vm.toggleIsSensitiveData()">
</umb-toggle>
</div>
</div>

View File

@@ -212,6 +212,11 @@
<localize key="contentTypeEditor_isSensitiveData"></localize>
</div>
<div class="umb-group-builder__property-tag -white" ng-if="property.allowCultureVariant">
<i class="icon-shuffle umb-group-builder__property-tag-icon"></i>
<localize key="contentTypeEditor_variantsHeading"></localize>
</div>
</div>
<div class="umb-group-builder__property-tags -right">

View File

@@ -1891,6 +1891,7 @@ To manage your website, simply open the Umbraco back office and start adding con
<key alias="invalidDate">Invalid date</key>
<key alias="invalidNumber">Not a number</key>
<key alias="invalidEmail">Invalid email</key>
<key alias="customValidation">Custom validation</key>
</area>
<area alias="healthcheck">
<!-- The following keys get these tokens passed in:

View File

@@ -1905,6 +1905,7 @@ To manage your website, simply open the Umbraco back office and start adding con
<key alias="invalidNull">Value cannot be null</key>
<key alias="invalidEmpty">Value cannot be empty</key>
<key alias="invalidPattern">Value is invalid, it does not match the correct pattern</key>
<key alias="customValidation">Custom validation</key>
</area>
<area alias="healthcheck">
<!-- The following keys get these tokens passed in: