@plusscommunities/pluss-core-web 1.6.13-beta.0 → 1.6.15-beta.0
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/package.json +1 -2
- package/rollup.config.js +45 -45
- package/src/actions/AuthActions.js +40 -40
- package/src/actions/LocalActions.js +5 -5
- package/src/actions/NavActions.js +5 -5
- package/src/actions/ScheduledActionsActions.js +5 -5
- package/src/actions/TemplateActions.js +9 -9
- package/src/actions/UsersActions.js +74 -70
- package/src/actions/index.js +6 -6
- package/src/actions/types.js +17 -17
- package/src/analytics.js +178 -158
- package/src/apis/analyticsActions.js +50 -50
- package/src/apis/authActions.js +55 -55
- package/src/apis/fileActions.js +147 -142
- package/src/apis/index.js +10 -10
- package/src/apis/profileActions.js +130 -130
- package/src/apis/scheduledActionsActions.js +9 -9
- package/src/apis/stringActions.js +26 -22
- package/src/apis/templateActions.js +38 -38
- package/src/apis/typeActions.js +183 -183
- package/src/apis/userActions.js +166 -166
- package/src/apis/utilityActions.js +32 -32
- package/src/colours.js +79 -77
- package/src/components/AddButton.js +29 -20
- package/src/components/AnalyticsFilter.js +136 -102
- package/src/components/Attachment.js +36 -22
- package/src/components/AudienceIncluder.js +209 -165
- package/src/components/AudienceSelector.js +680 -680
- package/src/components/Button.js +79 -56
- package/src/components/CheckBox.js +77 -65
- package/src/components/ColourOptions.js +205 -181
- package/src/components/ColourPicker.js +286 -244
- package/src/components/Comment.js +48 -39
- package/src/components/CommentSection.js +113 -103
- package/src/components/DatePicker.js +298 -255
- package/src/components/DropdownInput.js +236 -215
- package/src/components/DurationInput.js +46 -43
- package/src/components/ExportCsvPopup.js +236 -217
- package/src/components/FileInput.js +359 -346
- package/src/components/GenericInput.js +184 -153
- package/src/components/Header.js +88 -65
- package/src/components/HubSidebar.js +136 -124
- package/src/components/ImageInput.js +1182 -973
- package/src/components/InputGroup.js +20 -13
- package/src/components/MakerPopup.js +285 -278
- package/src/components/MoreMenu.js +21 -17
- package/src/components/OptionsSection.js +86 -74
- package/src/components/OverlayPage.js +61 -61
- package/src/components/OverlayPageBottomButtons.js +38 -38
- package/src/components/OverlayPageContents.js +38 -38
- package/src/components/OverlayPageSection.js +24 -24
- package/src/components/P60Icon.js +38 -33
- package/src/components/PageTitle.js +8 -8
- package/src/components/Popup.js +114 -95
- package/src/components/ProfilePic.js +40 -40
- package/src/components/RadioButton.js +142 -126
- package/src/components/Reactions.js +66 -66
- package/src/components/SVGIcon.js +31 -25
- package/src/components/SideNavItem.js +112 -83
- package/src/components/StatBox.js +54 -44
- package/src/components/StatusButton.js +31 -17
- package/src/components/SuccessPopup.js +61 -48
- package/src/components/Tabs.js +50 -47
- package/src/components/Tag.js +54 -54
- package/src/components/Text.js +18 -14
- package/src/components/TextFormatPopup.js +77 -49
- package/src/components/TimePicker.js +214 -200
- package/src/components/ToggleSwitch.js +60 -0
- package/src/components/UserListing.js +110 -97
- package/src/components/index.js +46 -46
- package/src/components/svg-icons.json +819 -819
- package/src/config.js +22 -22
- package/src/helper/HelpDeskWidget.js +4 -4
- package/src/helper/api/getUrl.js +16 -11
- package/src/helper/api/getUrlParams.js +8 -5
- package/src/helper/api/safeReadParams.js +3 -2
- package/src/helper/auth/getUserFromState.js +4 -4
- package/src/helper/colours/getAppColourFromState.js +10 -5
- package/src/helper/files/canvasImageUploader.js +152 -140
- package/src/helper/files/generateImageName.js +6 -6
- package/src/helper/files/get1400.js +33 -25
- package/src/helper/files/getExtension.js +5 -5
- package/src/helper/files/getFileName.js +9 -9
- package/src/helper/files/getThumb300.js +37 -29
- package/src/helper/files/isVideo.js +3 -3
- package/src/helper/helper.js +59 -56
- package/src/helper/index.js +29 -29
- package/src/helper/site/getMerchantsFromState.js +8 -4
- package/src/helper/site/getSiteLevelFromState.js +29 -29
- package/src/helper/site/getSiteName.js +11 -11
- package/src/helper/site/getSiteNameFromRoles.js +7 -7
- package/src/helper/site/getSiteSettingFromState.js +10 -5
- package/src/helper/storage/readJSONFromStorage.js +5 -5
- package/src/helper/storage/readStorageWithCookie.js +17 -17
- package/src/helper/storage/setLocalStorage.js +1 -1
- package/src/helper/strings/getFirstName.js +5 -5
- package/src/helper/strings/htmlDecode.js +2 -2
- package/src/helper/strings/htmlEncode.js +2 -2
- package/src/helper/strings/isEmail.js +7 -6
- package/src/helper/strings/isUrl.js +7 -7
- package/src/helper/strings/onlyAlphanumeric.js +4 -4
- package/src/helper/strings/randomString.js +6 -6
- package/src/helper/strings/toParagraphed.js +12 -12
- package/src/index.js +22 -11
- package/src/reducers/ScheduledActionsReducer.js +8 -8
- package/src/reducers/TemplatesReducer.js +22 -22
- package/src/reducers/index.js +4 -4
- package/src/session.js +70 -70
- package/src/urls.js +17 -16
- package/dist/index.cjs.js +0 -11623
- package/dist/index.esm.js +0 -11583
- package/dist/index.umd.js +0 -11595
|
@@ -1,173 +1,217 @@
|
|
|
1
|
-
import React, { Component } from
|
|
2
|
-
import _ from
|
|
3
|
-
import { withRouter } from
|
|
4
|
-
import { connect } from
|
|
5
|
-
import Config from
|
|
6
|
-
import { SVGIcon } from
|
|
7
|
-
import { GenericInput } from
|
|
8
|
-
import { Text } from
|
|
9
|
-
import { COLOUR_DUSK } from
|
|
1
|
+
import React, { Component } from "react";
|
|
2
|
+
import _ from "lodash";
|
|
3
|
+
import { withRouter } from "react-router";
|
|
4
|
+
import { connect } from "react-redux";
|
|
5
|
+
import Config from "../config";
|
|
6
|
+
import { SVGIcon } from "./SVGIcon";
|
|
7
|
+
import { GenericInput } from "./GenericInput";
|
|
8
|
+
import { Text } from "./Text";
|
|
9
|
+
import { COLOUR_DUSK } from "../colours";
|
|
10
10
|
|
|
11
11
|
class AudienceIncluder extends Component {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
12
|
+
constructor(props) {
|
|
13
|
+
super(props);
|
|
14
|
+
this.state = {
|
|
15
|
+
showUserAdd: false,
|
|
16
|
+
userSearch: "",
|
|
17
|
+
returnList: [],
|
|
18
|
+
userList: [],
|
|
19
|
+
|
|
20
|
+
selectionList: [],
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
UNSAFE_componentWillMount() {
|
|
25
|
+
this.updateProps(this.props);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
UNSAFE_componentWillReceiveProps(nextProps) {
|
|
29
|
+
this.updateProps(nextProps);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
updateProps(props) {
|
|
33
|
+
var stateChange = {
|
|
34
|
+
selectionList: props.selectionList,
|
|
35
|
+
userList: props.userList,
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
if (!_.isEmpty(this.state.userSearch) && this.state.userSearch.length > 1) {
|
|
39
|
+
stateChange.returnList = _.filter(props.userList, (ev) => {
|
|
40
|
+
return (
|
|
41
|
+
ev.displayName
|
|
42
|
+
.toLowerCase()
|
|
43
|
+
.indexOf(this.state.userSearch.toLowerCase()) > -1
|
|
44
|
+
);
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
stateChange.returnList = _.reject(stateChange.returnList, (item) =>
|
|
48
|
+
_.find(props.selectionList, (t) => {
|
|
49
|
+
return t.Id === item.Id;
|
|
50
|
+
}),
|
|
51
|
+
);
|
|
52
|
+
}
|
|
53
|
+
this.setState(stateChange);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
showUserAdd() {
|
|
57
|
+
this.setState({ showUserAdd: true });
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
handleChange(event) {
|
|
61
|
+
if (this.state.searchUserLoading) {
|
|
62
|
+
return;
|
|
63
|
+
}
|
|
64
|
+
var stateChange = { returnList: [] };
|
|
65
|
+
stateChange[event.target.getAttribute("id")] = event.target.value;
|
|
66
|
+
|
|
67
|
+
if (!_.isEmpty(event.target.value) && event.target.value.length > 1) {
|
|
68
|
+
stateChange.returnList = _.filter(this.props.userList, (ev) => {
|
|
69
|
+
return (
|
|
70
|
+
ev.displayName
|
|
71
|
+
.toLowerCase()
|
|
72
|
+
.indexOf(event.target.value.toLowerCase()) > -1
|
|
73
|
+
);
|
|
74
|
+
});
|
|
75
|
+
|
|
76
|
+
stateChange.returnList = _.reject(stateChange.returnList, (item) =>
|
|
77
|
+
_.find(this.state.selectionList, (t) => {
|
|
78
|
+
return t.Id === item.Id;
|
|
79
|
+
}),
|
|
80
|
+
);
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
this.setState(stateChange);
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
renderSearch() {
|
|
87
|
+
return (
|
|
88
|
+
<div style={{}}>
|
|
89
|
+
{this.state.returnList.map((user, index) => {
|
|
90
|
+
return (
|
|
91
|
+
<div
|
|
92
|
+
onClick={() => {
|
|
93
|
+
this.props.add(user);
|
|
94
|
+
}}
|
|
95
|
+
key={user.Id}
|
|
96
|
+
className="pointer"
|
|
97
|
+
style={{
|
|
98
|
+
marginBottom: 8,
|
|
99
|
+
display: "flex",
|
|
100
|
+
flexDirection: "row",
|
|
101
|
+
alignItems: "center",
|
|
102
|
+
}}
|
|
103
|
+
>
|
|
104
|
+
<img
|
|
105
|
+
style={{
|
|
106
|
+
height: 30,
|
|
107
|
+
width: 30,
|
|
108
|
+
borderRadius: 15,
|
|
109
|
+
marginRight: 16,
|
|
110
|
+
}}
|
|
111
|
+
src={
|
|
112
|
+
user.profilePic != null
|
|
113
|
+
? user.profilePic
|
|
114
|
+
: Config.env.defaultProfileImage
|
|
115
|
+
}
|
|
116
|
+
alt="user profilePic"
|
|
117
|
+
/>
|
|
118
|
+
<div className={`fontMedium fontSize-16 text-dark'`}>
|
|
119
|
+
{user.displayName}
|
|
120
|
+
</div>
|
|
121
|
+
</div>
|
|
122
|
+
);
|
|
123
|
+
})}
|
|
124
|
+
</div>
|
|
125
|
+
);
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
renderUserAdd() {
|
|
129
|
+
return (
|
|
130
|
+
<div className="" style={{ backgroundColor: "#fff" }}>
|
|
131
|
+
{" "}
|
|
132
|
+
{/* Search for peeps */}
|
|
133
|
+
<GenericInput
|
|
134
|
+
id="userSearch"
|
|
135
|
+
type="text"
|
|
136
|
+
label="Search for User"
|
|
137
|
+
placeholder="Search for user"
|
|
138
|
+
value={this.state.userSearch}
|
|
139
|
+
onChange={(e) => this.handleChange(e)}
|
|
140
|
+
alwaysShowLabel
|
|
141
|
+
/>
|
|
142
|
+
{this.renderSearch()}
|
|
143
|
+
</div>
|
|
144
|
+
);
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
renderAttendees() {
|
|
148
|
+
if (this.state.selectionList && !_.isEmpty(this.state.selectionList)) {
|
|
149
|
+
return (
|
|
150
|
+
<div style={{ marginTop: 16 }}>
|
|
151
|
+
<Text type="formLabel" className="marginBottom-8">
|
|
152
|
+
Selected Users
|
|
153
|
+
</Text>
|
|
154
|
+
{this.state.selectionList.map((user, index) => {
|
|
155
|
+
return (
|
|
156
|
+
<div
|
|
157
|
+
key={user.Id}
|
|
158
|
+
style={{
|
|
159
|
+
marginBottom: 8,
|
|
160
|
+
display: "flex",
|
|
161
|
+
flexDirection: "row",
|
|
162
|
+
justifyContent: "space-between",
|
|
163
|
+
alignItems: "center",
|
|
164
|
+
}}
|
|
165
|
+
>
|
|
166
|
+
<div className="flex" style={{ alignItems: "center" }}>
|
|
167
|
+
<img
|
|
168
|
+
style={{
|
|
169
|
+
height: 30,
|
|
170
|
+
width: 30,
|
|
171
|
+
borderRadius: 15,
|
|
172
|
+
marginRight: 16,
|
|
173
|
+
}}
|
|
174
|
+
src={
|
|
175
|
+
user.profilePic != null
|
|
176
|
+
? user.profilePic
|
|
177
|
+
: Config.env.defaultProfileImage
|
|
178
|
+
}
|
|
179
|
+
alt="user profilePic"
|
|
180
|
+
/>
|
|
181
|
+
<div className={`fontMedium fontSize-16 text-dark'`}>
|
|
182
|
+
{user.displayName}
|
|
183
|
+
</div>
|
|
184
|
+
</div>
|
|
185
|
+
<SVGIcon
|
|
186
|
+
className="removeIcon"
|
|
187
|
+
icon="close"
|
|
188
|
+
onClick={() => {
|
|
189
|
+
this.props.remove(user);
|
|
190
|
+
}}
|
|
191
|
+
colour={COLOUR_DUSK}
|
|
192
|
+
/>
|
|
193
|
+
{/* <ConfirmActions declineOnly onDecline={() => {}} /> */}
|
|
194
|
+
</div>
|
|
195
|
+
);
|
|
196
|
+
})}
|
|
197
|
+
</div>
|
|
198
|
+
);
|
|
199
|
+
}
|
|
200
|
+
return null;
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
render() {
|
|
204
|
+
return (
|
|
205
|
+
<div>
|
|
206
|
+
<div>{this.renderUserAdd()}</div>
|
|
207
|
+
<div>{this.renderAttendees()}</div>
|
|
208
|
+
</div>
|
|
209
|
+
);
|
|
210
|
+
}
|
|
167
211
|
}
|
|
168
212
|
|
|
169
213
|
const mapStateToProps = (state) => {
|
|
170
|
-
|
|
214
|
+
return { auth: state.auth };
|
|
171
215
|
};
|
|
172
216
|
|
|
173
217
|
let exportObj = connect(mapStateToProps, {})(withRouter(AudienceIncluder));
|