@churchapps/apphelper 0.1.7 → 0.1.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (192) hide show
  1. package/.eslintignore +3 -3
  2. package/.eslintrc.json +22 -22
  3. package/LICENSE +21 -21
  4. package/README.md +24 -24
  5. package/dist/components/gallery/GalleryModal.d.ts.map +1 -1
  6. package/dist/components/gallery/GalleryModal.js +13 -2
  7. package/dist/components/gallery/GalleryModal.js.map +1 -1
  8. package/dist/components/markdownEditor/editor.css +787 -787
  9. package/dist/components/markdownEditor/images/icons/arrow-clockwise.svg +3 -3
  10. package/dist/components/markdownEditor/images/icons/arrow-counterclockwise.svg +3 -3
  11. package/dist/components/markdownEditor/images/icons/chat-square-quote.svg +3 -3
  12. package/dist/components/markdownEditor/images/icons/chevron-down.svg +2 -2
  13. package/dist/components/markdownEditor/images/icons/code.svg +2 -2
  14. package/dist/components/markdownEditor/images/icons/journal-code.svg +4 -4
  15. package/dist/components/markdownEditor/images/icons/journal-text.svg +4 -4
  16. package/dist/components/markdownEditor/images/icons/justify.svg +2 -2
  17. package/dist/components/markdownEditor/images/icons/link.svg +3 -3
  18. package/dist/components/markdownEditor/images/icons/list-ol.svg +3 -3
  19. package/dist/components/markdownEditor/images/icons/list-ul.svg +2 -2
  20. package/dist/components/markdownEditor/images/icons/pencil-fill.svg +2 -2
  21. package/dist/components/markdownEditor/images/icons/text-center.svg +2 -2
  22. package/dist/components/markdownEditor/images/icons/text-left.svg +2 -2
  23. package/dist/components/markdownEditor/images/icons/text-paragraph.svg +2 -2
  24. package/dist/components/markdownEditor/images/icons/text-right.svg +2 -2
  25. package/dist/components/markdownEditor/images/icons/type-bold.svg +2 -2
  26. package/dist/components/markdownEditor/images/icons/type-h1.svg +2 -2
  27. package/dist/components/markdownEditor/images/icons/type-h2.svg +2 -2
  28. package/dist/components/markdownEditor/images/icons/type-h3.svg +2 -2
  29. package/dist/components/markdownEditor/images/icons/type-h4.svg +12 -12
  30. package/dist/components/markdownEditor/images/icons/type-italic.svg +2 -2
  31. package/dist/components/markdownEditor/images/icons/type-strikethrough.svg +2 -2
  32. package/dist/components/markdownEditor/images/icons/type-underline.svg +2 -2
  33. package/dist/components/wrapper/SiteWrapper.d.ts.map +1 -1
  34. package/dist/components/wrapper/SiteWrapper.js +5 -2
  35. package/dist/components/wrapper/SiteWrapper.js.map +1 -1
  36. package/package.json +86 -86
  37. package/src/components/CreatePerson.tsx +80 -80
  38. package/src/components/DisplayBox.tsx +68 -68
  39. package/src/components/ErrorMessages.tsx +26 -26
  40. package/src/components/ExportLink.tsx +67 -67
  41. package/src/components/FloatingSupport.tsx +16 -16
  42. package/src/components/FormSubmissionEdit.tsx +120 -120
  43. package/src/components/HelpIcon.tsx +10 -10
  44. package/src/components/ImageEditor.tsx +126 -126
  45. package/src/components/InputBox.tsx +73 -73
  46. package/src/components/Loading.tsx +29 -29
  47. package/src/components/PersonAdd.tsx +75 -75
  48. package/src/components/QuestionEdit.tsx +63 -63
  49. package/src/components/SmallButton.tsx +39 -39
  50. package/src/components/SupportModal.tsx +26 -26
  51. package/src/components/TabPanel.tsx +34 -34
  52. package/src/components/gallery/GalleryModal.tsx +119 -102
  53. package/src/components/gallery/StockPhotos.tsx +74 -74
  54. package/src/components/gallery/index.ts +1 -1
  55. package/src/components/iconPicker/IconNamesList.ts +2240 -2240
  56. package/src/components/iconPicker/IconPicker.tsx +153 -153
  57. package/src/components/index.tsx +24 -24
  58. package/src/components/markdownEditor/Editor.tsx +132 -132
  59. package/src/components/markdownEditor/MarkdownEditor.tsx +16 -16
  60. package/src/components/markdownEditor/MarkdownModal.tsx +46 -46
  61. package/src/components/markdownEditor/MarkdownPreview.tsx +14 -14
  62. package/src/components/markdownEditor/editor.css +787 -787
  63. package/src/components/markdownEditor/images/icons/arrow-clockwise.svg +3 -3
  64. package/src/components/markdownEditor/images/icons/arrow-counterclockwise.svg +3 -3
  65. package/src/components/markdownEditor/images/icons/chat-square-quote.svg +3 -3
  66. package/src/components/markdownEditor/images/icons/chevron-down.svg +2 -2
  67. package/src/components/markdownEditor/images/icons/code.svg +2 -2
  68. package/src/components/markdownEditor/images/icons/journal-code.svg +4 -4
  69. package/src/components/markdownEditor/images/icons/journal-text.svg +4 -4
  70. package/src/components/markdownEditor/images/icons/justify.svg +2 -2
  71. package/src/components/markdownEditor/images/icons/link.svg +3 -3
  72. package/src/components/markdownEditor/images/icons/list-ol.svg +3 -3
  73. package/src/components/markdownEditor/images/icons/list-ul.svg +2 -2
  74. package/src/components/markdownEditor/images/icons/pencil-fill.svg +2 -2
  75. package/src/components/markdownEditor/images/icons/text-center.svg +2 -2
  76. package/src/components/markdownEditor/images/icons/text-left.svg +2 -2
  77. package/src/components/markdownEditor/images/icons/text-paragraph.svg +2 -2
  78. package/src/components/markdownEditor/images/icons/text-right.svg +2 -2
  79. package/src/components/markdownEditor/images/icons/type-bold.svg +2 -2
  80. package/src/components/markdownEditor/images/icons/type-h1.svg +2 -2
  81. package/src/components/markdownEditor/images/icons/type-h2.svg +2 -2
  82. package/src/components/markdownEditor/images/icons/type-h3.svg +2 -2
  83. package/src/components/markdownEditor/images/icons/type-h4.svg +12 -12
  84. package/src/components/markdownEditor/images/icons/type-italic.svg +2 -2
  85. package/src/components/markdownEditor/images/icons/type-strikethrough.svg +2 -2
  86. package/src/components/markdownEditor/images/icons/type-underline.svg +2 -2
  87. package/src/components/markdownEditor/index.ts +2 -2
  88. package/src/components/markdownEditor/plugins/AutoLinkPlugin.tsx +35 -35
  89. package/src/components/markdownEditor/plugins/ControlledEditorPlugin.tsx +24 -24
  90. package/src/components/markdownEditor/plugins/ListMaxIndentLevelPlugin.tsx +68 -68
  91. package/src/components/markdownEditor/plugins/MarkdownTransformers.ts +106 -106
  92. package/src/components/markdownEditor/plugins/ReadOnlyPlugin.tsx +15 -15
  93. package/src/components/markdownEditor/plugins/ToolbarPlugin.tsx +401 -401
  94. package/src/components/markdownEditor/plugins/customLink/CustomLinkNode.tsx +224 -224
  95. package/src/components/markdownEditor/plugins/customLink/CustomLinkNodePlugin.tsx +32 -32
  96. package/src/components/markdownEditor/plugins/customLink/CustomLinkNodeTransformer.tsx +102 -102
  97. package/src/components/markdownEditor/plugins/customLink/FloatingLinkEditor.tsx +243 -243
  98. package/src/components/markdownEditor/plugins/customLink/FloatingLinkEditor.types.ts +11 -11
  99. package/src/components/markdownEditor/plugins/emoji/EmojiNode.tsx +95 -95
  100. package/src/components/markdownEditor/plugins/emoji/EmojiNodeTransform.ts +41 -41
  101. package/src/components/markdownEditor/plugins/emoji/EmojiPickerPlugin.tsx +152 -152
  102. package/src/components/markdownEditor/plugins/emoji/EmojisPlugin.tsx +65 -65
  103. package/src/components/markdownEditor/plugins/index.ts +6 -6
  104. package/src/components/markdownEditor/theme.ts +65 -65
  105. package/src/components/notes/AddNote.tsx +90 -90
  106. package/src/components/notes/Conversation.tsx +82 -82
  107. package/src/components/notes/Conversations.tsx +58 -58
  108. package/src/components/notes/NewConversation.tsx +78 -78
  109. package/src/components/notes/Note.tsx +44 -44
  110. package/src/components/notes/Notes.tsx +69 -69
  111. package/src/components/notes/index.ts +5 -5
  112. package/src/components/reporting/ChartReport.tsx +98 -98
  113. package/src/components/reporting/ReportFilter.tsx +54 -54
  114. package/src/components/reporting/ReportFilterField.tsx +160 -160
  115. package/src/components/reporting/ReportOutput.tsx +79 -79
  116. package/src/components/reporting/ReportWithFilter.tsx +70 -70
  117. package/src/components/reporting/TableReport.tsx +57 -57
  118. package/src/components/reporting/TreeReport.tsx +111 -111
  119. package/src/components/reporting/index.ts +4 -4
  120. package/src/components/wrapper/AppList.tsx +20 -20
  121. package/src/components/wrapper/ChurchList.tsx +22 -22
  122. package/src/components/wrapper/Drawers.tsx +60 -60
  123. package/src/components/wrapper/NavItem.tsx +41 -41
  124. package/src/components/wrapper/NewPrivateMessage.tsx +103 -103
  125. package/src/components/wrapper/NotificationMenu.tsx +96 -96
  126. package/src/components/wrapper/Notifications.tsx +53 -53
  127. package/src/components/wrapper/PrivateMessageDetails.tsx +24 -24
  128. package/src/components/wrapper/PrivateMessages.tsx +92 -92
  129. package/src/components/wrapper/SiteWrapper.tsx +99 -97
  130. package/src/components/wrapper/TabPanel.tsx +30 -30
  131. package/src/components/wrapper/UserMenu.tsx +106 -106
  132. package/src/components/wrapper/index.tsx +5 -5
  133. package/src/donationComponents/DonationPage.tsx +136 -136
  134. package/src/donationComponents/components/BankForm.tsx +159 -159
  135. package/src/donationComponents/components/CardForm.tsx +104 -104
  136. package/src/donationComponents/components/DonationForm.tsx +235 -235
  137. package/src/donationComponents/components/FundDonation.tsx +49 -49
  138. package/src/donationComponents/components/FundDonations.tsx +39 -39
  139. package/src/donationComponents/components/NonAuthDonation.tsx +31 -31
  140. package/src/donationComponents/components/NonAuthDonationInner.tsx +259 -259
  141. package/src/donationComponents/components/PaymentMethods.tsx +135 -135
  142. package/src/donationComponents/components/RecurringDonations.tsx +121 -121
  143. package/src/donationComponents/components/RecurringDonationsEdit.tsx +93 -93
  144. package/src/donationComponents/components/index.tsx +9 -9
  145. package/src/donationComponents/index.ts +3 -3
  146. package/src/donationComponents/modals/DonationPreviewModal.tsx +66 -66
  147. package/src/helpers/AnalyticsHelper.ts +33 -33
  148. package/src/helpers/ApiHelper.ts +125 -125
  149. package/src/helpers/AppearanceHelper.ts +69 -69
  150. package/src/helpers/ArrayHelper.ts +81 -81
  151. package/src/helpers/CommonEnvironmentHelper.ts +80 -80
  152. package/src/helpers/CurrencyHelper.ts +10 -10
  153. package/src/helpers/DateHelper.ts +109 -109
  154. package/src/helpers/DonationHelper.ts +26 -26
  155. package/src/helpers/ErrorHelper.ts +36 -36
  156. package/src/helpers/EventHelper.ts +52 -52
  157. package/src/helpers/FileHelper.ts +31 -31
  158. package/src/helpers/PersonHelper.ts +60 -60
  159. package/src/helpers/SocketHelper.ts +78 -78
  160. package/src/helpers/Themes.ts +14 -14
  161. package/src/helpers/UniqueIdHelper.ts +36 -36
  162. package/src/helpers/UserHelper.ts +59 -59
  163. package/src/helpers/createEmotionCache.ts +17 -17
  164. package/src/helpers/index.ts +18 -18
  165. package/src/hooks/index.ts +1 -1
  166. package/src/hooks/useMountedState.ts +16 -16
  167. package/src/index.ts +6 -6
  168. package/src/interfaces/Access.ts +24 -24
  169. package/src/interfaces/Attendance.ts +8 -8
  170. package/src/interfaces/Content.ts +10 -10
  171. package/src/interfaces/Doing.ts +24 -24
  172. package/src/interfaces/Donation.ts +45 -45
  173. package/src/interfaces/Error.ts +17 -17
  174. package/src/interfaces/Membership.ts +51 -51
  175. package/src/interfaces/Messaging.ts +11 -11
  176. package/src/interfaces/Permissions.ts +68 -68
  177. package/src/interfaces/Reporting.ts +7 -7
  178. package/src/interfaces/UserContextInterface.ts +13 -13
  179. package/src/interfaces/index.ts +13 -13
  180. package/src/pageComponents/LoginPage.tsx +244 -244
  181. package/src/pageComponents/LogoutPage.tsx +28 -28
  182. package/src/pageComponents/components/Forgot.tsx +79 -79
  183. package/src/pageComponents/components/Login.tsx +54 -54
  184. package/src/pageComponents/components/LoginSetPassword.tsx +63 -63
  185. package/src/pageComponents/components/Register.tsx +107 -107
  186. package/src/pageComponents/components/SelectChurchModal.tsx +41 -41
  187. package/src/pageComponents/components/SelectChurchRegister.tsx +88 -88
  188. package/src/pageComponents/components/SelectChurchSearch.tsx +69 -69
  189. package/src/pageComponents/components/SelectableChurch.tsx +38 -38
  190. package/src/pageComponents/index.ts +3 -3
  191. package/tsconfig.json +34 -34
  192. package/tslint.json +14 -14
