@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.esm.js
CHANGED
|
@@ -1716,7 +1716,7 @@ var fileActions = {
|
|
|
1716
1716
|
}).then(function (res) {
|
|
1717
1717
|
console.log('put the image');
|
|
1718
1718
|
return resolve(res);
|
|
1719
|
-
})
|
|
1719
|
+
})["catch"](function (err) {
|
|
1720
1720
|
return reject(err);
|
|
1721
1721
|
});
|
|
1722
1722
|
});
|
|
@@ -4810,7 +4810,7 @@ function _createSuper$u(Derived) { var hasNativeReflectConstruct = _isNativeRefl
|
|
|
4810
4810
|
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; } }
|
|
4811
4811
|
var DEFAULT_INPUT$1 = {
|
|
4812
4812
|
uploadingFile: false,
|
|
4813
|
-
value:
|
|
4813
|
+
value: ""
|
|
4814
4814
|
};
|
|
4815
4815
|
|
|
4816
4816
|
var FileInputComponent = /*#__PURE__*/function (_Component) {
|
|
@@ -4832,17 +4832,17 @@ var FileInputComponent = /*#__PURE__*/function (_Component) {
|
|
|
4832
4832
|
_defineProperty(_assertThisInitialized(_this), "state", {
|
|
4833
4833
|
inputs: [{
|
|
4834
4834
|
uploadingFile: false,
|
|
4835
|
-
value:
|
|
4835
|
+
value: ""
|
|
4836
4836
|
}]
|
|
4837
4837
|
});
|
|
4838
4838
|
|
|
4839
4839
|
_defineProperty(_assertThisInitialized(_this), "getAccept", function () {
|
|
4840
|
-
if (_typeof(_this.props.accept) ===
|
|
4840
|
+
if (_typeof(_this.props.accept) === "object") {
|
|
4841
4841
|
return _this.props.accept;
|
|
4842
4842
|
}
|
|
4843
4843
|
|
|
4844
|
-
if (typeof _this.props.accept ===
|
|
4845
|
-
var accept = _defineProperty({}, _this.props.accept, [".".concat(_.last(_this.props.accept.split(
|
|
4844
|
+
if (typeof _this.props.accept === "string") {
|
|
4845
|
+
var accept = _defineProperty({}, _this.props.accept, [".".concat(_.last(_this.props.accept.split("/")))]);
|
|
4846
4846
|
|
|
4847
4847
|
return accept;
|
|
4848
4848
|
}
|
|
@@ -4936,7 +4936,7 @@ var FileInputComponent = /*#__PURE__*/function (_Component) {
|
|
|
4936
4936
|
return _this.props.handleFile(file, newInputs);
|
|
4937
4937
|
|
|
4938
4938
|
case 9:
|
|
4939
|
-
_this.checkSetDisplayValue(input,
|
|
4939
|
+
_this.checkSetDisplayValue(input, "");
|
|
4940
4940
|
|
|
4941
4941
|
_context.next = 24;
|
|
4942
4942
|
break;
|
|
@@ -4958,7 +4958,7 @@ var FileInputComponent = /*#__PURE__*/function (_Component) {
|
|
|
4958
4958
|
case 20:
|
|
4959
4959
|
_context.prev = 20;
|
|
4960
4960
|
_context.t0 = _context["catch"](12);
|
|
4961
|
-
console.log(
|
|
4961
|
+
console.log("handleFile error", _context.t0);
|
|
4962
4962
|
|
|
4963
4963
|
_this.setState({
|
|
4964
4964
|
uploadingFile: false
|
|
@@ -5003,7 +5003,7 @@ var FileInputComponent = /*#__PURE__*/function (_Component) {
|
|
|
5003
5003
|
}, {
|
|
5004
5004
|
key: "setValue",
|
|
5005
5005
|
value: function setValue(val) {
|
|
5006
|
-
if (typeof val ===
|
|
5006
|
+
if (typeof val === "string") {
|
|
5007
5007
|
this.setState({
|
|
5008
5008
|
inputs: [{
|
|
5009
5009
|
uploadingImage: false,
|
|
@@ -5029,20 +5029,20 @@ var FileInputComponent = /*#__PURE__*/function (_Component) {
|
|
|
5029
5029
|
}, {
|
|
5030
5030
|
key: "getClassNames",
|
|
5031
5031
|
value: function getClassNames(input, inputsLength) {
|
|
5032
|
-
var classes =
|
|
5032
|
+
var classes = "clearfix imageInput";
|
|
5033
5033
|
|
|
5034
5034
|
if (input.uploadingFile) {
|
|
5035
|
-
classes +=
|
|
5035
|
+
classes += " imageInput-uploading";
|
|
5036
5036
|
} else if (!_.isEmpty(input.value) && !this.props.onlyAllowUpload) {
|
|
5037
|
-
classes +=
|
|
5037
|
+
classes += " imageInput-hasImage";
|
|
5038
5038
|
}
|
|
5039
5039
|
|
|
5040
5040
|
if (inputsLength === 1) {
|
|
5041
|
-
classes +=
|
|
5041
|
+
classes += " imageInput-only";
|
|
5042
5042
|
}
|
|
5043
5043
|
|
|
5044
5044
|
if (this.props.style && this.props.style.height && this.props.style.height < 150) {
|
|
5045
|
-
classes +=
|
|
5045
|
+
classes += " imageInput-condensed";
|
|
5046
5046
|
}
|
|
5047
5047
|
|
|
5048
5048
|
return classes;
|
|
@@ -5051,10 +5051,10 @@ var FileInputComponent = /*#__PURE__*/function (_Component) {
|
|
|
5051
5051
|
key: "getErrorState",
|
|
5052
5052
|
value: function getErrorState() {
|
|
5053
5053
|
if (!_.isUndefined(this.props.showError) && this.props.showError()) {
|
|
5054
|
-
return
|
|
5054
|
+
return " imageInput_upload--error";
|
|
5055
5055
|
}
|
|
5056
5056
|
|
|
5057
|
-
return
|
|
5057
|
+
return "";
|
|
5058
5058
|
}
|
|
5059
5059
|
}, {
|
|
5060
5060
|
key: "checkSetDisplayValue",
|
|
@@ -5073,7 +5073,7 @@ var FileInputComponent = /*#__PURE__*/function (_Component) {
|
|
|
5073
5073
|
key: "removeFile",
|
|
5074
5074
|
value: function removeFile(input) {
|
|
5075
5075
|
var newState = {};
|
|
5076
|
-
input.value =
|
|
5076
|
+
input.value = "";
|
|
5077
5077
|
|
|
5078
5078
|
var newInputs = _.clone(this.state.inputs);
|
|
5079
5079
|
|
|
@@ -5182,7 +5182,7 @@ var FileInputComponent = /*#__PURE__*/function (_Component) {
|
|
|
5182
5182
|
className: "imageInput_upload ".concat(_this3.getErrorState()),
|
|
5183
5183
|
style: _objectSpread$f({}, _this3.props.style)
|
|
5184
5184
|
}, getRootProps()), /*#__PURE__*/React.createElement("input", getInputProps()), /*#__PURE__*/React.createElement("div", {
|
|
5185
|
-
className: "".concat(isDragActive ?
|
|
5185
|
+
className: "".concat(isDragActive ? "imageInput_dropZoneActive" : "")
|
|
5186
5186
|
}, !_this3.props.simpleStyle && /*#__PURE__*/React.createElement("img", {
|
|
5187
5187
|
src: "https://s3-ap-southeast-2.amazonaws.com/pluss60-dev-media/pluss/document.svg",
|
|
5188
5188
|
className: "imageInput_icon",
|
|
@@ -5208,7 +5208,7 @@ var FileInputComponent = /*#__PURE__*/function (_Component) {
|
|
|
5208
5208
|
var _this4 = this;
|
|
5209
5209
|
|
|
5210
5210
|
return /*#__PURE__*/React.createElement("div", {
|
|
5211
|
-
className: "imageInputContainer clearfix ".concat(inputs.length === 1 ?
|
|
5211
|
+
className: "imageInputContainer clearfix ".concat(inputs.length === 1 ? "imageInputContainer-noPadding" : "", " ").concat(this.props.simpleStyle ? "imageInputContainer-simple" : ""),
|
|
5212
5212
|
style: _objectSpread$f({}, this.props.style)
|
|
5213
5213
|
}, inputs.map(function (input, index) {
|
|
5214
5214
|
return _this4.renderInput(input, index, inputs.length);
|
|
@@ -5236,7 +5236,7 @@ var mapStateToProps$5 = function mapStateToProps() {
|
|
|
5236
5236
|
};
|
|
5237
5237
|
|
|
5238
5238
|
var FileInput = connect(mapStateToProps$5, {}, null, {
|
|
5239
|
-
|
|
5239
|
+
forwardRef: true
|
|
5240
5240
|
})(FileInputComponent);
|
|
5241
5241
|
|
|
5242
5242
|
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; }
|
|
@@ -6758,7 +6758,7 @@ var ImageInputComponent = /*#__PURE__*/function (_Component) {
|
|
|
6758
6758
|
var RowId = selectedFolder.RowId,
|
|
6759
6759
|
Images = selectedFolder.Images;
|
|
6760
6760
|
var images = [].concat(_toConsumableArray(Images), [value]);
|
|
6761
|
-
fileActions.addImagesToFolder(RowId, _this5.props.auth.site, [value])
|
|
6761
|
+
fileActions.addImagesToFolder(RowId, _this5.props.auth.site, [value])["catch"](function (error) {
|
|
6762
6762
|
console.log('addImagesToFolder error', error);
|
|
6763
6763
|
});
|
|
6764
6764
|
selectedFolder.Images = images;
|
|
@@ -7344,7 +7344,7 @@ var mapStateToProps$2 = function mapStateToProps(state) {
|
|
|
7344
7344
|
};
|
|
7345
7345
|
|
|
7346
7346
|
var ImageInput = connect(mapStateToProps$2, {}, null, {
|
|
7347
|
-
|
|
7347
|
+
forwardRef: true
|
|
7348
7348
|
})(ImageInputComponent);
|
|
7349
7349
|
|
|
7350
7350
|
function _createSuper$n(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct$n(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
@@ -9230,7 +9230,7 @@ var AudienceSelector = /*#__PURE__*/function (_Component) {
|
|
|
9230
9230
|
AudienceTagList = _this$state.AudienceTagList;
|
|
9231
9231
|
var categoryTags = categories.map(function (c) {
|
|
9232
9232
|
return {
|
|
9233
|
-
AudienceType:
|
|
9233
|
+
AudienceType: "Category",
|
|
9234
9234
|
AudienceTypeSelection: c.Key,
|
|
9235
9235
|
Id: "category_".concat(c.Key),
|
|
9236
9236
|
Title: c.Title
|
|
@@ -9238,7 +9238,7 @@ var AudienceSelector = /*#__PURE__*/function (_Component) {
|
|
|
9238
9238
|
});
|
|
9239
9239
|
var userTypeTags = types.map(function (t) {
|
|
9240
9240
|
return {
|
|
9241
|
-
AudienceType:
|
|
9241
|
+
AudienceType: "UserType",
|
|
9242
9242
|
AudienceTypeSelection: t.typeName,
|
|
9243
9243
|
Id: "userType_".concat(t.typeName),
|
|
9244
9244
|
Title: "User Type: ".concat(t.displayName)
|
|
@@ -9246,7 +9246,7 @@ var AudienceSelector = /*#__PURE__*/function (_Component) {
|
|
|
9246
9246
|
});
|
|
9247
9247
|
var userTagTags = tagList.map(function (t) {
|
|
9248
9248
|
return {
|
|
9249
|
-
AudienceType:
|
|
9249
|
+
AudienceType: "UserTags",
|
|
9250
9250
|
AudienceTypeSelection: t.Id,
|
|
9251
9251
|
Id: "userTag_".concat(t.Id),
|
|
9252
9252
|
Title: "User Tag: ".concat(t.Title)
|
|
@@ -9280,26 +9280,26 @@ var AudienceSelector = /*#__PURE__*/function (_Component) {
|
|
|
9280
9280
|
|
|
9281
9281
|
_this.state = {
|
|
9282
9282
|
categories: [{
|
|
9283
|
-
Title:
|
|
9284
|
-
Key:
|
|
9285
|
-
ShortName:
|
|
9283
|
+
Title: "All Primary Users",
|
|
9284
|
+
Key: "resident",
|
|
9285
|
+
ShortName: "Primary"
|
|
9286
9286
|
}, {
|
|
9287
|
-
Title:
|
|
9288
|
-
Key:
|
|
9289
|
-
ShortName:
|
|
9287
|
+
Title: "All Staff Users",
|
|
9288
|
+
Key: "staff",
|
|
9289
|
+
ShortName: "Staff"
|
|
9290
9290
|
}, {
|
|
9291
|
-
Title:
|
|
9292
|
-
Key:
|
|
9293
|
-
ShortName:
|
|
9291
|
+
Title: "All Linked Users",
|
|
9292
|
+
Key: "family",
|
|
9293
|
+
ShortName: "Linked"
|
|
9294
9294
|
}],
|
|
9295
9295
|
types: [],
|
|
9296
|
-
AudienceType: props.audienceType ||
|
|
9296
|
+
AudienceType: props.audienceType || "All",
|
|
9297
9297
|
showInclude: false,
|
|
9298
9298
|
includeList: [],
|
|
9299
9299
|
showExclude: false,
|
|
9300
9300
|
excludeList: [],
|
|
9301
|
-
Type:
|
|
9302
|
-
Category:
|
|
9301
|
+
Type: "",
|
|
9302
|
+
Category: "",
|
|
9303
9303
|
userList: [],
|
|
9304
9304
|
tagList: [],
|
|
9305
9305
|
AudienceTagList: props.audienceTypeSelection || []
|
|
@@ -9329,7 +9329,7 @@ var AudienceSelector = /*#__PURE__*/function (_Component) {
|
|
|
9329
9329
|
}, {
|
|
9330
9330
|
key: "onSubmit",
|
|
9331
9331
|
value: function onSubmit() {
|
|
9332
|
-
if (this.state.AudienceType ===
|
|
9332
|
+
if (this.state.AudienceType === "User" && _.isEmpty(this.state.includeList)) {
|
|
9333
9333
|
this.setState({
|
|
9334
9334
|
showInclude: true
|
|
9335
9335
|
});
|
|
@@ -9349,9 +9349,9 @@ var AudienceSelector = /*#__PURE__*/function (_Component) {
|
|
|
9349
9349
|
Category = _this$state2.Category,
|
|
9350
9350
|
Tag = _this$state2.Tag,
|
|
9351
9351
|
Type = _this$state2.Type;
|
|
9352
|
-
if (AudienceType ===
|
|
9353
|
-
if (AudienceType ===
|
|
9354
|
-
if (AudienceType ===
|
|
9352
|
+
if (AudienceType === "Custom") return AudienceTagList || [];
|
|
9353
|
+
if (AudienceType === "Category") return Category;
|
|
9354
|
+
if (AudienceType === "UserTags") return Tag;
|
|
9355
9355
|
return Type;
|
|
9356
9356
|
}
|
|
9357
9357
|
}, {
|
|
@@ -9373,7 +9373,7 @@ var AudienceSelector = /*#__PURE__*/function (_Component) {
|
|
|
9373
9373
|
_this2.setState({
|
|
9374
9374
|
userList: res.data.results.Items
|
|
9375
9375
|
});
|
|
9376
|
-
})
|
|
9376
|
+
})["catch"](function (error) {});
|
|
9377
9377
|
}
|
|
9378
9378
|
}, {
|
|
9379
9379
|
key: "getUserTags",
|
|
@@ -9388,7 +9388,7 @@ var AudienceSelector = /*#__PURE__*/function (_Component) {
|
|
|
9388
9388
|
});
|
|
9389
9389
|
})
|
|
9390
9390
|
});
|
|
9391
|
-
})
|
|
9391
|
+
})["catch"](function (error) {});
|
|
9392
9392
|
}
|
|
9393
9393
|
}, {
|
|
9394
9394
|
key: "setType",
|
|
@@ -9396,9 +9396,9 @@ var AudienceSelector = /*#__PURE__*/function (_Component) {
|
|
|
9396
9396
|
var newState = {
|
|
9397
9397
|
AudienceType: type
|
|
9398
9398
|
};
|
|
9399
|
-
if (type ===
|
|
9400
|
-
if (type ===
|
|
9401
|
-
if (type ===
|
|
9399
|
+
if (type === "Custom") newState.AudienceTagList = selection;
|
|
9400
|
+
if (type === "UserType") newState.Type = selection;
|
|
9401
|
+
if (type === "Category") newState.Category = selection;
|
|
9402
9402
|
this.setState(newState);
|
|
9403
9403
|
}
|
|
9404
9404
|
}, {
|
|
@@ -9406,8 +9406,8 @@ var AudienceSelector = /*#__PURE__*/function (_Component) {
|
|
|
9406
9406
|
value: function onChangeOption(type) {
|
|
9407
9407
|
this.setState({
|
|
9408
9408
|
AudienceType: type,
|
|
9409
|
-
Type:
|
|
9410
|
-
Category:
|
|
9409
|
+
Type: "",
|
|
9410
|
+
Category: "",
|
|
9411
9411
|
includeList: [],
|
|
9412
9412
|
excludeList: [],
|
|
9413
9413
|
AudienceTagList: []
|
|
@@ -9420,57 +9420,57 @@ var AudienceSelector = /*#__PURE__*/function (_Component) {
|
|
|
9420
9420
|
var _this4 = this;
|
|
9421
9421
|
|
|
9422
9422
|
var options = [{
|
|
9423
|
-
Label:
|
|
9424
|
-
Value:
|
|
9423
|
+
Label: "All users",
|
|
9424
|
+
Value: "All",
|
|
9425
9425
|
onChange: function onChange() {
|
|
9426
|
-
return _this4.onChangeOption(
|
|
9426
|
+
return _this4.onChangeOption("All");
|
|
9427
9427
|
}
|
|
9428
9428
|
}];
|
|
9429
9429
|
|
|
9430
9430
|
if (this.props.custom) {
|
|
9431
9431
|
options.push({
|
|
9432
|
-
Label:
|
|
9433
|
-
Value:
|
|
9432
|
+
Label: "Custom",
|
|
9433
|
+
Value: "Custom",
|
|
9434
9434
|
onChange: function onChange() {
|
|
9435
|
-
return _this4.onChangeOption(
|
|
9435
|
+
return _this4.onChangeOption("Custom");
|
|
9436
9436
|
}
|
|
9437
9437
|
});
|
|
9438
9438
|
} else {
|
|
9439
9439
|
options.push({
|
|
9440
|
-
Label:
|
|
9441
|
-
Value:
|
|
9440
|
+
Label: "By user category",
|
|
9441
|
+
Value: "Category",
|
|
9442
9442
|
onChange: function onChange() {
|
|
9443
|
-
return _this4.onChangeOption(
|
|
9443
|
+
return _this4.onChangeOption("Category");
|
|
9444
9444
|
}
|
|
9445
9445
|
});
|
|
9446
9446
|
}
|
|
9447
9447
|
|
|
9448
9448
|
if (!this.props.disallowUserType) {
|
|
9449
9449
|
options.push({
|
|
9450
|
-
Label:
|
|
9451
|
-
Value:
|
|
9450
|
+
Label: "By user type",
|
|
9451
|
+
Value: "UserType",
|
|
9452
9452
|
onChange: function onChange() {
|
|
9453
|
-
return _this4.onChangeOption(
|
|
9453
|
+
return _this4.onChangeOption("UserType");
|
|
9454
9454
|
}
|
|
9455
9455
|
});
|
|
9456
9456
|
}
|
|
9457
9457
|
|
|
9458
9458
|
if (this.props.allowTags) {
|
|
9459
9459
|
options.push({
|
|
9460
|
-
Label:
|
|
9461
|
-
Value:
|
|
9460
|
+
Label: "By user tag",
|
|
9461
|
+
Value: "UserTags",
|
|
9462
9462
|
onChange: function onChange() {
|
|
9463
|
-
return _this4.onChangeOption(
|
|
9463
|
+
return _this4.onChangeOption("UserTags");
|
|
9464
9464
|
}
|
|
9465
9465
|
});
|
|
9466
9466
|
}
|
|
9467
9467
|
|
|
9468
9468
|
if (!this.props.disallowSingleUsers) {
|
|
9469
9469
|
options.push({
|
|
9470
|
-
Label:
|
|
9471
|
-
Value:
|
|
9470
|
+
Label: "To single users",
|
|
9471
|
+
Value: "User",
|
|
9472
9472
|
onChange: function onChange() {
|
|
9473
|
-
return _this4.onChangeOption(
|
|
9473
|
+
return _this4.onChangeOption("User");
|
|
9474
9474
|
}
|
|
9475
9475
|
});
|
|
9476
9476
|
}
|
|
@@ -9483,11 +9483,11 @@ var AudienceSelector = /*#__PURE__*/function (_Component) {
|
|
|
9483
9483
|
var _this$state3 = this.state,
|
|
9484
9484
|
AudienceType = _this$state3.AudienceType,
|
|
9485
9485
|
includeList = _this$state3.includeList;
|
|
9486
|
-
if (AudienceType ===
|
|
9487
|
-
if (AudienceType ===
|
|
9488
|
-
if (AudienceType ===
|
|
9489
|
-
if (AudienceType ===
|
|
9490
|
-
if (AudienceType ===
|
|
9486
|
+
if (AudienceType === "Custom" && !this.validateCustom()) return false;
|
|
9487
|
+
if (AudienceType === "Category" && !this.validateCategory()) return false;
|
|
9488
|
+
if (AudienceType === "UserType" && !this.validateType()) return false;
|
|
9489
|
+
if (AudienceType === "User" && _.isEmpty(includeList)) return false;
|
|
9490
|
+
if (AudienceType === "UserTags" && !this.validateTag()) return false;
|
|
9491
9491
|
return true;
|
|
9492
9492
|
}
|
|
9493
9493
|
}, {
|
|
@@ -9513,7 +9513,7 @@ var AudienceSelector = /*#__PURE__*/function (_Component) {
|
|
|
9513
9513
|
return typeObject.displayName;
|
|
9514
9514
|
}
|
|
9515
9515
|
|
|
9516
|
-
return
|
|
9516
|
+
return "";
|
|
9517
9517
|
}
|
|
9518
9518
|
}, {
|
|
9519
9519
|
key: "getTagTitle",
|
|
@@ -9528,7 +9528,7 @@ var AudienceSelector = /*#__PURE__*/function (_Component) {
|
|
|
9528
9528
|
return tag.Title;
|
|
9529
9529
|
}
|
|
9530
9530
|
|
|
9531
|
-
return
|
|
9531
|
+
return "";
|
|
9532
9532
|
}
|
|
9533
9533
|
}, {
|
|
9534
9534
|
key: "getUserTypes",
|
|
@@ -9549,7 +9549,7 @@ var AudienceSelector = /*#__PURE__*/function (_Component) {
|
|
|
9549
9549
|
return c.Key === e.category;
|
|
9550
9550
|
});
|
|
9551
9551
|
|
|
9552
|
-
var shortName = category ? "(".concat(category.ShortName, ") ") :
|
|
9552
|
+
var shortName = category ? "(".concat(category.ShortName, ") ") : "";
|
|
9553
9553
|
e.Title = "".concat(shortName, " ").concat(e.Title);
|
|
9554
9554
|
}
|
|
9555
9555
|
});
|
|
@@ -9558,30 +9558,30 @@ var AudienceSelector = /*#__PURE__*/function (_Component) {
|
|
|
9558
9558
|
};
|
|
9559
9559
|
|
|
9560
9560
|
if (!_.some(res.data, function (t) {
|
|
9561
|
-
return t.category ===
|
|
9561
|
+
return t.category === "family";
|
|
9562
9562
|
})) {
|
|
9563
9563
|
newState.categories = _.filter(_this7.state.categories, function (c) {
|
|
9564
|
-
return c.Key !==
|
|
9564
|
+
return c.Key !== "family";
|
|
9565
9565
|
});
|
|
9566
9566
|
}
|
|
9567
9567
|
|
|
9568
9568
|
_this7.setState(newState);
|
|
9569
|
-
})
|
|
9569
|
+
})["catch"](function (error) {});
|
|
9570
9570
|
}
|
|
9571
9571
|
}, {
|
|
9572
9572
|
key: "getUserList",
|
|
9573
9573
|
value: function getUserList() {
|
|
9574
9574
|
var _this8 = this;
|
|
9575
9575
|
|
|
9576
|
-
if (this.state.AudienceType ===
|
|
9576
|
+
if (this.state.AudienceType === "UserType" && !_.isEmpty(this.state.Type)) {
|
|
9577
9577
|
var users = [];
|
|
9578
9578
|
this.state.userList.forEach(function (element) {
|
|
9579
9579
|
if (element.type !== _this8.state.Type) users.push(element);
|
|
9580
9580
|
});
|
|
9581
|
-
return _.sortBy(users,
|
|
9581
|
+
return _.sortBy(users, "displayName");
|
|
9582
9582
|
}
|
|
9583
9583
|
|
|
9584
|
-
if (this.state.AudienceType ===
|
|
9584
|
+
if (this.state.AudienceType === "Category" && !_.isEmpty(this.state.Category)) {
|
|
9585
9585
|
var _users = [];
|
|
9586
9586
|
|
|
9587
9587
|
var types = _.filter(this.state.types, function (type) {
|
|
@@ -9595,10 +9595,10 @@ var AudienceSelector = /*#__PURE__*/function (_Component) {
|
|
|
9595
9595
|
_users.push(element);
|
|
9596
9596
|
}
|
|
9597
9597
|
});
|
|
9598
|
-
return _.sortBy(_users,
|
|
9598
|
+
return _.sortBy(_users, "displayName");
|
|
9599
9599
|
}
|
|
9600
9600
|
|
|
9601
|
-
return _.sortBy(this.state.userList,
|
|
9601
|
+
return _.sortBy(this.state.userList, "displayName");
|
|
9602
9602
|
}
|
|
9603
9603
|
}, {
|
|
9604
9604
|
key: "selectCat",
|
|
@@ -9623,7 +9623,7 @@ var AudienceSelector = /*#__PURE__*/function (_Component) {
|
|
|
9623
9623
|
return typeObject.Title;
|
|
9624
9624
|
}
|
|
9625
9625
|
|
|
9626
|
-
return
|
|
9626
|
+
return "";
|
|
9627
9627
|
}
|
|
9628
9628
|
}, {
|
|
9629
9629
|
key: "validateCategory",
|
|
@@ -9643,7 +9643,7 @@ var AudienceSelector = /*#__PURE__*/function (_Component) {
|
|
|
9643
9643
|
}, {
|
|
9644
9644
|
key: "showUserPickers",
|
|
9645
9645
|
value: function showUserPickers(isInclude) {
|
|
9646
|
-
if (isInclude && this.state.AudienceType ===
|
|
9646
|
+
if (isInclude && this.state.AudienceType === "User") {
|
|
9647
9647
|
return true;
|
|
9648
9648
|
}
|
|
9649
9649
|
|
|
@@ -9655,15 +9655,15 @@ var AudienceSelector = /*#__PURE__*/function (_Component) {
|
|
|
9655
9655
|
return false;
|
|
9656
9656
|
}
|
|
9657
9657
|
|
|
9658
|
-
if (isInclude && this.state.AudienceType ===
|
|
9658
|
+
if (isInclude && this.state.AudienceType === "All") {
|
|
9659
9659
|
return false;
|
|
9660
9660
|
}
|
|
9661
9661
|
|
|
9662
|
-
if (!isInclude && this.state.AudienceType ===
|
|
9662
|
+
if (!isInclude && this.state.AudienceType === "User") {
|
|
9663
9663
|
return false;
|
|
9664
9664
|
}
|
|
9665
9665
|
|
|
9666
|
-
if (this.state.AudienceType ===
|
|
9666
|
+
if (this.state.AudienceType === "Category" && _.isEmpty(this.state.Category) || this.state.AudienceType === "UserType" && _.isEmpty(this.state.Type)) {
|
|
9667
9667
|
return false;
|
|
9668
9668
|
}
|
|
9669
9669
|
|
|
@@ -9674,15 +9674,15 @@ var AudienceSelector = /*#__PURE__*/function (_Component) {
|
|
|
9674
9674
|
value: function getUserExcludeList() {
|
|
9675
9675
|
var _this10 = this;
|
|
9676
9676
|
|
|
9677
|
-
if (this.state.AudienceType ===
|
|
9677
|
+
if (this.state.AudienceType === "UserType" && !_.isEmpty(this.state.Type)) {
|
|
9678
9678
|
var users = [];
|
|
9679
9679
|
this.state.userList.forEach(function (element) {
|
|
9680
9680
|
if (element.type === _this10.state.Type) users.push(element);
|
|
9681
9681
|
});
|
|
9682
|
-
return _.sortBy(users,
|
|
9682
|
+
return _.sortBy(users, "displayName");
|
|
9683
9683
|
}
|
|
9684
9684
|
|
|
9685
|
-
if (this.state.AudienceType ===
|
|
9685
|
+
if (this.state.AudienceType === "Category" && !_.isEmpty(this.state.Category)) {
|
|
9686
9686
|
var _users2 = [];
|
|
9687
9687
|
|
|
9688
9688
|
var types = _.filter(this.state.types, function (type) {
|
|
@@ -9696,10 +9696,10 @@ var AudienceSelector = /*#__PURE__*/function (_Component) {
|
|
|
9696
9696
|
_users2.push(element);
|
|
9697
9697
|
}
|
|
9698
9698
|
});
|
|
9699
|
-
return _.sortBy(_users2,
|
|
9699
|
+
return _.sortBy(_users2, "displayName");
|
|
9700
9700
|
}
|
|
9701
9701
|
|
|
9702
|
-
return _.sortBy(this.state.userList,
|
|
9702
|
+
return _.sortBy(this.state.userList, "displayName");
|
|
9703
9703
|
}
|
|
9704
9704
|
}, {
|
|
9705
9705
|
key: "addToInc",
|
|
@@ -9773,12 +9773,12 @@ var AudienceSelector = /*#__PURE__*/function (_Component) {
|
|
|
9773
9773
|
}, /*#__PURE__*/React.createElement(Text, {
|
|
9774
9774
|
type: "formTitleSmall",
|
|
9775
9775
|
className: "marginBottom-16"
|
|
9776
|
-
}, "Exclude Users From Selection ", "(".concat(this.state.excludeList.length, ")"))), /*#__PURE__*/React.createElement(FontAwesome, {
|
|
9776
|
+
}, "Exclude Users From Selection", " ", "(".concat(this.state.excludeList.length, ")"))), /*#__PURE__*/React.createElement(FontAwesome, {
|
|
9777
9777
|
style: {
|
|
9778
9778
|
color: COLOUR_DUSK,
|
|
9779
9779
|
fontSize: 12
|
|
9780
9780
|
},
|
|
9781
|
-
name: this.state.showExclude ?
|
|
9781
|
+
name: this.state.showExclude ? "chevron-up" : "chevron-down"
|
|
9782
9782
|
})), this.state.showExclude && /*#__PURE__*/React.createElement(exportObj$1, {
|
|
9783
9783
|
add: this.addToEx.bind(this),
|
|
9784
9784
|
remove: this.removeUserEx.bind(this),
|
|
@@ -9810,12 +9810,12 @@ var AudienceSelector = /*#__PURE__*/function (_Component) {
|
|
|
9810
9810
|
}, /*#__PURE__*/React.createElement(Text, {
|
|
9811
9811
|
type: "formTitleSmall",
|
|
9812
9812
|
className: "marginBottom-16"
|
|
9813
|
-
}, this.state.AudienceType !==
|
|
9813
|
+
}, this.state.AudienceType !== "User" ? "Add Other" : "Select", " ", "Users ", "(".concat(this.state.includeList.length, ")"))), /*#__PURE__*/React.createElement(FontAwesome, {
|
|
9814
9814
|
style: {
|
|
9815
9815
|
color: COLOUR_DUSK,
|
|
9816
9816
|
fontSize: 12
|
|
9817
9817
|
},
|
|
9818
|
-
name: this.state.showInclude ?
|
|
9818
|
+
name: this.state.showInclude ? "chevron-up" : "chevron-down"
|
|
9819
9819
|
})), this.state.showInclude && /*#__PURE__*/React.createElement(exportObj$1, {
|
|
9820
9820
|
add: this.addToInc.bind(this),
|
|
9821
9821
|
remove: this.removeUserInc.bind(this),
|
|
@@ -9876,7 +9876,7 @@ var AudienceSelector = /*#__PURE__*/function (_Component) {
|
|
|
9876
9876
|
}, {
|
|
9877
9877
|
key: "renderCustom",
|
|
9878
9878
|
value: function renderCustom() {
|
|
9879
|
-
if (this.state.AudienceType !==
|
|
9879
|
+
if (this.state.AudienceType !== "Custom") return null;
|
|
9880
9880
|
return /*#__PURE__*/React.createElement("div", {
|
|
9881
9881
|
className: "optionsContent_bottom"
|
|
9882
9882
|
}, /*#__PURE__*/React.createElement(Text, {
|
|
@@ -9894,17 +9894,17 @@ var AudienceSelector = /*#__PURE__*/function (_Component) {
|
|
|
9894
9894
|
return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Text, {
|
|
9895
9895
|
type: "formTitleSmall",
|
|
9896
9896
|
className: "marginBottom-16"
|
|
9897
|
-
}, this.props.title ||
|
|
9897
|
+
}, this.props.title || "Target Audience"), /*#__PURE__*/React.createElement(RadioButton, {
|
|
9898
9898
|
isActive: this.state.AudienceType,
|
|
9899
9899
|
rowStyle: {
|
|
9900
|
-
flexDirection:
|
|
9900
|
+
flexDirection: "column"
|
|
9901
9901
|
},
|
|
9902
9902
|
buttonStyle: {
|
|
9903
9903
|
marginBottom: 8
|
|
9904
9904
|
},
|
|
9905
9905
|
options: this.getOptions(),
|
|
9906
9906
|
disabled: this.props.disabled
|
|
9907
|
-
}), this.state.AudienceType ===
|
|
9907
|
+
}), this.state.AudienceType === "Category" && /*#__PURE__*/React.createElement(DropdownInput, {
|
|
9908
9908
|
id: "typeSelect" // label='User Category'
|
|
9909
9909
|
,
|
|
9910
9910
|
alwaysShowLabel: true,
|
|
@@ -9924,7 +9924,7 @@ var AudienceSelector = /*#__PURE__*/function (_Component) {
|
|
|
9924
9924
|
},
|
|
9925
9925
|
isRequired: true,
|
|
9926
9926
|
disabled: this.props.disabled
|
|
9927
|
-
}), this.state.AudienceType ===
|
|
9927
|
+
}), this.state.AudienceType === "UserType" && /*#__PURE__*/React.createElement(DropdownInput, {
|
|
9928
9928
|
id: "typeSelect" // label='User Type'
|
|
9929
9929
|
,
|
|
9930
9930
|
alwaysShowLabel: true,
|
|
@@ -9944,7 +9944,7 @@ var AudienceSelector = /*#__PURE__*/function (_Component) {
|
|
|
9944
9944
|
},
|
|
9945
9945
|
isRequired: true,
|
|
9946
9946
|
disabled: this.props.disabled
|
|
9947
|
-
}), this.state.AudienceType ===
|
|
9947
|
+
}), this.state.AudienceType === "UserTags" && /*#__PURE__*/React.createElement(DropdownInput, {
|
|
9948
9948
|
id: "tagSelect",
|
|
9949
9949
|
alwaysShowLabel: true,
|
|
9950
9950
|
placeholder: "User Tag",
|
|
@@ -9973,7 +9973,7 @@ var AudienceSelector = /*#__PURE__*/function (_Component) {
|
|
|
9973
9973
|
var toExport = connect(null, {
|
|
9974
9974
|
setAuth: setAuth
|
|
9975
9975
|
}, null, {
|
|
9976
|
-
|
|
9976
|
+
forwardRef: true
|
|
9977
9977
|
})(AudienceSelector);
|
|
9978
9978
|
|
|
9979
9979
|
function _createSuper$6(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct$6(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
@@ -10305,7 +10305,7 @@ var MakerPopup = /*#__PURE__*/function (_Component) {
|
|
|
10305
10305
|
submitting: false,
|
|
10306
10306
|
asset: res.data.resultUrl
|
|
10307
10307
|
});
|
|
10308
|
-
})
|
|
10308
|
+
})["catch"](function (err) {
|
|
10309
10309
|
_this.setState({
|
|
10310
10310
|
submitting: false
|
|
10311
10311
|
});
|