@plusscommunities/pluss-core-web 1.4.36 → 1.5.0-auth.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/dist/index.cjs.js +139 -54
- package/dist/index.esm.js +139 -54
- package/dist/index.umd.js +142 -57
- package/package.json +9 -4
- package/src/apis/fileActions.js +28 -7
- package/src/components/AudienceSelector.js +1 -1
- package/src/components/FileInput.js +1 -1
- package/src/components/ImageInput.js +1 -2
- package/src/components/UserListing.js +0 -1
- package/src/config.js +5 -0
- package/src/session.js +5 -8
- package/src/urls.js +17 -17
package/dist/index.cjs.js
CHANGED
|
@@ -6,12 +6,12 @@ var _asyncToGenerator = require('@babel/runtime/helpers/asyncToGenerator');
|
|
|
6
6
|
var _regeneratorRuntime = require('@babel/runtime/regenerator');
|
|
7
7
|
var _ = require('lodash');
|
|
8
8
|
var axios = require('axios');
|
|
9
|
-
var awsAmplify = require('aws-amplify');
|
|
10
9
|
var _defineProperty = require('@babel/runtime/helpers/defineProperty');
|
|
11
10
|
var moment = require('moment');
|
|
12
11
|
var React = require('react');
|
|
13
12
|
var $ = require('jquery');
|
|
14
13
|
var Cookies = require('js-cookie');
|
|
14
|
+
var awsAmplify = require('aws-amplify');
|
|
15
15
|
var _classCallCheck = require('@babel/runtime/helpers/classCallCheck');
|
|
16
16
|
var _createClass = require('@babel/runtime/helpers/createClass');
|
|
17
17
|
var _inherits = require('@babel/runtime/helpers/inherits');
|
|
@@ -79,7 +79,75 @@ var CoreConfig = {
|
|
|
79
79
|
defaultAllowComments: true,
|
|
80
80
|
makeApiKey: '',
|
|
81
81
|
logo: '',
|
|
82
|
-
clientName: ''
|
|
82
|
+
clientName: '',
|
|
83
|
+
AuthStrategy: {
|
|
84
|
+
getAccessToken: function () {
|
|
85
|
+
var _getAccessToken = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee() {
|
|
86
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee$(_context) {
|
|
87
|
+
while (1) {
|
|
88
|
+
switch (_context.prev = _context.next) {
|
|
89
|
+
case 0:
|
|
90
|
+
return _context.abrupt("return", null);
|
|
91
|
+
|
|
92
|
+
case 1:
|
|
93
|
+
case "end":
|
|
94
|
+
return _context.stop();
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
}, _callee);
|
|
98
|
+
}));
|
|
99
|
+
|
|
100
|
+
function getAccessToken() {
|
|
101
|
+
return _getAccessToken.apply(this, arguments);
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
return getAccessToken;
|
|
105
|
+
}(),
|
|
106
|
+
getCurrentUserId: function () {
|
|
107
|
+
var _getCurrentUserId = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee2() {
|
|
108
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee2$(_context2) {
|
|
109
|
+
while (1) {
|
|
110
|
+
switch (_context2.prev = _context2.next) {
|
|
111
|
+
case 0:
|
|
112
|
+
return _context2.abrupt("return", null);
|
|
113
|
+
|
|
114
|
+
case 1:
|
|
115
|
+
case "end":
|
|
116
|
+
return _context2.stop();
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
}, _callee2);
|
|
120
|
+
}));
|
|
121
|
+
|
|
122
|
+
function getCurrentUserId() {
|
|
123
|
+
return _getCurrentUserId.apply(this, arguments);
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
return getCurrentUserId;
|
|
127
|
+
}(),
|
|
128
|
+
hasActiveSession: function () {
|
|
129
|
+
var _hasActiveSession = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee3() {
|
|
130
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee3$(_context3) {
|
|
131
|
+
while (1) {
|
|
132
|
+
switch (_context3.prev = _context3.next) {
|
|
133
|
+
case 0:
|
|
134
|
+
return _context3.abrupt("return", false);
|
|
135
|
+
|
|
136
|
+
case 1:
|
|
137
|
+
case "end":
|
|
138
|
+
return _context3.stop();
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
}, _callee3);
|
|
142
|
+
}));
|
|
143
|
+
|
|
144
|
+
function hasActiveSession() {
|
|
145
|
+
return _hasActiveSession.apply(this, arguments);
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
return hasActiveSession;
|
|
149
|
+
}()
|
|
150
|
+
}
|
|
83
151
|
},
|
|
84
152
|
init: function init(environment) {
|
|
85
153
|
CoreConfig.env = environment;
|
|
@@ -88,29 +156,28 @@ var CoreConfig = {
|
|
|
88
156
|
|
|
89
157
|
var getSessionTokenAWS = /*#__PURE__*/function () {
|
|
90
158
|
var _ref = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee(prefix) {
|
|
91
|
-
var
|
|
159
|
+
var token;
|
|
92
160
|
return _regeneratorRuntime__default['default'].wrap(function _callee$(_context) {
|
|
93
161
|
while (1) {
|
|
94
162
|
switch (_context.prev = _context.next) {
|
|
95
163
|
case 0:
|
|
96
164
|
_context.next = 2;
|
|
97
|
-
return
|
|
165
|
+
return CoreConfig.env.AuthStrategy.getAccessToken();
|
|
98
166
|
|
|
99
167
|
case 2:
|
|
100
|
-
|
|
101
|
-
token = data.getAccessToken().getJwtToken();
|
|
168
|
+
token = _context.sent;
|
|
102
169
|
|
|
103
170
|
if (!___default['default'].isUndefined(prefix)) {
|
|
104
|
-
_context.next =
|
|
171
|
+
_context.next = 5;
|
|
105
172
|
break;
|
|
106
173
|
}
|
|
107
174
|
|
|
108
175
|
return _context.abrupt("return", token);
|
|
109
176
|
|
|
110
|
-
case
|
|
177
|
+
case 5:
|
|
111
178
|
return _context.abrupt("return", "".concat(prefix, " ").concat(token));
|
|
112
179
|
|
|
113
|
-
case
|
|
180
|
+
case 6:
|
|
114
181
|
case "end":
|
|
115
182
|
return _context.stop();
|
|
116
183
|
}
|
|
@@ -170,30 +237,28 @@ var unauthedFunction = function unauthedFunction(request) {
|
|
|
170
237
|
};
|
|
171
238
|
var getCurrentUserSub = /*#__PURE__*/function () {
|
|
172
239
|
var _ref3 = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee3() {
|
|
173
|
-
var user;
|
|
174
240
|
return _regeneratorRuntime__default['default'].wrap(function _callee3$(_context3) {
|
|
175
241
|
while (1) {
|
|
176
242
|
switch (_context3.prev = _context3.next) {
|
|
177
243
|
case 0:
|
|
178
244
|
_context3.prev = 0;
|
|
179
245
|
_context3.next = 3;
|
|
180
|
-
return
|
|
246
|
+
return CoreConfig.env.AuthStrategy.getCurrentUserId();
|
|
181
247
|
|
|
182
248
|
case 3:
|
|
183
|
-
|
|
184
|
-
return _context3.abrupt("return", user.id);
|
|
249
|
+
return _context3.abrupt("return", _context3.sent);
|
|
185
250
|
|
|
186
|
-
case
|
|
187
|
-
_context3.prev =
|
|
251
|
+
case 6:
|
|
252
|
+
_context3.prev = 6;
|
|
188
253
|
_context3.t0 = _context3["catch"](0);
|
|
189
254
|
return _context3.abrupt("return", null);
|
|
190
255
|
|
|
191
|
-
case
|
|
256
|
+
case 9:
|
|
192
257
|
case "end":
|
|
193
258
|
return _context3.stop();
|
|
194
259
|
}
|
|
195
260
|
}
|
|
196
|
-
}, _callee3, null, [[0,
|
|
261
|
+
}, _callee3, null, [[0, 6]]);
|
|
197
262
|
}));
|
|
198
263
|
|
|
199
264
|
return function getCurrentUserSub() {
|
|
@@ -202,19 +267,19 @@ var getCurrentUserSub = /*#__PURE__*/function () {
|
|
|
202
267
|
}();
|
|
203
268
|
var checkLoggedIn = /*#__PURE__*/function () {
|
|
204
269
|
var _ref4 = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee4(self) {
|
|
205
|
-
var
|
|
270
|
+
var isLoggedIn;
|
|
206
271
|
return _regeneratorRuntime__default['default'].wrap(function _callee4$(_context4) {
|
|
207
272
|
while (1) {
|
|
208
273
|
switch (_context4.prev = _context4.next) {
|
|
209
274
|
case 0:
|
|
210
275
|
_context4.prev = 0;
|
|
211
276
|
_context4.next = 3;
|
|
212
|
-
return
|
|
277
|
+
return CoreConfig.env.AuthStrategy.hasActiveSession();
|
|
213
278
|
|
|
214
279
|
case 3:
|
|
215
|
-
|
|
280
|
+
isLoggedIn = _context4.sent;
|
|
216
281
|
|
|
217
|
-
if (
|
|
282
|
+
if (!isLoggedIn) {
|
|
218
283
|
console.log('redirecting to login');
|
|
219
284
|
self.props.history.push('/login');
|
|
220
285
|
}
|
|
@@ -1654,31 +1719,35 @@ function CanvasImageUploader(options) {
|
|
|
1654
1719
|
var fileActions = {
|
|
1655
1720
|
uploadMediaAsync: function () {
|
|
1656
1721
|
var _uploadMediaAsync = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee(file, filename) {
|
|
1657
|
-
var newFilename,
|
|
1658
|
-
|
|
1722
|
+
var newFilename, signedUrlRes, baseUploadsUrl;
|
|
1659
1723
|
return _regeneratorRuntime__default['default'].wrap(function _callee$(_context) {
|
|
1660
1724
|
while (1) {
|
|
1661
1725
|
switch (_context.prev = _context.next) {
|
|
1662
1726
|
case 0:
|
|
1663
1727
|
newFilename = filename.replace(/[^a-z0-9+.]+/gi, '').toLowerCase();
|
|
1664
1728
|
_context.next = 3;
|
|
1665
|
-
return
|
|
1729
|
+
return authedFunction({
|
|
1730
|
+
method: 'GET',
|
|
1731
|
+
url: getUrl('media', 'get/presignedurl', {
|
|
1732
|
+
filename: newFilename,
|
|
1733
|
+
contentType: file.type
|
|
1734
|
+
})
|
|
1735
|
+
});
|
|
1666
1736
|
|
|
1667
1737
|
case 3:
|
|
1668
|
-
|
|
1669
|
-
|
|
1670
|
-
|
|
1671
|
-
|
|
1672
|
-
|
|
1673
|
-
|
|
1674
|
-
bucket: uploadBucket
|
|
1738
|
+
signedUrlRes = _context.sent;
|
|
1739
|
+
_context.next = 6;
|
|
1740
|
+
return axios__default['default'].put(signedUrlRes.data.url, file, {
|
|
1741
|
+
headers: {
|
|
1742
|
+
'Content-Type': file.type
|
|
1743
|
+
}
|
|
1675
1744
|
});
|
|
1676
1745
|
|
|
1677
|
-
case
|
|
1678
|
-
|
|
1679
|
-
return _context.abrupt("return", "".concat(baseUploadsUrl).concat(
|
|
1746
|
+
case 6:
|
|
1747
|
+
baseUploadsUrl = CoreConfig.env.baseUploadsUrl;
|
|
1748
|
+
return _context.abrupt("return", "".concat(baseUploadsUrl).concat(signedUrlRes.data.key));
|
|
1680
1749
|
|
|
1681
|
-
case
|
|
1750
|
+
case 8:
|
|
1682
1751
|
case "end":
|
|
1683
1752
|
return _context.stop();
|
|
1684
1753
|
}
|
|
@@ -1692,6 +1761,15 @@ var fileActions = {
|
|
|
1692
1761
|
|
|
1693
1762
|
return uploadMediaAsync;
|
|
1694
1763
|
}(),
|
|
1764
|
+
// uploadMediaAsync: async (file, filename) => {
|
|
1765
|
+
// const newFilename = filename.replace(/[^a-z0-9+.]+/gi, '').toLowerCase();
|
|
1766
|
+
// const userId = await getCurrentUserSub();
|
|
1767
|
+
// const url = `uploads/users/${userId}/public/${randomString()}/${newFilename}`;
|
|
1768
|
+
// const { baseUploadsUrl, uploadBucket } = Config.env;
|
|
1769
|
+
// await Storage.put(url, file, { level: 'public', bucket: uploadBucket });
|
|
1770
|
+
// console.log('uploaded file', `${baseUploadsUrl}${url}`);
|
|
1771
|
+
// return `${baseUploadsUrl}${url}`;
|
|
1772
|
+
// },
|
|
1695
1773
|
// readBase64: async (file) => {
|
|
1696
1774
|
// return new Promise((resolve, reject) => {
|
|
1697
1775
|
// var reader = new FileReader();
|
|
@@ -1705,6 +1783,14 @@ var fileActions = {
|
|
|
1705
1783
|
// };
|
|
1706
1784
|
// });
|
|
1707
1785
|
// },
|
|
1786
|
+
getPresignedUrl: function getPresignedUrl(filename) {
|
|
1787
|
+
return authedFunction({
|
|
1788
|
+
method: 'GET',
|
|
1789
|
+
url: getUrl('media', 'get/presignedurl', {
|
|
1790
|
+
filename: filename
|
|
1791
|
+
})
|
|
1792
|
+
});
|
|
1793
|
+
},
|
|
1708
1794
|
compressImage: function compressImage(file, maxSize, quality, noCompress) {
|
|
1709
1795
|
return new Promise(function (resolve, reject) {
|
|
1710
1796
|
if (noCompress) {
|
|
@@ -5219,7 +5305,7 @@ var mapStateToProps$5 = function mapStateToProps() {
|
|
|
5219
5305
|
};
|
|
5220
5306
|
|
|
5221
5307
|
var FileInput = reactRedux.connect(mapStateToProps$5, {}, null, {
|
|
5222
|
-
|
|
5308
|
+
forwardRef: true
|
|
5223
5309
|
})(FileInputComponent);
|
|
5224
5310
|
|
|
5225
5311
|
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; }
|
|
@@ -6928,7 +7014,6 @@ var ImageInputComponent = /*#__PURE__*/function (_Component) {
|
|
|
6928
7014
|
value: function renderLibraryImage(image, index, allowDelete) {
|
|
6929
7015
|
var _this7 = this;
|
|
6930
7016
|
|
|
6931
|
-
console.log(image);
|
|
6932
7017
|
var classes = 'imageInput imageInput-hasImage imageInput-libraryImage';
|
|
6933
7018
|
|
|
6934
7019
|
if (image.Selected) {
|
|
@@ -7327,7 +7412,7 @@ var mapStateToProps$2 = function mapStateToProps(state) {
|
|
|
7327
7412
|
};
|
|
7328
7413
|
|
|
7329
7414
|
var ImageInput = reactRedux.connect(mapStateToProps$2, {}, null, {
|
|
7330
|
-
|
|
7415
|
+
forwardRef: true
|
|
7331
7416
|
})(ImageInputComponent);
|
|
7332
7417
|
|
|
7333
7418
|
function _createSuper$m(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct$m(); 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); }; }
|
|
@@ -9933,7 +10018,7 @@ var AudienceSelector = /*#__PURE__*/function (_Component) {
|
|
|
9933
10018
|
var toExport = reactRedux.connect(null, {
|
|
9934
10019
|
setAuth: setAuth
|
|
9935
10020
|
}, null, {
|
|
9936
|
-
|
|
10021
|
+
forwardRef: true
|
|
9937
10022
|
})(AudienceSelector);
|
|
9938
10023
|
|
|
9939
10024
|
function _createSuper$5(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct$5(); 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); }; }
|
|
@@ -11247,21 +11332,21 @@ var index = /*#__PURE__*/Object.freeze({
|
|
|
11247
11332
|
});
|
|
11248
11333
|
|
|
11249
11334
|
var HelpGuide = {
|
|
11250
|
-
Dashboard: 'https://www.
|
|
11251
|
-
FeaturePicker: 'https://www.
|
|
11252
|
-
News: 'https://www.
|
|
11253
|
-
Events: 'https://www.
|
|
11254
|
-
Alerts: 'https://www.
|
|
11255
|
-
Gallery: 'https://www.
|
|
11256
|
-
Groups: 'https://www.
|
|
11257
|
-
Maintenance: 'https://www.
|
|
11258
|
-
Facilities: 'https://www.
|
|
11259
|
-
Services: 'https://www.
|
|
11260
|
-
Offers: 'https://www.
|
|
11261
|
-
Survey: 'https://www.
|
|
11262
|
-
Information: 'https://www.
|
|
11263
|
-
Users: 'https://plusscommunities.
|
|
11264
|
-
Payment: 'https://plusscommunities.
|
|
11335
|
+
Dashboard: 'https://www.plusscommunities.com/user-guide',
|
|
11336
|
+
FeaturePicker: 'https://www.plusscommunities.com/getting-started-on-community-manager',
|
|
11337
|
+
News: 'https://www.plusscommunities.com/news-feature',
|
|
11338
|
+
Events: 'https://www.plusscommunities.com/events-feature',
|
|
11339
|
+
Alerts: 'https://www.plusscommunities.com/alerts-feature',
|
|
11340
|
+
Gallery: 'https://www.plusscommunities.com/gallery-feature',
|
|
11341
|
+
Groups: 'https://www.plusscommunities.com/groups-feature',
|
|
11342
|
+
Maintenance: 'https://www.plusscommunities.com/maintenance-feature',
|
|
11343
|
+
Facilities: 'https://www.plusscommunities.com/facilities-feature',
|
|
11344
|
+
Services: 'https://www.plusscommunities.com/services-feature',
|
|
11345
|
+
Offers: 'https://www.plusscommunities.com/offers-feature',
|
|
11346
|
+
Survey: 'https://www.plusscommunities.com/surveys-feature',
|
|
11347
|
+
Information: 'https://www.plusscommunities.com/information-feature',
|
|
11348
|
+
Users: 'https://www.plusscommunities.com/managing-your-users',
|
|
11349
|
+
Payment: 'https://www.plusscommunities.com/setting-up-your-payment-gateway'
|
|
11265
11350
|
};
|
|
11266
11351
|
var Urls = {
|
|
11267
11352
|
HelpGuide: HelpGuide
|
package/dist/index.esm.js
CHANGED
|
@@ -2,12 +2,12 @@ import _asyncToGenerator from '@babel/runtime/helpers/asyncToGenerator';
|
|
|
2
2
|
import _regeneratorRuntime from '@babel/runtime/regenerator';
|
|
3
3
|
import _ from 'lodash';
|
|
4
4
|
import axios from 'axios';
|
|
5
|
-
import { Auth, Storage } from 'aws-amplify';
|
|
6
5
|
import _defineProperty from '@babel/runtime/helpers/defineProperty';
|
|
7
6
|
import moment from 'moment';
|
|
8
7
|
import React, { Component, PureComponent } from 'react';
|
|
9
8
|
import $ from 'jquery';
|
|
10
9
|
import Cookies from 'js-cookie';
|
|
10
|
+
import { Storage } from 'aws-amplify';
|
|
11
11
|
import _classCallCheck from '@babel/runtime/helpers/classCallCheck';
|
|
12
12
|
import _createClass from '@babel/runtime/helpers/createClass';
|
|
13
13
|
import _inherits from '@babel/runtime/helpers/inherits';
|
|
@@ -49,7 +49,75 @@ var CoreConfig = {
|
|
|
49
49
|
defaultAllowComments: true,
|
|
50
50
|
makeApiKey: '',
|
|
51
51
|
logo: '',
|
|
52
|
-
clientName: ''
|
|
52
|
+
clientName: '',
|
|
53
|
+
AuthStrategy: {
|
|
54
|
+
getAccessToken: function () {
|
|
55
|
+
var _getAccessToken = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
|
56
|
+
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
57
|
+
while (1) {
|
|
58
|
+
switch (_context.prev = _context.next) {
|
|
59
|
+
case 0:
|
|
60
|
+
return _context.abrupt("return", null);
|
|
61
|
+
|
|
62
|
+
case 1:
|
|
63
|
+
case "end":
|
|
64
|
+
return _context.stop();
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
}, _callee);
|
|
68
|
+
}));
|
|
69
|
+
|
|
70
|
+
function getAccessToken() {
|
|
71
|
+
return _getAccessToken.apply(this, arguments);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
return getAccessToken;
|
|
75
|
+
}(),
|
|
76
|
+
getCurrentUserId: function () {
|
|
77
|
+
var _getCurrentUserId = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
|
|
78
|
+
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
|
79
|
+
while (1) {
|
|
80
|
+
switch (_context2.prev = _context2.next) {
|
|
81
|
+
case 0:
|
|
82
|
+
return _context2.abrupt("return", null);
|
|
83
|
+
|
|
84
|
+
case 1:
|
|
85
|
+
case "end":
|
|
86
|
+
return _context2.stop();
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
}, _callee2);
|
|
90
|
+
}));
|
|
91
|
+
|
|
92
|
+
function getCurrentUserId() {
|
|
93
|
+
return _getCurrentUserId.apply(this, arguments);
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
return getCurrentUserId;
|
|
97
|
+
}(),
|
|
98
|
+
hasActiveSession: function () {
|
|
99
|
+
var _hasActiveSession = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3() {
|
|
100
|
+
return _regeneratorRuntime.wrap(function _callee3$(_context3) {
|
|
101
|
+
while (1) {
|
|
102
|
+
switch (_context3.prev = _context3.next) {
|
|
103
|
+
case 0:
|
|
104
|
+
return _context3.abrupt("return", false);
|
|
105
|
+
|
|
106
|
+
case 1:
|
|
107
|
+
case "end":
|
|
108
|
+
return _context3.stop();
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
}, _callee3);
|
|
112
|
+
}));
|
|
113
|
+
|
|
114
|
+
function hasActiveSession() {
|
|
115
|
+
return _hasActiveSession.apply(this, arguments);
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
return hasActiveSession;
|
|
119
|
+
}()
|
|
120
|
+
}
|
|
53
121
|
},
|
|
54
122
|
init: function init(environment) {
|
|
55
123
|
CoreConfig.env = environment;
|
|
@@ -58,29 +126,28 @@ var CoreConfig = {
|
|
|
58
126
|
|
|
59
127
|
var getSessionTokenAWS = /*#__PURE__*/function () {
|
|
60
128
|
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(prefix) {
|
|
61
|
-
var
|
|
129
|
+
var token;
|
|
62
130
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
63
131
|
while (1) {
|
|
64
132
|
switch (_context.prev = _context.next) {
|
|
65
133
|
case 0:
|
|
66
134
|
_context.next = 2;
|
|
67
|
-
return
|
|
135
|
+
return CoreConfig.env.AuthStrategy.getAccessToken();
|
|
68
136
|
|
|
69
137
|
case 2:
|
|
70
|
-
|
|
71
|
-
token = data.getAccessToken().getJwtToken();
|
|
138
|
+
token = _context.sent;
|
|
72
139
|
|
|
73
140
|
if (!_.isUndefined(prefix)) {
|
|
74
|
-
_context.next =
|
|
141
|
+
_context.next = 5;
|
|
75
142
|
break;
|
|
76
143
|
}
|
|
77
144
|
|
|
78
145
|
return _context.abrupt("return", token);
|
|
79
146
|
|
|
80
|
-
case
|
|
147
|
+
case 5:
|
|
81
148
|
return _context.abrupt("return", "".concat(prefix, " ").concat(token));
|
|
82
149
|
|
|
83
|
-
case
|
|
150
|
+
case 6:
|
|
84
151
|
case "end":
|
|
85
152
|
return _context.stop();
|
|
86
153
|
}
|
|
@@ -140,30 +207,28 @@ var unauthedFunction = function unauthedFunction(request) {
|
|
|
140
207
|
};
|
|
141
208
|
var getCurrentUserSub = /*#__PURE__*/function () {
|
|
142
209
|
var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3() {
|
|
143
|
-
var user;
|
|
144
210
|
return _regeneratorRuntime.wrap(function _callee3$(_context3) {
|
|
145
211
|
while (1) {
|
|
146
212
|
switch (_context3.prev = _context3.next) {
|
|
147
213
|
case 0:
|
|
148
214
|
_context3.prev = 0;
|
|
149
215
|
_context3.next = 3;
|
|
150
|
-
return
|
|
216
|
+
return CoreConfig.env.AuthStrategy.getCurrentUserId();
|
|
151
217
|
|
|
152
218
|
case 3:
|
|
153
|
-
|
|
154
|
-
return _context3.abrupt("return", user.id);
|
|
219
|
+
return _context3.abrupt("return", _context3.sent);
|
|
155
220
|
|
|
156
|
-
case
|
|
157
|
-
_context3.prev =
|
|
221
|
+
case 6:
|
|
222
|
+
_context3.prev = 6;
|
|
158
223
|
_context3.t0 = _context3["catch"](0);
|
|
159
224
|
return _context3.abrupt("return", null);
|
|
160
225
|
|
|
161
|
-
case
|
|
226
|
+
case 9:
|
|
162
227
|
case "end":
|
|
163
228
|
return _context3.stop();
|
|
164
229
|
}
|
|
165
230
|
}
|
|
166
|
-
}, _callee3, null, [[0,
|
|
231
|
+
}, _callee3, null, [[0, 6]]);
|
|
167
232
|
}));
|
|
168
233
|
|
|
169
234
|
return function getCurrentUserSub() {
|
|
@@ -172,19 +237,19 @@ var getCurrentUserSub = /*#__PURE__*/function () {
|
|
|
172
237
|
}();
|
|
173
238
|
var checkLoggedIn = /*#__PURE__*/function () {
|
|
174
239
|
var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee4(self) {
|
|
175
|
-
var
|
|
240
|
+
var isLoggedIn;
|
|
176
241
|
return _regeneratorRuntime.wrap(function _callee4$(_context4) {
|
|
177
242
|
while (1) {
|
|
178
243
|
switch (_context4.prev = _context4.next) {
|
|
179
244
|
case 0:
|
|
180
245
|
_context4.prev = 0;
|
|
181
246
|
_context4.next = 3;
|
|
182
|
-
return
|
|
247
|
+
return CoreConfig.env.AuthStrategy.hasActiveSession();
|
|
183
248
|
|
|
184
249
|
case 3:
|
|
185
|
-
|
|
250
|
+
isLoggedIn = _context4.sent;
|
|
186
251
|
|
|
187
|
-
if (
|
|
252
|
+
if (!isLoggedIn) {
|
|
188
253
|
console.log('redirecting to login');
|
|
189
254
|
self.props.history.push('/login');
|
|
190
255
|
}
|
|
@@ -1624,31 +1689,35 @@ function CanvasImageUploader(options) {
|
|
|
1624
1689
|
var fileActions = {
|
|
1625
1690
|
uploadMediaAsync: function () {
|
|
1626
1691
|
var _uploadMediaAsync = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(file, filename) {
|
|
1627
|
-
var newFilename,
|
|
1628
|
-
|
|
1692
|
+
var newFilename, signedUrlRes, baseUploadsUrl;
|
|
1629
1693
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
1630
1694
|
while (1) {
|
|
1631
1695
|
switch (_context.prev = _context.next) {
|
|
1632
1696
|
case 0:
|
|
1633
1697
|
newFilename = filename.replace(/[^a-z0-9+.]+/gi, '').toLowerCase();
|
|
1634
1698
|
_context.next = 3;
|
|
1635
|
-
return
|
|
1699
|
+
return authedFunction({
|
|
1700
|
+
method: 'GET',
|
|
1701
|
+
url: getUrl('media', 'get/presignedurl', {
|
|
1702
|
+
filename: newFilename,
|
|
1703
|
+
contentType: file.type
|
|
1704
|
+
})
|
|
1705
|
+
});
|
|
1636
1706
|
|
|
1637
1707
|
case 3:
|
|
1638
|
-
|
|
1639
|
-
|
|
1640
|
-
|
|
1641
|
-
|
|
1642
|
-
|
|
1643
|
-
|
|
1644
|
-
bucket: uploadBucket
|
|
1708
|
+
signedUrlRes = _context.sent;
|
|
1709
|
+
_context.next = 6;
|
|
1710
|
+
return axios.put(signedUrlRes.data.url, file, {
|
|
1711
|
+
headers: {
|
|
1712
|
+
'Content-Type': file.type
|
|
1713
|
+
}
|
|
1645
1714
|
});
|
|
1646
1715
|
|
|
1647
|
-
case
|
|
1648
|
-
|
|
1649
|
-
return _context.abrupt("return", "".concat(baseUploadsUrl).concat(
|
|
1716
|
+
case 6:
|
|
1717
|
+
baseUploadsUrl = CoreConfig.env.baseUploadsUrl;
|
|
1718
|
+
return _context.abrupt("return", "".concat(baseUploadsUrl).concat(signedUrlRes.data.key));
|
|
1650
1719
|
|
|
1651
|
-
case
|
|
1720
|
+
case 8:
|
|
1652
1721
|
case "end":
|
|
1653
1722
|
return _context.stop();
|
|
1654
1723
|
}
|
|
@@ -1662,6 +1731,15 @@ var fileActions = {
|
|
|
1662
1731
|
|
|
1663
1732
|
return uploadMediaAsync;
|
|
1664
1733
|
}(),
|
|
1734
|
+
// uploadMediaAsync: async (file, filename) => {
|
|
1735
|
+
// const newFilename = filename.replace(/[^a-z0-9+.]+/gi, '').toLowerCase();
|
|
1736
|
+
// const userId = await getCurrentUserSub();
|
|
1737
|
+
// const url = `uploads/users/${userId}/public/${randomString()}/${newFilename}`;
|
|
1738
|
+
// const { baseUploadsUrl, uploadBucket } = Config.env;
|
|
1739
|
+
// await Storage.put(url, file, { level: 'public', bucket: uploadBucket });
|
|
1740
|
+
// console.log('uploaded file', `${baseUploadsUrl}${url}`);
|
|
1741
|
+
// return `${baseUploadsUrl}${url}`;
|
|
1742
|
+
// },
|
|
1665
1743
|
// readBase64: async (file) => {
|
|
1666
1744
|
// return new Promise((resolve, reject) => {
|
|
1667
1745
|
// var reader = new FileReader();
|
|
@@ -1675,6 +1753,14 @@ var fileActions = {
|
|
|
1675
1753
|
// };
|
|
1676
1754
|
// });
|
|
1677
1755
|
// },
|
|
1756
|
+
getPresignedUrl: function getPresignedUrl(filename) {
|
|
1757
|
+
return authedFunction({
|
|
1758
|
+
method: 'GET',
|
|
1759
|
+
url: getUrl('media', 'get/presignedurl', {
|
|
1760
|
+
filename: filename
|
|
1761
|
+
})
|
|
1762
|
+
});
|
|
1763
|
+
},
|
|
1678
1764
|
compressImage: function compressImage(file, maxSize, quality, noCompress) {
|
|
1679
1765
|
return new Promise(function (resolve, reject) {
|
|
1680
1766
|
if (noCompress) {
|
|
@@ -5189,7 +5275,7 @@ var mapStateToProps$5 = function mapStateToProps() {
|
|
|
5189
5275
|
};
|
|
5190
5276
|
|
|
5191
5277
|
var FileInput = connect(mapStateToProps$5, {}, null, {
|
|
5192
|
-
|
|
5278
|
+
forwardRef: true
|
|
5193
5279
|
})(FileInputComponent);
|
|
5194
5280
|
|
|
5195
5281
|
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; }
|
|
@@ -6898,7 +6984,6 @@ var ImageInputComponent = /*#__PURE__*/function (_Component) {
|
|
|
6898
6984
|
value: function renderLibraryImage(image, index, allowDelete) {
|
|
6899
6985
|
var _this7 = this;
|
|
6900
6986
|
|
|
6901
|
-
console.log(image);
|
|
6902
6987
|
var classes = 'imageInput imageInput-hasImage imageInput-libraryImage';
|
|
6903
6988
|
|
|
6904
6989
|
if (image.Selected) {
|
|
@@ -7297,7 +7382,7 @@ var mapStateToProps$2 = function mapStateToProps(state) {
|
|
|
7297
7382
|
};
|
|
7298
7383
|
|
|
7299
7384
|
var ImageInput = connect(mapStateToProps$2, {}, null, {
|
|
7300
|
-
|
|
7385
|
+
forwardRef: true
|
|
7301
7386
|
})(ImageInputComponent);
|
|
7302
7387
|
|
|
7303
7388
|
function _createSuper$m(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct$m(); 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); }; }
|
|
@@ -9903,7 +9988,7 @@ var AudienceSelector = /*#__PURE__*/function (_Component) {
|
|
|
9903
9988
|
var toExport = connect(null, {
|
|
9904
9989
|
setAuth: setAuth
|
|
9905
9990
|
}, null, {
|
|
9906
|
-
|
|
9991
|
+
forwardRef: true
|
|
9907
9992
|
})(AudienceSelector);
|
|
9908
9993
|
|
|
9909
9994
|
function _createSuper$5(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct$5(); 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); }; }
|
|
@@ -11217,21 +11302,21 @@ var index = /*#__PURE__*/Object.freeze({
|
|
|
11217
11302
|
});
|
|
11218
11303
|
|
|
11219
11304
|
var HelpGuide = {
|
|
11220
|
-
Dashboard: 'https://www.
|
|
11221
|
-
FeaturePicker: 'https://www.
|
|
11222
|
-
News: 'https://www.
|
|
11223
|
-
Events: 'https://www.
|
|
11224
|
-
Alerts: 'https://www.
|
|
11225
|
-
Gallery: 'https://www.
|
|
11226
|
-
Groups: 'https://www.
|
|
11227
|
-
Maintenance: 'https://www.
|
|
11228
|
-
Facilities: 'https://www.
|
|
11229
|
-
Services: 'https://www.
|
|
11230
|
-
Offers: 'https://www.
|
|
11231
|
-
Survey: 'https://www.
|
|
11232
|
-
Information: 'https://www.
|
|
11233
|
-
Users: 'https://plusscommunities.
|
|
11234
|
-
Payment: 'https://plusscommunities.
|
|
11305
|
+
Dashboard: 'https://www.plusscommunities.com/user-guide',
|
|
11306
|
+
FeaturePicker: 'https://www.plusscommunities.com/getting-started-on-community-manager',
|
|
11307
|
+
News: 'https://www.plusscommunities.com/news-feature',
|
|
11308
|
+
Events: 'https://www.plusscommunities.com/events-feature',
|
|
11309
|
+
Alerts: 'https://www.plusscommunities.com/alerts-feature',
|
|
11310
|
+
Gallery: 'https://www.plusscommunities.com/gallery-feature',
|
|
11311
|
+
Groups: 'https://www.plusscommunities.com/groups-feature',
|
|
11312
|
+
Maintenance: 'https://www.plusscommunities.com/maintenance-feature',
|
|
11313
|
+
Facilities: 'https://www.plusscommunities.com/facilities-feature',
|
|
11314
|
+
Services: 'https://www.plusscommunities.com/services-feature',
|
|
11315
|
+
Offers: 'https://www.plusscommunities.com/offers-feature',
|
|
11316
|
+
Survey: 'https://www.plusscommunities.com/surveys-feature',
|
|
11317
|
+
Information: 'https://www.plusscommunities.com/information-feature',
|
|
11318
|
+
Users: 'https://www.plusscommunities.com/managing-your-users',
|
|
11319
|
+
Payment: 'https://www.plusscommunities.com/setting-up-your-payment-gateway'
|
|
11235
11320
|
};
|
|
11236
11321
|
var Urls = {
|
|
11237
11322
|
HelpGuide: HelpGuide
|
package/dist/index.umd.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
(function (global, factory) {
|
|
2
|
-
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@babel/runtime/helpers/asyncToGenerator'), require('@babel/runtime/regenerator'), require('lodash'), require('axios'), require('
|
|
3
|
-
typeof define === 'function' && define.amd ? define(['exports', '@babel/runtime/helpers/asyncToGenerator', '@babel/runtime/regenerator', 'lodash', 'axios', '
|
|
4
|
-
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global['@plusscommunities/pluss-core-web'] = {}, global._asyncToGenerator, global._regeneratorRuntime, global._, global.axios, global.
|
|
5
|
-
}(this, (function (exports, _asyncToGenerator, _regeneratorRuntime, _, axios,
|
|
2
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@babel/runtime/helpers/asyncToGenerator'), require('@babel/runtime/regenerator'), require('lodash'), require('axios'), require('@babel/runtime/helpers/defineProperty'), require('moment'), require('react'), require('jquery'), require('js-cookie'), require('aws-amplify'), require('@babel/runtime/helpers/classCallCheck'), require('@babel/runtime/helpers/createClass'), require('@babel/runtime/helpers/inherits'), require('@babel/runtime/helpers/possibleConstructorReturn'), require('@babel/runtime/helpers/getPrototypeOf'), require('react-fontawesome'), require('@babel/runtime/helpers/extends'), require('@babel/runtime/helpers/assertThisInitialized'), require('react-redux'), require('react-textarea-autosize'), require('@babel/runtime/helpers/toConsumableArray'), require('@babel/runtime/helpers/typeof'), require('react-dropzone'), require('react-router'), require('react-bootstrap'), require('@fortawesome/react-fontawesome'), require('@crello/react-lottie'), require('react-csv'), require('@babel/runtime/helpers/objectWithoutProperties'), require('react-color'), require('tinycolor2'), require('react-router-dom'), require('@fortawesome/free-solid-svg-icons')) :
|
|
3
|
+
typeof define === 'function' && define.amd ? define(['exports', '@babel/runtime/helpers/asyncToGenerator', '@babel/runtime/regenerator', 'lodash', 'axios', '@babel/runtime/helpers/defineProperty', 'moment', 'react', 'jquery', 'js-cookie', 'aws-amplify', '@babel/runtime/helpers/classCallCheck', '@babel/runtime/helpers/createClass', '@babel/runtime/helpers/inherits', '@babel/runtime/helpers/possibleConstructorReturn', '@babel/runtime/helpers/getPrototypeOf', 'react-fontawesome', '@babel/runtime/helpers/extends', '@babel/runtime/helpers/assertThisInitialized', 'react-redux', 'react-textarea-autosize', '@babel/runtime/helpers/toConsumableArray', '@babel/runtime/helpers/typeof', 'react-dropzone', 'react-router', 'react-bootstrap', '@fortawesome/react-fontawesome', '@crello/react-lottie', 'react-csv', '@babel/runtime/helpers/objectWithoutProperties', 'react-color', 'tinycolor2', 'react-router-dom', '@fortawesome/free-solid-svg-icons'], factory) :
|
|
4
|
+
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global['@plusscommunities/pluss-core-web'] = {}, global._asyncToGenerator, global._regeneratorRuntime, global._, global.axios, global._defineProperty, global.moment, global.React, global.$, global.Cookies, global.awsAmplify, global._classCallCheck, global._createClass, global._inherits, global._possibleConstructorReturn, global._getPrototypeOf, global.FontAwesome, global._extends, global._assertThisInitialized, global.reactRedux, global.Textarea, global._toConsumableArray, global._typeof, global.Dropzone, global.reactRouter, global.reactBootstrap, global.reactFontawesome, global.reactLottie, global.reactCsv, global._objectWithoutProperties, global.reactColor, global.tinycolor, global.reactRouterDom, global.freeSolidSvgIcons));
|
|
5
|
+
}(this, (function (exports, _asyncToGenerator, _regeneratorRuntime, _, axios, _defineProperty, moment, React, $, Cookies, awsAmplify, _classCallCheck, _createClass, _inherits, _possibleConstructorReturn, _getPrototypeOf, FontAwesome, _extends, _assertThisInitialized, reactRedux, Textarea, _toConsumableArray, _typeof, Dropzone, reactRouter, reactBootstrap, reactFontawesome, reactLottie, reactCsv, _objectWithoutProperties, reactColor, tinycolor, reactRouterDom, freeSolidSvgIcons) { 'use strict';
|
|
6
6
|
|
|
7
7
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
8
8
|
|
|
@@ -47,7 +47,75 @@
|
|
|
47
47
|
defaultAllowComments: true,
|
|
48
48
|
makeApiKey: '',
|
|
49
49
|
logo: '',
|
|
50
|
-
clientName: ''
|
|
50
|
+
clientName: '',
|
|
51
|
+
AuthStrategy: {
|
|
52
|
+
getAccessToken: function () {
|
|
53
|
+
var _getAccessToken = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee() {
|
|
54
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee$(_context) {
|
|
55
|
+
while (1) {
|
|
56
|
+
switch (_context.prev = _context.next) {
|
|
57
|
+
case 0:
|
|
58
|
+
return _context.abrupt("return", null);
|
|
59
|
+
|
|
60
|
+
case 1:
|
|
61
|
+
case "end":
|
|
62
|
+
return _context.stop();
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
}, _callee);
|
|
66
|
+
}));
|
|
67
|
+
|
|
68
|
+
function getAccessToken() {
|
|
69
|
+
return _getAccessToken.apply(this, arguments);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
return getAccessToken;
|
|
73
|
+
}(),
|
|
74
|
+
getCurrentUserId: function () {
|
|
75
|
+
var _getCurrentUserId = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee2() {
|
|
76
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee2$(_context2) {
|
|
77
|
+
while (1) {
|
|
78
|
+
switch (_context2.prev = _context2.next) {
|
|
79
|
+
case 0:
|
|
80
|
+
return _context2.abrupt("return", null);
|
|
81
|
+
|
|
82
|
+
case 1:
|
|
83
|
+
case "end":
|
|
84
|
+
return _context2.stop();
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
}, _callee2);
|
|
88
|
+
}));
|
|
89
|
+
|
|
90
|
+
function getCurrentUserId() {
|
|
91
|
+
return _getCurrentUserId.apply(this, arguments);
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
return getCurrentUserId;
|
|
95
|
+
}(),
|
|
96
|
+
hasActiveSession: function () {
|
|
97
|
+
var _hasActiveSession = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee3() {
|
|
98
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee3$(_context3) {
|
|
99
|
+
while (1) {
|
|
100
|
+
switch (_context3.prev = _context3.next) {
|
|
101
|
+
case 0:
|
|
102
|
+
return _context3.abrupt("return", false);
|
|
103
|
+
|
|
104
|
+
case 1:
|
|
105
|
+
case "end":
|
|
106
|
+
return _context3.stop();
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
}, _callee3);
|
|
110
|
+
}));
|
|
111
|
+
|
|
112
|
+
function hasActiveSession() {
|
|
113
|
+
return _hasActiveSession.apply(this, arguments);
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
return hasActiveSession;
|
|
117
|
+
}()
|
|
118
|
+
}
|
|
51
119
|
},
|
|
52
120
|
init: function init(environment) {
|
|
53
121
|
CoreConfig.env = environment;
|
|
@@ -56,29 +124,28 @@
|
|
|
56
124
|
|
|
57
125
|
var getSessionTokenAWS = /*#__PURE__*/function () {
|
|
58
126
|
var _ref = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee(prefix) {
|
|
59
|
-
var
|
|
127
|
+
var token;
|
|
60
128
|
return _regeneratorRuntime__default['default'].wrap(function _callee$(_context) {
|
|
61
129
|
while (1) {
|
|
62
130
|
switch (_context.prev = _context.next) {
|
|
63
131
|
case 0:
|
|
64
132
|
_context.next = 2;
|
|
65
|
-
return
|
|
133
|
+
return CoreConfig.env.AuthStrategy.getAccessToken();
|
|
66
134
|
|
|
67
135
|
case 2:
|
|
68
|
-
|
|
69
|
-
token = data.getAccessToken().getJwtToken();
|
|
136
|
+
token = _context.sent;
|
|
70
137
|
|
|
71
138
|
if (!___default['default'].isUndefined(prefix)) {
|
|
72
|
-
_context.next =
|
|
139
|
+
_context.next = 5;
|
|
73
140
|
break;
|
|
74
141
|
}
|
|
75
142
|
|
|
76
143
|
return _context.abrupt("return", token);
|
|
77
144
|
|
|
78
|
-
case
|
|
145
|
+
case 5:
|
|
79
146
|
return _context.abrupt("return", "".concat(prefix, " ").concat(token));
|
|
80
147
|
|
|
81
|
-
case
|
|
148
|
+
case 6:
|
|
82
149
|
case "end":
|
|
83
150
|
return _context.stop();
|
|
84
151
|
}
|
|
@@ -138,30 +205,28 @@
|
|
|
138
205
|
};
|
|
139
206
|
var getCurrentUserSub = /*#__PURE__*/function () {
|
|
140
207
|
var _ref3 = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee3() {
|
|
141
|
-
var user;
|
|
142
208
|
return _regeneratorRuntime__default['default'].wrap(function _callee3$(_context3) {
|
|
143
209
|
while (1) {
|
|
144
210
|
switch (_context3.prev = _context3.next) {
|
|
145
211
|
case 0:
|
|
146
212
|
_context3.prev = 0;
|
|
147
213
|
_context3.next = 3;
|
|
148
|
-
return
|
|
214
|
+
return CoreConfig.env.AuthStrategy.getCurrentUserId();
|
|
149
215
|
|
|
150
216
|
case 3:
|
|
151
|
-
|
|
152
|
-
return _context3.abrupt("return", user.id);
|
|
217
|
+
return _context3.abrupt("return", _context3.sent);
|
|
153
218
|
|
|
154
|
-
case
|
|
155
|
-
_context3.prev =
|
|
219
|
+
case 6:
|
|
220
|
+
_context3.prev = 6;
|
|
156
221
|
_context3.t0 = _context3["catch"](0);
|
|
157
222
|
return _context3.abrupt("return", null);
|
|
158
223
|
|
|
159
|
-
case
|
|
224
|
+
case 9:
|
|
160
225
|
case "end":
|
|
161
226
|
return _context3.stop();
|
|
162
227
|
}
|
|
163
228
|
}
|
|
164
|
-
}, _callee3, null, [[0,
|
|
229
|
+
}, _callee3, null, [[0, 6]]);
|
|
165
230
|
}));
|
|
166
231
|
|
|
167
232
|
return function getCurrentUserSub() {
|
|
@@ -170,19 +235,19 @@
|
|
|
170
235
|
}();
|
|
171
236
|
var checkLoggedIn = /*#__PURE__*/function () {
|
|
172
237
|
var _ref4 = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee4(self) {
|
|
173
|
-
var
|
|
238
|
+
var isLoggedIn;
|
|
174
239
|
return _regeneratorRuntime__default['default'].wrap(function _callee4$(_context4) {
|
|
175
240
|
while (1) {
|
|
176
241
|
switch (_context4.prev = _context4.next) {
|
|
177
242
|
case 0:
|
|
178
243
|
_context4.prev = 0;
|
|
179
244
|
_context4.next = 3;
|
|
180
|
-
return
|
|
245
|
+
return CoreConfig.env.AuthStrategy.hasActiveSession();
|
|
181
246
|
|
|
182
247
|
case 3:
|
|
183
|
-
|
|
248
|
+
isLoggedIn = _context4.sent;
|
|
184
249
|
|
|
185
|
-
if (
|
|
250
|
+
if (!isLoggedIn) {
|
|
186
251
|
console.log('redirecting to login');
|
|
187
252
|
self.props.history.push('/login');
|
|
188
253
|
}
|
|
@@ -1622,31 +1687,35 @@
|
|
|
1622
1687
|
var fileActions = {
|
|
1623
1688
|
uploadMediaAsync: function () {
|
|
1624
1689
|
var _uploadMediaAsync = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee(file, filename) {
|
|
1625
|
-
var newFilename,
|
|
1626
|
-
|
|
1690
|
+
var newFilename, signedUrlRes, baseUploadsUrl;
|
|
1627
1691
|
return _regeneratorRuntime__default['default'].wrap(function _callee$(_context) {
|
|
1628
1692
|
while (1) {
|
|
1629
1693
|
switch (_context.prev = _context.next) {
|
|
1630
1694
|
case 0:
|
|
1631
1695
|
newFilename = filename.replace(/[^a-z0-9+.]+/gi, '').toLowerCase();
|
|
1632
1696
|
_context.next = 3;
|
|
1633
|
-
return
|
|
1697
|
+
return authedFunction({
|
|
1698
|
+
method: 'GET',
|
|
1699
|
+
url: getUrl('media', 'get/presignedurl', {
|
|
1700
|
+
filename: newFilename,
|
|
1701
|
+
contentType: file.type
|
|
1702
|
+
})
|
|
1703
|
+
});
|
|
1634
1704
|
|
|
1635
1705
|
case 3:
|
|
1636
|
-
|
|
1637
|
-
|
|
1638
|
-
|
|
1639
|
-
|
|
1640
|
-
|
|
1641
|
-
|
|
1642
|
-
bucket: uploadBucket
|
|
1706
|
+
signedUrlRes = _context.sent;
|
|
1707
|
+
_context.next = 6;
|
|
1708
|
+
return axios__default['default'].put(signedUrlRes.data.url, file, {
|
|
1709
|
+
headers: {
|
|
1710
|
+
'Content-Type': file.type
|
|
1711
|
+
}
|
|
1643
1712
|
});
|
|
1644
1713
|
|
|
1645
|
-
case
|
|
1646
|
-
|
|
1647
|
-
return _context.abrupt("return", "".concat(baseUploadsUrl).concat(
|
|
1714
|
+
case 6:
|
|
1715
|
+
baseUploadsUrl = CoreConfig.env.baseUploadsUrl;
|
|
1716
|
+
return _context.abrupt("return", "".concat(baseUploadsUrl).concat(signedUrlRes.data.key));
|
|
1648
1717
|
|
|
1649
|
-
case
|
|
1718
|
+
case 8:
|
|
1650
1719
|
case "end":
|
|
1651
1720
|
return _context.stop();
|
|
1652
1721
|
}
|
|
@@ -1660,6 +1729,15 @@
|
|
|
1660
1729
|
|
|
1661
1730
|
return uploadMediaAsync;
|
|
1662
1731
|
}(),
|
|
1732
|
+
// uploadMediaAsync: async (file, filename) => {
|
|
1733
|
+
// const newFilename = filename.replace(/[^a-z0-9+.]+/gi, '').toLowerCase();
|
|
1734
|
+
// const userId = await getCurrentUserSub();
|
|
1735
|
+
// const url = `uploads/users/${userId}/public/${randomString()}/${newFilename}`;
|
|
1736
|
+
// const { baseUploadsUrl, uploadBucket } = Config.env;
|
|
1737
|
+
// await Storage.put(url, file, { level: 'public', bucket: uploadBucket });
|
|
1738
|
+
// console.log('uploaded file', `${baseUploadsUrl}${url}`);
|
|
1739
|
+
// return `${baseUploadsUrl}${url}`;
|
|
1740
|
+
// },
|
|
1663
1741
|
// readBase64: async (file) => {
|
|
1664
1742
|
// return new Promise((resolve, reject) => {
|
|
1665
1743
|
// var reader = new FileReader();
|
|
@@ -1673,6 +1751,14 @@
|
|
|
1673
1751
|
// };
|
|
1674
1752
|
// });
|
|
1675
1753
|
// },
|
|
1754
|
+
getPresignedUrl: function getPresignedUrl(filename) {
|
|
1755
|
+
return authedFunction({
|
|
1756
|
+
method: 'GET',
|
|
1757
|
+
url: getUrl('media', 'get/presignedurl', {
|
|
1758
|
+
filename: filename
|
|
1759
|
+
})
|
|
1760
|
+
});
|
|
1761
|
+
},
|
|
1676
1762
|
compressImage: function compressImage(file, maxSize, quality, noCompress) {
|
|
1677
1763
|
return new Promise(function (resolve, reject) {
|
|
1678
1764
|
if (noCompress) {
|
|
@@ -5187,7 +5273,7 @@
|
|
|
5187
5273
|
};
|
|
5188
5274
|
|
|
5189
5275
|
var FileInput = reactRedux.connect(mapStateToProps$5, {}, null, {
|
|
5190
|
-
|
|
5276
|
+
forwardRef: true
|
|
5191
5277
|
})(FileInputComponent);
|
|
5192
5278
|
|
|
5193
5279
|
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; }
|
|
@@ -6896,7 +6982,6 @@
|
|
|
6896
6982
|
value: function renderLibraryImage(image, index, allowDelete) {
|
|
6897
6983
|
var _this7 = this;
|
|
6898
6984
|
|
|
6899
|
-
console.log(image);
|
|
6900
6985
|
var classes = 'imageInput imageInput-hasImage imageInput-libraryImage';
|
|
6901
6986
|
|
|
6902
6987
|
if (image.Selected) {
|
|
@@ -7295,7 +7380,7 @@
|
|
|
7295
7380
|
};
|
|
7296
7381
|
|
|
7297
7382
|
var ImageInput = reactRedux.connect(mapStateToProps$2, {}, null, {
|
|
7298
|
-
|
|
7383
|
+
forwardRef: true
|
|
7299
7384
|
})(ImageInputComponent);
|
|
7300
7385
|
|
|
7301
7386
|
function _createSuper$m(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct$m(); 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); }; }
|
|
@@ -9901,7 +9986,7 @@
|
|
|
9901
9986
|
var toExport = reactRedux.connect(null, {
|
|
9902
9987
|
setAuth: setAuth
|
|
9903
9988
|
}, null, {
|
|
9904
|
-
|
|
9989
|
+
forwardRef: true
|
|
9905
9990
|
})(AudienceSelector);
|
|
9906
9991
|
|
|
9907
9992
|
function _createSuper$5(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct$5(); 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); }; }
|
|
@@ -11215,21 +11300,21 @@
|
|
|
11215
11300
|
});
|
|
11216
11301
|
|
|
11217
11302
|
var HelpGuide = {
|
|
11218
|
-
Dashboard: 'https://www.
|
|
11219
|
-
FeaturePicker: 'https://www.
|
|
11220
|
-
News: 'https://www.
|
|
11221
|
-
Events: 'https://www.
|
|
11222
|
-
Alerts: 'https://www.
|
|
11223
|
-
Gallery: 'https://www.
|
|
11224
|
-
Groups: 'https://www.
|
|
11225
|
-
Maintenance: 'https://www.
|
|
11226
|
-
Facilities: 'https://www.
|
|
11227
|
-
Services: 'https://www.
|
|
11228
|
-
Offers: 'https://www.
|
|
11229
|
-
Survey: 'https://www.
|
|
11230
|
-
Information: 'https://www.
|
|
11231
|
-
Users: 'https://plusscommunities.
|
|
11232
|
-
Payment: 'https://plusscommunities.
|
|
11303
|
+
Dashboard: 'https://www.plusscommunities.com/user-guide',
|
|
11304
|
+
FeaturePicker: 'https://www.plusscommunities.com/getting-started-on-community-manager',
|
|
11305
|
+
News: 'https://www.plusscommunities.com/news-feature',
|
|
11306
|
+
Events: 'https://www.plusscommunities.com/events-feature',
|
|
11307
|
+
Alerts: 'https://www.plusscommunities.com/alerts-feature',
|
|
11308
|
+
Gallery: 'https://www.plusscommunities.com/gallery-feature',
|
|
11309
|
+
Groups: 'https://www.plusscommunities.com/groups-feature',
|
|
11310
|
+
Maintenance: 'https://www.plusscommunities.com/maintenance-feature',
|
|
11311
|
+
Facilities: 'https://www.plusscommunities.com/facilities-feature',
|
|
11312
|
+
Services: 'https://www.plusscommunities.com/services-feature',
|
|
11313
|
+
Offers: 'https://www.plusscommunities.com/offers-feature',
|
|
11314
|
+
Survey: 'https://www.plusscommunities.com/surveys-feature',
|
|
11315
|
+
Information: 'https://www.plusscommunities.com/information-feature',
|
|
11316
|
+
Users: 'https://www.plusscommunities.com/managing-your-users',
|
|
11317
|
+
Payment: 'https://www.plusscommunities.com/setting-up-your-payment-gateway'
|
|
11233
11318
|
};
|
|
11234
11319
|
var Urls = {
|
|
11235
11320
|
HelpGuide: HelpGuide
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@plusscommunities/pluss-core-web",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.5.0-auth.0",
|
|
4
4
|
"description": "Core extension package for Pluss Communities platform",
|
|
5
5
|
"main": "dist/index.cjs.js",
|
|
6
6
|
"scripts": {
|
|
@@ -9,6 +9,9 @@
|
|
|
9
9
|
"patch": "npm version patch",
|
|
10
10
|
"betaupload": "npm run build && npm publish --access public --tag beta && rm -rf node_modules",
|
|
11
11
|
"betaupload:p": "npm run betapatch && npm run betaupload",
|
|
12
|
+
"authpatch": "npm version prepatch --preid=auth",
|
|
13
|
+
"authupload": "npm run build && npm publish --access public --tag auth && rm -rf node_modules",
|
|
14
|
+
"authupload:p": "npm run authpatch && npm run authupload",
|
|
12
15
|
"upload": "npm run build && npm publish --access public && rm -rf node_modules",
|
|
13
16
|
"upload:p": "npm run patch && npm run upload"
|
|
14
17
|
},
|
|
@@ -28,18 +31,20 @@
|
|
|
28
31
|
"rollup-plugin-styles": "^3.14.1"
|
|
29
32
|
},
|
|
30
33
|
"dependencies": {
|
|
31
|
-
"@babel/runtime": "^7.14.0"
|
|
34
|
+
"@babel/runtime": "^7.14.0"
|
|
35
|
+
},
|
|
36
|
+
"peerDependencies": {
|
|
32
37
|
"@fortawesome/fontawesome-svg-core": "^6.4.0",
|
|
33
38
|
"@fortawesome/free-solid-svg-icons": "^6.4.0",
|
|
34
39
|
"@fortawesome/react-fontawesome": "^0.2.0",
|
|
35
40
|
"jquery": "^3.2.1",
|
|
36
41
|
"js-cookie": "^2.2.0",
|
|
37
42
|
"lodash": "^4.17.4",
|
|
38
|
-
"moment": "^2.
|
|
43
|
+
"moment": "^2.30.1",
|
|
39
44
|
"react": "^16.14.0",
|
|
40
45
|
"react-dropzone": "^14.2.3",
|
|
41
46
|
"react-fontawesome": "^1.6.1",
|
|
42
|
-
"react-redux": "^
|
|
47
|
+
"react-redux": "^7.2.9",
|
|
43
48
|
"react-router-dom": "^4.2.2",
|
|
44
49
|
"react-textarea-autosize": "^7.1.0-1"
|
|
45
50
|
},
|
package/src/apis/fileActions.js
CHANGED
|
@@ -4,18 +4,33 @@ import { Storage } from 'aws-amplify';
|
|
|
4
4
|
import CanvasImageUploader from '../helper/files/canvasImageUploader';
|
|
5
5
|
import $ from 'jquery';
|
|
6
6
|
import { generateImageName, randomString, getUrl } from '../helper';
|
|
7
|
+
import Axios from 'axios';
|
|
7
8
|
|
|
8
9
|
export const fileActions = {
|
|
9
10
|
uploadMediaAsync: async (file, filename) => {
|
|
10
11
|
const newFilename = filename.replace(/[^a-z0-9+.]+/gi, '').toLowerCase();
|
|
11
|
-
const
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
await
|
|
16
|
-
|
|
17
|
-
|
|
12
|
+
const signedUrlRes = await authedFunction({
|
|
13
|
+
method: 'GET',
|
|
14
|
+
url: getUrl('media', 'get/presignedurl', { filename: newFilename, contentType: file.type }),
|
|
15
|
+
});
|
|
16
|
+
await Axios.put(signedUrlRes.data.url, file, {
|
|
17
|
+
headers: {
|
|
18
|
+
'Content-Type': file.type,
|
|
19
|
+
},
|
|
20
|
+
});
|
|
21
|
+
const { baseUploadsUrl } = Config.env;
|
|
22
|
+
return `${baseUploadsUrl}${signedUrlRes.data.key}`;
|
|
18
23
|
},
|
|
24
|
+
// uploadMediaAsync: async (file, filename) => {
|
|
25
|
+
// const newFilename = filename.replace(/[^a-z0-9+.]+/gi, '').toLowerCase();
|
|
26
|
+
// const userId = await getCurrentUserSub();
|
|
27
|
+
// const url = `uploads/users/${userId}/public/${randomString()}/${newFilename}`;
|
|
28
|
+
|
|
29
|
+
// const { baseUploadsUrl, uploadBucket } = Config.env;
|
|
30
|
+
// await Storage.put(url, file, { level: 'public', bucket: uploadBucket });
|
|
31
|
+
// console.log('uploaded file', `${baseUploadsUrl}${url}`);
|
|
32
|
+
// return `${baseUploadsUrl}${url}`;
|
|
33
|
+
// },
|
|
19
34
|
|
|
20
35
|
// readBase64: async (file) => {
|
|
21
36
|
// return new Promise((resolve, reject) => {
|
|
@@ -30,6 +45,12 @@ export const fileActions = {
|
|
|
30
45
|
// };
|
|
31
46
|
// });
|
|
32
47
|
// },
|
|
48
|
+
getPresignedUrl: (filename) => {
|
|
49
|
+
return authedFunction({
|
|
50
|
+
method: 'GET',
|
|
51
|
+
url: getUrl('media', 'get/presignedurl', { filename }),
|
|
52
|
+
});
|
|
53
|
+
},
|
|
33
54
|
compressImage: (file, maxSize, quality, noCompress) => {
|
|
34
55
|
return new Promise((resolve, reject) => {
|
|
35
56
|
if (noCompress) {
|
|
@@ -647,6 +647,6 @@ class AudienceSelector extends Component {
|
|
|
647
647
|
}
|
|
648
648
|
}
|
|
649
649
|
|
|
650
|
-
const toExport = connect(null, { setAuth }, null, {
|
|
650
|
+
const toExport = connect(null, { setAuth }, null, { forwardRef: true })(AudienceSelector);
|
|
651
651
|
|
|
652
652
|
export { toExport as AudienceSelector };
|
|
@@ -329,5 +329,5 @@ const mapStateToProps = () => {
|
|
|
329
329
|
return {};
|
|
330
330
|
};
|
|
331
331
|
|
|
332
|
-
const FileInput = connect(mapStateToProps, {}, null, {
|
|
332
|
+
const FileInput = connect(mapStateToProps, {}, null, { forwardRef: true })(FileInputComponent);
|
|
333
333
|
export { FileInput };
|
|
@@ -626,7 +626,6 @@ class ImageInputComponent extends Component {
|
|
|
626
626
|
}
|
|
627
627
|
|
|
628
628
|
renderLibraryImage(image, index, allowDelete) {
|
|
629
|
-
console.log(image);
|
|
630
629
|
let classes = 'imageInput imageInput-hasImage imageInput-libraryImage';
|
|
631
630
|
if (image.Selected) {
|
|
632
631
|
classes += ' imageInput-librarySelected';
|
|
@@ -984,5 +983,5 @@ const mapStateToProps = (state) => {
|
|
|
984
983
|
};
|
|
985
984
|
};
|
|
986
985
|
|
|
987
|
-
const ImageInput = connect(mapStateToProps, {}, null, {
|
|
986
|
+
const ImageInput = connect(mapStateToProps, {}, null, { forwardRef: true })(ImageInputComponent);
|
|
988
987
|
export { ImageInput };
|
package/src/config.js
CHANGED
|
@@ -17,6 +17,11 @@ const CoreConfig = {
|
|
|
17
17
|
makeApiKey: '',
|
|
18
18
|
logo: '',
|
|
19
19
|
clientName: '',
|
|
20
|
+
AuthStrategy: {
|
|
21
|
+
getAccessToken: async () => null,
|
|
22
|
+
getCurrentUserId: async () => null,
|
|
23
|
+
hasActiveSession: async () => false,
|
|
24
|
+
},
|
|
20
25
|
},
|
|
21
26
|
init: (environment) => {
|
|
22
27
|
CoreConfig.env = environment;
|
package/src/session.js
CHANGED
|
@@ -1,14 +1,12 @@
|
|
|
1
1
|
import _ from 'lodash';
|
|
2
2
|
import axios from 'axios';
|
|
3
|
-
import
|
|
3
|
+
import Config from './config';
|
|
4
4
|
|
|
5
5
|
export const getSessionTokenAWS = async (prefix) => {
|
|
6
|
-
const
|
|
7
|
-
const token = data.getAccessToken().getJwtToken();
|
|
6
|
+
const token = await Config.env.AuthStrategy.getAccessToken();
|
|
8
7
|
if (_.isUndefined(prefix)) return token;
|
|
9
8
|
return `${prefix} ${token}`;
|
|
10
9
|
};
|
|
11
|
-
|
|
12
10
|
// export const getRefreshTokenAWS = async () => {
|
|
13
11
|
// const data = await Auth.currentSession();
|
|
14
12
|
// return data.getRefreshToken().token;
|
|
@@ -34,8 +32,7 @@ export const unauthedFunction = (request) => {
|
|
|
34
32
|
|
|
35
33
|
export const getCurrentUserSub = async () => {
|
|
36
34
|
try {
|
|
37
|
-
|
|
38
|
-
return user.id;
|
|
35
|
+
return await Config.env.AuthStrategy.getCurrentUserId();
|
|
39
36
|
} catch (error) {
|
|
40
37
|
return null;
|
|
41
38
|
}
|
|
@@ -43,8 +40,8 @@ export const getCurrentUserSub = async () => {
|
|
|
43
40
|
|
|
44
41
|
export const checkLoggedIn = async (self) => {
|
|
45
42
|
try {
|
|
46
|
-
const
|
|
47
|
-
if (
|
|
43
|
+
const isLoggedIn = await Config.env.AuthStrategy.hasActiveSession();
|
|
44
|
+
if (!isLoggedIn) {
|
|
48
45
|
console.log('redirecting to login');
|
|
49
46
|
self.props.history.push('/login');
|
|
50
47
|
}
|
package/src/urls.js
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
const HelpGuide = {
|
|
2
|
-
Dashboard: 'https://www.
|
|
3
|
-
FeaturePicker: 'https://www.
|
|
4
|
-
News: 'https://www.
|
|
5
|
-
Events: 'https://www.
|
|
6
|
-
Alerts: 'https://www.
|
|
7
|
-
Gallery: 'https://www.
|
|
8
|
-
Groups: 'https://www.
|
|
9
|
-
Maintenance: 'https://www.
|
|
10
|
-
Facilities: 'https://www.
|
|
11
|
-
Services: 'https://www.
|
|
12
|
-
Offers: 'https://www.
|
|
13
|
-
Survey: 'https://www.
|
|
14
|
-
Information: 'https://www.
|
|
15
|
-
Users: 'https://plusscommunities.
|
|
16
|
-
Payment: 'https://plusscommunities.
|
|
2
|
+
Dashboard: 'https://www.plusscommunities.com/user-guide',
|
|
3
|
+
FeaturePicker: 'https://www.plusscommunities.com/getting-started-on-community-manager',
|
|
4
|
+
News: 'https://www.plusscommunities.com/news-feature',
|
|
5
|
+
Events: 'https://www.plusscommunities.com/events-feature',
|
|
6
|
+
Alerts: 'https://www.plusscommunities.com/alerts-feature',
|
|
7
|
+
Gallery: 'https://www.plusscommunities.com/gallery-feature',
|
|
8
|
+
Groups: 'https://www.plusscommunities.com/groups-feature',
|
|
9
|
+
Maintenance: 'https://www.plusscommunities.com/maintenance-feature',
|
|
10
|
+
Facilities: 'https://www.plusscommunities.com/facilities-feature',
|
|
11
|
+
Services: 'https://www.plusscommunities.com/services-feature',
|
|
12
|
+
Offers: 'https://www.plusscommunities.com/offers-feature',
|
|
13
|
+
Survey: 'https://www.plusscommunities.com/surveys-feature',
|
|
14
|
+
Information: 'https://www.plusscommunities.com/information-feature',
|
|
15
|
+
Users: 'https://www.plusscommunities.com/managing-your-users',
|
|
16
|
+
Payment: 'https://www.plusscommunities.com/setting-up-your-payment-gateway',
|
|
17
17
|
};
|
|
18
18
|
|
|
19
19
|
export const Urls = {
|
|
20
|
-
HelpGuide
|
|
21
|
-
}
|
|
20
|
+
HelpGuide,
|
|
21
|
+
};
|