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