@plusscommunities/pluss-core-web 1.4.28 → 1.4.30
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 +51 -648
- package/dist/index.esm.js +51 -649
- package/dist/index.umd.js +51 -648
- package/package.json +1 -1
- package/src/components/HubSidebar.js +21 -0
- package/src/components/Popup.js +3 -0
- package/src/helper/helper.js +0 -688
- package/src/index.js +2 -1
- package/src/urls.js +21 -0
package/src/helper/helper.js
CHANGED
|
@@ -1,97 +1,5 @@
|
|
|
1
1
|
import _ from 'lodash';
|
|
2
2
|
import moment from 'moment';
|
|
3
|
-
// import Cookies from 'js-cookie';
|
|
4
|
-
// import {
|
|
5
|
-
// baseUploadsUrl,
|
|
6
|
-
// baseLibraryUrl,
|
|
7
|
-
// defaultProfileImage,
|
|
8
|
-
// logo,
|
|
9
|
-
// baseStage,
|
|
10
|
-
// baseClient,
|
|
11
|
-
// contentSource,
|
|
12
|
-
// contentSourceSite,
|
|
13
|
-
// CONST_STRINGS,
|
|
14
|
-
// } from '../config';
|
|
15
|
-
// import { extensionFeatureInfo } from '../config/features';
|
|
16
|
-
|
|
17
|
-
// export const arrayToObject = (array, key) => {
|
|
18
|
-
// array.reduce((obj, item) => {
|
|
19
|
-
// obj[item[key]] = item;
|
|
20
|
-
// return obj;
|
|
21
|
-
// }, {});
|
|
22
|
-
// };
|
|
23
|
-
|
|
24
|
-
// export const getLogo = (siteBranding) => {
|
|
25
|
-
// if (siteBranding && siteBranding.Logo) {
|
|
26
|
-
// return siteBranding.Logo;
|
|
27
|
-
// }
|
|
28
|
-
// return logo;
|
|
29
|
-
// };
|
|
30
|
-
|
|
31
|
-
// export const getUrlParams = () => {
|
|
32
|
-
// var vars = {};
|
|
33
|
-
// window.location.href.replace(/[?&]+([^=&]+)=([^&]*)/gi, function (m, key, value) {
|
|
34
|
-
// vars[key] = value;
|
|
35
|
-
// });
|
|
36
|
-
// return vars;
|
|
37
|
-
// };
|
|
38
|
-
|
|
39
|
-
// export const onlyAlphanumeric = (input) => {
|
|
40
|
-
// if (!input) {
|
|
41
|
-
// return input;
|
|
42
|
-
// }
|
|
43
|
-
// return input.replace(/[^a-z0-9]/gi, '');
|
|
44
|
-
// };
|
|
45
|
-
|
|
46
|
-
// export const isUrl = (url) => {
|
|
47
|
-
// const dotpos = url.lastIndexOf('.');
|
|
48
|
-
// if (dotpos < 2 || dotpos + 2 >= url.length) {
|
|
49
|
-
// return false;
|
|
50
|
-
// }
|
|
51
|
-
// return true;
|
|
52
|
-
// };
|
|
53
|
-
|
|
54
|
-
// export const generateImageName = (name) => {
|
|
55
|
-
// return `xxxxxxxx4xxxyxxxxxxxxxxxxx${name}`.replace(/[xy]/g, (c) => {
|
|
56
|
-
// // eslint-disable-next-line
|
|
57
|
-
// var r = (Math.random() * 16) | 0,
|
|
58
|
-
// v = c === 'x' ? r : (r & 0x3) | 0x8;
|
|
59
|
-
// return v.toString(16);
|
|
60
|
-
// });
|
|
61
|
-
// };
|
|
62
|
-
|
|
63
|
-
// export const capitalize = (string) => {
|
|
64
|
-
// if (_.isEmpty(string)) {
|
|
65
|
-
// return string;
|
|
66
|
-
// }
|
|
67
|
-
// return string.charAt(0).toUpperCase() + string.slice(1);
|
|
68
|
-
// };
|
|
69
|
-
|
|
70
|
-
// export const get300 = (url) => {
|
|
71
|
-
// if (!url) {
|
|
72
|
-
// return url;
|
|
73
|
-
// }
|
|
74
|
-
// if (url.indexOf('https://plussprdstorage.blob.core.windows.net/') !== -1) {
|
|
75
|
-
// return url.replace('https://plussprdstorage.blob.core.windows.net/', 'https://plusscdn.azureedge.net/');
|
|
76
|
-
// }
|
|
77
|
-
// if (url.indexOf('https://plusscdn.azureedge.net/') !== -1) {
|
|
78
|
-
// return url.replace('/uploads/', '/uploads300/').replace('/general/', '/general300/');
|
|
79
|
-
// }
|
|
80
|
-
// if (url.indexOf(baseUploadsUrl) !== -1 || url.indexOf(baseLibraryUrl) !== -1) {
|
|
81
|
-
// const extension = getExtension(url);
|
|
82
|
-
// let urlToUse = url;
|
|
83
|
-
// if (extension !== 'jpg') {
|
|
84
|
-
// urlToUse = `${url.substring(0, url.length - (extension.length + 1))}.jpg`;
|
|
85
|
-
// }
|
|
86
|
-
// return urlToUse.replace('/uploads/', '/300/');
|
|
87
|
-
// }
|
|
88
|
-
// return url;
|
|
89
|
-
// };
|
|
90
|
-
|
|
91
|
-
// export const getCompressed = (url) => {
|
|
92
|
-
// if (!url || typeof url !== 'string') return '';
|
|
93
|
-
// return url.replace('/uploads/', '/compressed/');
|
|
94
|
-
// };
|
|
95
3
|
|
|
96
4
|
export const getTimepickerTime = (input) => {
|
|
97
5
|
var timeSplit = input.split(':');
|
|
@@ -187,599 +95,3 @@ export const getPluralOptions = (count, singular, plural) => {
|
|
|
187
95
|
}
|
|
188
96
|
return plural;
|
|
189
97
|
};
|
|
190
|
-
|
|
191
|
-
// export const getPercentage = (count, total) => {
|
|
192
|
-
// if (!count) {
|
|
193
|
-
// return '0%';
|
|
194
|
-
// }
|
|
195
|
-
// if (!total) {
|
|
196
|
-
// return '100%';
|
|
197
|
-
// }
|
|
198
|
-
// return `${Math.round((100 * count) / total)}%`;
|
|
199
|
-
// };
|
|
200
|
-
|
|
201
|
-
// export const getUserPreview = (user) => {
|
|
202
|
-
// return {
|
|
203
|
-
// displayName: user.displayName,
|
|
204
|
-
// id: user.Id,
|
|
205
|
-
// profilePic: user.profilePic || defaultProfileImage,
|
|
206
|
-
// };
|
|
207
|
-
// };
|
|
208
|
-
|
|
209
|
-
// export const usersToPreviews = (users) => {
|
|
210
|
-
// return _.map(users, getUserPreview);
|
|
211
|
-
// };
|
|
212
|
-
|
|
213
|
-
// export const getSiteNameFromRoles = (site, roles) => {
|
|
214
|
-
// return getSiteName(
|
|
215
|
-
// site,
|
|
216
|
-
// roles.map((r) => {
|
|
217
|
-
// return r.siteInfo;
|
|
218
|
-
// }),
|
|
219
|
-
// );
|
|
220
|
-
// };
|
|
221
|
-
|
|
222
|
-
// export const getSiteName = (site, sites) => {
|
|
223
|
-
// if (site === 'hq') {
|
|
224
|
-
// return 'HQ';
|
|
225
|
-
// }
|
|
226
|
-
// const siteObject = _.find(sites, (t) => {
|
|
227
|
-
// return t.Id === site;
|
|
228
|
-
// });
|
|
229
|
-
// if (siteObject) {
|
|
230
|
-
// return siteObject.siteName;
|
|
231
|
-
// }
|
|
232
|
-
// return site;
|
|
233
|
-
// };
|
|
234
|
-
|
|
235
|
-
// export const formatCurrency = (number, locale = 'en-AU', curencyCode = 'AUD', shouldFix = false) => {
|
|
236
|
-
// const formatter = Intl.NumberFormat(locale, { style: 'currency', currency: curencyCode, minimumFractionDigits: 2 });
|
|
237
|
-
// let formattedNumber = number;
|
|
238
|
-
// if (shouldFix && formatter.format(formattedNumber).indexOf('NaN') > -1) {
|
|
239
|
-
// formattedNumber = number.replace(/[^\d.-]/g, '');
|
|
240
|
-
// }
|
|
241
|
-
// return formatter.format(formattedNumber);
|
|
242
|
-
// };
|
|
243
|
-
|
|
244
|
-
// export const currencyToFloat = (number) => {
|
|
245
|
-
// let result = parseFloat(number);
|
|
246
|
-
// if (isNaN(result)) {
|
|
247
|
-
// result = parseFloat(number.replace(/[^\d.-]/g, ''));
|
|
248
|
-
// if (isNaN(result)) {
|
|
249
|
-
// result = 0;
|
|
250
|
-
// }
|
|
251
|
-
// }
|
|
252
|
-
// return result;
|
|
253
|
-
// };
|
|
254
|
-
|
|
255
|
-
// export const getCurrencySymbol = () => {
|
|
256
|
-
// return formatCurrency(0).replace(/[0-9.]+/g, '');
|
|
257
|
-
// };
|
|
258
|
-
|
|
259
|
-
// export const isCurrency = (text) => {
|
|
260
|
-
// if (!text) return false;
|
|
261
|
-
// const price = parseFloat(typeof text === 'string' ? text.replace(getCurrencySymbol(), '') : text, 10);
|
|
262
|
-
// return _.isNumber(price) && !Number.isNaN(price) ? price : false;
|
|
263
|
-
// };
|
|
264
|
-
|
|
265
|
-
// export const isPaidItem = (enabled, tickets) => {
|
|
266
|
-
// // console.log('isPaidItem', enabled, tickets);
|
|
267
|
-
// return (
|
|
268
|
-
// enabled &&
|
|
269
|
-
// tickets &&
|
|
270
|
-
// tickets.merchant &&
|
|
271
|
-
// tickets.categories &&
|
|
272
|
-
// tickets.categories.length > 0 &&
|
|
273
|
-
// tickets.categories.every((t) => !t.price || _.isNumber(t.price))
|
|
274
|
-
// );
|
|
275
|
-
// };
|
|
276
|
-
|
|
277
|
-
// export const getTotalQuantity = (tickets) => _.sumBy(tickets, (t) => t.quantity || 0);
|
|
278
|
-
|
|
279
|
-
// export const getTotalPrice = (tickets) => _.sumBy(tickets, (t) => t.price * (t.quantity || 0));
|
|
280
|
-
|
|
281
|
-
// export const parseTickets = (tickets, merchant) => {
|
|
282
|
-
// if (Array.isArray(tickets)) return { merchant, categories: tickets };
|
|
283
|
-
// if (tickets && typeof tickets === 'object') return tickets;
|
|
284
|
-
// return { merchant, categories: [{ category: 'Default', price: tickets }] };
|
|
285
|
-
// };
|
|
286
|
-
|
|
287
|
-
// export const compileTickets = (tickets, merchant) => {
|
|
288
|
-
// const newTickets = _.cloneDeep(tickets);
|
|
289
|
-
// newTickets.merchant = merchant;
|
|
290
|
-
// newTickets.categories = newTickets.categories.map((ticket) => {
|
|
291
|
-
// ticket.price = isCurrency(ticket.price);
|
|
292
|
-
// return ticket;
|
|
293
|
-
// });
|
|
294
|
-
// return newTickets;
|
|
295
|
-
// };
|
|
296
|
-
|
|
297
|
-
// export const getTicketPriceText = (ticket) => {
|
|
298
|
-
// return typeof ticket.price === 'string' ? ticket.price : formatCurrency(ticket.price);
|
|
299
|
-
// };
|
|
300
|
-
|
|
301
|
-
// export const isTicketCategoryValid = (ticket, ticketDetail) => {
|
|
302
|
-
// return !_.isEmpty(ticket.category) && ticketDetail.categories.filter((t) => t.category === ticket.category).length === 1;
|
|
303
|
-
// };
|
|
304
|
-
|
|
305
|
-
// export const isTicketPriceValid = (ticket) => {
|
|
306
|
-
// return ticket.price && isCurrency(ticket.price) !== false;
|
|
307
|
-
// };
|
|
308
|
-
|
|
309
|
-
// export const isTicketsValid = (tickets) => {
|
|
310
|
-
// if (tickets && tickets.categories && tickets.categories.length > 0) {
|
|
311
|
-
// return tickets.categories.every((ticket) => isTicketCategoryValid(ticket, tickets) && isTicketPriceValid(ticket));
|
|
312
|
-
// }
|
|
313
|
-
// return true;
|
|
314
|
-
// };
|
|
315
|
-
|
|
316
|
-
// export const getFee = (feeInfo, amount) => {
|
|
317
|
-
// if (!feeInfo.fee) return 0;
|
|
318
|
-
// return feeInfo.isPercentage ? (feeInfo.fee / 100) * amount : feeInfo.fee;
|
|
319
|
-
// };
|
|
320
|
-
|
|
321
|
-
// export const isRefund = (transaction) => transaction.TransactionType === 'REFUND';
|
|
322
|
-
|
|
323
|
-
// export const combineTickets = (ticketsArray, diff = false) => {
|
|
324
|
-
// if (_.isNil(ticketsArray) || ticketsArray.length === 0) return [];
|
|
325
|
-
|
|
326
|
-
// const combined = ticketsArray.reduce((a, c) => {
|
|
327
|
-
// if (_.isNil(a) || a.length === 0) return c;
|
|
328
|
-
// const summed = a.map((cat) => {
|
|
329
|
-
// const cloned = _.clone(cat);
|
|
330
|
-
// const match = c.find((i) => i.category === cloned.category);
|
|
331
|
-
// cloned.quantity = (diff ? -1 : 1) * (cloned.quantity || 0) + (match ? match.quantity || 0 : 0);
|
|
332
|
-
// return cloned;
|
|
333
|
-
// });
|
|
334
|
-
// return summed;
|
|
335
|
-
// });
|
|
336
|
-
// return combined;
|
|
337
|
-
// };
|
|
338
|
-
|
|
339
|
-
// export const combineTransactions = (transactionsArray) => {
|
|
340
|
-
// if (_.isNil(transactionsArray) || transactionsArray.length === 0) return null;
|
|
341
|
-
|
|
342
|
-
// const combined = _.orderBy(transactionsArray, 'UnixTimestamp', 'desc').reduce((a, c) => {
|
|
343
|
-
// // console.log('transaction a', a.TransactionType, a.TransactionId, a.Amount, a.Fee.amount);
|
|
344
|
-
// // console.log('transaction c', c.TransactionType, c.TransactionId, c.Amount, c.Fee.amount);
|
|
345
|
-
// const cloned = _.cloneDeep(c);
|
|
346
|
-
// cloned.Amount = cloned.Amount + a.Amount;
|
|
347
|
-
// cloned.Fee.amount = cloned.Fee.amount + a.Fee.amount;
|
|
348
|
-
// cloned.Item.categories = combineTickets([cloned.Item.categories, a.Item.categories]);
|
|
349
|
-
// return cloned;
|
|
350
|
-
// });
|
|
351
|
-
// // console.log('combined', combined.TransactionType, combined.TransactionId, combined.Amount, combined.Fee.amount);
|
|
352
|
-
// return combined;
|
|
353
|
-
// };
|
|
354
|
-
|
|
355
|
-
// export const consolidateTransactions = (transactionsArray) => {
|
|
356
|
-
// const transactions = transactionsArray
|
|
357
|
-
// .filter((pt) => pt.TransactionType === 'PAYMENT')
|
|
358
|
-
// .map((p) => {
|
|
359
|
-
// // Combine with all refunds for the transaction
|
|
360
|
-
// const refunds = transactionsArray.filter((rt) => rt.TransactionType === 'REFUND' && rt.TransactionId === p.TransactionId);
|
|
361
|
-
// return combineTransactions([...refunds, p]);
|
|
362
|
-
// })
|
|
363
|
-
// .filter((p) => getTotalQuantity(p.Item.categories) > 0);
|
|
364
|
-
// return transactions;
|
|
365
|
-
// };
|
|
366
|
-
|
|
367
|
-
// export const isKiosk = (type) => {
|
|
368
|
-
// return type === 'KIOSK' || type === 'FORMKIOSK' || type === 'SIGNINKIOSK';
|
|
369
|
-
// };
|
|
370
|
-
|
|
371
|
-
// export const isContentSource = (site) => {
|
|
372
|
-
// if (`${baseClient}-${baseStage}` !== contentSource) {
|
|
373
|
-
// return false;
|
|
374
|
-
// }
|
|
375
|
-
// return site === contentSourceSite;
|
|
376
|
-
// };
|
|
377
|
-
|
|
378
|
-
// export const formatDuration = (msDuration) => {
|
|
379
|
-
// const diff = moment.duration(msDuration);
|
|
380
|
-
|
|
381
|
-
// let result = '';
|
|
382
|
-
// const days = Math.floor(diff.asDays());
|
|
383
|
-
// if (days > 0) {
|
|
384
|
-
// result += `${days} day${getPluralS(days)} `;
|
|
385
|
-
// diff.add(-days, 'd');
|
|
386
|
-
// }
|
|
387
|
-
// const hours = Math.floor(diff.asHours());
|
|
388
|
-
// if (hours > 0) {
|
|
389
|
-
// result += `${hours} hour${getPluralS(hours)} `;
|
|
390
|
-
// diff.add(-hours, 'h');
|
|
391
|
-
// }
|
|
392
|
-
// const minutes = Math.floor(diff.asMinutes());
|
|
393
|
-
// if (minutes > 0) {
|
|
394
|
-
// result += `${minutes} minute${getPluralS(minutes)} `;
|
|
395
|
-
// diff.add(-minutes, 'm');
|
|
396
|
-
// }
|
|
397
|
-
// if (_.isEmpty(result)) {
|
|
398
|
-
// return 'Less than a minute';
|
|
399
|
-
// }
|
|
400
|
-
// return result.trim();
|
|
401
|
-
// };
|
|
402
|
-
|
|
403
|
-
// export const clearLocalStorage = (key) => {
|
|
404
|
-
// window.localStorage.removeItem(key);
|
|
405
|
-
// Cookies.remove(key);
|
|
406
|
-
// };
|
|
407
|
-
|
|
408
|
-
// export const TIMESTAMPFORMAT = 'D MMM YYYY h:mma';
|
|
409
|
-
|
|
410
|
-
// export const featureInfo = [
|
|
411
|
-
// ...extensionFeatureInfo,
|
|
412
|
-
// {
|
|
413
|
-
// key: 'dashboard',
|
|
414
|
-
// order: 1,
|
|
415
|
-
// text: 'Dashboard',
|
|
416
|
-
// icon: 'dashboard',
|
|
417
|
-
// isFontAwesome: false,
|
|
418
|
-
// url: '/mastermenu',
|
|
419
|
-
// countProps: null,
|
|
420
|
-
// visibleExps: null,
|
|
421
|
-
// },
|
|
422
|
-
// {
|
|
423
|
-
// key: 'events',
|
|
424
|
-
// order: 2,
|
|
425
|
-
// text: 'Events',
|
|
426
|
-
// icon: 'event',
|
|
427
|
-
// isFontAwesome: false,
|
|
428
|
-
// url: '/events',
|
|
429
|
-
// addUrl: '/events/event',
|
|
430
|
-
// addPermission: 'events',
|
|
431
|
-
// singularName: 'event',
|
|
432
|
-
// countProps: ['eventSubmissions', 'length'],
|
|
433
|
-
// visibleExps: {
|
|
434
|
-
// type: 'and',
|
|
435
|
-
// exps: [
|
|
436
|
-
// { type: 'feature', value: 'events' },
|
|
437
|
-
// {
|
|
438
|
-
// type: 'or',
|
|
439
|
-
// exps: [
|
|
440
|
-
// { type: 'permission', value: 'events' },
|
|
441
|
-
// { type: 'permission', value: 'eventAttendance' },
|
|
442
|
-
// { type: 'permission', value: 'eventSubmit' },
|
|
443
|
-
// ],
|
|
444
|
-
// },
|
|
445
|
-
// ],
|
|
446
|
-
// },
|
|
447
|
-
// },
|
|
448
|
-
// {
|
|
449
|
-
// key: 'news',
|
|
450
|
-
// order: 3,
|
|
451
|
-
// text: 'News',
|
|
452
|
-
// icon: 'news',
|
|
453
|
-
// isFontAwesome: false,
|
|
454
|
-
// url: '/news',
|
|
455
|
-
// addUrl: '/news/article',
|
|
456
|
-
// addPermission: 'newsletter',
|
|
457
|
-
// singularName: 'news',
|
|
458
|
-
// countProps: ['newsSubmissions', 'length'],
|
|
459
|
-
// visibleExps: {
|
|
460
|
-
// type: 'and',
|
|
461
|
-
// exps: [
|
|
462
|
-
// { type: 'feature', value: 'news' },
|
|
463
|
-
// {
|
|
464
|
-
// type: 'or',
|
|
465
|
-
// exps: [
|
|
466
|
-
// { type: 'permission', value: 'newsletter' },
|
|
467
|
-
// { type: 'permission', value: 'newsletterSubmit' },
|
|
468
|
-
// ],
|
|
469
|
-
// },
|
|
470
|
-
// ],
|
|
471
|
-
// },
|
|
472
|
-
// },
|
|
473
|
-
// {
|
|
474
|
-
// key: 'alerts',
|
|
475
|
-
// order: 4,
|
|
476
|
-
// text: 'Alerts',
|
|
477
|
-
// icon: 'exclamation-triangle',
|
|
478
|
-
// isFontAwesome: true,
|
|
479
|
-
// url: '/alerts',
|
|
480
|
-
// addUrl: '/alerts/addalert',
|
|
481
|
-
// addPermission: 'alerts',
|
|
482
|
-
// singularName: 'alert',
|
|
483
|
-
// countProps: null,
|
|
484
|
-
// visibleExps: {
|
|
485
|
-
// type: 'and',
|
|
486
|
-
// exps: [
|
|
487
|
-
// { type: 'feature', value: 'alerts' },
|
|
488
|
-
// { type: 'permission', value: 'alerts' },
|
|
489
|
-
// ],
|
|
490
|
-
// },
|
|
491
|
-
// },
|
|
492
|
-
// {
|
|
493
|
-
// key: 'users',
|
|
494
|
-
// order: 5,
|
|
495
|
-
// text: 'Users',
|
|
496
|
-
// icon: 'people',
|
|
497
|
-
// isFontAwesome: false,
|
|
498
|
-
// url: '/usershub',
|
|
499
|
-
// addUrl: '/usershub/adduser',
|
|
500
|
-
// addPermission: 'userManagement',
|
|
501
|
-
// singularName: 'user',
|
|
502
|
-
// countProps: null,
|
|
503
|
-
// visibleExps: {
|
|
504
|
-
// type: 'and',
|
|
505
|
-
// exps: [
|
|
506
|
-
// { type: 'feature', value: 'users' },
|
|
507
|
-
// { type: 'permission', value: 'userManagement' },
|
|
508
|
-
// { type: 'state', value: 'adminOpen' },
|
|
509
|
-
// ],
|
|
510
|
-
// },
|
|
511
|
-
// },
|
|
512
|
-
// {
|
|
513
|
-
// key: 'gallery',
|
|
514
|
-
// order: 6,
|
|
515
|
-
// text: 'Gallery',
|
|
516
|
-
// icon: 'picture-o',
|
|
517
|
-
// isFontAwesome: true,
|
|
518
|
-
// url: '/imageLibrary',
|
|
519
|
-
// addPermission: 'addToPublishingImageLibrary',
|
|
520
|
-
// singularName: 'gallery image',
|
|
521
|
-
// countProps: null,
|
|
522
|
-
// visibleExps: {
|
|
523
|
-
// type: 'and',
|
|
524
|
-
// exps: [
|
|
525
|
-
// { type: 'feature', value: 'gallery' },
|
|
526
|
-
// { type: 'permission', value: 'addToPublishingImageLibrary' },
|
|
527
|
-
// { type: 'state', value: 'adminOpen' },
|
|
528
|
-
// ],
|
|
529
|
-
// },
|
|
530
|
-
// },
|
|
531
|
-
// {
|
|
532
|
-
// key: 'services',
|
|
533
|
-
// order: 7,
|
|
534
|
-
// text: 'Services',
|
|
535
|
-
// icon: 'stethoscope',
|
|
536
|
-
// isFontAwesome: true,
|
|
537
|
-
// url: '/services',
|
|
538
|
-
// addUrl: '/services/service',
|
|
539
|
-
// addPermission: 'services',
|
|
540
|
-
// singularName: 'service',
|
|
541
|
-
// countProps: null,
|
|
542
|
-
// visibleExps: {
|
|
543
|
-
// type: 'and',
|
|
544
|
-
// exps: [
|
|
545
|
-
// { type: 'feature', value: 'services' },
|
|
546
|
-
// { type: 'permission', value: 'services' },
|
|
547
|
-
// { type: 'state', value: 'adminOpen' },
|
|
548
|
-
// ],
|
|
549
|
-
// },
|
|
550
|
-
// },
|
|
551
|
-
// {
|
|
552
|
-
// key: 'sponsors',
|
|
553
|
-
// order: 8,
|
|
554
|
-
// text: 'Sponsors',
|
|
555
|
-
// icon: 'star-o',
|
|
556
|
-
// isFontAwesome: true,
|
|
557
|
-
// url: '/sponsors',
|
|
558
|
-
// addUrl: '/sponsors/sponsor',
|
|
559
|
-
// addPermission: 'services',
|
|
560
|
-
// singularName: 'sponsor',
|
|
561
|
-
// countProps: null,
|
|
562
|
-
// visibleExps: {
|
|
563
|
-
// type: 'and',
|
|
564
|
-
// exps: [
|
|
565
|
-
// { type: 'feature', value: 'services' },
|
|
566
|
-
// { type: 'permission', value: 'services' },
|
|
567
|
-
// { type: 'state', value: 'adminOpen' },
|
|
568
|
-
// ],
|
|
569
|
-
// },
|
|
570
|
-
// },
|
|
571
|
-
// {
|
|
572
|
-
// key: 'info',
|
|
573
|
-
// order: 9,
|
|
574
|
-
// text: 'Information',
|
|
575
|
-
// icon: 'info',
|
|
576
|
-
// isFontAwesome: false,
|
|
577
|
-
// url: '/info',
|
|
578
|
-
// addUrl: '/info/infopage',
|
|
579
|
-
// addPermission: 'infoPages',
|
|
580
|
-
// singularName: CONST_STRINGS.FAQ_ENTRY,
|
|
581
|
-
// countProps: null,
|
|
582
|
-
// visibleExps: {
|
|
583
|
-
// type: 'or',
|
|
584
|
-
// exps: [
|
|
585
|
-
// {
|
|
586
|
-
// type: 'and',
|
|
587
|
-
// exps: [
|
|
588
|
-
// { type: 'feature', value: 'importantContacts' },
|
|
589
|
-
// { type: 'permission', value: 'importantContacts' },
|
|
590
|
-
// ],
|
|
591
|
-
// },
|
|
592
|
-
// {
|
|
593
|
-
// type: 'and',
|
|
594
|
-
// exps: [
|
|
595
|
-
// { type: 'feature', value: 'maps' },
|
|
596
|
-
// { type: 'permission', value: 'maps' },
|
|
597
|
-
// ],
|
|
598
|
-
// },
|
|
599
|
-
// {
|
|
600
|
-
// type: 'and',
|
|
601
|
-
// exps: [
|
|
602
|
-
// { type: 'feature', value: 'infoPages' },
|
|
603
|
-
// { type: 'permission', value: 'infoPages' },
|
|
604
|
-
// ],
|
|
605
|
-
// },
|
|
606
|
-
// {
|
|
607
|
-
// type: 'and',
|
|
608
|
-
// exps: [
|
|
609
|
-
// { type: 'feature', value: 'news' },
|
|
610
|
-
// { type: 'permission', value: 'welcomePages' },
|
|
611
|
-
// ],
|
|
612
|
-
// },
|
|
613
|
-
// { type: 'permission', value: 'terms' },
|
|
614
|
-
// ],
|
|
615
|
-
// },
|
|
616
|
-
// },
|
|
617
|
-
// {
|
|
618
|
-
// key: 'surveys',
|
|
619
|
-
// order: 11,
|
|
620
|
-
// text: 'Surveys',
|
|
621
|
-
// icon: 'pie-chart',
|
|
622
|
-
// isFontAwesome: true,
|
|
623
|
-
// url: '/polls',
|
|
624
|
-
// addUrl: '/polls/poll',
|
|
625
|
-
// addPermission: 'polls',
|
|
626
|
-
// singularName: 'survey',
|
|
627
|
-
// countProps: null,
|
|
628
|
-
// visibleExps: {
|
|
629
|
-
// type: 'and',
|
|
630
|
-
// exps: [
|
|
631
|
-
// { type: 'feature', value: 'surveys' },
|
|
632
|
-
// { type: 'permission', value: 'polls' },
|
|
633
|
-
// { type: 'state', value: 'conciergeOpen' },
|
|
634
|
-
// ],
|
|
635
|
-
// },
|
|
636
|
-
// },
|
|
637
|
-
// {
|
|
638
|
-
// key: 'facilities',
|
|
639
|
-
// order: 12,
|
|
640
|
-
// text: CONST_STRINGS.FACILITIES,
|
|
641
|
-
// icon: 'facility',
|
|
642
|
-
// isFontAwesome: false,
|
|
643
|
-
// url: '/facilities',
|
|
644
|
-
// addUrl: '/facilities/facility',
|
|
645
|
-
// addPermission: 'facilities',
|
|
646
|
-
// singularName: 'facility',
|
|
647
|
-
// countProps: null,
|
|
648
|
-
// visibleExps: {
|
|
649
|
-
// type: 'and',
|
|
650
|
-
// exps: [
|
|
651
|
-
// { type: 'feature', value: 'facilities' },
|
|
652
|
-
// { type: 'permission', value: 'facilities' },
|
|
653
|
-
// { type: 'state', value: 'conciergeOpen' },
|
|
654
|
-
// ],
|
|
655
|
-
// },
|
|
656
|
-
// },
|
|
657
|
-
// {
|
|
658
|
-
// key: 'offers',
|
|
659
|
-
// order: 13,
|
|
660
|
-
// text: 'Offers',
|
|
661
|
-
// icon: 'shopping-bag',
|
|
662
|
-
// isFontAwesome: true,
|
|
663
|
-
// url: '/offers',
|
|
664
|
-
// addUrl: '/offers/offer',
|
|
665
|
-
// addPermission: 'offers',
|
|
666
|
-
// singularName: 'offer',
|
|
667
|
-
// countProps: null,
|
|
668
|
-
// visibleExps: {
|
|
669
|
-
// type: 'and',
|
|
670
|
-
// exps: [
|
|
671
|
-
// { type: 'feature', value: 'offers' },
|
|
672
|
-
// { type: 'permission', value: 'offers' },
|
|
673
|
-
// { type: 'state', value: 'conciergeOpen' },
|
|
674
|
-
// ],
|
|
675
|
-
// },
|
|
676
|
-
// },
|
|
677
|
-
// {
|
|
678
|
-
// key: 'signin',
|
|
679
|
-
// order: 14,
|
|
680
|
-
// text: 'Sign Ins',
|
|
681
|
-
// icon: 'signin',
|
|
682
|
-
// isFontAwesome: false,
|
|
683
|
-
// url: '/signinHub',
|
|
684
|
-
// addUrl: null,
|
|
685
|
-
// addPermission: 'visitors',
|
|
686
|
-
// singularName: 'visitor',
|
|
687
|
-
// countProps: null,
|
|
688
|
-
// visibleExps: {
|
|
689
|
-
// type: 'and',
|
|
690
|
-
// exps: [
|
|
691
|
-
// { type: 'feature', value: 'visitors' },
|
|
692
|
-
// { type: 'permission', value: 'visitors' },
|
|
693
|
-
// { type: 'state', value: 'conciergeOpen' },
|
|
694
|
-
// ],
|
|
695
|
-
// },
|
|
696
|
-
// },
|
|
697
|
-
// {
|
|
698
|
-
// key: 'food',
|
|
699
|
-
// order: 15,
|
|
700
|
-
// text: 'Restaurant Manager',
|
|
701
|
-
// icon: 'cutlery',
|
|
702
|
-
// isFontAwesome: true,
|
|
703
|
-
// url: '/food',
|
|
704
|
-
// addUrl: null,
|
|
705
|
-
// addPermission: 'food',
|
|
706
|
-
// singularName: 'dish',
|
|
707
|
-
// countProps: null,
|
|
708
|
-
// visibleExps: {
|
|
709
|
-
// type: 'and',
|
|
710
|
-
// exps: [
|
|
711
|
-
// { type: 'feature', value: 'food' },
|
|
712
|
-
// { type: 'permission', value: 'food' },
|
|
713
|
-
// ],
|
|
714
|
-
// },
|
|
715
|
-
// },
|
|
716
|
-
// {
|
|
717
|
-
// key: 'payment',
|
|
718
|
-
// order: 16,
|
|
719
|
-
// text: 'Payment',
|
|
720
|
-
// icon: 'usd',
|
|
721
|
-
// isFontAwesome: true,
|
|
722
|
-
// url: '/payment',
|
|
723
|
-
// addUrl: null,
|
|
724
|
-
// addPermission: null,
|
|
725
|
-
// singularName: 'payment',
|
|
726
|
-
// countProps: null,
|
|
727
|
-
// visibleExps: {
|
|
728
|
-
// type: 'and',
|
|
729
|
-
// exps: [
|
|
730
|
-
// { type: 'props', value: 'paymentEnabled' },
|
|
731
|
-
// {
|
|
732
|
-
// type: 'or',
|
|
733
|
-
// exps: [
|
|
734
|
-
// { type: 'feature', value: 'managePayments' },
|
|
735
|
-
// { type: 'permission', value: 'viewPayments' },
|
|
736
|
-
// ],
|
|
737
|
-
// },
|
|
738
|
-
// ],
|
|
739
|
-
// },
|
|
740
|
-
// },
|
|
741
|
-
// {
|
|
742
|
-
// key: 'automation',
|
|
743
|
-
// order: 17,
|
|
744
|
-
// text: 'Automation',
|
|
745
|
-
// icon: 'bolt',
|
|
746
|
-
// isFontAwesome: true,
|
|
747
|
-
// url: '/automationHub',
|
|
748
|
-
// addUrl: null,
|
|
749
|
-
// addPermission: null,
|
|
750
|
-
// singularName: 'automation',
|
|
751
|
-
// countProps: null,
|
|
752
|
-
// visibleExps: { type: 'master', value: true },
|
|
753
|
-
// },
|
|
754
|
-
// ];
|
|
755
|
-
|
|
756
|
-
// export const getFeatureInfo = (type) => {
|
|
757
|
-
// switch (type) {
|
|
758
|
-
// case 'maps':
|
|
759
|
-
// return {
|
|
760
|
-
// key: 'maps',
|
|
761
|
-
// icon: 'map',
|
|
762
|
-
// isFontAwesome: true,
|
|
763
|
-
// url: '/info',
|
|
764
|
-
// addUrl: '/info/map',
|
|
765
|
-
// addPermission: 'maps',
|
|
766
|
-
// singularName: 'map',
|
|
767
|
-
// };
|
|
768
|
-
// case 'importantContacts':
|
|
769
|
-
// return {
|
|
770
|
-
// key: 'importantContacts',
|
|
771
|
-
// icon: 'address-card-o',
|
|
772
|
-
// isFontAwesome: true,
|
|
773
|
-
// url: '/info',
|
|
774
|
-
// addUrl: '/info/importantcontact',
|
|
775
|
-
// addPermission: 'importantContacts',
|
|
776
|
-
// singularName: 'contact',
|
|
777
|
-
// };
|
|
778
|
-
// case 'info':
|
|
779
|
-
// case 'infoPages':
|
|
780
|
-
// return featureInfo.find((n) => n.key === 'info');
|
|
781
|
-
// default:
|
|
782
|
-
// const info = featureInfo.find((n) => n.key === type);
|
|
783
|
-
// return info || { key: type, icon: type };
|
|
784
|
-
// }
|
|
785
|
-
// };
|