@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,25 +1,29 @@
|
|
|
1
|
-
import axios from
|
|
2
|
-
import { getUrl } from
|
|
3
|
-
import { authedFunction } from
|
|
1
|
+
import axios from "axios";
|
|
2
|
+
import { getUrl } from "../helper";
|
|
3
|
+
import { authedFunction } from "../session";
|
|
4
4
|
|
|
5
5
|
export const stringActions = {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
6
|
+
getString: (site, id, useDefault) => {
|
|
7
|
+
let url = getUrl(
|
|
8
|
+
"strings",
|
|
9
|
+
`get/${site}_${id}`,
|
|
10
|
+
useDefault ? { useDefault } : undefined,
|
|
11
|
+
);
|
|
12
|
+
return axios({
|
|
13
|
+
method: "GET",
|
|
14
|
+
url,
|
|
15
|
+
});
|
|
16
|
+
},
|
|
17
|
+
setString: (site, key, value) => {
|
|
18
|
+
let url = getUrl("strings", "set");
|
|
19
|
+
return authedFunction({
|
|
20
|
+
method: "POST",
|
|
21
|
+
url,
|
|
22
|
+
data: {
|
|
23
|
+
site,
|
|
24
|
+
key,
|
|
25
|
+
value,
|
|
26
|
+
},
|
|
27
|
+
});
|
|
28
|
+
},
|
|
25
29
|
};
|
|
@@ -1,41 +1,41 @@
|
|
|
1
|
-
import { getUrl, htmlEncode } from
|
|
2
|
-
import { authedFunction } from
|
|
1
|
+
import { getUrl, htmlEncode } from "../helper";
|
|
2
|
+
import { authedFunction } from "../session";
|
|
3
3
|
|
|
4
4
|
export const templateActions = {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
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
|
-
|
|
5
|
+
getTemplates: (site, featureKey) => {
|
|
6
|
+
const query = { site, featureKey };
|
|
7
|
+
return authedFunction({
|
|
8
|
+
method: "GET",
|
|
9
|
+
url: getUrl("templates", "get/list", query),
|
|
10
|
+
});
|
|
11
|
+
},
|
|
12
|
+
getTemplate: (site, featureKey, rowId) => {
|
|
13
|
+
return authedFunction({
|
|
14
|
+
method: "GET",
|
|
15
|
+
url: getUrl("templates", "get/single", { site, featureKey, rowId }),
|
|
16
|
+
});
|
|
17
|
+
},
|
|
18
|
+
createTemplate: (template) => {
|
|
19
|
+
template.content = htmlEncode(template.content);
|
|
20
|
+
return authedFunction({
|
|
21
|
+
method: "POST",
|
|
22
|
+
url: getUrl("templates", "update/add"),
|
|
23
|
+
data: template,
|
|
24
|
+
});
|
|
25
|
+
},
|
|
26
|
+
editTemplate: (template) => {
|
|
27
|
+
template.content = htmlEncode(template.content);
|
|
28
|
+
return authedFunction({
|
|
29
|
+
method: "POST",
|
|
30
|
+
url: getUrl("templates", "update/edit"),
|
|
31
|
+
data: template,
|
|
32
|
+
});
|
|
33
|
+
},
|
|
34
|
+
deleteTemplate: (site, rowId) => {
|
|
35
|
+
return authedFunction({
|
|
36
|
+
method: "POST",
|
|
37
|
+
url: getUrl("templates", "update/delete"),
|
|
38
|
+
data: { site, rowId },
|
|
39
|
+
});
|
|
40
|
+
},
|
|
41
41
|
};
|
package/src/apis/typeActions.js
CHANGED
|
@@ -1,186 +1,186 @@
|
|
|
1
|
-
import { getUrl } from
|
|
2
|
-
import { authedFunction, unauthedFunction } from
|
|
1
|
+
import { getUrl } from "../helper";
|
|
2
|
+
import { authedFunction, unauthedFunction } from "../session";
|
|
3
3
|
|
|
4
4
|
export const typeActions = {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
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
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
5
|
+
getSubdomains: () => {
|
|
6
|
+
return authedFunction({
|
|
7
|
+
method: "GET",
|
|
8
|
+
url: getUrl("types", "subdomains/get"),
|
|
9
|
+
});
|
|
10
|
+
},
|
|
11
|
+
getSubdomain: (key) => {
|
|
12
|
+
return unauthedFunction({
|
|
13
|
+
method: "GET",
|
|
14
|
+
url: getUrl("types", `subdomains/get/${key}`),
|
|
15
|
+
});
|
|
16
|
+
},
|
|
17
|
+
updateSubdomain: (key, background) => {
|
|
18
|
+
return authedFunction({
|
|
19
|
+
method: "POST",
|
|
20
|
+
url: getUrl("types", "subdomains/update"),
|
|
21
|
+
data: {
|
|
22
|
+
Key: key,
|
|
23
|
+
Background: background,
|
|
24
|
+
},
|
|
25
|
+
});
|
|
26
|
+
},
|
|
27
|
+
getSites: () => {
|
|
28
|
+
let url = getUrl("types", "getsites");
|
|
29
|
+
return authedFunction({
|
|
30
|
+
method: "POST",
|
|
31
|
+
url,
|
|
32
|
+
});
|
|
33
|
+
},
|
|
34
|
+
getSite: async (id) => {
|
|
35
|
+
let url = getUrl("types", `getsite`, { site: id });
|
|
36
|
+
return authedFunction({
|
|
37
|
+
method: "GET",
|
|
38
|
+
url,
|
|
39
|
+
});
|
|
40
|
+
},
|
|
41
|
+
getUserTypes: (site) => {
|
|
42
|
+
let url = getUrl("types", "getusertypes");
|
|
43
|
+
return authedFunction({
|
|
44
|
+
method: "POST",
|
|
45
|
+
url,
|
|
46
|
+
data: {
|
|
47
|
+
site,
|
|
48
|
+
},
|
|
49
|
+
});
|
|
50
|
+
},
|
|
51
|
+
setTypePermissions: (type, adminId) => {
|
|
52
|
+
let url = getUrl("types", "setusertypepermissions");
|
|
53
|
+
return authedFunction({
|
|
54
|
+
method: "POST",
|
|
55
|
+
url,
|
|
56
|
+
data: {
|
|
57
|
+
type,
|
|
58
|
+
},
|
|
59
|
+
});
|
|
60
|
+
},
|
|
61
|
+
deleteUserType: (site, type) => {
|
|
62
|
+
let url = getUrl("types", "usertype/delete");
|
|
63
|
+
return authedFunction({
|
|
64
|
+
method: "POST",
|
|
65
|
+
url,
|
|
66
|
+
data: {
|
|
67
|
+
site,
|
|
68
|
+
id: type,
|
|
69
|
+
},
|
|
70
|
+
});
|
|
71
|
+
},
|
|
72
|
+
createNewSite: (siteName, options) => {
|
|
73
|
+
let url = getUrl("types", "setNewSite");
|
|
74
|
+
const request = {
|
|
75
|
+
method: "POST",
|
|
76
|
+
url,
|
|
77
|
+
data: {
|
|
78
|
+
siteName,
|
|
79
|
+
...options,
|
|
80
|
+
},
|
|
81
|
+
};
|
|
82
|
+
return authedFunction(request);
|
|
83
|
+
},
|
|
84
|
+
signUpNewSite: (site, user) => {
|
|
85
|
+
let url = getUrl("types", "site/signup");
|
|
86
|
+
const request = {
|
|
87
|
+
method: "POST",
|
|
88
|
+
url,
|
|
89
|
+
data: { site, user },
|
|
90
|
+
};
|
|
91
|
+
return unauthedFunction(request);
|
|
92
|
+
},
|
|
93
|
+
getInterface: (id) => {
|
|
94
|
+
return authedFunction({
|
|
95
|
+
method: "GET",
|
|
96
|
+
url: getUrl("types", `interfaces/get/${id}`),
|
|
97
|
+
});
|
|
98
|
+
},
|
|
99
|
+
getInterfaces: (site, type) => {
|
|
100
|
+
const q = { site };
|
|
101
|
+
if (type) {
|
|
102
|
+
q.type = type;
|
|
103
|
+
}
|
|
104
|
+
return authedFunction({
|
|
105
|
+
method: "GET",
|
|
106
|
+
url: getUrl("types", "interfaces/get", q),
|
|
107
|
+
});
|
|
108
|
+
},
|
|
109
|
+
deleteInterface: (id) => {
|
|
110
|
+
const request = {
|
|
111
|
+
method: "POST",
|
|
112
|
+
url: getUrl("types", "interfaces/remove"),
|
|
113
|
+
data: { id },
|
|
114
|
+
};
|
|
115
|
+
return authedFunction(request);
|
|
116
|
+
},
|
|
117
|
+
saveInterface: (site, type, title, settings, id) => {
|
|
118
|
+
const request = {
|
|
119
|
+
method: "POST",
|
|
120
|
+
url: getUrl("types", "interfaces/save"),
|
|
121
|
+
data: { site, type, title, settings, id },
|
|
122
|
+
};
|
|
123
|
+
return authedFunction(request);
|
|
124
|
+
},
|
|
125
|
+
attachInterface: (site, typeName, interfaceId) => {
|
|
126
|
+
const request = {
|
|
127
|
+
method: "POST",
|
|
128
|
+
url: getUrl("types", "interfaces/attach"),
|
|
129
|
+
data: { site, typeName, interfaceId },
|
|
130
|
+
};
|
|
131
|
+
return authedFunction(request);
|
|
132
|
+
},
|
|
133
|
+
getSiteBranding: (site) => {
|
|
134
|
+
const request = {
|
|
135
|
+
method: "GET",
|
|
136
|
+
url: getUrl("types", "branding/get", { site }),
|
|
137
|
+
};
|
|
138
|
+
return unauthedFunction(request);
|
|
139
|
+
},
|
|
140
|
+
generateSiteBranding: (url) => {
|
|
141
|
+
const request = {
|
|
142
|
+
method: "GET",
|
|
143
|
+
url: getUrl("types", "branding/generate", { url }),
|
|
144
|
+
};
|
|
145
|
+
return unauthedFunction(request);
|
|
146
|
+
},
|
|
147
|
+
editSiteBranding: (siteName, branding) => {
|
|
148
|
+
let url = getUrl("types", "editsitebranding");
|
|
149
|
+
const request = {
|
|
150
|
+
method: "POST",
|
|
151
|
+
url,
|
|
152
|
+
data: {
|
|
153
|
+
siteName,
|
|
154
|
+
branding,
|
|
155
|
+
},
|
|
156
|
+
};
|
|
157
|
+
return authedFunction(request);
|
|
158
|
+
},
|
|
159
|
+
editSiteSettings: (site, values) => {
|
|
160
|
+
return authedFunction({
|
|
161
|
+
method: "POST",
|
|
162
|
+
url: getUrl("types", "site/edit"),
|
|
163
|
+
data: {
|
|
164
|
+
Id: site,
|
|
165
|
+
...values,
|
|
166
|
+
},
|
|
167
|
+
});
|
|
168
|
+
},
|
|
169
|
+
getDefaultTVSettings: () => {
|
|
170
|
+
return {
|
|
171
|
+
widgets: [],
|
|
172
|
+
};
|
|
173
|
+
},
|
|
174
|
+
getDefaultTabSettings: () => {
|
|
175
|
+
return [
|
|
176
|
+
{
|
|
177
|
+
key: "tab0",
|
|
178
|
+
tabTitle: "Home",
|
|
179
|
+
type: "home",
|
|
180
|
+
isEnabled: true,
|
|
181
|
+
widgets: [],
|
|
182
|
+
widgetOptions: [],
|
|
183
|
+
},
|
|
184
|
+
];
|
|
185
|
+
},
|
|
186
186
|
};
|