@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.cjs.js
CHANGED
|
@@ -1746,7 +1746,7 @@ var fileActions = {
|
|
|
1746
1746
|
}).then(function (res) {
|
|
1747
1747
|
console.log('put the image');
|
|
1748
1748
|
return resolve(res);
|
|
1749
|
-
})
|
|
1749
|
+
})["catch"](function (err) {
|
|
1750
1750
|
return reject(err);
|
|
1751
1751
|
});
|
|
1752
1752
|
});
|
|
@@ -4840,7 +4840,7 @@ function _createSuper$u(Derived) { var hasNativeReflectConstruct = _isNativeRefl
|
|
|
4840
4840
|
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; } }
|
|
4841
4841
|
var DEFAULT_INPUT$1 = {
|
|
4842
4842
|
uploadingFile: false,
|
|
4843
|
-
value:
|
|
4843
|
+
value: ""
|
|
4844
4844
|
};
|
|
4845
4845
|
|
|
4846
4846
|
var FileInputComponent = /*#__PURE__*/function (_Component) {
|
|
@@ -4862,17 +4862,17 @@ var FileInputComponent = /*#__PURE__*/function (_Component) {
|
|
|
4862
4862
|
_defineProperty__default['default'](_assertThisInitialized__default['default'](_this), "state", {
|
|
4863
4863
|
inputs: [{
|
|
4864
4864
|
uploadingFile: false,
|
|
4865
|
-
value:
|
|
4865
|
+
value: ""
|
|
4866
4866
|
}]
|
|
4867
4867
|
});
|
|
4868
4868
|
|
|
4869
4869
|
_defineProperty__default['default'](_assertThisInitialized__default['default'](_this), "getAccept", function () {
|
|
4870
|
-
if (_typeof__default['default'](_this.props.accept) ===
|
|
4870
|
+
if (_typeof__default['default'](_this.props.accept) === "object") {
|
|
4871
4871
|
return _this.props.accept;
|
|
4872
4872
|
}
|
|
4873
4873
|
|
|
4874
|
-
if (typeof _this.props.accept ===
|
|
4875
|
-
var accept = _defineProperty__default['default']({}, _this.props.accept, [".".concat(___default['default'].last(_this.props.accept.split(
|
|
4874
|
+
if (typeof _this.props.accept === "string") {
|
|
4875
|
+
var accept = _defineProperty__default['default']({}, _this.props.accept, [".".concat(___default['default'].last(_this.props.accept.split("/")))]);
|
|
4876
4876
|
|
|
4877
4877
|
return accept;
|
|
4878
4878
|
}
|
|
@@ -4966,7 +4966,7 @@ var FileInputComponent = /*#__PURE__*/function (_Component) {
|
|
|
4966
4966
|
return _this.props.handleFile(file, newInputs);
|
|
4967
4967
|
|
|
4968
4968
|
case 9:
|
|
4969
|
-
_this.checkSetDisplayValue(input,
|
|
4969
|
+
_this.checkSetDisplayValue(input, "");
|
|
4970
4970
|
|
|
4971
4971
|
_context.next = 24;
|
|
4972
4972
|
break;
|
|
@@ -4988,7 +4988,7 @@ var FileInputComponent = /*#__PURE__*/function (_Component) {
|
|
|
4988
4988
|
case 20:
|
|
4989
4989
|
_context.prev = 20;
|
|
4990
4990
|
_context.t0 = _context["catch"](12);
|
|
4991
|
-
console.log(
|
|
4991
|
+
console.log("handleFile error", _context.t0);
|
|
4992
4992
|
|
|
4993
4993
|
_this.setState({
|
|
4994
4994
|
uploadingFile: false
|
|
@@ -5033,7 +5033,7 @@ var FileInputComponent = /*#__PURE__*/function (_Component) {
|
|
|
5033
5033
|
}, {
|
|
5034
5034
|
key: "setValue",
|
|
5035
5035
|
value: function setValue(val) {
|
|
5036
|
-
if (typeof val ===
|
|
5036
|
+
if (typeof val === "string") {
|
|
5037
5037
|
this.setState({
|
|
5038
5038
|
inputs: [{
|
|
5039
5039
|
uploadingImage: false,
|
|
@@ -5059,20 +5059,20 @@ var FileInputComponent = /*#__PURE__*/function (_Component) {
|
|
|
5059
5059
|
}, {
|
|
5060
5060
|
key: "getClassNames",
|
|
5061
5061
|
value: function getClassNames(input, inputsLength) {
|
|
5062
|
-
var classes =
|
|
5062
|
+
var classes = "clearfix imageInput";
|
|
5063
5063
|
|
|
5064
5064
|
if (input.uploadingFile) {
|
|
5065
|
-
classes +=
|
|
5065
|
+
classes += " imageInput-uploading";
|
|
5066
5066
|
} else if (!___default['default'].isEmpty(input.value) && !this.props.onlyAllowUpload) {
|
|
5067
|
-
classes +=
|
|
5067
|
+
classes += " imageInput-hasImage";
|
|
5068
5068
|
}
|
|
5069
5069
|
|
|
5070
5070
|
if (inputsLength === 1) {
|
|
5071
|
-
classes +=
|
|
5071
|
+
classes += " imageInput-only";
|
|
5072
5072
|
}
|
|
5073
5073
|
|
|
5074
5074
|
if (this.props.style && this.props.style.height && this.props.style.height < 150) {
|
|
5075
|
-
classes +=
|
|
5075
|
+
classes += " imageInput-condensed";
|
|
5076
5076
|
}
|
|
5077
5077
|
|
|
5078
5078
|
return classes;
|
|
@@ -5081,10 +5081,10 @@ var FileInputComponent = /*#__PURE__*/function (_Component) {
|
|
|
5081
5081
|
key: "getErrorState",
|
|
5082
5082
|
value: function getErrorState() {
|
|
5083
5083
|
if (!___default['default'].isUndefined(this.props.showError) && this.props.showError()) {
|
|
5084
|
-
return
|
|
5084
|
+
return " imageInput_upload--error";
|
|
5085
5085
|
}
|
|
5086
5086
|
|
|
5087
|
-
return
|
|
5087
|
+
return "";
|
|
5088
5088
|
}
|
|
5089
5089
|
}, {
|
|
5090
5090
|
key: "checkSetDisplayValue",
|
|
@@ -5103,7 +5103,7 @@ var FileInputComponent = /*#__PURE__*/function (_Component) {
|
|
|
5103
5103
|
key: "removeFile",
|
|
5104
5104
|
value: function removeFile(input) {
|
|
5105
5105
|
var newState = {};
|
|
5106
|
-
input.value =
|
|
5106
|
+
input.value = "";
|
|
5107
5107
|
|
|
5108
5108
|
var newInputs = ___default['default'].clone(this.state.inputs);
|
|
5109
5109
|
|
|
@@ -5212,7 +5212,7 @@ var FileInputComponent = /*#__PURE__*/function (_Component) {
|
|
|
5212
5212
|
className: "imageInput_upload ".concat(_this3.getErrorState()),
|
|
5213
5213
|
style: _objectSpread$f({}, _this3.props.style)
|
|
5214
5214
|
}, getRootProps()), /*#__PURE__*/React__default['default'].createElement("input", getInputProps()), /*#__PURE__*/React__default['default'].createElement("div", {
|
|
5215
|
-
className: "".concat(isDragActive ?
|
|
5215
|
+
className: "".concat(isDragActive ? "imageInput_dropZoneActive" : "")
|
|
5216
5216
|
}, !_this3.props.simpleStyle && /*#__PURE__*/React__default['default'].createElement("img", {
|
|
5217
5217
|
src: "https://s3-ap-southeast-2.amazonaws.com/pluss60-dev-media/pluss/document.svg",
|
|
5218
5218
|
className: "imageInput_icon",
|
|
@@ -5238,7 +5238,7 @@ var FileInputComponent = /*#__PURE__*/function (_Component) {
|
|
|
5238
5238
|
var _this4 = this;
|
|
5239
5239
|
|
|
5240
5240
|
return /*#__PURE__*/React__default['default'].createElement("div", {
|
|
5241
|
-
className: "imageInputContainer clearfix ".concat(inputs.length === 1 ?
|
|
5241
|
+
className: "imageInputContainer clearfix ".concat(inputs.length === 1 ? "imageInputContainer-noPadding" : "", " ").concat(this.props.simpleStyle ? "imageInputContainer-simple" : ""),
|
|
5242
5242
|
style: _objectSpread$f({}, this.props.style)
|
|
5243
5243
|
}, inputs.map(function (input, index) {
|
|
5244
5244
|
return _this4.renderInput(input, index, inputs.length);
|
|
@@ -5266,7 +5266,7 @@ var mapStateToProps$5 = function mapStateToProps() {
|
|
|
5266
5266
|
};
|
|
5267
5267
|
|
|
5268
5268
|
var FileInput = reactRedux.connect(mapStateToProps$5, {}, null, {
|
|
5269
|
-
|
|
5269
|
+
forwardRef: true
|
|
5270
5270
|
})(FileInputComponent);
|
|
5271
5271
|
|
|
5272
5272
|
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; }
|
|
@@ -6788,7 +6788,7 @@ var ImageInputComponent = /*#__PURE__*/function (_Component) {
|
|
|
6788
6788
|
var RowId = selectedFolder.RowId,
|
|
6789
6789
|
Images = selectedFolder.Images;
|
|
6790
6790
|
var images = [].concat(_toConsumableArray__default['default'](Images), [value]);
|
|
6791
|
-
fileActions.addImagesToFolder(RowId, _this5.props.auth.site, [value])
|
|
6791
|
+
fileActions.addImagesToFolder(RowId, _this5.props.auth.site, [value])["catch"](function (error) {
|
|
6792
6792
|
console.log('addImagesToFolder error', error);
|
|
6793
6793
|
});
|
|
6794
6794
|
selectedFolder.Images = images;
|
|
@@ -7374,7 +7374,7 @@ var mapStateToProps$2 = function mapStateToProps(state) {
|
|
|
7374
7374
|
};
|
|
7375
7375
|
|
|
7376
7376
|
var ImageInput = reactRedux.connect(mapStateToProps$2, {}, null, {
|
|
7377
|
-
|
|
7377
|
+
forwardRef: true
|
|
7378
7378
|
})(ImageInputComponent);
|
|
7379
7379
|
|
|
7380
7380
|
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); }; }
|
|
@@ -9260,7 +9260,7 @@ var AudienceSelector = /*#__PURE__*/function (_Component) {
|
|
|
9260
9260
|
AudienceTagList = _this$state.AudienceTagList;
|
|
9261
9261
|
var categoryTags = categories.map(function (c) {
|
|
9262
9262
|
return {
|
|
9263
|
-
AudienceType:
|
|
9263
|
+
AudienceType: "Category",
|
|
9264
9264
|
AudienceTypeSelection: c.Key,
|
|
9265
9265
|
Id: "category_".concat(c.Key),
|
|
9266
9266
|
Title: c.Title
|
|
@@ -9268,7 +9268,7 @@ var AudienceSelector = /*#__PURE__*/function (_Component) {
|
|
|
9268
9268
|
});
|
|
9269
9269
|
var userTypeTags = types.map(function (t) {
|
|
9270
9270
|
return {
|
|
9271
|
-
AudienceType:
|
|
9271
|
+
AudienceType: "UserType",
|
|
9272
9272
|
AudienceTypeSelection: t.typeName,
|
|
9273
9273
|
Id: "userType_".concat(t.typeName),
|
|
9274
9274
|
Title: "User Type: ".concat(t.displayName)
|
|
@@ -9276,7 +9276,7 @@ var AudienceSelector = /*#__PURE__*/function (_Component) {
|
|
|
9276
9276
|
});
|
|
9277
9277
|
var userTagTags = tagList.map(function (t) {
|
|
9278
9278
|
return {
|
|
9279
|
-
AudienceType:
|
|
9279
|
+
AudienceType: "UserTags",
|
|
9280
9280
|
AudienceTypeSelection: t.Id,
|
|
9281
9281
|
Id: "userTag_".concat(t.Id),
|
|
9282
9282
|
Title: "User Tag: ".concat(t.Title)
|
|
@@ -9310,26 +9310,26 @@ var AudienceSelector = /*#__PURE__*/function (_Component) {
|
|
|
9310
9310
|
|
|
9311
9311
|
_this.state = {
|
|
9312
9312
|
categories: [{
|
|
9313
|
-
Title:
|
|
9314
|
-
Key:
|
|
9315
|
-
ShortName:
|
|
9313
|
+
Title: "All Primary Users",
|
|
9314
|
+
Key: "resident",
|
|
9315
|
+
ShortName: "Primary"
|
|
9316
9316
|
}, {
|
|
9317
|
-
Title:
|
|
9318
|
-
Key:
|
|
9319
|
-
ShortName:
|
|
9317
|
+
Title: "All Staff Users",
|
|
9318
|
+
Key: "staff",
|
|
9319
|
+
ShortName: "Staff"
|
|
9320
9320
|
}, {
|
|
9321
|
-
Title:
|
|
9322
|
-
Key:
|
|
9323
|
-
ShortName:
|
|
9321
|
+
Title: "All Linked Users",
|
|
9322
|
+
Key: "family",
|
|
9323
|
+
ShortName: "Linked"
|
|
9324
9324
|
}],
|
|
9325
9325
|
types: [],
|
|
9326
|
-
AudienceType: props.audienceType ||
|
|
9326
|
+
AudienceType: props.audienceType || "All",
|
|
9327
9327
|
showInclude: false,
|
|
9328
9328
|
includeList: [],
|
|
9329
9329
|
showExclude: false,
|
|
9330
9330
|
excludeList: [],
|
|
9331
|
-
Type:
|
|
9332
|
-
Category:
|
|
9331
|
+
Type: "",
|
|
9332
|
+
Category: "",
|
|
9333
9333
|
userList: [],
|
|
9334
9334
|
tagList: [],
|
|
9335
9335
|
AudienceTagList: props.audienceTypeSelection || []
|
|
@@ -9359,7 +9359,7 @@ var AudienceSelector = /*#__PURE__*/function (_Component) {
|
|
|
9359
9359
|
}, {
|
|
9360
9360
|
key: "onSubmit",
|
|
9361
9361
|
value: function onSubmit() {
|
|
9362
|
-
if (this.state.AudienceType ===
|
|
9362
|
+
if (this.state.AudienceType === "User" && ___default['default'].isEmpty(this.state.includeList)) {
|
|
9363
9363
|
this.setState({
|
|
9364
9364
|
showInclude: true
|
|
9365
9365
|
});
|
|
@@ -9379,9 +9379,9 @@ var AudienceSelector = /*#__PURE__*/function (_Component) {
|
|
|
9379
9379
|
Category = _this$state2.Category,
|
|
9380
9380
|
Tag = _this$state2.Tag,
|
|
9381
9381
|
Type = _this$state2.Type;
|
|
9382
|
-
if (AudienceType ===
|
|
9383
|
-
if (AudienceType ===
|
|
9384
|
-
if (AudienceType ===
|
|
9382
|
+
if (AudienceType === "Custom") return AudienceTagList || [];
|
|
9383
|
+
if (AudienceType === "Category") return Category;
|
|
9384
|
+
if (AudienceType === "UserTags") return Tag;
|
|
9385
9385
|
return Type;
|
|
9386
9386
|
}
|
|
9387
9387
|
}, {
|
|
@@ -9403,7 +9403,7 @@ var AudienceSelector = /*#__PURE__*/function (_Component) {
|
|
|
9403
9403
|
_this2.setState({
|
|
9404
9404
|
userList: res.data.results.Items
|
|
9405
9405
|
});
|
|
9406
|
-
})
|
|
9406
|
+
})["catch"](function (error) {});
|
|
9407
9407
|
}
|
|
9408
9408
|
}, {
|
|
9409
9409
|
key: "getUserTags",
|
|
@@ -9418,7 +9418,7 @@ var AudienceSelector = /*#__PURE__*/function (_Component) {
|
|
|
9418
9418
|
});
|
|
9419
9419
|
})
|
|
9420
9420
|
});
|
|
9421
|
-
})
|
|
9421
|
+
})["catch"](function (error) {});
|
|
9422
9422
|
}
|
|
9423
9423
|
}, {
|
|
9424
9424
|
key: "setType",
|
|
@@ -9426,9 +9426,9 @@ var AudienceSelector = /*#__PURE__*/function (_Component) {
|
|
|
9426
9426
|
var newState = {
|
|
9427
9427
|
AudienceType: type
|
|
9428
9428
|
};
|
|
9429
|
-
if (type ===
|
|
9430
|
-
if (type ===
|
|
9431
|
-
if (type ===
|
|
9429
|
+
if (type === "Custom") newState.AudienceTagList = selection;
|
|
9430
|
+
if (type === "UserType") newState.Type = selection;
|
|
9431
|
+
if (type === "Category") newState.Category = selection;
|
|
9432
9432
|
this.setState(newState);
|
|
9433
9433
|
}
|
|
9434
9434
|
}, {
|
|
@@ -9436,8 +9436,8 @@ var AudienceSelector = /*#__PURE__*/function (_Component) {
|
|
|
9436
9436
|
value: function onChangeOption(type) {
|
|
9437
9437
|
this.setState({
|
|
9438
9438
|
AudienceType: type,
|
|
9439
|
-
Type:
|
|
9440
|
-
Category:
|
|
9439
|
+
Type: "",
|
|
9440
|
+
Category: "",
|
|
9441
9441
|
includeList: [],
|
|
9442
9442
|
excludeList: [],
|
|
9443
9443
|
AudienceTagList: []
|
|
@@ -9450,57 +9450,57 @@ var AudienceSelector = /*#__PURE__*/function (_Component) {
|
|
|
9450
9450
|
var _this4 = this;
|
|
9451
9451
|
|
|
9452
9452
|
var options = [{
|
|
9453
|
-
Label:
|
|
9454
|
-
Value:
|
|
9453
|
+
Label: "All users",
|
|
9454
|
+
Value: "All",
|
|
9455
9455
|
onChange: function onChange() {
|
|
9456
|
-
return _this4.onChangeOption(
|
|
9456
|
+
return _this4.onChangeOption("All");
|
|
9457
9457
|
}
|
|
9458
9458
|
}];
|
|
9459
9459
|
|
|
9460
9460
|
if (this.props.custom) {
|
|
9461
9461
|
options.push({
|
|
9462
|
-
Label:
|
|
9463
|
-
Value:
|
|
9462
|
+
Label: "Custom",
|
|
9463
|
+
Value: "Custom",
|
|
9464
9464
|
onChange: function onChange() {
|
|
9465
|
-
return _this4.onChangeOption(
|
|
9465
|
+
return _this4.onChangeOption("Custom");
|
|
9466
9466
|
}
|
|
9467
9467
|
});
|
|
9468
9468
|
} else {
|
|
9469
9469
|
options.push({
|
|
9470
|
-
Label:
|
|
9471
|
-
Value:
|
|
9470
|
+
Label: "By user category",
|
|
9471
|
+
Value: "Category",
|
|
9472
9472
|
onChange: function onChange() {
|
|
9473
|
-
return _this4.onChangeOption(
|
|
9473
|
+
return _this4.onChangeOption("Category");
|
|
9474
9474
|
}
|
|
9475
9475
|
});
|
|
9476
9476
|
}
|
|
9477
9477
|
|
|
9478
9478
|
if (!this.props.disallowUserType) {
|
|
9479
9479
|
options.push({
|
|
9480
|
-
Label:
|
|
9481
|
-
Value:
|
|
9480
|
+
Label: "By user type",
|
|
9481
|
+
Value: "UserType",
|
|
9482
9482
|
onChange: function onChange() {
|
|
9483
|
-
return _this4.onChangeOption(
|
|
9483
|
+
return _this4.onChangeOption("UserType");
|
|
9484
9484
|
}
|
|
9485
9485
|
});
|
|
9486
9486
|
}
|
|
9487
9487
|
|
|
9488
9488
|
if (this.props.allowTags) {
|
|
9489
9489
|
options.push({
|
|
9490
|
-
Label:
|
|
9491
|
-
Value:
|
|
9490
|
+
Label: "By user tag",
|
|
9491
|
+
Value: "UserTags",
|
|
9492
9492
|
onChange: function onChange() {
|
|
9493
|
-
return _this4.onChangeOption(
|
|
9493
|
+
return _this4.onChangeOption("UserTags");
|
|
9494
9494
|
}
|
|
9495
9495
|
});
|
|
9496
9496
|
}
|
|
9497
9497
|
|
|
9498
9498
|
if (!this.props.disallowSingleUsers) {
|
|
9499
9499
|
options.push({
|
|
9500
|
-
Label:
|
|
9501
|
-
Value:
|
|
9500
|
+
Label: "To single users",
|
|
9501
|
+
Value: "User",
|
|
9502
9502
|
onChange: function onChange() {
|
|
9503
|
-
return _this4.onChangeOption(
|
|
9503
|
+
return _this4.onChangeOption("User");
|
|
9504
9504
|
}
|
|
9505
9505
|
});
|
|
9506
9506
|
}
|
|
@@ -9513,11 +9513,11 @@ var AudienceSelector = /*#__PURE__*/function (_Component) {
|
|
|
9513
9513
|
var _this$state3 = this.state,
|
|
9514
9514
|
AudienceType = _this$state3.AudienceType,
|
|
9515
9515
|
includeList = _this$state3.includeList;
|
|
9516
|
-
if (AudienceType ===
|
|
9517
|
-
if (AudienceType ===
|
|
9518
|
-
if (AudienceType ===
|
|
9519
|
-
if (AudienceType ===
|
|
9520
|
-
if (AudienceType ===
|
|
9516
|
+
if (AudienceType === "Custom" && !this.validateCustom()) return false;
|
|
9517
|
+
if (AudienceType === "Category" && !this.validateCategory()) return false;
|
|
9518
|
+
if (AudienceType === "UserType" && !this.validateType()) return false;
|
|
9519
|
+
if (AudienceType === "User" && ___default['default'].isEmpty(includeList)) return false;
|
|
9520
|
+
if (AudienceType === "UserTags" && !this.validateTag()) return false;
|
|
9521
9521
|
return true;
|
|
9522
9522
|
}
|
|
9523
9523
|
}, {
|
|
@@ -9543,7 +9543,7 @@ var AudienceSelector = /*#__PURE__*/function (_Component) {
|
|
|
9543
9543
|
return typeObject.displayName;
|
|
9544
9544
|
}
|
|
9545
9545
|
|
|
9546
|
-
return
|
|
9546
|
+
return "";
|
|
9547
9547
|
}
|
|
9548
9548
|
}, {
|
|
9549
9549
|
key: "getTagTitle",
|
|
@@ -9558,7 +9558,7 @@ var AudienceSelector = /*#__PURE__*/function (_Component) {
|
|
|
9558
9558
|
return tag.Title;
|
|
9559
9559
|
}
|
|
9560
9560
|
|
|
9561
|
-
return
|
|
9561
|
+
return "";
|
|
9562
9562
|
}
|
|
9563
9563
|
}, {
|
|
9564
9564
|
key: "getUserTypes",
|
|
@@ -9579,7 +9579,7 @@ var AudienceSelector = /*#__PURE__*/function (_Component) {
|
|
|
9579
9579
|
return c.Key === e.category;
|
|
9580
9580
|
});
|
|
9581
9581
|
|
|
9582
|
-
var shortName = category ? "(".concat(category.ShortName, ") ") :
|
|
9582
|
+
var shortName = category ? "(".concat(category.ShortName, ") ") : "";
|
|
9583
9583
|
e.Title = "".concat(shortName, " ").concat(e.Title);
|
|
9584
9584
|
}
|
|
9585
9585
|
});
|
|
@@ -9588,30 +9588,30 @@ var AudienceSelector = /*#__PURE__*/function (_Component) {
|
|
|
9588
9588
|
};
|
|
9589
9589
|
|
|
9590
9590
|
if (!___default['default'].some(res.data, function (t) {
|
|
9591
|
-
return t.category ===
|
|
9591
|
+
return t.category === "family";
|
|
9592
9592
|
})) {
|
|
9593
9593
|
newState.categories = ___default['default'].filter(_this7.state.categories, function (c) {
|
|
9594
|
-
return c.Key !==
|
|
9594
|
+
return c.Key !== "family";
|
|
9595
9595
|
});
|
|
9596
9596
|
}
|
|
9597
9597
|
|
|
9598
9598
|
_this7.setState(newState);
|
|
9599
|
-
})
|
|
9599
|
+
})["catch"](function (error) {});
|
|
9600
9600
|
}
|
|
9601
9601
|
}, {
|
|
9602
9602
|
key: "getUserList",
|
|
9603
9603
|
value: function getUserList() {
|
|
9604
9604
|
var _this8 = this;
|
|
9605
9605
|
|
|
9606
|
-
if (this.state.AudienceType ===
|
|
9606
|
+
if (this.state.AudienceType === "UserType" && !___default['default'].isEmpty(this.state.Type)) {
|
|
9607
9607
|
var users = [];
|
|
9608
9608
|
this.state.userList.forEach(function (element) {
|
|
9609
9609
|
if (element.type !== _this8.state.Type) users.push(element);
|
|
9610
9610
|
});
|
|
9611
|
-
return ___default['default'].sortBy(users,
|
|
9611
|
+
return ___default['default'].sortBy(users, "displayName");
|
|
9612
9612
|
}
|
|
9613
9613
|
|
|
9614
|
-
if (this.state.AudienceType ===
|
|
9614
|
+
if (this.state.AudienceType === "Category" && !___default['default'].isEmpty(this.state.Category)) {
|
|
9615
9615
|
var _users = [];
|
|
9616
9616
|
|
|
9617
9617
|
var types = ___default['default'].filter(this.state.types, function (type) {
|
|
@@ -9625,10 +9625,10 @@ var AudienceSelector = /*#__PURE__*/function (_Component) {
|
|
|
9625
9625
|
_users.push(element);
|
|
9626
9626
|
}
|
|
9627
9627
|
});
|
|
9628
|
-
return ___default['default'].sortBy(_users,
|
|
9628
|
+
return ___default['default'].sortBy(_users, "displayName");
|
|
9629
9629
|
}
|
|
9630
9630
|
|
|
9631
|
-
return ___default['default'].sortBy(this.state.userList,
|
|
9631
|
+
return ___default['default'].sortBy(this.state.userList, "displayName");
|
|
9632
9632
|
}
|
|
9633
9633
|
}, {
|
|
9634
9634
|
key: "selectCat",
|
|
@@ -9653,7 +9653,7 @@ var AudienceSelector = /*#__PURE__*/function (_Component) {
|
|
|
9653
9653
|
return typeObject.Title;
|
|
9654
9654
|
}
|
|
9655
9655
|
|
|
9656
|
-
return
|
|
9656
|
+
return "";
|
|
9657
9657
|
}
|
|
9658
9658
|
}, {
|
|
9659
9659
|
key: "validateCategory",
|
|
@@ -9673,7 +9673,7 @@ var AudienceSelector = /*#__PURE__*/function (_Component) {
|
|
|
9673
9673
|
}, {
|
|
9674
9674
|
key: "showUserPickers",
|
|
9675
9675
|
value: function showUserPickers(isInclude) {
|
|
9676
|
-
if (isInclude && this.state.AudienceType ===
|
|
9676
|
+
if (isInclude && this.state.AudienceType === "User") {
|
|
9677
9677
|
return true;
|
|
9678
9678
|
}
|
|
9679
9679
|
|
|
@@ -9685,15 +9685,15 @@ var AudienceSelector = /*#__PURE__*/function (_Component) {
|
|
|
9685
9685
|
return false;
|
|
9686
9686
|
}
|
|
9687
9687
|
|
|
9688
|
-
if (isInclude && this.state.AudienceType ===
|
|
9688
|
+
if (isInclude && this.state.AudienceType === "All") {
|
|
9689
9689
|
return false;
|
|
9690
9690
|
}
|
|
9691
9691
|
|
|
9692
|
-
if (!isInclude && this.state.AudienceType ===
|
|
9692
|
+
if (!isInclude && this.state.AudienceType === "User") {
|
|
9693
9693
|
return false;
|
|
9694
9694
|
}
|
|
9695
9695
|
|
|
9696
|
-
if (this.state.AudienceType ===
|
|
9696
|
+
if (this.state.AudienceType === "Category" && ___default['default'].isEmpty(this.state.Category) || this.state.AudienceType === "UserType" && ___default['default'].isEmpty(this.state.Type)) {
|
|
9697
9697
|
return false;
|
|
9698
9698
|
}
|
|
9699
9699
|
|
|
@@ -9704,15 +9704,15 @@ var AudienceSelector = /*#__PURE__*/function (_Component) {
|
|
|
9704
9704
|
value: function getUserExcludeList() {
|
|
9705
9705
|
var _this10 = this;
|
|
9706
9706
|
|
|
9707
|
-
if (this.state.AudienceType ===
|
|
9707
|
+
if (this.state.AudienceType === "UserType" && !___default['default'].isEmpty(this.state.Type)) {
|
|
9708
9708
|
var users = [];
|
|
9709
9709
|
this.state.userList.forEach(function (element) {
|
|
9710
9710
|
if (element.type === _this10.state.Type) users.push(element);
|
|
9711
9711
|
});
|
|
9712
|
-
return ___default['default'].sortBy(users,
|
|
9712
|
+
return ___default['default'].sortBy(users, "displayName");
|
|
9713
9713
|
}
|
|
9714
9714
|
|
|
9715
|
-
if (this.state.AudienceType ===
|
|
9715
|
+
if (this.state.AudienceType === "Category" && !___default['default'].isEmpty(this.state.Category)) {
|
|
9716
9716
|
var _users2 = [];
|
|
9717
9717
|
|
|
9718
9718
|
var types = ___default['default'].filter(this.state.types, function (type) {
|
|
@@ -9726,10 +9726,10 @@ var AudienceSelector = /*#__PURE__*/function (_Component) {
|
|
|
9726
9726
|
_users2.push(element);
|
|
9727
9727
|
}
|
|
9728
9728
|
});
|
|
9729
|
-
return ___default['default'].sortBy(_users2,
|
|
9729
|
+
return ___default['default'].sortBy(_users2, "displayName");
|
|
9730
9730
|
}
|
|
9731
9731
|
|
|
9732
|
-
return ___default['default'].sortBy(this.state.userList,
|
|
9732
|
+
return ___default['default'].sortBy(this.state.userList, "displayName");
|
|
9733
9733
|
}
|
|
9734
9734
|
}, {
|
|
9735
9735
|
key: "addToInc",
|
|
@@ -9803,12 +9803,12 @@ var AudienceSelector = /*#__PURE__*/function (_Component) {
|
|
|
9803
9803
|
}, /*#__PURE__*/React__default['default'].createElement(Text, {
|
|
9804
9804
|
type: "formTitleSmall",
|
|
9805
9805
|
className: "marginBottom-16"
|
|
9806
|
-
}, "Exclude Users From Selection ", "(".concat(this.state.excludeList.length, ")"))), /*#__PURE__*/React__default['default'].createElement(FontAwesome__default['default'], {
|
|
9806
|
+
}, "Exclude Users From Selection", " ", "(".concat(this.state.excludeList.length, ")"))), /*#__PURE__*/React__default['default'].createElement(FontAwesome__default['default'], {
|
|
9807
9807
|
style: {
|
|
9808
9808
|
color: COLOUR_DUSK,
|
|
9809
9809
|
fontSize: 12
|
|
9810
9810
|
},
|
|
9811
|
-
name: this.state.showExclude ?
|
|
9811
|
+
name: this.state.showExclude ? "chevron-up" : "chevron-down"
|
|
9812
9812
|
})), this.state.showExclude && /*#__PURE__*/React__default['default'].createElement(exportObj$1, {
|
|
9813
9813
|
add: this.addToEx.bind(this),
|
|
9814
9814
|
remove: this.removeUserEx.bind(this),
|
|
@@ -9840,12 +9840,12 @@ var AudienceSelector = /*#__PURE__*/function (_Component) {
|
|
|
9840
9840
|
}, /*#__PURE__*/React__default['default'].createElement(Text, {
|
|
9841
9841
|
type: "formTitleSmall",
|
|
9842
9842
|
className: "marginBottom-16"
|
|
9843
|
-
}, this.state.AudienceType !==
|
|
9843
|
+
}, this.state.AudienceType !== "User" ? "Add Other" : "Select", " ", "Users ", "(".concat(this.state.includeList.length, ")"))), /*#__PURE__*/React__default['default'].createElement(FontAwesome__default['default'], {
|
|
9844
9844
|
style: {
|
|
9845
9845
|
color: COLOUR_DUSK,
|
|
9846
9846
|
fontSize: 12
|
|
9847
9847
|
},
|
|
9848
|
-
name: this.state.showInclude ?
|
|
9848
|
+
name: this.state.showInclude ? "chevron-up" : "chevron-down"
|
|
9849
9849
|
})), this.state.showInclude && /*#__PURE__*/React__default['default'].createElement(exportObj$1, {
|
|
9850
9850
|
add: this.addToInc.bind(this),
|
|
9851
9851
|
remove: this.removeUserInc.bind(this),
|
|
@@ -9906,7 +9906,7 @@ var AudienceSelector = /*#__PURE__*/function (_Component) {
|
|
|
9906
9906
|
}, {
|
|
9907
9907
|
key: "renderCustom",
|
|
9908
9908
|
value: function renderCustom() {
|
|
9909
|
-
if (this.state.AudienceType !==
|
|
9909
|
+
if (this.state.AudienceType !== "Custom") return null;
|
|
9910
9910
|
return /*#__PURE__*/React__default['default'].createElement("div", {
|
|
9911
9911
|
className: "optionsContent_bottom"
|
|
9912
9912
|
}, /*#__PURE__*/React__default['default'].createElement(Text, {
|
|
@@ -9924,17 +9924,17 @@ var AudienceSelector = /*#__PURE__*/function (_Component) {
|
|
|
9924
9924
|
return /*#__PURE__*/React__default['default'].createElement("div", null, /*#__PURE__*/React__default['default'].createElement(Text, {
|
|
9925
9925
|
type: "formTitleSmall",
|
|
9926
9926
|
className: "marginBottom-16"
|
|
9927
|
-
}, this.props.title ||
|
|
9927
|
+
}, this.props.title || "Target Audience"), /*#__PURE__*/React__default['default'].createElement(RadioButton, {
|
|
9928
9928
|
isActive: this.state.AudienceType,
|
|
9929
9929
|
rowStyle: {
|
|
9930
|
-
flexDirection:
|
|
9930
|
+
flexDirection: "column"
|
|
9931
9931
|
},
|
|
9932
9932
|
buttonStyle: {
|
|
9933
9933
|
marginBottom: 8
|
|
9934
9934
|
},
|
|
9935
9935
|
options: this.getOptions(),
|
|
9936
9936
|
disabled: this.props.disabled
|
|
9937
|
-
}), this.state.AudienceType ===
|
|
9937
|
+
}), this.state.AudienceType === "Category" && /*#__PURE__*/React__default['default'].createElement(DropdownInput, {
|
|
9938
9938
|
id: "typeSelect" // label='User Category'
|
|
9939
9939
|
,
|
|
9940
9940
|
alwaysShowLabel: true,
|
|
@@ -9954,7 +9954,7 @@ var AudienceSelector = /*#__PURE__*/function (_Component) {
|
|
|
9954
9954
|
},
|
|
9955
9955
|
isRequired: true,
|
|
9956
9956
|
disabled: this.props.disabled
|
|
9957
|
-
}), this.state.AudienceType ===
|
|
9957
|
+
}), this.state.AudienceType === "UserType" && /*#__PURE__*/React__default['default'].createElement(DropdownInput, {
|
|
9958
9958
|
id: "typeSelect" // label='User Type'
|
|
9959
9959
|
,
|
|
9960
9960
|
alwaysShowLabel: true,
|
|
@@ -9974,7 +9974,7 @@ var AudienceSelector = /*#__PURE__*/function (_Component) {
|
|
|
9974
9974
|
},
|
|
9975
9975
|
isRequired: true,
|
|
9976
9976
|
disabled: this.props.disabled
|
|
9977
|
-
}), this.state.AudienceType ===
|
|
9977
|
+
}), this.state.AudienceType === "UserTags" && /*#__PURE__*/React__default['default'].createElement(DropdownInput, {
|
|
9978
9978
|
id: "tagSelect",
|
|
9979
9979
|
alwaysShowLabel: true,
|
|
9980
9980
|
placeholder: "User Tag",
|
|
@@ -10003,7 +10003,7 @@ var AudienceSelector = /*#__PURE__*/function (_Component) {
|
|
|
10003
10003
|
var toExport = reactRedux.connect(null, {
|
|
10004
10004
|
setAuth: setAuth
|
|
10005
10005
|
}, null, {
|
|
10006
|
-
|
|
10006
|
+
forwardRef: true
|
|
10007
10007
|
})(AudienceSelector);
|
|
10008
10008
|
|
|
10009
10009
|
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); }; }
|
|
@@ -10335,7 +10335,7 @@ var MakerPopup = /*#__PURE__*/function (_Component) {
|
|
|
10335
10335
|
submitting: false,
|
|
10336
10336
|
asset: res.data.resultUrl
|
|
10337
10337
|
});
|
|
10338
|
-
})
|
|
10338
|
+
})["catch"](function (err) {
|
|
10339
10339
|
_this.setState({
|
|
10340
10340
|
submitting: false
|
|
10341
10341
|
});
|