@@ -1,80 +1,80 @@
1
-
2
- export class CommonEnvironmentHelper {
3
- public static AttendanceApi = "";
4
- public static DoingApi = "";
5
- public static GivingApi = "";
6
- public static MembershipApi = "";
7
- public static ReportingApi = "";
8
- public static MessagingApi = "";
9
- public static MessagingApiSocket = "";
10
- public static ContentApi = "";
11
- public static GoogleAnalyticsTag = "";
12
-
13
- static ContentRoot = "";
14
- static B1Root = "";
15
- static ChumsRoot = "";
16
- static LessonsRoot = "";
17
-
18
- static init = (stage: string) => {
19
- switch (stage) {
20
- case "staging": CommonEnvironmentHelper.initStaging(); break;
21
- case "prod": CommonEnvironmentHelper.initProd(); break;
22
- default: CommonEnvironmentHelper.initDev(); break;
23
- }
24
- }
25
-
26
- static initDev = () => {
27
- this.initStaging(); //Use staging values for anything not provided
28
- CommonEnvironmentHelper.AttendanceApi = process.env.REACT_APP_ATTENDANCE_API || process.env.NEXT_PUBLIC_ATTENDANCE_API || CommonEnvironmentHelper.AttendanceApi;
29
- CommonEnvironmentHelper.DoingApi = process.env.REACT_APP_DOING_API || process.env.NEXT_PUBLIC_DOING_API || CommonEnvironmentHelper.DoingApi;
30
- CommonEnvironmentHelper.GivingApi = process.env.REACT_APP_GIVING_API || process.env.NEXT_PUBLIC_GIVING_API || CommonEnvironmentHelper.GivingApi;
31
- CommonEnvironmentHelper.MembershipApi = process.env.REACT_APP_MEMBERSHIP_API || process.env.NEXT_PUBLIC_MEMBERSHIP_API || CommonEnvironmentHelper.MembershipApi;
32
- CommonEnvironmentHelper.ReportingApi = process.env.REACT_APP_REPORTING_API || process.env.NEXT_PUBLIC_REPORTING_API || CommonEnvironmentHelper.ReportingApi;
33
- CommonEnvironmentHelper.MessagingApi = process.env.REACT_APP_MESSAGING_API || process.env.NEXT_PUBLIC_MESSAGING_API || CommonEnvironmentHelper.MessagingApi;
34
- CommonEnvironmentHelper.MessagingApiSocket = process.env.REACT_APP_MESSAGING_API_SOCKET || process.env.NEXT_PUBLIC_MESSAGING_API_SOCKET || CommonEnvironmentHelper.MessagingApiSocket;
35
- CommonEnvironmentHelper.ContentApi = process.env.REACT_APP_CONTENT_API || process.env.NEXT_PUBLIC_CONTENT_API || CommonEnvironmentHelper.ContentApi;
36
- CommonEnvironmentHelper.GoogleAnalyticsTag = process.env.REACT_APP_GOOGLE_ANALYTICS || process.env.NEXT_PUBLIC_GOOGLE_ANALYTICS || CommonEnvironmentHelper.GoogleAnalyticsTag;
37
-
38
- CommonEnvironmentHelper.ContentRoot = process.env.REACT_APP_CONTENT_ROOT || process.env.NEXT_PUBLIC_CONTENT_ROOT || CommonEnvironmentHelper.ContentRoot;
39
- CommonEnvironmentHelper.B1Root = process.env.REACT_APP_B1_ROOT || process.env.NEXT_PUBLIC_B1_ROOT || CommonEnvironmentHelper.B1Root;
40
- CommonEnvironmentHelper.ChumsRoot = process.env.REACT_APP_CHUMS_ROOT || process.env.NEXT_PUBLIC_CHUMS_ROOT || CommonEnvironmentHelper.ChumsRoot;
41
- CommonEnvironmentHelper.LessonsRoot = process.env.REACT_APP_LESSONS_ROOT || process.env.NEXT_PUBLIC_LESSONS_ROOT || CommonEnvironmentHelper.LessonsRoot;
42
- }
43
-
44
- //NOTE: None of these values are secret.
45
- static initStaging = () => {
46
- CommonEnvironmentHelper.AttendanceApi = "https://attendanceapi.staging.churchapps.org";
47
- CommonEnvironmentHelper.DoingApi = "https://doingapi.staging.churchapps.org";
48
- CommonEnvironmentHelper.GivingApi = "https://givingapi.staging.churchapps.org";
49
- CommonEnvironmentHelper.MembershipApi = "https://membershipapi.staging.churchapps.org";
50
- CommonEnvironmentHelper.ReportingApi = "https://reportingapi.staging.churchapps.org";
51
- CommonEnvironmentHelper.MessagingApi = "https://messagingapi.staging.churchapps.org";
52
- CommonEnvironmentHelper.MessagingApiSocket = "wss://socket.staging.churchapps.org";
53
- CommonEnvironmentHelper.ContentApi = "https://contentapi.staging.churchapps.org";
54
- CommonEnvironmentHelper.GoogleAnalyticsTag = "";
55
-
56
- CommonEnvironmentHelper.ContentRoot = "https://content.staging.churchapps.org";
57
- CommonEnvironmentHelper.B1Root = "https://{key}.staging.b1.church";
58
- CommonEnvironmentHelper.ChumsRoot = "https://app.staging.chums.org";
59
- CommonEnvironmentHelper.LessonsRoot = "https://staging.lessons.church";
60
- }
61
-
62
- //NOTE: None of these values are secret.
63
- static initProd = () => {
64
- CommonEnvironmentHelper.AttendanceApi = "https://attendanceapi.churchapps.org";
65
- CommonEnvironmentHelper.DoingApi = "https://doingapi.churchapps.org";
66
- CommonEnvironmentHelper.GivingApi = "https://givingapi.churchapps.org";
67
- CommonEnvironmentHelper.MembershipApi = "https://membershipapi.churchapps.org";
68
- CommonEnvironmentHelper.ReportingApi = "https://reportingapi.churchapps.org";
69
- CommonEnvironmentHelper.MessagingApi = "https://messagingapi.churchapps.org";
70
- CommonEnvironmentHelper.MessagingApiSocket = "wss://socket.churchapps.org";
71
- CommonEnvironmentHelper.ContentApi = "https://contentapi.churchapps.org";
72
-
73
- CommonEnvironmentHelper.ContentRoot = "https://content.churchapps.org";
74
- CommonEnvironmentHelper.B1Root = "https://{key}.b1.church";
75
- CommonEnvironmentHelper.ChumsRoot = "https://app.chums.org";
76
- CommonEnvironmentHelper.LessonsRoot = "https://lessons.church";
77
- }
78
-
79
- }
80
-
1
+
2
+ export class CommonEnvironmentHelper {
3
+ public static AttendanceApi = "";
4
+ public static DoingApi = "";
5
+ public static GivingApi = "";
6
+ public static MembershipApi = "";
7
+ public static ReportingApi = "";
8
+ public static MessagingApi = "";
9
+ public static MessagingApiSocket = "";
10
+ public static ContentApi = "";
11
+ public static GoogleAnalyticsTag = "";
12
+
13
+ static ContentRoot = "";
14
+ static B1Root = "";
15
+ static ChumsRoot = "";
16
+ static LessonsRoot = "";
17
+
18
+ static init = (stage: string) => {
19
+ switch (stage) {
20
+ case "staging": CommonEnvironmentHelper.initStaging(); break;
21
+ case "prod": CommonEnvironmentHelper.initProd(); break;
22
+ default: CommonEnvironmentHelper.initDev(); break;
23
+ }
24
+ }
25
+
26
+ static initDev = () => {
27
+ this.initStaging(); //Use staging values for anything not provided
28
+ CommonEnvironmentHelper.AttendanceApi = process.env.REACT_APP_ATTENDANCE_API || process.env.NEXT_PUBLIC_ATTENDANCE_API || CommonEnvironmentHelper.AttendanceApi;
29
+ CommonEnvironmentHelper.DoingApi = process.env.REACT_APP_DOING_API || process.env.NEXT_PUBLIC_DOING_API || CommonEnvironmentHelper.DoingApi;
30
+ CommonEnvironmentHelper.GivingApi = process.env.REACT_APP_GIVING_API || process.env.NEXT_PUBLIC_GIVING_API || CommonEnvironmentHelper.GivingApi;
31
+ CommonEnvironmentHelper.MembershipApi = process.env.REACT_APP_MEMBERSHIP_API || process.env.NEXT_PUBLIC_MEMBERSHIP_API || CommonEnvironmentHelper.MembershipApi;
32
+ CommonEnvironmentHelper.ReportingApi = process.env.REACT_APP_REPORTING_API || process.env.NEXT_PUBLIC_REPORTING_API || CommonEnvironmentHelper.ReportingApi;
33
+ CommonEnvironmentHelper.MessagingApi = process.env.REACT_APP_MESSAGING_API || process.env.NEXT_PUBLIC_MESSAGING_API || CommonEnvironmentHelper.MessagingApi;
34
+ CommonEnvironmentHelper.MessagingApiSocket = process.env.REACT_APP_MESSAGING_API_SOCKET || process.env.NEXT_PUBLIC_MESSAGING_API_SOCKET || CommonEnvironmentHelper.MessagingApiSocket;
35
+ CommonEnvironmentHelper.ContentApi = process.env.REACT_APP_CONTENT_API || process.env.NEXT_PUBLIC_CONTENT_API || CommonEnvironmentHelper.ContentApi;
36
+ CommonEnvironmentHelper.GoogleAnalyticsTag = process.env.REACT_APP_GOOGLE_ANALYTICS || process.env.NEXT_PUBLIC_GOOGLE_ANALYTICS || CommonEnvironmentHelper.GoogleAnalyticsTag;
37
+
38
+ CommonEnvironmentHelper.ContentRoot = process.env.REACT_APP_CONTENT_ROOT || process.env.NEXT_PUBLIC_CONTENT_ROOT || CommonEnvironmentHelper.ContentRoot;
39
+ CommonEnvironmentHelper.B1Root = process.env.REACT_APP_B1_ROOT || process.env.NEXT_PUBLIC_B1_ROOT || CommonEnvironmentHelper.B1Root;
40
+ CommonEnvironmentHelper.ChumsRoot = process.env.REACT_APP_CHUMS_ROOT || process.env.NEXT_PUBLIC_CHUMS_ROOT || CommonEnvironmentHelper.ChumsRoot;
41
+ CommonEnvironmentHelper.LessonsRoot = process.env.REACT_APP_LESSONS_ROOT || process.env.NEXT_PUBLIC_LESSONS_ROOT || CommonEnvironmentHelper.LessonsRoot;
42
+ }
43
+
44
+ //NOTE: None of these values are secret.
45
+ static initStaging = () => {
46
+ CommonEnvironmentHelper.AttendanceApi = "https://attendanceapi.staging.churchapps.org";
47
+ CommonEnvironmentHelper.DoingApi = "https://doingapi.staging.churchapps.org";
48
+ CommonEnvironmentHelper.GivingApi = "https://givingapi.staging.churchapps.org";
49
+ CommonEnvironmentHelper.MembershipApi = "https://membershipapi.staging.churchapps.org";
50
+ CommonEnvironmentHelper.ReportingApi = "https://reportingapi.staging.churchapps.org";
51
+ CommonEnvironmentHelper.MessagingApi = "https://messagingapi.staging.churchapps.org";
52
+ CommonEnvironmentHelper.MessagingApiSocket = "wss://socket.staging.churchapps.org";
53
+ CommonEnvironmentHelper.ContentApi = "https://contentapi.staging.churchapps.org";
54
+ CommonEnvironmentHelper.GoogleAnalyticsTag = "";
55
+
56
+ CommonEnvironmentHelper.ContentRoot = "https://content.staging.churchapps.org";
57
+ CommonEnvironmentHelper.B1Root = "https://{key}.staging.b1.church";
58
+ CommonEnvironmentHelper.ChumsRoot = "https://app.staging.chums.org";
59
+ CommonEnvironmentHelper.LessonsRoot = "https://staging.lessons.church";
60
+ }
61
+
62
+ //NOTE: None of these values are secret.
63
+ static initProd = () => {
64
+ CommonEnvironmentHelper.AttendanceApi = "https://attendanceapi.churchapps.org";
65
+ CommonEnvironmentHelper.DoingApi = "https://doingapi.churchapps.org";
66
+ CommonEnvironmentHelper.GivingApi = "https://givingapi.churchapps.org";
67
+ CommonEnvironmentHelper.MembershipApi = "https://membershipapi.churchapps.org";
68
+ CommonEnvironmentHelper.ReportingApi = "https://reportingapi.churchapps.org";
69
+ CommonEnvironmentHelper.MessagingApi = "https://messagingapi.churchapps.org";
70
+ CommonEnvironmentHelper.MessagingApiSocket = "wss://socket.churchapps.org";
71
+ CommonEnvironmentHelper.ContentApi = "https://contentapi.churchapps.org";
72
+
73
+ CommonEnvironmentHelper.ContentRoot = "https://content.churchapps.org";
74
+ CommonEnvironmentHelper.B1Root = "https://{key}.b1.church";
75
+ CommonEnvironmentHelper.ChumsRoot = "https://app.chums.org";
76
+ CommonEnvironmentHelper.LessonsRoot = "https://lessons.church";
77
+ }
78
+
79
+ }
80
+
@@ -1,10 +1,10 @@
1
- export class CurrencyHelper {
2
- static formatCurrency(amount: number) {
3
- const formatter = new Intl.NumberFormat("en-US", {
4
- style: "currency",
5
- currency: "USD",
6
- minimumFractionDigits: 2
7
- });
8
- return formatter.format(amount);
9
- }
10
- }
1
+ export class CurrencyHelper {
2
+ static formatCurrency(amount: number) {
3
+ const formatter = new Intl.NumberFormat("en-US", {
4
+ style: "currency",
5
+ currency: "USD",
6
+ minimumFractionDigits: 2
7
+ });
8
+ return formatter.format(amount);
9
+ }
10
+ }
@@ -1,109 +1,109 @@
1
- import { format as dateFormat } from "date-fns"
2
-
3
- export class DateHelper {
4
-
5
- //Fixes timezone issues when you just need the date.
6
- static toDate(input: any) {
7
- return new Date(Date.parse(input.toString().replace("Z", "")));
8
- }
9
-
10
- static toDateTime(input: any) {
11
- return new Date(Date.parse(input.toString()));
12
- }
13
-
14
- //obsolete. Do not use
15
- static convertToDate(input: any) {
16
- return this.toDateTime(input);
17
- }
18
-
19
- static addDays(date: Date, days: number) {
20
- date.setDate(date.getDate() + days);
21
- return date;
22
- }
23
-
24
- static prettyDate(date: Date) {
25
- if (date === undefined || date === null) return "";
26
- return this.formatDateTime(date, "MMM d, yyyy");
27
- }
28
-
29
- static prettyDateTime(date: Date) {
30
- if (date === undefined || date === null) return "";
31
- return this.formatDateTime(date, "MMM d, yyyy h:mm a");
32
- }
33
-
34
- static prettyTime(date: Date) {
35
- if (date === undefined || date === null) return "";
36
- return this.formatDateTime(date, "h:mm a");
37
- }
38
-
39
- static getLastSunday() {
40
- let result = new Date();
41
- while (result.getDay() !== 0) result.setDate(result.getDate() - 1);
42
- return result;
43
- }
44
-
45
- static getWeekSunday(year: number, week: number) {
46
- let result = new Date(year, 0, 1);
47
- while (result.getDay() !== 0) result.setDate(result.getDate() + 1);
48
- result.setDate(result.getDate() + ((week - 1) * 7));
49
- return result;
50
- }
51
-
52
- static formatHtml5Date(date: Date): string {
53
- let result = "";
54
- if (date !== undefined && date !== null) {
55
- try {
56
- result = new Date(date).toISOString().split("T")[0];
57
- } catch { }
58
- }
59
- return result;
60
- }
61
-
62
- static formatHtml5Time(time: Date): string {
63
- let h = time.getHours();
64
- let m = time.getMinutes();
65
- let s = time.getSeconds();
66
- return `${h < 10 ? ("0" + h) : h}:${m < 10 ? ("0" + m) : m}:${s < 10 ? ("0" + s) : s}`;
67
- }
68
-
69
- static formatHtml5DateTime(date: Date): string {
70
- if (date === undefined || date === null) return "";
71
- else {
72
- return this.formatDateTime(date, "yyyy-MM-dd") + "T" + this.formatDateTime(date, "HH:mm");
73
- }
74
- }
75
-
76
- static getDisplayDuration(d: Date): string {
77
- let seconds = Math.round((new Date().getTime() - d.getTime()) / 1000);
78
- if (seconds > 86400) {
79
- let days = Math.floor(seconds / 86400);
80
- return (days === 1) ? "1d" : days.toString() + "d";
81
- }
82
- else if (seconds > 3600) {
83
- let hours = Math.floor(seconds / 3600);
84
- return (hours === 1) ? "1h" : hours.toString() + "h";
85
- }
86
- else if (seconds > 60) {
87
- let minutes = Math.floor(seconds / 60);
88
- return (minutes === 1) ? "1m" : minutes.toString() + "m";
89
- }
90
- else if (seconds < 1) return "now";
91
- else return (seconds === 1) ? "1s" : Math.floor(seconds).toString() + "s";
92
- }
93
-
94
- static getShortDate(d: Date): string {
95
- return (d.getMonth() + 1).toString() + "/" + (d.getDate()).toString() + "/" + d.getFullYear().toString();
96
- }
97
-
98
- static convertDatePickerFormat(d: Date): Date {
99
- const date = this.formatHtml5Date(d).split("-");
100
- if (date.length === 3) return new Date(`${date[1]}-${date[2]}-${date[0]}`);
101
- return new Date();
102
- }
103
-
104
- private static formatDateTime(date: Date, format: string) {
105
- try {
106
- return dateFormat(date, format);
107
- } catch { return ""; }
108
- }
109
- }
1
+ import { format as dateFormat } from "date-fns"
2
+
3
+ export class DateHelper {
4
+
5
+ //Fixes timezone issues when you just need the date.
6
+ static toDate(input: any) {
7
+ return new Date(Date.parse(input.toString().replace("Z", "")));
8
+ }
9
+
10
+ static toDateTime(input: any) {
11
+ return new Date(Date.parse(input.toString()));
12
+ }
13
+
14
+ //obsolete. Do not use
15
+ static convertToDate(input: any) {
16
+ return this.toDateTime(input);
17
+ }
18
+
19
+ static addDays(date: Date, days: number) {
20
+ date.setDate(date.getDate() + days);
21
+ return date;
22
+ }
23
+
24
+ static prettyDate(date: Date) {
25
+ if (date === undefined || date === null) return "";
26
+ return this.formatDateTime(date, "MMM d, yyyy");
27
+ }
28
+
29
+ static prettyDateTime(date: Date) {
30
+ if (date === undefined || date === null) return "";
31
+ return this.formatDateTime(date, "MMM d, yyyy h:mm a");
32
+ }
33
+
34
+ static prettyTime(date: Date) {
35
+ if (date === undefined || date === null) return "";
36
+ return this.formatDateTime(date, "h:mm a");
37
+ }
38
+
39
+ static getLastSunday() {
40
+ let result = new Date();
41
+ while (result.getDay() !== 0) result.setDate(result.getDate() - 1);
42
+ return result;
43
+ }
44
+
45
+ static getWeekSunday(year: number, week: number) {
46
+ let result = new Date(year, 0, 1);
47
+ while (result.getDay() !== 0) result.setDate(result.getDate() + 1);
48
+ result.setDate(result.getDate() + ((week - 1) * 7));
49
+ return result;
50
+ }
51
+
52
+ static formatHtml5Date(date: Date): string {
53
+ let result = "";
54
+ if (date !== undefined && date !== null) {
55
+ try {
56
+ result = new Date(date).toISOString().split("T")[0];
57
+ } catch { }
58
+ }
59
+ return result;
60
+ }
61
+
62
+ static formatHtml5Time(time: Date): string {
63
+ let h = time.getHours();
64
+ let m = time.getMinutes();
65
+ let s = time.getSeconds();
66
+ return `${h < 10 ? ("0" + h) : h}:${m < 10 ? ("0" + m) : m}:${s < 10 ? ("0" + s) : s}`;
67
+ }
68
+
69
+ static formatHtml5DateTime(date: Date): string {
70
+ if (date === undefined || date === null) return "";
71
+ else {
72
+ return this.formatDateTime(date, "yyyy-MM-dd") + "T" + this.formatDateTime(date, "HH:mm");
73
+ }
74
+ }
75
+
76
+ static getDisplayDuration(d: Date): string {
77
+ let seconds = Math.round((new Date().getTime() - d.getTime()) / 1000);
78
+ if (seconds > 86400) {
79
+ let days = Math.floor(seconds / 86400);
80
+ return (days === 1) ? "1d" : days.toString() + "d";
81
+ }
82
+ else if (seconds > 3600) {
83
+ let hours = Math.floor(seconds / 3600);
84
+ return (hours === 1) ? "1h" : hours.toString() + "h";
85
+ }
86
+ else if (seconds > 60) {
87
+ let minutes = Math.floor(seconds / 60);
88
+ return (minutes === 1) ? "1m" : minutes.toString() + "m";
89
+ }
90
+ else if (seconds < 1) return "now";
91
+ else return (seconds === 1) ? "1s" : Math.floor(seconds).toString() + "s";
92
+ }
93
+
94
+ static getShortDate(d: Date): string {
95
+ return (d.getMonth() + 1).toString() + "/" + (d.getDate()).toString() + "/" + d.getFullYear().toString();
96
+ }
97
+
98
+ static convertDatePickerFormat(d: Date): Date {
99
+ const date = this.formatHtml5Date(d).split("-");
100
+ if (date.length === 3) return new Date(`${date[1]}-${date[2]}-${date[0]}`);
101
+ return new Date();
102
+ }
103
+
104
+ private static formatDateTime(date: Date, format: string) {
105
+ try {
106
+ return dateFormat(date, format);
107
+ } catch { return ""; }
108
+ }
109
+ }
@@ -1,26 +1,26 @@
1
- export class DonationHelper {
2
-
3
- static getInterval(intervalName:string) {
4
- let intervalCount = 1;
5
- let intervalType = "month";
6
- let parts = intervalName.split("_");
7
- if (parts.length === 2) {
8
- switch (parts[0])
9
- {
10
- case "two": intervalCount = 2; break;
11
- case "three": intervalCount = 3; break;
12
- }
13
- intervalType = parts[1];
14
- }
15
- let result = { interval_count: intervalCount, interval: intervalType };
16
- return result;
17
- }
18
-
19
- static getIntervalKeyName(intervalCount: number, intervalType: string) {
20
- let firstPart = "one";
21
- if (intervalCount === 2) firstPart = "two";
22
- else if (intervalCount === 3) firstPart = "three";
23
- return firstPart + "_" + intervalType;
24
- }
25
-
26
- }
1
+ export class DonationHelper {
2
+
3
+ static getInterval(intervalName:string) {
4
+ let intervalCount = 1;
5
+ let intervalType = "month";
6
+ let parts = intervalName.split("_");
7
+ if (parts.length === 2) {
8
+ switch (parts[0])
9
+ {
10
+ case "two": intervalCount = 2; break;
11
+ case "three": intervalCount = 3; break;
12
+ }
13
+ intervalType = parts[1];
14
+ }
15
+ let result = { interval_count: intervalCount, interval: intervalType };
16
+ return result;
17
+ }
18
+
19
+ static getIntervalKeyName(intervalCount: number, intervalType: string) {
20
+ let firstPart = "one";
21
+ if (intervalCount === 2) firstPart = "two";
22
+ else if (intervalCount === 3) firstPart = "three";
23
+ return firstPart + "_" + intervalType;
24
+ }
25
+
26
+ }
@@ -1,36 +1,36 @@
1
- import { ErrorLogInterface, ErrrorAppDataInterface } from "../interfaces/Error";
2
- import { ApiHelper } from "./ApiHelper";
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:() => ErrrorAppDataInterface, 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
- {
18
- const data = this.getAppData();
19
- const log:ErrorLogInterface = {
20
- application: data.application,
21
- errorTime: new Date(),
22
- userId: data.userId,
23
- churchId: data.churchId,
24
- originUrl: data.originUrl,
25
- errorType: errorType,
26
- message: message,
27
- details: details
28
- }
29
-
30
- if (log.errorType==="401" && log.message.indexOf("/users/login")===-1) return;
31
- ApiHelper.postAnonymous("/errors", [log], "MembershipApi");
32
- if (ErrorHelper.customErrorHandler) ErrorHelper.customErrorHandler(log);
33
- }
34
- }
35
-
36
- }
1
+ import { ErrorLogInterface, ErrrorAppDataInterface } from "../interfaces/Error";
2
+ import { ApiHelper } from "./ApiHelper";
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:() => ErrrorAppDataInterface, 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
+ {
18
+ const data = this.getAppData();
19
+ const log:ErrorLogInterface = {
20
+ application: data.application,
21
+ errorTime: new Date(),
22
+ userId: data.userId,
23
+ churchId: data.churchId,
24
+ originUrl: data.originUrl,
25
+ errorType: errorType,
26
+ message: message,
27
+ details: details
28
+ }
29
+
30
+ if (log.errorType==="401" && log.message.indexOf("/users/login")===-1) return;
31
+ ApiHelper.postAnonymous("/errors", [log], "MembershipApi");
32
+ if (ErrorHelper.customErrorHandler) ErrorHelper.customErrorHandler(log);
33
+ }
34
+ }
35
+
36
+ }
@@ -1,52 +1,52 @@
1
- import { EventInterface } from "../interfaces";
2
- import { RRule, datetime } 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
- console.log("START", rrule.options.dtstart, event.start, rrule)
25
- return rrule;
26
- }
27
-
28
- static removeExcludeDates = (events:EventInterface[]) => {
29
- for (let i=events.length-1; i>=0; i--) {
30
- if (events[i].exceptionDates?.length>0)
31
- {
32
- const parsedDates = events[i].exceptionDates.map(d=>new Date(d).toISOString());
33
- //console.log("Compare", events[i].start.toISOString(), parsedDates, parsedDates.indexOf(events[i].start.toISOString()));
34
- if (parsedDates.indexOf(events[i].start.toISOString())>-1) events.splice(i,1);
35
- }
36
- }
37
- }
38
-
39
- static getPartialRRuleString = (options:ParsedOptions) => {
40
- const parts = new RRule(options).toString().split("RRULE:");
41
- const result = parts.length===2 ? parts[1] : "";
42
- console.log("getPartialRRuleString", options, new RRule(options).toString(), result);
43
- return result;
44
- }
45
-
46
- static cleanRule = (options:ParsedOptions) => {
47
- options.byhour = undefined;
48
- options.byminute = undefined;
49
- options.bysecond = undefined;
50
- }
51
-
52
- }
1
+ import { EventInterface } from "../interfaces";
2
+ import { RRule, datetime } 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
+ console.log("START", rrule.options.dtstart, event.start, rrule)
25
+ return rrule;
26
+ }
27
+
28
+ static removeExcludeDates = (events:EventInterface[]) => {
29
+ for (let i=events.length-1; i>=0; i--) {
30
+ if (events[i].exceptionDates?.length>0)
31
+ {
32
+ const parsedDates = events[i].exceptionDates.map(d=>new Date(d).toISOString());
33
+ //console.log("Compare", events[i].start.toISOString(), parsedDates, parsedDates.indexOf(events[i].start.toISOString()));
34
+ if (parsedDates.indexOf(events[i].start.toISOString())>-1) events.splice(i,1);
35
+ }
36
+ }
37
+ }
38
+
39
+ static getPartialRRuleString = (options:ParsedOptions) => {
40
+ const parts = new RRule(options).toString().split("RRULE:");
41
+ const result = parts.length===2 ? parts[1] : "";
42
+ console.log("getPartialRRuleString", options, new RRule(options).toString(), result);
43
+ return result;
44
+ }
45
+
46
+ static cleanRule = (options:ParsedOptions) => {
47
+ options.byhour = undefined;
48
+ options.byminute = undefined;
49
+ options.bysecond = undefined;
50
+ }
51
+
52
+ }