Refined post visibility settings

- added placeholder text to product/tier dropdown
- applied visual refinements

Note: alpha feature
This commit is contained in:
Peter Zimon 2021-07-06 14:46:33 +02:00
parent 42c861b90b
commit 830d24cb20
6 changed files with 38 additions and 4 deletions

View File

@ -8,6 +8,7 @@
@onChange={{this.setSegment}}
@disabled={{@disabled}}
@class="select-members"
@placeholder="Select a product"
as |option|
>
{{option.name}}

View File

@ -1,4 +1,4 @@
<div class="mb4">
<div class="mb4 gh-default-post-access">
<div class="gh-expandable-header">
<div>
<h4 class="gh-expandable-title">Default post access</h4>

View File

@ -31,7 +31,7 @@ export default class SettingsMembersDefaultPostAccess extends Component {
name: 'A segment',
description: 'Members with any of the selected products',
value: 'filter',
icon: 'members-paid',
icon: 'members-segment',
icon_color: 'yellow'
});
}

View File

@ -1538,6 +1538,18 @@ p.theme-validation-details {
margin: 36px 0;
}
.gh-default-post-access .ember-power-select-multiple-trigger {
padding: 8px;
}
.gh-default-post-access .segment-totals {
display: none;
}
.gh-setting-members-access .ember-power-select-status-icon {
right: 20px;
}
.gh-setting-members-tierscontainer {
margin-top: 4vmin;
}

View File

@ -69,14 +69,14 @@ export default BaseValidator.create({
visibility(model) {
if (isBlank(model.visibility) && !model.isNew) {
model.errors.add('visibility', 'A members group must be selected for members-only posts');
model.errors.add('visibility', 'Please select a product');
this.invalidate();
}
},
visibilityFilter(model) {
if (isBlank(model.visibilityFilter) && !isBlank(model.visibility) && model.visibility === 'filter' && !model.isNew) {
model.errors.add('visibilityFilter', 'A members group must be selected for members-only posts');
model.errors.add('visibilityFilter', 'Please select a product');
this.invalidate();
}
},

View File

@ -0,0 +1,21 @@
<?xml version="1.0" encoding="utf-8"?>
<svg version="1.1" id="Light" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="0 0 24 24" style="enable-background:new 0 0 24 24;" xml:space="preserve">
<g>
<path d="M3.5,24c-0.258,0-0.477-0.201-0.498-0.458L2.54,18H0.5C0.224,18,0,17.776,0,17.5V14c-0.002-2.354,1.495-4.448,3.724-5.208
c0.578-0.197,1.178-0.297,1.781-0.297c0.841,0,1.655,0.19,2.42,0.566c1.319,0.648,2.306,1.77,2.781,3.16
c0.043,0.126,0.035,0.262-0.024,0.382c-0.059,0.12-0.161,0.21-0.287,0.253c-0.052,0.018-0.106,0.027-0.162,0.027l0,0
c-0.214,0-0.404-0.136-0.473-0.339c-0.388-1.137-1.196-2.056-2.275-2.586C6.857,9.65,6.191,9.495,5.504,9.495
c-0.493,0-0.984,0.082-1.457,0.244C2.223,10.36,0.999,12.073,1,14v3h2c0.258,0,0.477,0.201,0.498,0.458L3.96,23h3.08l0.462-5.542
C7.523,17.201,7.742,17,8,17h1c0.276,0,0.5,0.224,0.5,0.5S9.276,18,9,18H8.46l-0.462,5.542C7.977,23.799,7.758,24,7.5,24H3.5z"/>
<path d="M5.5,8c-2.206,0-4-1.794-4-4s1.794-4,4-4s4,1.794,4,4S7.706,8,5.5,8z M5.5,1c-1.654,0-3,1.346-3,3s1.346,3,3,3s3-1.346,3-3
S7.154,1,5.5,1z"/>
<path d="M17.5,24c-3.584,0-6.5-2.916-6.5-6.5s2.916-6.5,6.5-6.5s6.5,2.916,6.5,6.5S21.084,24,17.5,24z M17.5,12
c-3.033,0-5.5,2.467-5.5,5.5s2.467,5.5,5.5,5.5s5.5-2.467,5.5-5.5S20.533,12,17.5,12z"/>
<path d="M16.667,20.428c-0.273,0-0.533-0.087-0.751-0.251c-0.047-0.035-0.09-0.073-0.131-0.114l-1.5-1.5
c-0.195-0.195-0.195-0.512,0-0.707c0.094-0.094,0.22-0.146,0.354-0.146s0.259,0.052,0.354,0.146l1.5,1.5
c0.008,0.008,0.017,0.016,0.027,0.023c0.042,0.032,0.094,0.049,0.149,0.049c0.081,0,0.154-0.037,0.202-0.1l2.905-3.872
c0.093-0.125,0.243-0.2,0.4-0.2c0.109,0,0.213,0.035,0.3,0.1c0.107,0.08,0.176,0.197,0.195,0.329
c0.019,0.132-0.015,0.264-0.095,0.371l-2.905,3.872C17.434,20.242,17.059,20.428,16.667,20.428z"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.9 KiB