@churchapps/apphelper 0.4.50 → 0.5.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/components/FormCardPayment.d.ts +1 -1
- package/dist/components/FormCardPayment.d.ts.map +1 -1
- package/dist/components/FormCardPayment.js +27 -10
- package/dist/components/FormCardPayment.js.map +1 -1
- package/dist/components/Loading.js +36 -36
- package/dist/components/notes/Notes.js +27 -27
- package/dist/helpers/index.d.ts +1 -1
- package/dist/helpers/index.d.ts.map +1 -1
- package/dist/helpers/index.js +1 -1
- package/dist/helpers/index.js.map +1 -1
- package/dist/public/css/cropper.css +309 -309
- package/dist/public/css/styles.css +111 -111
- package/package.json +72 -73
- package/public/css/cropper.css +309 -309
- package/public/css/styles.css +111 -111
- package/public/locales/de.json +269 -269
- package/public/locales/en.json +276 -276
- package/public/locales/es.json +272 -272
- package/public/locales/fr.json +269 -269
- package/public/locales/hi.json +269 -269
- package/public/locales/it.json +269 -269
- package/public/locales/ko.json +269 -269
- package/public/locales/no.json +269 -269
- package/public/locales/pt.json +269 -269
- package/public/locales/ru.json +269 -269
- package/public/locales/tl.json +269 -269
- package/public/locales/zh.json +269 -269
- package/src/components/DisplayBox.tsx +83 -83
- package/src/components/ErrorMessages.tsx +28 -28
- package/src/components/ExportLink.tsx +81 -81
- package/src/components/FloatingSupport.tsx +18 -18
- package/src/components/FormCardPayment.tsx +184 -169
- package/src/components/FormSubmissionEdit.tsx +168 -168
- package/src/components/HelpIcon.tsx +12 -12
- package/src/components/ImageEditor.tsx +161 -161
- package/src/components/InputBox.tsx +96 -96
- package/src/components/Loading.tsx +77 -77
- package/src/components/PageHeader.tsx +110 -110
- package/src/components/PersonAvatar.tsx +77 -77
- package/src/components/QuestionEdit.tsx +99 -99
- package/src/components/SmallButton.tsx +42 -42
- package/src/components/SupportModal.tsx +32 -32
- package/src/components/TabPanel.tsx +28 -28
- package/src/components/gallery/GalleryModal.tsx +173 -173
- package/src/components/gallery/StockPhotos.tsx +95 -95
- package/src/components/gallery/index.ts +1 -1
- package/src/components/header/Banner.tsx +11 -11
- package/src/components/header/PrimaryMenu.tsx +100 -100
- package/src/components/header/SecondaryMenu.tsx +23 -23
- package/src/components/header/SecondaryMenuAlt.tsx +40 -40
- package/src/components/header/SiteHeader.tsx +207 -207
- package/src/components/header/SupportDrawer.tsx +111 -111
- package/src/components/header/index.tsx +2 -2
- package/src/components/index.tsx +20 -20
- package/src/components/notes/AddNote.tsx +180 -180
- package/src/components/notes/Note.tsx +68 -68
- package/src/components/notes/Notes.tsx +208 -208
- package/src/components/notes/index.ts +3 -3
- package/src/components/wrapper/AppList.tsx +19 -19
- package/src/components/wrapper/ChurchList.tsx +154 -154
- package/src/components/wrapper/NavItem.tsx +47 -47
- package/src/components/wrapper/NewPrivateMessage.tsx +253 -253
- package/src/components/wrapper/Notifications.tsx +223 -223
- package/src/components/wrapper/PrivateMessageDetails.tsx +112 -112
- package/src/components/wrapper/PrivateMessages.tsx +576 -576
- package/src/components/wrapper/UserMenu.tsx +383 -383
- package/src/components/wrapper/index.tsx +8 -8
- package/src/helpers/AnalyticsHelper.ts +32 -32
- package/src/helpers/AppearanceHelper.ts +73 -73
- package/src/helpers/ArrayHelper.ts +87 -87
- package/src/helpers/CurrencyHelper.ts +10 -10
- package/src/helpers/DateHelper.ts +104 -104
- package/src/helpers/ErrorHelper.ts +43 -43
- package/src/helpers/EventHelper.ts +49 -49
- package/src/helpers/FileHelper.ts +31 -31
- package/src/helpers/Locale.ts +457 -457
- package/src/helpers/NotificationService.ts +296 -296
- package/src/helpers/PersonHelper.ts +62 -62
- package/src/helpers/SlugHelper.ts +37 -37
- package/src/helpers/SocketHelper.ts +296 -296
- package/src/helpers/UniqueIdHelper.ts +36 -36
- package/src/helpers/UserHelper.ts +104 -104
- package/src/helpers/createEmotionCache.ts +17 -17
- package/src/helpers/index.ts +58 -50
- package/src/hooks/index.ts +3 -3
- package/src/hooks/useMountedState.ts +16 -16
- package/src/hooks/useNotifications.ts +93 -93
- package/src/index.ts +2 -2
- package/src/types/interface-extensions.d.ts +12 -0
- package/tsconfig.json +31 -31
- package/dist/public/locales/de.json +0 -270
- package/dist/public/locales/en.json +0 -277
- package/dist/public/locales/es.json +0 -272
- package/dist/public/locales/fr.json +0 -270
- package/dist/public/locales/hi.json +0 -270
- package/dist/public/locales/it.json +0 -270
- package/dist/public/locales/ko.json +0 -270
- package/dist/public/locales/no.json +0 -270
- package/dist/public/locales/pt.json +0 -270
- package/dist/public/locales/ru.json +0 -270
- package/dist/public/locales/tl.json +0 -270
- package/dist/public/locales/zh.json +0 -270
|
@@ -1,43 +1,43 @@
|
|
|
1
|
-
import { ErrorLogInterface, ErrorAppDataInterface } from "@churchapps/helpers";
|
|
2
|
-
import { ApiHelper } from "@churchapps/helpers";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
export class ErrorHelper {
|
|
6
|
-
|
|
7
|
-
static getAppData: () => { churchId: string, userId: string, originUrl: string, application: string };
|
|
8
|
-
static customErrorHandler: (errorLog: ErrorLogInterface) => void;
|
|
9
|
-
|
|
10
|
-
static init = (getAppData: () => ErrorAppDataInterface, customErrorHandler: (errorLog: ErrorLogInterface) => void) => {
|
|
11
|
-
ErrorHelper.getAppData = getAppData;
|
|
12
|
-
ErrorHelper.customErrorHandler = customErrorHandler;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
static logError = (errorType: string, message: string, details: string) => {
|
|
16
|
-
if (this.getAppData) {
|
|
17
|
-
const data = this.getAppData();
|
|
18
|
-
const log: ErrorLogInterface = {
|
|
19
|
-
application: data.application,
|
|
20
|
-
errorTime: new Date(),
|
|
21
|
-
userId: data.userId,
|
|
22
|
-
churchId: data.churchId,
|
|
23
|
-
originUrl: data.originUrl,
|
|
24
|
-
errorType: errorType,
|
|
25
|
-
message: message,
|
|
26
|
-
details: details
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
console.log("ERROR LOG", log);
|
|
30
|
-
|
|
31
|
-
if (log.errorType === "401" && log.message.indexOf("/users/login") > -1) return;
|
|
32
|
-
if (log.message.indexOf("clientErrors") > -1) return;
|
|
33
|
-
try {
|
|
34
|
-
// Error posting to /errors endpoint disabled
|
|
35
|
-
// ApiHelper.postAnonymous("/clientErrors", [log], "MembershipApi");
|
|
36
|
-
} catch (error) {
|
|
37
|
-
console.log(error)
|
|
38
|
-
}
|
|
39
|
-
if (ErrorHelper.customErrorHandler) ErrorHelper.customErrorHandler(log);
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
}
|
|
1
|
+
import { ErrorLogInterface, ErrorAppDataInterface } from "@churchapps/helpers";
|
|
2
|
+
import { ApiHelper } from "@churchapps/helpers";
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
export class ErrorHelper {
|
|
6
|
+
|
|
7
|
+
static getAppData: () => { churchId: string, userId: string, originUrl: string, application: string };
|
|
8
|
+
static customErrorHandler: (errorLog: ErrorLogInterface) => void;
|
|
9
|
+
|
|
10
|
+
static init = (getAppData: () => ErrorAppDataInterface, customErrorHandler: (errorLog: ErrorLogInterface) => void) => {
|
|
11
|
+
ErrorHelper.getAppData = getAppData;
|
|
12
|
+
ErrorHelper.customErrorHandler = customErrorHandler;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
static logError = (errorType: string, message: string, details: string) => {
|
|
16
|
+
if (this.getAppData) {
|
|
17
|
+
const data = this.getAppData();
|
|
18
|
+
const log: ErrorLogInterface = {
|
|
19
|
+
application: data.application,
|
|
20
|
+
errorTime: new Date(),
|
|
21
|
+
userId: data.userId,
|
|
22
|
+
churchId: data.churchId,
|
|
23
|
+
originUrl: data.originUrl,
|
|
24
|
+
errorType: errorType,
|
|
25
|
+
message: message,
|
|
26
|
+
details: details
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
console.log("ERROR LOG", log);
|
|
30
|
+
|
|
31
|
+
if (log.errorType === "401" && log.message.indexOf("/users/login") > -1) return;
|
|
32
|
+
if (log.message.indexOf("clientErrors") > -1) return;
|
|
33
|
+
try {
|
|
34
|
+
// Error posting to /errors endpoint disabled
|
|
35
|
+
// ApiHelper.postAnonymous("/clientErrors", [log], "MembershipApi");
|
|
36
|
+
} catch (error) {
|
|
37
|
+
console.log(error)
|
|
38
|
+
}
|
|
39
|
+
if (ErrorHelper.customErrorHandler) ErrorHelper.customErrorHandler(log);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
}
|
|
@@ -1,49 +1,49 @@
|
|
|
1
|
-
import { EventInterface } from "@churchapps/helpers";
|
|
2
|
-
import { RRule } from "rrule";
|
|
3
|
-
import { ParsedOptions } from "rrule/dist/esm/types";
|
|
4
|
-
|
|
5
|
-
export class EventHelper {
|
|
6
|
-
|
|
7
|
-
static getRange = (event:EventInterface, startDate:Date, endDate:Date) => {
|
|
8
|
-
const start = new Date(event.start);
|
|
9
|
-
const rrule = EventHelper.getFullRRule(event);
|
|
10
|
-
|
|
11
|
-
const dates = rrule.between(startDate, endDate);
|
|
12
|
-
|
|
13
|
-
dates.forEach(d => {
|
|
14
|
-
d.setHours(start.getHours());
|
|
15
|
-
d.setMinutes(start.getMinutes());
|
|
16
|
-
d.setSeconds(start.getSeconds());
|
|
17
|
-
})
|
|
18
|
-
return dates;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
static getFullRRule = (event:EventInterface) => {
|
|
22
|
-
let rrule = RRule.fromString(event.recurrenceRule);
|
|
23
|
-
rrule.options.dtstart = new Date(event.start);
|
|
24
|
-
return rrule;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
static removeExcludeDates = (events:EventInterface[]) => {
|
|
28
|
-
for (let i=events.length-1; i>=0; i--) {
|
|
29
|
-
if (events[i].exceptionDates?.length>0)
|
|
30
|
-
{
|
|
31
|
-
const parsedDates = events[i].exceptionDates.map(d=>new Date(d).toISOString());
|
|
32
|
-
if (parsedDates.indexOf(events[i].start.toISOString())>-1) events.splice(i,1);
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
static getPartialRRuleString = (options:ParsedOptions) => {
|
|
38
|
-
const parts = new RRule(options).toString().split("RRULE:");
|
|
39
|
-
const result = parts.length===2 ? parts[1] : "";
|
|
40
|
-
return result;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
static cleanRule = (options:ParsedOptions) => {
|
|
44
|
-
options.byhour = undefined;
|
|
45
|
-
options.byminute = undefined;
|
|
46
|
-
options.bysecond = undefined;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
}
|
|
1
|
+
import { EventInterface } from "@churchapps/helpers";
|
|
2
|
+
import { RRule } from "rrule";
|
|
3
|
+
import { ParsedOptions } from "rrule/dist/esm/types";
|
|
4
|
+
|
|
5
|
+
export class EventHelper {
|
|
6
|
+
|
|
7
|
+
static getRange = (event:EventInterface, startDate:Date, endDate:Date) => {
|
|
8
|
+
const start = new Date(event.start);
|
|
9
|
+
const rrule = EventHelper.getFullRRule(event);
|
|
10
|
+
|
|
11
|
+
const dates = rrule.between(startDate, endDate);
|
|
12
|
+
|
|
13
|
+
dates.forEach(d => {
|
|
14
|
+
d.setHours(start.getHours());
|
|
15
|
+
d.setMinutes(start.getMinutes());
|
|
16
|
+
d.setSeconds(start.getSeconds());
|
|
17
|
+
})
|
|
18
|
+
return dates;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
static getFullRRule = (event:EventInterface) => {
|
|
22
|
+
let rrule = RRule.fromString(event.recurrenceRule);
|
|
23
|
+
rrule.options.dtstart = new Date(event.start);
|
|
24
|
+
return rrule;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
static removeExcludeDates = (events:EventInterface[]) => {
|
|
28
|
+
for (let i=events.length-1; i>=0; i--) {
|
|
29
|
+
if (events[i].exceptionDates?.length>0)
|
|
30
|
+
{
|
|
31
|
+
const parsedDates = events[i].exceptionDates.map(d=>new Date(d).toISOString());
|
|
32
|
+
if (parsedDates.indexOf(events[i].start.toISOString())>-1) events.splice(i,1);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
static getPartialRRuleString = (options:ParsedOptions) => {
|
|
38
|
+
const parts = new RRule(options).toString().split("RRULE:");
|
|
39
|
+
const result = parts.length===2 ? parts[1] : "";
|
|
40
|
+
return result;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
static cleanRule = (options:ParsedOptions) => {
|
|
44
|
+
options.byhour = undefined;
|
|
45
|
+
options.byminute = undefined;
|
|
46
|
+
options.bysecond = undefined;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
}
|
|
@@ -1,31 +1,31 @@
|
|
|
1
|
-
import axios from "axios";
|
|
2
|
-
|
|
3
|
-
export class FileHelper {
|
|
4
|
-
|
|
5
|
-
static postPresignedFile = (presigned: any, uploadedFile: File, progressCallback: (percent: number) => void) => {
|
|
6
|
-
const formData = new FormData();
|
|
7
|
-
//formData.append("key", presigned.key); //no longer needed with new aws sdk
|
|
8
|
-
formData.append("acl", "public-read");
|
|
9
|
-
formData.append("Content-Type", uploadedFile.type);
|
|
10
|
-
for (const property in presigned.fields) formData.append(property, presigned.fields[property]);
|
|
11
|
-
formData.append("file", uploadedFile);
|
|
12
|
-
|
|
13
|
-
const axiosConfig = {
|
|
14
|
-
headers: { "Content-Type": "multipart/form-data" },
|
|
15
|
-
onUploadProgress: (data: any) => {
|
|
16
|
-
progressCallback(Math.round((100 * data.loaded) / data.total));
|
|
17
|
-
}
|
|
18
|
-
};
|
|
19
|
-
|
|
20
|
-
return axios.post(presigned.url, formData, axiosConfig);
|
|
21
|
-
};
|
|
22
|
-
|
|
23
|
-
static dataURLtoBlob(dataurl: string) {
|
|
24
|
-
let arr = dataurl.split(","), mime = arr[0].match(/:(.*?);/)[1],
|
|
25
|
-
bstr = atob(arr[1]), n = bstr.length, u8arr = new Uint8Array(n);
|
|
26
|
-
while (n--) {
|
|
27
|
-
u8arr[n] = bstr.charCodeAt(n);
|
|
28
|
-
}
|
|
29
|
-
return new Blob([u8arr], { type: mime });
|
|
30
|
-
}
|
|
31
|
-
}
|
|
1
|
+
import axios from "axios";
|
|
2
|
+
|
|
3
|
+
export class FileHelper {
|
|
4
|
+
|
|
5
|
+
static postPresignedFile = (presigned: any, uploadedFile: File, progressCallback: (percent: number) => void) => {
|
|
6
|
+
const formData = new FormData();
|
|
7
|
+
//formData.append("key", presigned.key); //no longer needed with new aws sdk
|
|
8
|
+
formData.append("acl", "public-read");
|
|
9
|
+
formData.append("Content-Type", uploadedFile.type);
|
|
10
|
+
for (const property in presigned.fields) formData.append(property, presigned.fields[property]);
|
|
11
|
+
formData.append("file", uploadedFile);
|
|
12
|
+
|
|
13
|
+
const axiosConfig = {
|
|
14
|
+
headers: { "Content-Type": "multipart/form-data" },
|
|
15
|
+
onUploadProgress: (data: any) => {
|
|
16
|
+
progressCallback(Math.round((100 * data.loaded) / data.total));
|
|
17
|
+
}
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
return axios.post(presigned.url, formData, axiosConfig);
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
static dataURLtoBlob(dataurl: string) {
|
|
24
|
+
let arr = dataurl.split(","), mime = arr[0].match(/:(.*?);/)[1],
|
|
25
|
+
bstr = atob(arr[1]), n = bstr.length, u8arr = new Uint8Array(n);
|
|
26
|
+
while (n--) {
|
|
27
|
+
u8arr[n] = bstr.charCodeAt(n);
|
|
28
|
+
}
|
|
29
|
+
return new Blob([u8arr], { type: mime });
|
|
30
|
+
}
|
|
31
|
+
}
|