@plusscommunities/pluss-core-web 1.6.8 → 1.6.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs.js +104 -104
- package/dist/index.esm.js +104 -104
- package/dist/index.umd.js +104 -104
- package/package.json +47 -47
- package/src/components/AudienceSelector.js +149 -101
- package/src/components/FileInput.js +94 -44
- package/src/components/ImageInput.js +3 -4
package/dist/index.umd.js
CHANGED
|
@@ -1714,7 +1714,7 @@
|
|
|
1714
1714
|
}).then(function (res) {
|
|
1715
1715
|
console.log('put the image');
|
|
1716
1716
|
return resolve(res);
|
|
1717
|
-
})
|
|
1717
|
+
})["catch"](function (err) {
|
|
1718
1718
|
return reject(err);
|
|
1719
1719
|
});
|
|
1720
1720
|
});
|
|
@@ -4808,7 +4808,7 @@
|
|
|
4808
4808
|
function _isNativeReflectConstruct$u() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
4809
4809
|
var DEFAULT_INPUT$1 = {
|
|
4810
4810
|
uploadingFile: false,
|
|
4811
|
-
value:
|
|
4811
|
+
value: ""
|
|
4812
4812
|
};
|
|
4813
4813
|
|
|
4814
4814
|
var FileInputComponent = /*#__PURE__*/function (_Component) {
|
|
@@ -4830,17 +4830,17 @@
|
|
|
4830
4830
|
_defineProperty__default['default'](_assertThisInitialized__default['default'](_this), "state", {
|
|
4831
4831
|
inputs: [{
|
|
4832
4832
|
uploadingFile: false,
|
|
4833
|
-
value:
|
|
4833
|
+
value: ""
|
|
4834
4834
|
}]
|
|
4835
4835
|
});
|
|
4836
4836
|
|
|
4837
4837
|
_defineProperty__default['default'](_assertThisInitialized__default['default'](_this), "getAccept", function () {
|
|
4838
|
-
if (_typeof__default['default'](_this.props.accept) ===
|
|
4838
|
+
if (_typeof__default['default'](_this.props.accept) === "object") {
|
|
4839
4839
|
return _this.props.accept;
|
|
4840
4840
|
}
|
|
4841
4841
|
|
|
4842
|
-
if (typeof _this.props.accept ===
|
|
4843
|
-
var accept = _defineProperty__default['default']({}, _this.props.accept, [".".concat(___default['default'].last(_this.props.accept.split(
|
|
4842
|
+
if (typeof _this.props.accept === "string") {
|
|
4843
|
+
var accept = _defineProperty__default['default']({}, _this.props.accept, [".".concat(___default['default'].last(_this.props.accept.split("/")))]);
|
|
4844
4844
|
|
|
4845
4845
|
return accept;
|
|
4846
4846
|
}
|
|
@@ -4934,7 +4934,7 @@
|
|
|
4934
4934
|
return _this.props.handleFile(file, newInputs);
|
|
4935
4935
|
|
|
4936
4936
|
case 9:
|
|
4937
|
-
_this.checkSetDisplayValue(input,
|
|
4937
|
+
_this.checkSetDisplayValue(input, "");
|
|
4938
4938
|
|
|
4939
4939
|
_context.next = 24;
|
|
4940
4940
|
break;
|
|
@@ -4956,7 +4956,7 @@
|
|
|
4956
4956
|
case 20:
|
|
4957
4957
|
_context.prev = 20;
|
|
4958
4958
|
_context.t0 = _context["catch"](12);
|
|
4959
|
-
console.log(
|
|
4959
|
+
console.log("handleFile error", _context.t0);
|
|
4960
4960
|
|
|
4961
4961
|
_this.setState({
|
|
4962
4962
|
uploadingFile: false
|
|
@@ -5001,7 +5001,7 @@
|
|
|
5001
5001
|
}, {
|
|
5002
5002
|
key: "setValue",
|
|
5003
5003
|
value: function setValue(val) {
|
|
5004
|
-
if (typeof val ===
|
|
5004
|
+
if (typeof val === "string") {
|
|
5005
5005
|
this.setState({
|
|
5006
5006
|
inputs: [{
|
|
5007
5007
|
uploadingImage: false,
|
|
@@ -5027,20 +5027,20 @@
|
|
|
5027
5027
|
}, {
|
|
5028
5028
|
key: "getClassNames",
|
|
5029
5029
|
value: function getClassNames(input, inputsLength) {
|
|
5030
|
-
var classes =
|
|
5030
|
+
var classes = "clearfix imageInput";
|
|
5031
5031
|
|
|
5032
5032
|
if (input.uploadingFile) {
|
|
5033
|
-
classes +=
|
|
5033
|
+
classes += " imageInput-uploading";
|
|
5034
5034
|
} else if (!___default['default'].isEmpty(input.value) && !this.props.onlyAllowUpload) {
|
|
5035
|
-
classes +=
|
|
5035
|
+
classes += " imageInput-hasImage";
|
|
5036
5036
|
}
|
|
5037
5037
|
|
|
5038
5038
|
if (inputsLength === 1) {
|
|
5039
|
-
classes +=
|
|
5039
|
+
classes += " imageInput-only";
|
|
5040
5040
|
}
|
|
5041
5041
|
|
|
5042
5042
|
if (this.props.style && this.props.style.height && this.props.style.height < 150) {
|
|
5043
|
-
classes +=
|
|
5043
|
+
classes += " imageInput-condensed";
|
|
5044
5044
|
}
|
|
5045
5045
|
|
|
5046
5046
|
return classes;
|
|
@@ -5049,10 +5049,10 @@
|
|
|
5049
5049
|
key: "getErrorState",
|
|
5050
5050
|
value: function getErrorState() {
|
|
5051
5051
|
if (!___default['default'].isUndefined(this.props.showError) && this.props.showError()) {
|
|
5052
|
-
return
|
|
5052
|
+
return " imageInput_upload--error";
|
|
5053
5053
|
}
|
|
5054
5054
|
|
|
5055
|
-
return
|
|
5055
|
+
return "";
|
|
5056
5056
|
}
|
|
5057
5057
|
}, {
|
|
5058
5058
|
key: "checkSetDisplayValue",
|
|
@@ -5071,7 +5071,7 @@
|
|
|
5071
5071
|
key: "removeFile",
|
|
5072
5072
|
value: function removeFile(input) {
|
|
5073
5073
|
var newState = {};
|
|
5074
|
-
input.value =
|
|
5074
|
+
input.value = "";
|
|
5075
5075
|
|
|
5076
5076
|
var newInputs = ___default['default'].clone(this.state.inputs);
|
|
5077
5077
|
|
|
@@ -5180,7 +5180,7 @@
|
|
|
5180
5180
|
className: "imageInput_upload ".concat(_this3.getErrorState()),
|
|
5181
5181
|
style: _objectSpread$f({}, _this3.props.style)
|
|
5182
5182
|
}, getRootProps()), /*#__PURE__*/React__default['default'].createElement("input", getInputProps()), /*#__PURE__*/React__default['default'].createElement("div", {
|
|
5183
|
-
className: "".concat(isDragActive ?
|
|
5183
|
+
className: "".concat(isDragActive ? "imageInput_dropZoneActive" : "")
|
|
5184
5184
|
}, !_this3.props.simpleStyle && /*#__PURE__*/React__default['default'].createElement("img", {
|
|
5185
5185
|
src: "https://s3-ap-southeast-2.amazonaws.com/pluss60-dev-media/pluss/document.svg",
|
|
5186
5186
|
className: "imageInput_icon",
|
|
@@ -5206,7 +5206,7 @@
|
|
|
5206
5206
|
var _this4 = this;
|
|
5207
5207
|
|
|
5208
5208
|
return /*#__PURE__*/React__default['default'].createElement("div", {
|
|
5209
|
-
className: "imageInputContainer clearfix ".concat(inputs.length === 1 ?
|
|
5209
|
+
className: "imageInputContainer clearfix ".concat(inputs.length === 1 ? "imageInputContainer-noPadding" : "", " ").concat(this.props.simpleStyle ? "imageInputContainer-simple" : ""),
|
|
5210
5210
|
style: _objectSpread$f({}, this.props.style)
|
|
5211
5211
|
}, inputs.map(function (input, index) {
|
|
5212
5212
|
return _this4.renderInput(input, index, inputs.length);
|
|
@@ -5234,7 +5234,7 @@
|
|
|
5234
5234
|
};
|
|
5235
5235
|
|
|
5236
5236
|
var FileInput = reactRedux.connect(mapStateToProps$5, {}, null, {
|
|
5237
|
-
|
|
5237
|
+
forwardRef: true
|
|
5238
5238
|
})(FileInputComponent);
|
|
5239
5239
|
|
|
5240
5240
|
function ownKeys$e(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
@@ -6756,7 +6756,7 @@
|
|
|
6756
6756
|
var RowId = selectedFolder.RowId,
|
|
6757
6757
|
Images = selectedFolder.Images;
|
|
6758
6758
|
var images = [].concat(_toConsumableArray__default['default'](Images), [value]);
|
|
6759
|
-
fileActions.addImagesToFolder(RowId, _this5.props.auth.site, [value])
|
|
6759
|
+
fileActions.addImagesToFolder(RowId, _this5.props.auth.site, [value])["catch"](function (error) {
|
|
6760
6760
|
console.log('addImagesToFolder error', error);
|
|
6761
6761
|
});
|
|
6762
6762
|
selectedFolder.Images = images;
|
|
@@ -7342,7 +7342,7 @@
|
|
|
7342
7342
|
};
|
|
7343
7343
|
|
|
7344
7344
|
var ImageInput = reactRedux.connect(mapStateToProps$2, {}, null, {
|
|
7345
|
-
|
|
7345
|
+
forwardRef: true
|
|
7346
7346
|
})(ImageInputComponent);
|
|
7347
7347
|
|
|
7348
7348
|
function _createSuper$n(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct$n(); return function _createSuperInternal() { var Super = _getPrototypeOf__default['default'](Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf__default['default'](this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn__default['default'](this, result); }; }
|
|
@@ -9228,7 +9228,7 @@
|
|
|
9228
9228
|
AudienceTagList = _this$state.AudienceTagList;
|
|
9229
9229
|
var categoryTags = categories.map(function (c) {
|
|
9230
9230
|
return {
|
|
9231
|
-
AudienceType:
|
|
9231
|
+
AudienceType: "Category",
|
|
9232
9232
|
AudienceTypeSelection: c.Key,
|
|
9233
9233
|
Id: "category_".concat(c.Key),
|
|
9234
9234
|
Title: c.Title
|
|
@@ -9236,7 +9236,7 @@
|
|
|
9236
9236
|
});
|
|
9237
9237
|
var userTypeTags = types.map(function (t) {
|
|
9238
9238
|
return {
|
|
9239
|
-
AudienceType:
|
|
9239
|
+
AudienceType: "UserType",
|
|
9240
9240
|
AudienceTypeSelection: t.typeName,
|
|
9241
9241
|
Id: "userType_".concat(t.typeName),
|
|
9242
9242
|
Title: "User Type: ".concat(t.displayName)
|
|
@@ -9244,7 +9244,7 @@
|
|
|
9244
9244
|
});
|
|
9245
9245
|
var userTagTags = tagList.map(function (t) {
|
|
9246
9246
|
return {
|
|
9247
|
-
AudienceType:
|
|
9247
|
+
AudienceType: "UserTags",
|
|
9248
9248
|
AudienceTypeSelection: t.Id,
|
|
9249
9249
|
Id: "userTag_".concat(t.Id),
|
|
9250
9250
|
Title: "User Tag: ".concat(t.Title)
|
|
@@ -9278,26 +9278,26 @@
|
|
|
9278
9278
|
|
|
9279
9279
|
_this.state = {
|
|
9280
9280
|
categories: [{
|
|
9281
|
-
Title:
|
|
9282
|
-
Key:
|
|
9283
|
-
ShortName:
|
|
9281
|
+
Title: "All Primary Users",
|
|
9282
|
+
Key: "resident",
|
|
9283
|
+
ShortName: "Primary"
|
|
9284
9284
|
}, {
|
|
9285
|
-
Title:
|
|
9286
|
-
Key:
|
|
9287
|
-
ShortName:
|
|
9285
|
+
Title: "All Staff Users",
|
|
9286
|
+
Key: "staff",
|
|
9287
|
+
ShortName: "Staff"
|
|
9288
9288
|
}, {
|
|
9289
|
-
Title:
|
|
9290
|
-
Key:
|
|
9291
|
-
ShortName:
|
|
9289
|
+
Title: "All Linked Users",
|
|
9290
|
+
Key: "family",
|
|
9291
|
+
ShortName: "Linked"
|
|
9292
9292
|
}],
|
|
9293
9293
|
types: [],
|
|
9294
|
-
AudienceType: props.audienceType ||
|
|
9294
|
+
AudienceType: props.audienceType || "All",
|
|
9295
9295
|
showInclude: false,
|
|
9296
9296
|
includeList: [],
|
|
9297
9297
|
showExclude: false,
|
|
9298
9298
|
excludeList: [],
|
|
9299
|
-
Type:
|
|
9300
|
-
Category:
|
|
9299
|
+
Type: "",
|
|
9300
|
+
Category: "",
|
|
9301
9301
|
userList: [],
|
|
9302
9302
|
tagList: [],
|
|
9303
9303
|
AudienceTagList: props.audienceTypeSelection || []
|
|
@@ -9327,7 +9327,7 @@
|
|
|
9327
9327
|
}, {
|
|
9328
9328
|
key: "onSubmit",
|
|
9329
9329
|
value: function onSubmit() {
|
|
9330
|
-
if (this.state.AudienceType ===
|
|
9330
|
+
if (this.state.AudienceType === "User" && ___default['default'].isEmpty(this.state.includeList)) {
|
|
9331
9331
|
this.setState({
|
|
9332
9332
|
showInclude: true
|
|
9333
9333
|
});
|
|
@@ -9347,9 +9347,9 @@
|
|
|
9347
9347
|
Category = _this$state2.Category,
|
|
9348
9348
|
Tag = _this$state2.Tag,
|
|
9349
9349
|
Type = _this$state2.Type;
|
|
9350
|
-
if (AudienceType ===
|
|
9351
|
-
if (AudienceType ===
|
|
9352
|
-
if (AudienceType ===
|
|
9350
|
+
if (AudienceType === "Custom") return AudienceTagList || [];
|
|
9351
|
+
if (AudienceType === "Category") return Category;
|
|
9352
|
+
if (AudienceType === "UserTags") return Tag;
|
|
9353
9353
|
return Type;
|
|
9354
9354
|
}
|
|
9355
9355
|
}, {
|
|
@@ -9371,7 +9371,7 @@
|
|
|
9371
9371
|
_this2.setState({
|
|
9372
9372
|
userList: res.data.results.Items
|
|
9373
9373
|
});
|
|
9374
|
-
})
|
|
9374
|
+
})["catch"](function (error) {});
|
|
9375
9375
|
}
|
|
9376
9376
|
}, {
|
|
9377
9377
|
key: "getUserTags",
|
|
@@ -9386,7 +9386,7 @@
|
|
|
9386
9386
|
});
|
|
9387
9387
|
})
|
|
9388
9388
|
});
|
|
9389
|
-
})
|
|
9389
|
+
})["catch"](function (error) {});
|
|
9390
9390
|
}
|
|
9391
9391
|
}, {
|
|
9392
9392
|
key: "setType",
|
|
@@ -9394,9 +9394,9 @@
|
|
|
9394
9394
|
var newState = {
|
|
9395
9395
|
AudienceType: type
|
|
9396
9396
|
};
|
|
9397
|
-
if (type ===
|
|
9398
|
-
if (type ===
|
|
9399
|
-
if (type ===
|
|
9397
|
+
if (type === "Custom") newState.AudienceTagList = selection;
|
|
9398
|
+
if (type === "UserType") newState.Type = selection;
|
|
9399
|
+
if (type === "Category") newState.Category = selection;
|
|
9400
9400
|
this.setState(newState);
|
|
9401
9401
|
}
|
|
9402
9402
|
}, {
|
|
@@ -9404,8 +9404,8 @@
|
|
|
9404
9404
|
value: function onChangeOption(type) {
|
|
9405
9405
|
this.setState({
|
|
9406
9406
|
AudienceType: type,
|
|
9407
|
-
Type:
|
|
9408
|
-
Category:
|
|
9407
|
+
Type: "",
|
|
9408
|
+
Category: "",
|
|
9409
9409
|
includeList: [],
|
|
9410
9410
|
excludeList: [],
|
|
9411
9411
|
AudienceTagList: []
|
|
@@ -9418,57 +9418,57 @@
|
|
|
9418
9418
|
var _this4 = this;
|
|
9419
9419
|
|
|
9420
9420
|
var options = [{
|
|
9421
|
-
Label:
|
|
9422
|
-
Value:
|
|
9421
|
+
Label: "All users",
|
|
9422
|
+
Value: "All",
|
|
9423
9423
|
onChange: function onChange() {
|
|
9424
|
-
return _this4.onChangeOption(
|
|
9424
|
+
return _this4.onChangeOption("All");
|
|
9425
9425
|
}
|
|
9426
9426
|
}];
|
|
9427
9427
|
|
|
9428
9428
|
if (this.props.custom) {
|
|
9429
9429
|
options.push({
|
|
9430
|
-
Label:
|
|
9431
|
-
Value:
|
|
9430
|
+
Label: "Custom",
|
|
9431
|
+
Value: "Custom",
|
|
9432
9432
|
onChange: function onChange() {
|
|
9433
|
-
return _this4.onChangeOption(
|
|
9433
|
+
return _this4.onChangeOption("Custom");
|
|
9434
9434
|
}
|
|
9435
9435
|
});
|
|
9436
9436
|
} else {
|
|
9437
9437
|
options.push({
|
|
9438
|
-
Label:
|
|
9439
|
-
Value:
|
|
9438
|
+
Label: "By user category",
|
|
9439
|
+
Value: "Category",
|
|
9440
9440
|
onChange: function onChange() {
|
|
9441
|
-
return _this4.onChangeOption(
|
|
9441
|
+
return _this4.onChangeOption("Category");
|
|
9442
9442
|
}
|
|
9443
9443
|
});
|
|
9444
9444
|
}
|
|
9445
9445
|
|
|
9446
9446
|
if (!this.props.disallowUserType) {
|
|
9447
9447
|
options.push({
|
|
9448
|
-
Label:
|
|
9449
|
-
Value:
|
|
9448
|
+
Label: "By user type",
|
|
9449
|
+
Value: "UserType",
|
|
9450
9450
|
onChange: function onChange() {
|
|
9451
|
-
return _this4.onChangeOption(
|
|
9451
|
+
return _this4.onChangeOption("UserType");
|
|
9452
9452
|
}
|
|
9453
9453
|
});
|
|
9454
9454
|
}
|
|
9455
9455
|
|
|
9456
9456
|
if (this.props.allowTags) {
|
|
9457
9457
|
options.push({
|
|
9458
|
-
Label:
|
|
9459
|
-
Value:
|
|
9458
|
+
Label: "By user tag",
|
|
9459
|
+
Value: "UserTags",
|
|
9460
9460
|
onChange: function onChange() {
|
|
9461
|
-
return _this4.onChangeOption(
|
|
9461
|
+
return _this4.onChangeOption("UserTags");
|
|
9462
9462
|
}
|
|
9463
9463
|
});
|
|
9464
9464
|
}
|
|
9465
9465
|
|
|
9466
9466
|
if (!this.props.disallowSingleUsers) {
|
|
9467
9467
|
options.push({
|
|
9468
|
-
Label:
|
|
9469
|
-
Value:
|
|
9468
|
+
Label: "To single users",
|
|
9469
|
+
Value: "User",
|
|
9470
9470
|
onChange: function onChange() {
|
|
9471
|
-
return _this4.onChangeOption(
|
|
9471
|
+
return _this4.onChangeOption("User");
|
|
9472
9472
|
}
|
|
9473
9473
|
});
|
|
9474
9474
|
}
|
|
@@ -9481,11 +9481,11 @@
|
|
|
9481
9481
|
var _this$state3 = this.state,
|
|
9482
9482
|
AudienceType = _this$state3.AudienceType,
|
|
9483
9483
|
includeList = _this$state3.includeList;
|
|
9484
|
-
if (AudienceType ===
|
|
9485
|
-
if (AudienceType ===
|
|
9486
|
-
if (AudienceType ===
|
|
9487
|
-
if (AudienceType ===
|
|
9488
|
-
if (AudienceType ===
|
|
9484
|
+
if (AudienceType === "Custom" && !this.validateCustom()) return false;
|
|
9485
|
+
if (AudienceType === "Category" && !this.validateCategory()) return false;
|
|
9486
|
+
if (AudienceType === "UserType" && !this.validateType()) return false;
|
|
9487
|
+
if (AudienceType === "User" && ___default['default'].isEmpty(includeList)) return false;
|
|
9488
|
+
if (AudienceType === "UserTags" && !this.validateTag()) return false;
|
|
9489
9489
|
return true;
|
|
9490
9490
|
}
|
|
9491
9491
|
}, {
|
|
@@ -9511,7 +9511,7 @@
|
|
|
9511
9511
|
return typeObject.displayName;
|
|
9512
9512
|
}
|
|
9513
9513
|
|
|
9514
|
-
return
|
|
9514
|
+
return "";
|
|
9515
9515
|
}
|
|
9516
9516
|
}, {
|
|
9517
9517
|
key: "getTagTitle",
|
|
@@ -9526,7 +9526,7 @@
|
|
|
9526
9526
|
return tag.Title;
|
|
9527
9527
|
}
|
|
9528
9528
|
|
|
9529
|
-
return
|
|
9529
|
+
return "";
|
|
9530
9530
|
}
|
|
9531
9531
|
}, {
|
|
9532
9532
|
key: "getUserTypes",
|
|
@@ -9547,7 +9547,7 @@
|
|
|
9547
9547
|
return c.Key === e.category;
|
|
9548
9548
|
});
|
|
9549
9549
|
|
|
9550
|
-
var shortName = category ? "(".concat(category.ShortName, ") ") :
|
|
9550
|
+
var shortName = category ? "(".concat(category.ShortName, ") ") : "";
|
|
9551
9551
|
e.Title = "".concat(shortName, " ").concat(e.Title);
|
|
9552
9552
|
}
|
|
9553
9553
|
});
|
|
@@ -9556,30 +9556,30 @@
|
|
|
9556
9556
|
};
|
|
9557
9557
|
|
|
9558
9558
|
if (!___default['default'].some(res.data, function (t) {
|
|
9559
|
-
return t.category ===
|
|
9559
|
+
return t.category === "family";
|
|
9560
9560
|
})) {
|
|
9561
9561
|
newState.categories = ___default['default'].filter(_this7.state.categories, function (c) {
|
|
9562
|
-
return c.Key !==
|
|
9562
|
+
return c.Key !== "family";
|
|
9563
9563
|
});
|
|
9564
9564
|
}
|
|
9565
9565
|
|
|
9566
9566
|
_this7.setState(newState);
|
|
9567
|
-
})
|
|
9567
|
+
})["catch"](function (error) {});
|
|
9568
9568
|
}
|
|
9569
9569
|
}, {
|
|
9570
9570
|
key: "getUserList",
|
|
9571
9571
|
value: function getUserList() {
|
|
9572
9572
|
var _this8 = this;
|
|
9573
9573
|
|
|
9574
|
-
if (this.state.AudienceType ===
|
|
9574
|
+
if (this.state.AudienceType === "UserType" && !___default['default'].isEmpty(this.state.Type)) {
|
|
9575
9575
|
var users = [];
|
|
9576
9576
|
this.state.userList.forEach(function (element) {
|
|
9577
9577
|
if (element.type !== _this8.state.Type) users.push(element);
|
|
9578
9578
|
});
|
|
9579
|
-
return ___default['default'].sortBy(users,
|
|
9579
|
+
return ___default['default'].sortBy(users, "displayName");
|
|
9580
9580
|
}
|
|
9581
9581
|
|
|
9582
|
-
if (this.state.AudienceType ===
|
|
9582
|
+
if (this.state.AudienceType === "Category" && !___default['default'].isEmpty(this.state.Category)) {
|
|
9583
9583
|
var _users = [];
|
|
9584
9584
|
|
|
9585
9585
|
var types = ___default['default'].filter(this.state.types, function (type) {
|
|
@@ -9593,10 +9593,10 @@
|
|
|
9593
9593
|
_users.push(element);
|
|
9594
9594
|
}
|
|
9595
9595
|
});
|
|
9596
|
-
return ___default['default'].sortBy(_users,
|
|
9596
|
+
return ___default['default'].sortBy(_users, "displayName");
|
|
9597
9597
|
}
|
|
9598
9598
|
|
|
9599
|
-
return ___default['default'].sortBy(this.state.userList,
|
|
9599
|
+
return ___default['default'].sortBy(this.state.userList, "displayName");
|
|
9600
9600
|
}
|
|
9601
9601
|
}, {
|
|
9602
9602
|
key: "selectCat",
|
|
@@ -9621,7 +9621,7 @@
|
|
|
9621
9621
|
return typeObject.Title;
|
|
9622
9622
|
}
|
|
9623
9623
|
|
|
9624
|
-
return
|
|
9624
|
+
return "";
|
|
9625
9625
|
}
|
|
9626
9626
|
}, {
|
|
9627
9627
|
key: "validateCategory",
|
|
@@ -9641,7 +9641,7 @@
|
|
|
9641
9641
|
}, {
|
|
9642
9642
|
key: "showUserPickers",
|
|
9643
9643
|
value: function showUserPickers(isInclude) {
|
|
9644
|
-
if (isInclude && this.state.AudienceType ===
|
|
9644
|
+
if (isInclude && this.state.AudienceType === "User") {
|
|
9645
9645
|
return true;
|
|
9646
9646
|
}
|
|
9647
9647
|
|
|
@@ -9653,15 +9653,15 @@
|
|
|
9653
9653
|
return false;
|
|
9654
9654
|
}
|
|
9655
9655
|
|
|
9656
|
-
if (isInclude && this.state.AudienceType ===
|
|
9656
|
+
if (isInclude && this.state.AudienceType === "All") {
|
|
9657
9657
|
return false;
|
|
9658
9658
|
}
|
|
9659
9659
|
|
|
9660
|
-
if (!isInclude && this.state.AudienceType ===
|
|
9660
|
+
if (!isInclude && this.state.AudienceType === "User") {
|
|
9661
9661
|
return false;
|
|
9662
9662
|
}
|
|
9663
9663
|
|
|
9664
|
-
if (this.state.AudienceType ===
|
|
9664
|
+
if (this.state.AudienceType === "Category" && ___default['default'].isEmpty(this.state.Category) || this.state.AudienceType === "UserType" && ___default['default'].isEmpty(this.state.Type)) {
|
|
9665
9665
|
return false;
|
|
9666
9666
|
}
|
|
9667
9667
|
|
|
@@ -9672,15 +9672,15 @@
|
|
|
9672
9672
|
value: function getUserExcludeList() {
|
|
9673
9673
|
var _this10 = this;
|
|
9674
9674
|
|
|
9675
|
-
if (this.state.AudienceType ===
|
|
9675
|
+
if (this.state.AudienceType === "UserType" && !___default['default'].isEmpty(this.state.Type)) {
|
|
9676
9676
|
var users = [];
|
|
9677
9677
|
this.state.userList.forEach(function (element) {
|
|
9678
9678
|
if (element.type === _this10.state.Type) users.push(element);
|
|
9679
9679
|
});
|
|
9680
|
-
return ___default['default'].sortBy(users,
|
|
9680
|
+
return ___default['default'].sortBy(users, "displayName");
|
|
9681
9681
|
}
|
|
9682
9682
|
|
|
9683
|
-
if (this.state.AudienceType ===
|
|
9683
|
+
if (this.state.AudienceType === "Category" && !___default['default'].isEmpty(this.state.Category)) {
|
|
9684
9684
|
var _users2 = [];
|
|
9685
9685
|
|
|
9686
9686
|
var types = ___default['default'].filter(this.state.types, function (type) {
|
|
@@ -9694,10 +9694,10 @@
|
|
|
9694
9694
|
_users2.push(element);
|
|
9695
9695
|
}
|
|
9696
9696
|
});
|
|
9697
|
-
return ___default['default'].sortBy(_users2,
|
|
9697
|
+
return ___default['default'].sortBy(_users2, "displayName");
|
|
9698
9698
|
}
|
|
9699
9699
|
|
|
9700
|
-
return ___default['default'].sortBy(this.state.userList,
|
|
9700
|
+
return ___default['default'].sortBy(this.state.userList, "displayName");
|
|
9701
9701
|
}
|
|
9702
9702
|
}, {
|
|
9703
9703
|
key: "addToInc",
|
|
@@ -9771,12 +9771,12 @@
|
|
|
9771
9771
|
}, /*#__PURE__*/React__default['default'].createElement(Text, {
|
|
9772
9772
|
type: "formTitleSmall",
|
|
9773
9773
|
className: "marginBottom-16"
|
|
9774
|
-
}, "Exclude Users From Selection ", "(".concat(this.state.excludeList.length, ")"))), /*#__PURE__*/React__default['default'].createElement(FontAwesome__default['default'], {
|
|
9774
|
+
}, "Exclude Users From Selection", " ", "(".concat(this.state.excludeList.length, ")"))), /*#__PURE__*/React__default['default'].createElement(FontAwesome__default['default'], {
|
|
9775
9775
|
style: {
|
|
9776
9776
|
color: COLOUR_DUSK,
|
|
9777
9777
|
fontSize: 12
|
|
9778
9778
|
},
|
|
9779
|
-
name: this.state.showExclude ?
|
|
9779
|
+
name: this.state.showExclude ? "chevron-up" : "chevron-down"
|
|
9780
9780
|
})), this.state.showExclude && /*#__PURE__*/React__default['default'].createElement(exportObj$1, {
|
|
9781
9781
|
add: this.addToEx.bind(this),
|
|
9782
9782
|
remove: this.removeUserEx.bind(this),
|
|
@@ -9808,12 +9808,12 @@
|
|
|
9808
9808
|
}, /*#__PURE__*/React__default['default'].createElement(Text, {
|
|
9809
9809
|
type: "formTitleSmall",
|
|
9810
9810
|
className: "marginBottom-16"
|
|
9811
|
-
}, this.state.AudienceType !==
|
|
9811
|
+
}, this.state.AudienceType !== "User" ? "Add Other" : "Select", " ", "Users ", "(".concat(this.state.includeList.length, ")"))), /*#__PURE__*/React__default['default'].createElement(FontAwesome__default['default'], {
|
|
9812
9812
|
style: {
|
|
9813
9813
|
color: COLOUR_DUSK,
|
|
9814
9814
|
fontSize: 12
|
|
9815
9815
|
},
|
|
9816
|
-
name: this.state.showInclude ?
|
|
9816
|
+
name: this.state.showInclude ? "chevron-up" : "chevron-down"
|
|
9817
9817
|
})), this.state.showInclude && /*#__PURE__*/React__default['default'].createElement(exportObj$1, {
|
|
9818
9818
|
add: this.addToInc.bind(this),
|
|
9819
9819
|
remove: this.removeUserInc.bind(this),
|
|
@@ -9874,7 +9874,7 @@
|
|
|
9874
9874
|
}, {
|
|
9875
9875
|
key: "renderCustom",
|
|
9876
9876
|
value: function renderCustom() {
|
|
9877
|
-
if (this.state.AudienceType !==
|
|
9877
|
+
if (this.state.AudienceType !== "Custom") return null;
|
|
9878
9878
|
return /*#__PURE__*/React__default['default'].createElement("div", {
|
|
9879
9879
|
className: "optionsContent_bottom"
|
|
9880
9880
|
}, /*#__PURE__*/React__default['default'].createElement(Text, {
|
|
@@ -9892,17 +9892,17 @@
|
|
|
9892
9892
|
return /*#__PURE__*/React__default['default'].createElement("div", null, /*#__PURE__*/React__default['default'].createElement(Text, {
|
|
9893
9893
|
type: "formTitleSmall",
|
|
9894
9894
|
className: "marginBottom-16"
|
|
9895
|
-
}, this.props.title ||
|
|
9895
|
+
}, this.props.title || "Target Audience"), /*#__PURE__*/React__default['default'].createElement(RadioButton, {
|
|
9896
9896
|
isActive: this.state.AudienceType,
|
|
9897
9897
|
rowStyle: {
|
|
9898
|
-
flexDirection:
|
|
9898
|
+
flexDirection: "column"
|
|
9899
9899
|
},
|
|
9900
9900
|
buttonStyle: {
|
|
9901
9901
|
marginBottom: 8
|
|
9902
9902
|
},
|
|
9903
9903
|
options: this.getOptions(),
|
|
9904
9904
|
disabled: this.props.disabled
|
|
9905
|
-
}), this.state.AudienceType ===
|
|
9905
|
+
}), this.state.AudienceType === "Category" && /*#__PURE__*/React__default['default'].createElement(DropdownInput, {
|
|
9906
9906
|
id: "typeSelect" // label='User Category'
|
|
9907
9907
|
,
|
|
9908
9908
|
alwaysShowLabel: true,
|
|
@@ -9922,7 +9922,7 @@
|
|
|
9922
9922
|
},
|
|
9923
9923
|
isRequired: true,
|
|
9924
9924
|
disabled: this.props.disabled
|
|
9925
|
-
}), this.state.AudienceType ===
|
|
9925
|
+
}), this.state.AudienceType === "UserType" && /*#__PURE__*/React__default['default'].createElement(DropdownInput, {
|
|
9926
9926
|
id: "typeSelect" // label='User Type'
|
|
9927
9927
|
,
|
|
9928
9928
|
alwaysShowLabel: true,
|
|
@@ -9942,7 +9942,7 @@
|
|
|
9942
9942
|
},
|
|
9943
9943
|
isRequired: true,
|
|
9944
9944
|
disabled: this.props.disabled
|
|
9945
|
-
}), this.state.AudienceType ===
|
|
9945
|
+
}), this.state.AudienceType === "UserTags" && /*#__PURE__*/React__default['default'].createElement(DropdownInput, {
|
|
9946
9946
|
id: "tagSelect",
|
|
9947
9947
|
alwaysShowLabel: true,
|
|
9948
9948
|
placeholder: "User Tag",
|
|
@@ -9971,7 +9971,7 @@
|
|
|
9971
9971
|
var toExport = reactRedux.connect(null, {
|
|
9972
9972
|
setAuth: setAuth
|
|
9973
9973
|
}, null, {
|
|
9974
|
-
|
|
9974
|
+
forwardRef: true
|
|
9975
9975
|
})(AudienceSelector);
|
|
9976
9976
|
|
|
9977
9977
|
function _createSuper$6(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct$6(); return function _createSuperInternal() { var Super = _getPrototypeOf__default['default'](Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf__default['default'](this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn__default['default'](this, result); }; }
|
|
@@ -10303,7 +10303,7 @@
|
|
|
10303
10303
|
submitting: false,
|
|
10304
10304
|
asset: res.data.resultUrl
|
|
10305
10305
|
});
|
|
10306
|
-
})
|
|
10306
|
+
})["catch"](function (err) {
|
|
10307
10307
|
_this.setState({
|
|
10308
10308
|
submitting: false
|
|
10309
10309
|
});
|