@churchapps/apphelper 0.0.1
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/.eslintignore +4 -0
- package/.eslintrc.json +22 -0
- package/LICENSE +21 -0
- package/README.md +16 -0
- package/dist/components/CreatePerson.d.ts +9 -0
- package/dist/components/CreatePerson.d.ts.map +1 -0
- package/dist/components/CreatePerson.js +80 -0
- package/dist/components/CreatePerson.js.map +1 -0
- package/dist/components/DisplayBox.d.ts +16 -0
- package/dist/components/DisplayBox.d.ts.map +1 -0
- package/dist/components/DisplayBox.js +48 -0
- package/dist/components/DisplayBox.js.map +1 -0
- package/dist/components/ErrorMessages.d.ts +7 -0
- package/dist/components/ErrorMessages.d.ts.map +1 -0
- package/dist/components/ErrorMessages.js +47 -0
- package/dist/components/ErrorMessages.js.map +1 -0
- package/dist/components/ExportLink.d.ts +10 -0
- package/dist/components/ExportLink.d.ts.map +1 -0
- package/dist/components/ExportLink.js +70 -0
- package/dist/components/ExportLink.js.map +1 -0
- package/dist/components/FloatingSupport.d.ts +7 -0
- package/dist/components/FloatingSupport.d.ts.map +1 -0
- package/dist/components/FloatingSupport.js +18 -0
- package/dist/components/FloatingSupport.js.map +1 -0
- package/dist/components/FormSubmissionEdit.d.ts +18 -0
- package/dist/components/FormSubmissionEdit.d.ts.map +1 -0
- package/dist/components/FormSubmissionEdit.js +125 -0
- package/dist/components/FormSubmissionEdit.js.map +1 -0
- package/dist/components/HelpIcon.d.ts +7 -0
- package/dist/components/HelpIcon.d.ts.map +1 -0
- package/dist/components/HelpIcon.js +12 -0
- package/dist/components/HelpIcon.js.map +1 -0
- package/dist/components/ImageEditor.d.ts +15 -0
- package/dist/components/ImageEditor.d.ts.map +1 -0
- package/dist/components/ImageEditor.js +109 -0
- package/dist/components/ImageEditor.js.map +1 -0
- package/dist/components/InputBox.d.ts +24 -0
- package/dist/components/InputBox.d.ts.map +1 -0
- package/dist/components/InputBox.js +59 -0
- package/dist/components/InputBox.js.map +1 -0
- package/dist/components/Loading.d.ts +10 -0
- package/dist/components/Loading.d.ts.map +1 -0
- package/dist/components/Loading.js +34 -0
- package/dist/components/Loading.js.map +1 -0
- package/dist/components/PersonAdd.d.ts +15 -0
- package/dist/components/PersonAdd.d.ts.map +1 -0
- package/dist/components/PersonAdd.js +84 -0
- package/dist/components/PersonAdd.js.map +1 -0
- package/dist/components/QuestionEdit.d.ts +11 -0
- package/dist/components/QuestionEdit.d.ts.map +1 -0
- package/dist/components/QuestionEdit.js +76 -0
- package/dist/components/QuestionEdit.js.map +1 -0
- package/dist/components/SmallButton.d.ts +14 -0
- package/dist/components/SmallButton.d.ts.map +1 -0
- package/dist/components/SmallButton.js +31 -0
- package/dist/components/SmallButton.js.map +1 -0
- package/dist/components/SupportModal.d.ts +8 -0
- package/dist/components/SupportModal.d.ts.map +1 -0
- package/dist/components/SupportModal.js +47 -0
- package/dist/components/SupportModal.js.map +1 -0
- package/dist/components/TabPanel.d.ts +9 -0
- package/dist/components/TabPanel.d.ts.map +1 -0
- package/dist/components/TabPanel.js +24 -0
- package/dist/components/TabPanel.js.map +1 -0
- package/dist/components/gallery/GalleryModal.d.ts +9 -0
- package/dist/components/gallery/GalleryModal.d.ts.map +1 -0
- package/dist/components/gallery/GalleryModal.js +108 -0
- package/dist/components/gallery/GalleryModal.js.map +1 -0
- package/dist/components/gallery/StockPhotos.d.ts +9 -0
- package/dist/components/gallery/StockPhotos.d.ts.map +1 -0
- package/dist/components/gallery/StockPhotos.js +82 -0
- package/dist/components/gallery/StockPhotos.js.map +1 -0
- package/dist/components/index.d.ts +18 -0
- package/dist/components/index.d.ts.map +1 -0
- package/dist/components/index.js +51 -0
- package/dist/components/index.js.map +1 -0
- package/dist/components/markdownEditor/Editor.d.ts +12 -0
- package/dist/components/markdownEditor/Editor.d.ts.map +1 -0
- package/dist/components/markdownEditor/Editor.js +106 -0
- package/dist/components/markdownEditor/Editor.js.map +1 -0
- package/dist/components/markdownEditor/MarkdownEditor.d.ts +11 -0
- package/dist/components/markdownEditor/MarkdownEditor.d.ts.map +1 -0
- package/dist/components/markdownEditor/MarkdownEditor.js +39 -0
- package/dist/components/markdownEditor/MarkdownEditor.js.map +1 -0
- package/dist/components/markdownEditor/MarkdownModal.d.ts +9 -0
- package/dist/components/markdownEditor/MarkdownModal.d.ts.map +1 -0
- package/dist/components/markdownEditor/MarkdownModal.js +58 -0
- package/dist/components/markdownEditor/MarkdownModal.js.map +1 -0
- package/dist/components/markdownEditor/MarkdownPreview.d.ts +8 -0
- package/dist/components/markdownEditor/MarkdownPreview.d.ts.map +1 -0
- package/dist/components/markdownEditor/MarkdownPreview.js +35 -0
- package/dist/components/markdownEditor/MarkdownPreview.js.map +1 -0
- package/dist/components/markdownEditor/plugins/AutoLinkPlugin.d.ts +3 -0
- package/dist/components/markdownEditor/plugins/AutoLinkPlugin.d.ts.map +1 -0
- package/dist/components/markdownEditor/plugins/AutoLinkPlugin.js +35 -0
- package/dist/components/markdownEditor/plugins/AutoLinkPlugin.js.map +1 -0
- package/dist/components/markdownEditor/plugins/ControlledEditorPlugin.d.ts +8 -0
- package/dist/components/markdownEditor/plugins/ControlledEditorPlugin.d.ts.map +1 -0
- package/dist/components/markdownEditor/plugins/ControlledEditorPlugin.js +20 -0
- package/dist/components/markdownEditor/plugins/ControlledEditorPlugin.js.map +1 -0
- package/dist/components/markdownEditor/plugins/ListMaxIndentLevelPlugin.d.ts +2 -0
- package/dist/components/markdownEditor/plugins/ListMaxIndentLevelPlugin.d.ts.map +1 -0
- package/dist/components/markdownEditor/plugins/ListMaxIndentLevelPlugin.js +46 -0
- package/dist/components/markdownEditor/plugins/ListMaxIndentLevelPlugin.js.map +1 -0
- package/dist/components/markdownEditor/plugins/MarkdownTransformers.d.ts +12 -0
- package/dist/components/markdownEditor/plugins/MarkdownTransformers.d.ts.map +1 -0
- package/dist/components/markdownEditor/plugins/MarkdownTransformers.js +85 -0
- package/dist/components/markdownEditor/plugins/MarkdownTransformers.js.map +1 -0
- package/dist/components/markdownEditor/plugins/ReadOnlyPlugin.d.ts +6 -0
- package/dist/components/markdownEditor/plugins/ReadOnlyPlugin.d.ts.map +1 -0
- package/dist/components/markdownEditor/plugins/ReadOnlyPlugin.js +13 -0
- package/dist/components/markdownEditor/plugins/ReadOnlyPlugin.js.map +1 -0
- package/dist/components/markdownEditor/plugins/ToolbarPlugin.d.ts +8 -0
- package/dist/components/markdownEditor/plugins/ToolbarPlugin.d.ts.map +1 -0
- package/dist/components/markdownEditor/plugins/ToolbarPlugin.js +324 -0
- package/dist/components/markdownEditor/plugins/ToolbarPlugin.js.map +1 -0
- package/dist/components/markdownEditor/plugins/customLink/CustomLinkNode.d.ts +27 -0
- package/dist/components/markdownEditor/plugins/customLink/CustomLinkNode.d.ts.map +1 -0
- package/dist/components/markdownEditor/plugins/customLink/CustomLinkNode.js +158 -0
- package/dist/components/markdownEditor/plugins/customLink/CustomLinkNode.js.map +1 -0
- package/dist/components/markdownEditor/plugins/customLink/CustomLinkNodePlugin.d.ts +4 -0
- package/dist/components/markdownEditor/plugins/customLink/CustomLinkNodePlugin.d.ts.map +1 -0
- package/dist/components/markdownEditor/plugins/customLink/CustomLinkNodePlugin.js +18 -0
- package/dist/components/markdownEditor/plugins/customLink/CustomLinkNodePlugin.js.map +1 -0
- package/dist/components/markdownEditor/plugins/customLink/CustomLinkNodeTransformer.d.ts +3 -0
- package/dist/components/markdownEditor/plugins/customLink/CustomLinkNodeTransformer.d.ts.map +1 -0
- package/dist/components/markdownEditor/plugins/customLink/CustomLinkNodeTransformer.js +67 -0
- package/dist/components/markdownEditor/plugins/customLink/CustomLinkNodeTransformer.js.map +1 -0
- package/dist/components/markdownEditor/plugins/customLink/FloatingLinkEditor.d.ts +5 -0
- package/dist/components/markdownEditor/plugins/customLink/FloatingLinkEditor.d.ts.map +1 -0
- package/dist/components/markdownEditor/plugins/customLink/FloatingLinkEditor.js +212 -0
- package/dist/components/markdownEditor/plugins/customLink/FloatingLinkEditor.js.map +1 -0
- package/dist/components/markdownEditor/plugins/customLink/FloatingLinkEditor.types.d.ts +11 -0
- package/dist/components/markdownEditor/plugins/customLink/FloatingLinkEditor.types.d.ts.map +1 -0
- package/dist/components/markdownEditor/plugins/customLink/FloatingLinkEditor.types.js +3 -0
- package/dist/components/markdownEditor/plugins/customLink/FloatingLinkEditor.types.js.map +1 -0
- package/dist/components/markdownEditor/plugins/emoji/EmojiNode.d.ts +24 -0
- package/dist/components/markdownEditor/plugins/emoji/EmojiNode.d.ts.map +1 -0
- package/dist/components/markdownEditor/plugins/emoji/EmojiNode.js +63 -0
- package/dist/components/markdownEditor/plugins/emoji/EmojiNode.js.map +1 -0
- package/dist/components/markdownEditor/plugins/emoji/EmojiNodeTransform.d.ts +4 -0
- package/dist/components/markdownEditor/plugins/emoji/EmojiNodeTransform.d.ts.map +1 -0
- package/dist/components/markdownEditor/plugins/emoji/EmojiNodeTransform.js +35 -0
- package/dist/components/markdownEditor/plugins/emoji/EmojiNodeTransform.js.map +1 -0
- package/dist/components/markdownEditor/plugins/emoji/EmojiPickerPlugin.d.ts +10 -0
- package/dist/components/markdownEditor/plugins/emoji/EmojiPickerPlugin.d.ts.map +1 -0
- package/dist/components/markdownEditor/plugins/emoji/EmojiPickerPlugin.js +99 -0
- package/dist/components/markdownEditor/plugins/emoji/EmojiPickerPlugin.js.map +1 -0
- package/dist/components/markdownEditor/plugins/emoji/EmojisPlugin.d.ts +11 -0
- package/dist/components/markdownEditor/plugins/emoji/EmojisPlugin.d.ts.map +1 -0
- package/dist/components/markdownEditor/plugins/emoji/EmojisPlugin.js +55 -0
- package/dist/components/markdownEditor/plugins/emoji/EmojisPlugin.js.map +1 -0
- package/dist/components/markdownEditor/plugins/index.d.ts +7 -0
- package/dist/components/markdownEditor/plugins/index.d.ts.map +1 -0
- package/dist/components/markdownEditor/plugins/index.js +16 -0
- package/dist/components/markdownEditor/plugins/index.js.map +1 -0
- package/dist/components/markdownEditor/theme.d.ts +66 -0
- package/dist/components/markdownEditor/theme.d.ts.map +1 -0
- package/dist/components/markdownEditor/theme.js +69 -0
- package/dist/components/markdownEditor/theme.js.map +1 -0
- package/dist/components/material/AppList.d.ts +9 -0
- package/dist/components/material/AppList.d.ts.map +1 -0
- package/dist/components/material/AppList.js +21 -0
- package/dist/components/material/AppList.js.map +1 -0
- package/dist/components/material/ChurchList.d.ts +9 -0
- package/dist/components/material/ChurchList.d.ts.map +1 -0
- package/dist/components/material/ChurchList.js +25 -0
- package/dist/components/material/ChurchList.js.map +1 -0
- package/dist/components/material/NavItem.d.ts +14 -0
- package/dist/components/material/NavItem.d.ts.map +1 -0
- package/dist/components/material/NavItem.js +36 -0
- package/dist/components/material/NavItem.js.map +1 -0
- package/dist/components/material/NewPrivateMessage.d.ts +10 -0
- package/dist/components/material/NewPrivateMessage.d.ts.map +1 -0
- package/dist/components/material/NewPrivateMessage.js +96 -0
- package/dist/components/material/NewPrivateMessage.js.map +1 -0
- package/dist/components/material/PrivateMessageDetails.d.ts +10 -0
- package/dist/components/material/PrivateMessageDetails.d.ts.map +1 -0
- package/dist/components/material/PrivateMessageDetails.js +18 -0
- package/dist/components/material/PrivateMessageDetails.js.map +1 -0
- package/dist/components/material/PrivateMessages.d.ts +8 -0
- package/dist/components/material/PrivateMessages.d.ts.map +1 -0
- package/dist/components/material/PrivateMessages.js +105 -0
- package/dist/components/material/PrivateMessages.js.map +1 -0
- package/dist/components/material/SiteWrapper.d.ts +14 -0
- package/dist/components/material/SiteWrapper.d.ts.map +1 -0
- package/dist/components/material/SiteWrapper.js +120 -0
- package/dist/components/material/SiteWrapper.js.map +1 -0
- package/dist/components/material/UserMenu.d.ts +14 -0
- package/dist/components/material/UserMenu.d.ts.map +1 -0
- package/dist/components/material/UserMenu.js +98 -0
- package/dist/components/material/UserMenu.js.map +1 -0
- package/dist/components/material/iconPicker/IconNamesList.d.ts +3 -0
- package/dist/components/material/iconPicker/IconNamesList.d.ts.map +1 -0
- package/dist/components/material/iconPicker/IconNamesList.js +2241 -0
- package/dist/components/material/iconPicker/IconNamesList.js.map +1 -0
- package/dist/components/material/iconPicker/IconPicker.d.ts +7 -0
- package/dist/components/material/iconPicker/IconPicker.d.ts.map +1 -0
- package/dist/components/material/iconPicker/IconPicker.js +136 -0
- package/dist/components/material/iconPicker/IconPicker.js.map +1 -0
- package/dist/components/material/index.d.ts +6 -0
- package/dist/components/material/index.d.ts.map +1 -0
- package/dist/components/material/index.js +14 -0
- package/dist/components/material/index.js.map +1 -0
- package/dist/components/notes/AddNote.d.ts +12 -0
- package/dist/components/notes/AddNote.d.ts.map +1 -0
- package/dist/components/notes/AddNote.js +123 -0
- package/dist/components/notes/AddNote.js.map +1 -0
- package/dist/components/notes/Conversation.d.ts +11 -0
- package/dist/components/notes/Conversation.d.ts.map +1 -0
- package/dist/components/notes/Conversation.js +85 -0
- package/dist/components/notes/Conversation.js.map +1 -0
- package/dist/components/notes/Conversations.d.ts +11 -0
- package/dist/components/notes/Conversations.d.ts.map +1 -0
- package/dist/components/notes/Conversations.js +64 -0
- package/dist/components/notes/Conversations.js.map +1 -0
- package/dist/components/notes/NewConversation.d.ts +13 -0
- package/dist/components/notes/NewConversation.d.ts.map +1 -0
- package/dist/components/notes/NewConversation.js +86 -0
- package/dist/components/notes/NewConversation.js.map +1 -0
- package/dist/components/notes/Note.d.ts +9 -0
- package/dist/components/notes/Note.d.ts.map +1 -0
- package/dist/components/notes/Note.js +58 -0
- package/dist/components/notes/Note.js.map +1 -0
- package/dist/components/notes/Notes.d.ts +11 -0
- package/dist/components/notes/Notes.d.ts.map +1 -0
- package/dist/components/notes/Notes.js +59 -0
- package/dist/components/notes/Notes.js.map +1 -0
- package/dist/components/reporting/ChartReport.d.ts +9 -0
- package/dist/components/reporting/ChartReport.d.ts.map +1 -0
- package/dist/components/reporting/ChartReport.js +93 -0
- package/dist/components/reporting/ChartReport.js.map +1 -0
- package/dist/components/reporting/ReportFilter.d.ts +10 -0
- package/dist/components/reporting/ReportFilter.d.ts.map +1 -0
- package/dist/components/reporting/ReportFilter.js +54 -0
- package/dist/components/reporting/ReportFilter.js.map +1 -0
- package/dist/components/reporting/ReportFilterField.d.ts +10 -0
- package/dist/components/reporting/ReportFilterField.d.ts.map +1 -0
- package/dist/components/reporting/ReportFilterField.js +167 -0
- package/dist/components/reporting/ReportFilterField.js.map +1 -0
- package/dist/components/reporting/ReportOutput.d.ts +8 -0
- package/dist/components/reporting/ReportOutput.d.ts.map +1 -0
- package/dist/components/reporting/ReportOutput.js +95 -0
- package/dist/components/reporting/ReportOutput.js.map +1 -0
- package/dist/components/reporting/ReportWithFilter.d.ts +8 -0
- package/dist/components/reporting/ReportWithFilter.d.ts.map +1 -0
- package/dist/components/reporting/ReportWithFilter.js +67 -0
- package/dist/components/reporting/ReportWithFilter.js.map +1 -0
- package/dist/components/reporting/TableReport.d.ts +9 -0
- package/dist/components/reporting/TableReport.d.ts.map +1 -0
- package/dist/components/reporting/TableReport.js +50 -0
- package/dist/components/reporting/TableReport.js.map +1 -0
- package/dist/components/reporting/TreeReport.d.ts +9 -0
- package/dist/components/reporting/TreeReport.d.ts.map +1 -0
- package/dist/components/reporting/TreeReport.js +104 -0
- package/dist/components/reporting/TreeReport.js.map +1 -0
- package/dist/components/reporting/index.d.ts +5 -0
- package/dist/components/reporting/index.d.ts.map +1 -0
- package/dist/components/reporting/index.js +12 -0
- package/dist/components/reporting/index.js.map +1 -0
- package/dist/donationComponents/DonationPage.d.ts +9 -0
- package/dist/donationComponents/DonationPage.d.ts.map +1 -0
- package/dist/donationComponents/DonationPage.js +128 -0
- package/dist/donationComponents/DonationPage.js.map +1 -0
- package/dist/donationComponents/components/BankForm.d.ts +14 -0
- package/dist/donationComponents/components/BankForm.d.ts.map +1 -0
- package/dist/donationComponents/components/BankForm.js +161 -0
- package/dist/donationComponents/components/BankForm.js.map +1 -0
- package/dist/donationComponents/components/CardForm.d.ts +13 -0
- package/dist/donationComponents/components/CardForm.d.ts.map +1 -0
- package/dist/donationComponents/components/CardForm.js +128 -0
- package/dist/donationComponents/components/CardForm.js.map +1 -0
- package/dist/donationComponents/components/DonationForm.d.ts +14 -0
- package/dist/donationComponents/components/DonationForm.d.ts.map +1 -0
- package/dist/donationComponents/components/DonationForm.js +227 -0
- package/dist/donationComponents/components/DonationForm.js.map +1 -0
- package/dist/donationComponents/components/FundDonation.d.ts +11 -0
- package/dist/donationComponents/components/FundDonation.d.ts.map +1 -0
- package/dist/donationComponents/components/FundDonation.js +37 -0
- package/dist/donationComponents/components/FundDonation.js.map +1 -0
- package/dist/donationComponents/components/FundDonations.d.ts +10 -0
- package/dist/donationComponents/components/FundDonations.d.ts.map +1 -0
- package/dist/donationComponents/components/FundDonations.js +35 -0
- package/dist/donationComponents/components/FundDonations.js.map +1 -0
- package/dist/donationComponents/components/NonAuthDonation.d.ts +11 -0
- package/dist/donationComponents/components/NonAuthDonation.d.ts.map +1 -0
- package/dist/donationComponents/components/NonAuthDonation.js +40 -0
- package/dist/donationComponents/components/NonAuthDonation.js.map +1 -0
- package/dist/donationComponents/components/NonAuthDonationInner.d.ts +11 -0
- package/dist/donationComponents/components/NonAuthDonationInner.d.ts.map +1 -0
- package/dist/donationComponents/components/NonAuthDonationInner.js +246 -0
- package/dist/donationComponents/components/NonAuthDonationInner.js.map +1 -0
- package/dist/donationComponents/components/PaymentMethods.d.ts +14 -0
- package/dist/donationComponents/components/PaymentMethods.d.ts.map +1 -0
- package/dist/donationComponents/components/PaymentMethods.js +113 -0
- package/dist/donationComponents/components/PaymentMethods.js.map +1 -0
- package/dist/donationComponents/components/RecurringDonations.d.ts +10 -0
- package/dist/donationComponents/components/RecurringDonations.d.ts.map +1 -0
- package/dist/donationComponents/components/RecurringDonations.js +118 -0
- package/dist/donationComponents/components/RecurringDonations.js.map +1 -0
- package/dist/donationComponents/components/RecurringDonationsEdit.d.ts +11 -0
- package/dist/donationComponents/components/RecurringDonationsEdit.d.ts.map +1 -0
- package/dist/donationComponents/components/RecurringDonationsEdit.js +81 -0
- package/dist/donationComponents/components/RecurringDonationsEdit.js.map +1 -0
- package/dist/donationComponents/components/index.d.ts +10 -0
- package/dist/donationComponents/components/index.d.ts.map +1 -0
- package/dist/donationComponents/components/index.js +22 -0
- package/dist/donationComponents/components/index.js.map +1 -0
- package/dist/donationComponents/modals/DonationPreviewModal.d.ts +15 -0
- package/dist/donationComponents/modals/DonationPreviewModal.d.ts.map +1 -0
- package/dist/donationComponents/modals/DonationPreviewModal.js +73 -0
- package/dist/donationComponents/modals/DonationPreviewModal.js.map +1 -0
- package/dist/helpers/AnalyticsHelper.d.ts +7 -0
- package/dist/helpers/AnalyticsHelper.d.ts.map +1 -0
- package/dist/helpers/AnalyticsHelper.js +39 -0
- package/dist/helpers/AnalyticsHelper.js.map +1 -0
- package/dist/helpers/ApiHelper.d.ts +18 -0
- package/dist/helpers/ApiHelper.d.ts.map +1 -0
- package/dist/helpers/ApiHelper.js +145 -0
- package/dist/helpers/ApiHelper.js.map +1 -0
- package/dist/helpers/AppearanceHelper.d.ts +19 -0
- package/dist/helpers/AppearanceHelper.d.ts.map +1 -0
- package/dist/helpers/AppearanceHelper.js +64 -0
- package/dist/helpers/AppearanceHelper.js.map +1 -0
- package/dist/helpers/ArrayHelper.d.ts +12 -0
- package/dist/helpers/ArrayHelper.d.ts.map +1 -0
- package/dist/helpers/ArrayHelper.js +88 -0
- package/dist/helpers/ArrayHelper.js.map +1 -0
- package/dist/helpers/CommonEnvironmentHelper.d.ts +20 -0
- package/dist/helpers/CommonEnvironmentHelper.d.ts.map +1 -0
- package/dist/helpers/CommonEnvironmentHelper.js +82 -0
- package/dist/helpers/CommonEnvironmentHelper.js.map +1 -0
- package/dist/helpers/CurrencyHelper.d.ts +4 -0
- package/dist/helpers/CurrencyHelper.d.ts.map +1 -0
- package/dist/helpers/CurrencyHelper.js +15 -0
- package/dist/helpers/CurrencyHelper.js.map +1 -0
- package/dist/helpers/DateHelper.d.ts +19 -0
- package/dist/helpers/DateHelper.d.ts.map +1 -0
- package/dist/helpers/DateHelper.js +108 -0
- package/dist/helpers/DateHelper.js.map +1 -0
- package/dist/helpers/DonationHelper.d.ts +8 -0
- package/dist/helpers/DonationHelper.d.ts.map +1 -0
- package/dist/helpers/DonationHelper.js +33 -0
- package/dist/helpers/DonationHelper.js.map +1 -0
- package/dist/helpers/ErrorHelper.d.ts +13 -0
- package/dist/helpers/ErrorHelper.d.ts.map +1 -0
- package/dist/helpers/ErrorHelper.js +34 -0
- package/dist/helpers/ErrorHelper.js.map +1 -0
- package/dist/helpers/EventHelper.d.ts +11 -0
- package/dist/helpers/EventHelper.d.ts.map +1 -0
- package/dist/helpers/EventHelper.js +47 -0
- package/dist/helpers/EventHelper.js.map +1 -0
- package/dist/helpers/FileHelper.d.ts +5 -0
- package/dist/helpers/FileHelper.d.ts.map +1 -0
- package/dist/helpers/FileHelper.js +34 -0
- package/dist/helpers/FileHelper.js.map +1 -0
- package/dist/helpers/PersonHelper.d.ts +11 -0
- package/dist/helpers/PersonHelper.d.ts.map +1 -0
- package/dist/helpers/PersonHelper.js +53 -0
- package/dist/helpers/PersonHelper.js.map +1 -0
- package/dist/helpers/SocketHelper.d.ts +16 -0
- package/dist/helpers/SocketHelper.d.ts.map +1 -0
- package/dist/helpers/SocketHelper.js +87 -0
- package/dist/helpers/SocketHelper.js.map +1 -0
- package/dist/helpers/Themes.d.ts +9 -0
- package/dist/helpers/Themes.d.ts.map +1 -0
- package/dist/helpers/Themes.js +16 -0
- package/dist/helpers/Themes.js.map +1 -0
- package/dist/helpers/UniqueIdHelper.d.ts +9 -0
- package/dist/helpers/UniqueIdHelper.d.ts.map +1 -0
- package/dist/helpers/UniqueIdHelper.js +37 -0
- package/dist/helpers/UniqueIdHelper.js.map +1 -0
- package/dist/helpers/UserHelper.d.ts +14 -0
- package/dist/helpers/UserHelper.d.ts.map +1 -0
- package/dist/helpers/UserHelper.js +68 -0
- package/dist/helpers/UserHelper.js.map +1 -0
- package/dist/helpers/createEmotionCache.d.ts +2 -0
- package/dist/helpers/createEmotionCache.d.ts.map +1 -0
- package/dist/helpers/createEmotionCache.js +21 -0
- package/dist/helpers/createEmotionCache.js.map +1 -0
- package/dist/helpers/index.d.ts +16 -0
- package/dist/helpers/index.d.ts.map +1 -0
- package/dist/helpers/index.js +47 -0
- package/dist/helpers/index.js.map +1 -0
- package/dist/hooks/index.d.ts +2 -0
- package/dist/hooks/index.d.ts.map +1 -0
- package/dist/hooks/index.js +6 -0
- package/dist/hooks/index.js.map +1 -0
- package/dist/hooks/useMountedState.d.ts +2 -0
- package/dist/hooks/useMountedState.d.ts.map +1 -0
- package/dist/hooks/useMountedState.js +17 -0
- package/dist/hooks/useMountedState.js.map +1 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +25 -0
- package/dist/index.js.map +1 -0
- package/dist/interfaces/Access.d.ts +131 -0
- package/dist/interfaces/Access.d.ts.map +1 -0
- package/dist/interfaces/Access.js +3 -0
- package/dist/interfaces/Access.js.map +1 -0
- package/dist/interfaces/Attendance.d.ts +45 -0
- package/dist/interfaces/Attendance.d.ts.map +1 -0
- package/dist/interfaces/Attendance.js +3 -0
- package/dist/interfaces/Attendance.js.map +1 -0
- package/dist/interfaces/Content.d.ts +86 -0
- package/dist/interfaces/Content.d.ts.map +1 -0
- package/dist/interfaces/Content.js +3 -0
- package/dist/interfaces/Content.js.map +1 -0
- package/dist/interfaces/Doing.d.ts +50 -0
- package/dist/interfaces/Doing.d.ts.map +1 -0
- package/dist/interfaces/Doing.js +3 -0
- package/dist/interfaces/Doing.js.map +1 -0
- package/dist/interfaces/Donation.d.ts +138 -0
- package/dist/interfaces/Donation.d.ts.map +1 -0
- package/dist/interfaces/Donation.js +24 -0
- package/dist/interfaces/Donation.js.map +1 -0
- package/dist/interfaces/Error.d.ts +17 -0
- package/dist/interfaces/Error.d.ts.map +1 -0
- package/dist/interfaces/Error.js +4 -0
- package/dist/interfaces/Error.js.map +1 -0
- package/dist/interfaces/Membership.d.ts +172 -0
- package/dist/interfaces/Membership.d.ts.map +1 -0
- package/dist/interfaces/Membership.js +3 -0
- package/dist/interfaces/Membership.js.map +1 -0
- package/dist/interfaces/Messaging.d.ts +59 -0
- package/dist/interfaces/Messaging.d.ts.map +1 -0
- package/dist/interfaces/Messaging.js +3 -0
- package/dist/interfaces/Messaging.js.map +1 -0
- package/dist/interfaces/Permissions.d.ts +159 -0
- package/dist/interfaces/Permissions.d.ts.map +1 -0
- package/dist/interfaces/Permissions.js +67 -0
- package/dist/interfaces/Permissions.js.map +1 -0
- package/dist/interfaces/Reporting.d.ts +45 -0
- package/dist/interfaces/Reporting.d.ts.map +1 -0
- package/dist/interfaces/Reporting.js +3 -0
- package/dist/interfaces/Reporting.js.map +1 -0
- package/dist/interfaces/UserContextInterface.d.ts +13 -0
- package/dist/interfaces/UserContextInterface.d.ts.map +1 -0
- package/dist/interfaces/UserContextInterface.js +3 -0
- package/dist/interfaces/UserContextInterface.js.map +1 -0
- package/dist/interfaces/index.d.ts +11 -0
- package/dist/interfaces/index.d.ts.map +1 -0
- package/dist/interfaces/index.js +28 -0
- package/dist/interfaces/index.js.map +1 -0
- package/dist/pageComponents/LoginPage.d.ts +22 -0
- package/dist/pageComponents/LoginPage.d.ts.map +1 -0
- package/dist/pageComponents/LoginPage.js +287 -0
- package/dist/pageComponents/LoginPage.js.map +1 -0
- package/dist/pageComponents/LogoutPage.d.ts +8 -0
- package/dist/pageComponents/LogoutPage.d.ts.map +1 -0
- package/dist/pageComponents/LogoutPage.js +26 -0
- package/dist/pageComponents/LogoutPage.js.map +1 -0
- package/dist/pageComponents/components/Forgot.d.ts +8 -0
- package/dist/pageComponents/components/Forgot.d.ts.map +1 -0
- package/dist/pageComponents/components/Forgot.js +70 -0
- package/dist/pageComponents/components/Forgot.js.map +1 -0
- package/dist/pageComponents/components/Login.d.ts +13 -0
- package/dist/pageComponents/components/Login.d.ts.map +1 -0
- package/dist/pageComponents/components/Login.js +57 -0
- package/dist/pageComponents/components/Login.js.map +1 -0
- package/dist/pageComponents/components/LoginSetPassword.d.ts +13 -0
- package/dist/pageComponents/components/LoginSetPassword.d.ts.map +1 -0
- package/dist/pageComponents/components/LoginSetPassword.js +68 -0
- package/dist/pageComponents/components/LoginSetPassword.js.map +1 -0
- package/dist/pageComponents/components/Register.d.ts +12 -0
- package/dist/pageComponents/components/Register.d.ts.map +1 -0
- package/dist/pageComponents/components/Register.js +105 -0
- package/dist/pageComponents/components/Register.js.map +1 -0
- package/dist/pageComponents/components/SelectChurchModal.d.ts +13 -0
- package/dist/pageComponents/components/SelectChurchModal.d.ts.map +1 -0
- package/dist/pageComponents/components/SelectChurchModal.js +33 -0
- package/dist/pageComponents/components/SelectChurchModal.js.map +1 -0
- package/dist/pageComponents/components/SelectChurchRegister.d.ts +11 -0
- package/dist/pageComponents/components/SelectChurchRegister.d.ts.map +1 -0
- package/dist/pageComponents/components/SelectChurchRegister.js +114 -0
- package/dist/pageComponents/components/SelectChurchRegister.js.map +1 -0
- package/dist/pageComponents/components/SelectChurchSearch.d.ts +10 -0
- package/dist/pageComponents/components/SelectChurchSearch.d.ts.map +1 -0
- package/dist/pageComponents/components/SelectChurchSearch.js +61 -0
- package/dist/pageComponents/components/SelectChurchSearch.js.map +1 -0
- package/dist/pageComponents/components/SelectableChurch.d.ts +9 -0
- package/dist/pageComponents/components/SelectableChurch.d.ts.map +1 -0
- package/dist/pageComponents/components/SelectableChurch.js +31 -0
- package/dist/pageComponents/components/SelectableChurch.js.map +1 -0
- package/dist/pageComponents/index.d.ts +4 -0
- package/dist/pageComponents/index.d.ts.map +1 -0
- package/dist/pageComponents/index.js +10 -0
- package/dist/pageComponents/index.js.map +1 -0
- package/package.json +77 -0
- package/src/components/CreatePerson.tsx +80 -0
- package/src/components/DisplayBox.tsx +68 -0
- package/src/components/ErrorMessages.tsx +26 -0
- package/src/components/ExportLink.tsx +61 -0
- package/src/components/FloatingSupport.tsx +16 -0
- package/src/components/FormSubmissionEdit.tsx +122 -0
- package/src/components/HelpIcon.tsx +10 -0
- package/src/components/ImageEditor.tsx +126 -0
- package/src/components/InputBox.tsx +73 -0
- package/src/components/Loading.tsx +29 -0
- package/src/components/PersonAdd.tsx +75 -0
- package/src/components/QuestionEdit.tsx +62 -0
- package/src/components/SmallButton.tsx +39 -0
- package/src/components/SupportModal.tsx +26 -0
- package/src/components/TabPanel.tsx +34 -0
- package/src/components/gallery/GalleryModal.tsx +102 -0
- package/src/components/gallery/StockPhotos.tsx +74 -0
- package/src/components/index.tsx +18 -0
- package/src/components/markdownEditor/Editor.tsx +132 -0
- package/src/components/markdownEditor/MarkdownEditor.tsx +16 -0
- package/src/components/markdownEditor/MarkdownModal.tsx +46 -0
- package/src/components/markdownEditor/MarkdownPreview.tsx +14 -0
- package/src/components/markdownEditor/editor.css +787 -0
- package/src/components/markdownEditor/images/emoji/1F600.png +0 -0
- package/src/components/markdownEditor/images/emoji/1F641.png +0 -0
- package/src/components/markdownEditor/images/emoji/1F642.png +0 -0
- package/src/components/markdownEditor/images/emoji/2764.png +0 -0
- package/src/components/markdownEditor/images/icons/arrow-clockwise.svg +4 -0
- package/src/components/markdownEditor/images/icons/arrow-counterclockwise.svg +4 -0
- package/src/components/markdownEditor/images/icons/chat-square-quote.svg +4 -0
- package/src/components/markdownEditor/images/icons/chevron-down.svg +3 -0
- package/src/components/markdownEditor/images/icons/code.svg +3 -0
- package/src/components/markdownEditor/images/icons/journal-code.svg +5 -0
- package/src/components/markdownEditor/images/icons/journal-text.svg +5 -0
- package/src/components/markdownEditor/images/icons/justify.svg +3 -0
- package/src/components/markdownEditor/images/icons/link.svg +4 -0
- package/src/components/markdownEditor/images/icons/list-ol.svg +4 -0
- package/src/components/markdownEditor/images/icons/list-ul.svg +3 -0
- package/src/components/markdownEditor/images/icons/pencil-fill.svg +3 -0
- package/src/components/markdownEditor/images/icons/text-center.svg +3 -0
- package/src/components/markdownEditor/images/icons/text-left.svg +3 -0
- package/src/components/markdownEditor/images/icons/text-paragraph.svg +3 -0
- package/src/components/markdownEditor/images/icons/text-right.svg +3 -0
- package/src/components/markdownEditor/images/icons/type-bold.svg +3 -0
- package/src/components/markdownEditor/images/icons/type-h1.svg +3 -0
- package/src/components/markdownEditor/images/icons/type-h2.svg +3 -0
- package/src/components/markdownEditor/images/icons/type-h3.svg +3 -0
- package/src/components/markdownEditor/images/icons/type-h4.svg +13 -0
- package/src/components/markdownEditor/images/icons/type-italic.svg +3 -0
- package/src/components/markdownEditor/images/icons/type-strikethrough.svg +3 -0
- package/src/components/markdownEditor/images/icons/type-underline.svg +3 -0
- package/src/components/markdownEditor/plugins/AutoLinkPlugin.tsx +35 -0
- package/src/components/markdownEditor/plugins/ControlledEditorPlugin.tsx +24 -0
- package/src/components/markdownEditor/plugins/ListMaxIndentLevelPlugin.tsx +68 -0
- package/src/components/markdownEditor/plugins/MarkdownTransformers.ts +106 -0
- package/src/components/markdownEditor/plugins/ReadOnlyPlugin.tsx +15 -0
- package/src/components/markdownEditor/plugins/ToolbarPlugin.tsx +401 -0
- package/src/components/markdownEditor/plugins/customLink/CustomLinkNode.tsx +224 -0
- package/src/components/markdownEditor/plugins/customLink/CustomLinkNodePlugin.tsx +32 -0
- package/src/components/markdownEditor/plugins/customLink/CustomLinkNodeTransformer.tsx +102 -0
- package/src/components/markdownEditor/plugins/customLink/FloatingLinkEditor.tsx +243 -0
- package/src/components/markdownEditor/plugins/customLink/FloatingLinkEditor.types.ts +11 -0
- package/src/components/markdownEditor/plugins/emoji/EmojiNode.tsx +95 -0
- package/src/components/markdownEditor/plugins/emoji/EmojiNodeTransform.ts +41 -0
- package/src/components/markdownEditor/plugins/emoji/EmojiPickerPlugin.tsx +152 -0
- package/src/components/markdownEditor/plugins/emoji/EmojisPlugin.tsx +65 -0
- package/src/components/markdownEditor/plugins/index.ts +6 -0
- package/src/components/markdownEditor/theme.ts +65 -0
- package/src/components/material/AppList.tsx +20 -0
- package/src/components/material/ChurchList.tsx +22 -0
- package/src/components/material/NavItem.tsx +41 -0
- package/src/components/material/NewPrivateMessage.tsx +103 -0
- package/src/components/material/PrivateMessageDetails.tsx +23 -0
- package/src/components/material/PrivateMessages.tsx +87 -0
- package/src/components/material/SiteWrapper.tsx +140 -0
- package/src/components/material/UserMenu.tsx +141 -0
- package/src/components/material/iconPicker/IconNamesList.ts +2240 -0
- package/src/components/material/iconPicker/IconPicker.tsx +153 -0
- package/src/components/material/index.tsx +5 -0
- package/src/components/notes/AddNote.tsx +90 -0
- package/src/components/notes/Conversation.tsx +82 -0
- package/src/components/notes/Conversations.tsx +58 -0
- package/src/components/notes/NewConversation.tsx +78 -0
- package/src/components/notes/Note.tsx +44 -0
- package/src/components/notes/Notes.tsx +52 -0
- package/src/components/reporting/ChartReport.tsx +98 -0
- package/src/components/reporting/ReportFilter.tsx +54 -0
- package/src/components/reporting/ReportFilterField.tsx +160 -0
- package/src/components/reporting/ReportOutput.tsx +79 -0
- package/src/components/reporting/ReportWithFilter.tsx +70 -0
- package/src/components/reporting/TableReport.tsx +57 -0
- package/src/components/reporting/TreeReport.tsx +111 -0
- package/src/components/reporting/index.ts +4 -0
- package/src/donationComponents/DonationPage.tsx +136 -0
- package/src/donationComponents/components/BankForm.tsx +159 -0
- package/src/donationComponents/components/CardForm.tsx +104 -0
- package/src/donationComponents/components/DonationForm.tsx +228 -0
- package/src/donationComponents/components/FundDonation.tsx +49 -0
- package/src/donationComponents/components/FundDonations.tsx +39 -0
- package/src/donationComponents/components/NonAuthDonation.tsx +31 -0
- package/src/donationComponents/components/NonAuthDonationInner.tsx +208 -0
- package/src/donationComponents/components/PaymentMethods.tsx +135 -0
- package/src/donationComponents/components/RecurringDonations.tsx +121 -0
- package/src/donationComponents/components/RecurringDonationsEdit.tsx +93 -0
- package/src/donationComponents/components/index.tsx +9 -0
- package/src/donationComponents/modals/DonationPreviewModal.tsx +66 -0
- package/src/helpers/AnalyticsHelper.ts +33 -0
- package/src/helpers/ApiHelper.ts +125 -0
- package/src/helpers/AppearanceHelper.ts +69 -0
- package/src/helpers/ArrayHelper.ts +81 -0
- package/src/helpers/CommonEnvironmentHelper.ts +80 -0
- package/src/helpers/CurrencyHelper.ts +10 -0
- package/src/helpers/DateHelper.ts +108 -0
- package/src/helpers/DonationHelper.ts +26 -0
- package/src/helpers/ErrorHelper.ts +36 -0
- package/src/helpers/EventHelper.ts +52 -0
- package/src/helpers/FileHelper.ts +31 -0
- package/src/helpers/PersonHelper.ts +60 -0
- package/src/helpers/SocketHelper.ts +76 -0
- package/src/helpers/Themes.ts +14 -0
- package/src/helpers/UniqueIdHelper.ts +36 -0
- package/src/helpers/UserHelper.ts +59 -0
- package/src/helpers/createEmotionCache.ts +17 -0
- package/src/helpers/index.ts +15 -0
- package/src/hooks/index.ts +1 -0
- package/src/hooks/useMountedState.ts +16 -0
- package/src/index.ts +6 -0
- package/src/interfaces/Access.ts +24 -0
- package/src/interfaces/Attendance.ts +8 -0
- package/src/interfaces/Content.ts +10 -0
- package/src/interfaces/Doing.ts +24 -0
- package/src/interfaces/Donation.ts +45 -0
- package/src/interfaces/Error.ts +17 -0
- package/src/interfaces/Membership.ts +51 -0
- package/src/interfaces/Messaging.ts +20 -0
- package/src/interfaces/Permissions.ts +68 -0
- package/src/interfaces/Reporting.ts +7 -0
- package/src/interfaces/UserContextInterface.ts +13 -0
- package/src/interfaces/index.ts +12 -0
- package/src/pageComponents/LoginPage.tsx +244 -0
- package/src/pageComponents/LogoutPage.tsx +28 -0
- package/src/pageComponents/components/Forgot.tsx +79 -0
- package/src/pageComponents/components/Login.tsx +54 -0
- package/src/pageComponents/components/LoginSetPassword.tsx +63 -0
- package/src/pageComponents/components/Register.tsx +107 -0
- package/src/pageComponents/components/SelectChurchModal.tsx +41 -0
- package/src/pageComponents/components/SelectChurchRegister.tsx +88 -0
- package/src/pageComponents/components/SelectChurchSearch.tsx +69 -0
- package/src/pageComponents/components/SelectableChurch.tsx +38 -0
- package/src/pageComponents/index.ts +3 -0
- package/tsconfig.json +35 -0
- package/tslint.json +15 -0
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
import { ApiConfig, RolePermissionInterface, ApiListType } from "../interfaces";
|
|
2
|
+
import { ErrorHelper } from "./ErrorHelper";
|
|
3
|
+
|
|
4
|
+
export class ApiHelper {
|
|
5
|
+
|
|
6
|
+
static apiConfigs: ApiConfig[] = [];
|
|
7
|
+
static isAuthenticated = false;
|
|
8
|
+
|
|
9
|
+
static getConfig(keyName: string) {
|
|
10
|
+
let result: ApiConfig;
|
|
11
|
+
this.apiConfigs.forEach(config => { if (config.keyName === keyName) result = config });
|
|
12
|
+
//if (result === null) throw new Error("Unconfigured API: " + keyName);
|
|
13
|
+
return result;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
static setDefaultPermissions(jwt: string) {
|
|
17
|
+
this.apiConfigs.forEach(config => {
|
|
18
|
+
config.jwt = jwt;
|
|
19
|
+
config.permisssions = [];
|
|
20
|
+
});
|
|
21
|
+
this.isAuthenticated = true;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
static setPermissions(keyName: string, jwt: string, permissions: RolePermissionInterface[]) {
|
|
25
|
+
this.apiConfigs.forEach(config => {
|
|
26
|
+
if (config.keyName === keyName) {
|
|
27
|
+
config.jwt = jwt;
|
|
28
|
+
config.permisssions = permissions;
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
this.isAuthenticated = true;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
static clearPermissions() {
|
|
35
|
+
this.apiConfigs.forEach(config => { config.jwt = ""; config.permisssions = []; });
|
|
36
|
+
this.isAuthenticated = false;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
static async get(path: string, apiName: ApiListType) {
|
|
40
|
+
const config = this.getConfig(apiName);
|
|
41
|
+
const requestOptions = { method: "GET", headers: { Authorization: "Bearer " + config.jwt } };
|
|
42
|
+
return await this.fetchWithErrorHandling(config.url + path, requestOptions);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
static async getAnonymous(path: string, apiName: ApiListType) {
|
|
46
|
+
const config = this.getConfig(apiName);
|
|
47
|
+
const requestOptions = { method: "GET" };
|
|
48
|
+
return await this.fetchWithErrorHandling(config.url + path, requestOptions);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
static async post(path: string, data: any[] | {}, apiName: ApiListType) {
|
|
52
|
+
const config = this.getConfig(apiName);
|
|
53
|
+
const requestOptions = {
|
|
54
|
+
method: "POST",
|
|
55
|
+
headers: { Authorization: "Bearer " + config.jwt, "Content-Type": "application/json" },
|
|
56
|
+
body: JSON.stringify(data)
|
|
57
|
+
};
|
|
58
|
+
return await this.fetchWithErrorHandling(config.url + path, requestOptions);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
static async patch(path: string, data: any[] | {}, apiName: ApiListType) {
|
|
62
|
+
const config = this.getConfig(apiName);
|
|
63
|
+
const requestOptions = {
|
|
64
|
+
method: "PATCH",
|
|
65
|
+
headers: { Authorization: "Bearer " + config.jwt, "Content-Type": "application/json" },
|
|
66
|
+
body: JSON.stringify(data)
|
|
67
|
+
};
|
|
68
|
+
return await this.fetchWithErrorHandling(config.url + path, requestOptions);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
static async delete(path: string, apiName: ApiListType) {
|
|
72
|
+
const config = this.getConfig(apiName);
|
|
73
|
+
const requestOptions = {
|
|
74
|
+
method: "DELETE",
|
|
75
|
+
headers: { Authorization: "Bearer " + config.jwt }
|
|
76
|
+
};
|
|
77
|
+
try {
|
|
78
|
+
const response = await fetch(config.url + path, requestOptions);
|
|
79
|
+
if (!response.ok) await this.throwApiError(response);
|
|
80
|
+
} catch (e) {
|
|
81
|
+
console.log(e)
|
|
82
|
+
throw (e);
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
static async postAnonymous(path: string, data: any[] | {}, apiName: ApiListType) {
|
|
87
|
+
const config = this.getConfig(apiName);
|
|
88
|
+
const requestOptions = {
|
|
89
|
+
method: "POST",
|
|
90
|
+
headers: { "Content-Type": "application/json" },
|
|
91
|
+
body: JSON.stringify(data)
|
|
92
|
+
};
|
|
93
|
+
console.log(config.url + path, requestOptions);
|
|
94
|
+
return await this.fetchWithErrorHandling(config.url + path, requestOptions);
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
static async fetchWithErrorHandling(url: string, requestOptions: any) {
|
|
98
|
+
try {
|
|
99
|
+
const response = await fetch(url, requestOptions);
|
|
100
|
+
if (!response.ok) await this.throwApiError(response);
|
|
101
|
+
else {
|
|
102
|
+
if (response.status !== 204 ) {
|
|
103
|
+
return response.json();
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
} catch (e) {
|
|
107
|
+
console.log("Error loading url: " + url);
|
|
108
|
+
console.log(e)
|
|
109
|
+
throw (e);
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
private static async throwApiError(response: Response) {
|
|
114
|
+
console.log("THROW API ERROR");
|
|
115
|
+
let msg = response.statusText;
|
|
116
|
+
try {
|
|
117
|
+
const json = await response.json();
|
|
118
|
+
msg = json.errors[0];
|
|
119
|
+
} catch { }
|
|
120
|
+
console.log("RESPONSE", response)
|
|
121
|
+
ErrorHelper.logError(response.status.toString(), response.url, msg);
|
|
122
|
+
throw new Error(msg || "Error");
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
|
|
2
|
+
export interface AppearanceInterface { primaryColor?: string, primaryContrast?: string, secondaryColor?: string, secondaryContrast?: string, logoLight?: string, logoDark?: string, favicon_400x400?: string, favicon_16x16?: string }
|
|
3
|
+
|
|
4
|
+
export class AppearanceHelper {
|
|
5
|
+
|
|
6
|
+
public static getLogoDark(appearanceSettings: AppearanceInterface, defaultLogo: string) {
|
|
7
|
+
return (appearanceSettings?.logoDark) ? appearanceSettings.logoDark : defaultLogo;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
public static getLogoLight(appearanceSettings: AppearanceInterface, defaultLogo: string) {
|
|
11
|
+
return (appearanceSettings?.logoLight) ? appearanceSettings.logoLight : defaultLogo;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
public static getFavicon(appearanceSettings: AppearanceInterface, size: "400" | "16") {
|
|
15
|
+
if (size === "400") {
|
|
16
|
+
return appearanceSettings?.favicon_400x400;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
if (size === "16") {
|
|
20
|
+
return appearanceSettings?.favicon_16x16;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
return;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
public static getLogo(appearanceSettings: AppearanceInterface, defaultLogoLight: string, defaultLogoDark: string, backgroundColor: string) {
|
|
27
|
+
const isDark = (appearanceSettings.logoDark) ? this.isDark(backgroundColor) : false;
|
|
28
|
+
if (isDark) return this.getLogoDark(appearanceSettings, defaultLogoDark);
|
|
29
|
+
else return this.getLogoLight(appearanceSettings, defaultLogoLight);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
private static isDark(backgroundColor: string) {
|
|
33
|
+
let valid = false;
|
|
34
|
+
let r = 0;
|
|
35
|
+
let g = 0;
|
|
36
|
+
let b = 0;
|
|
37
|
+
|
|
38
|
+
if (backgroundColor.match(/#[0-9a-fA-F{6}]/)) {
|
|
39
|
+
r = this.getHexValue(backgroundColor.substring(1, 2));
|
|
40
|
+
g = this.getHexValue(backgroundColor.substring(3, 4));
|
|
41
|
+
b = this.getHexValue(backgroundColor.substring(5, 6));
|
|
42
|
+
valid = true;
|
|
43
|
+
} else if (backgroundColor.match(/#[0-9a-fA-F{3}]/)) {
|
|
44
|
+
r = this.getHexValue(backgroundColor.substring(1, 1));
|
|
45
|
+
g = this.getHexValue(backgroundColor.substring(2, 2));
|
|
46
|
+
b = this.getHexValue(backgroundColor.substring(3, 3));
|
|
47
|
+
valid = true;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
if (!valid) return false;
|
|
51
|
+
else {
|
|
52
|
+
//HSP brightness formula. Some colors have a bigger impact on our perceived brightness than others.
|
|
53
|
+
const rWeight = .299 * Math.pow(r, 2);
|
|
54
|
+
const gWeight = .587 * Math.pow(g, 2);
|
|
55
|
+
const bWeight = .114 * Math.pow(b, 2);
|
|
56
|
+
const brightness = Math.sqrt(rWeight + gWeight + bWeight);
|
|
57
|
+
//return brightness < 128; //
|
|
58
|
+
return brightness < 156;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
private static getHexValue(hex: string) {
|
|
64
|
+
let result = parseInt(hex, 16);
|
|
65
|
+
if (hex.length === 1) result = result * 16;
|
|
66
|
+
return result;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { UniqueIdHelper } from "./UniqueIdHelper";
|
|
2
|
+
|
|
3
|
+
export class ArrayHelper {
|
|
4
|
+
static getIds(array: any[], propertyName: string) {
|
|
5
|
+
const result: string[] = [];
|
|
6
|
+
for (const item of array) {
|
|
7
|
+
const id = item[propertyName]?.toString();
|
|
8
|
+
if (!UniqueIdHelper.isMissing(id) && result.indexOf(id) === -1) result.push(id);
|
|
9
|
+
}
|
|
10
|
+
return result;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
static sortBy(array: any[], propertyName: string, descending: boolean = false) {
|
|
14
|
+
array.sort((a, b) => {
|
|
15
|
+
const valA = a[propertyName];
|
|
16
|
+
const valB = b[propertyName];
|
|
17
|
+
if (valA < valB) return descending ? 1 : -1;
|
|
18
|
+
else return descending ? -1 : 1;
|
|
19
|
+
//console.log(valA, valB, valA < valB, )
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
static getIndex(array: any[], propertyName: string, value: any) {
|
|
24
|
+
for (let i = 0; i < array.length; i++) {
|
|
25
|
+
const item = array[i];
|
|
26
|
+
if (ArrayHelper.compare(item, propertyName, value)) return i;
|
|
27
|
+
}
|
|
28
|
+
return -1;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
static getOne(array: any[], propertyName: string, value: any) {
|
|
32
|
+
for (const item of array || []) if (ArrayHelper.compare(item, propertyName, value)) return item;
|
|
33
|
+
return null
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
static getAll(array: any[], propertyName: string, value: any) {
|
|
37
|
+
const result: any[] = []
|
|
38
|
+
for (const item of array || []) {
|
|
39
|
+
if (ArrayHelper.compare(item, propertyName, value)) result.push(item);
|
|
40
|
+
}
|
|
41
|
+
return result;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
static getAllArray(array: any[], propertyName: string, values: any[]) {
|
|
45
|
+
const result: any[] = []
|
|
46
|
+
for (const item of array || []) if (values.indexOf(item[propertyName]) > -1) result.push(item);
|
|
47
|
+
return result;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
private static compare(item: any, propertyName: string, value: any) {
|
|
51
|
+
const propChain = propertyName.split(".");
|
|
52
|
+
if (propChain.length === 1) return item[propertyName] === value;
|
|
53
|
+
else {
|
|
54
|
+
let obj = item;
|
|
55
|
+
for (let i = 0; i < propChain.length - 1; i++) {
|
|
56
|
+
if (obj) obj = item[propChain[i]];
|
|
57
|
+
}
|
|
58
|
+
return obj[propChain[propChain.length - 1]] === value;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
static getUniqueValues(array: any[], propertyName: string) {
|
|
63
|
+
const result: any[] = [];
|
|
64
|
+
|
|
65
|
+
for (const item of array) {
|
|
66
|
+
const val = (propertyName.indexOf(".") === -1) ? item[propertyName] : this.getDeepValue(item, propertyName)
|
|
67
|
+
if (result.indexOf(val) === -1) result.push(val);
|
|
68
|
+
}
|
|
69
|
+
return result;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
static getDeepValue(item: any, propertyName: string) {
|
|
73
|
+
const propertyNames = propertyName.split(".");
|
|
74
|
+
let result: any = item;
|
|
75
|
+
propertyNames.forEach(name => {
|
|
76
|
+
result = result[name];
|
|
77
|
+
});
|
|
78
|
+
return result;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
}
|
|
@@ -0,0 +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
|
+
|
|
@@ -0,0 +1,108 @@
|
|
|
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 return (seconds === 1) ? "1s" : Math.floor(seconds).toString() + "s";
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
static getShortDate(d: Date): string {
|
|
94
|
+
return (d.getMonth() + 1).toString() + "/" + (d.getDate()).toString() + "/" + d.getFullYear().toString();
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
static convertDatePickerFormat(d: Date): Date {
|
|
98
|
+
const date = this.formatHtml5Date(d).split("-");
|
|
99
|
+
if (date.length === 3) return new Date(`${date[1]}-${date[2]}-${date[0]}`);
|
|
100
|
+
return new Date();
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
private static formatDateTime(date: Date, format: string) {
|
|
104
|
+
try {
|
|
105
|
+
return dateFormat(date, format);
|
|
106
|
+
} catch { return ""; }
|
|
107
|
+
}
|
|
108
|
+
}
|
|
@@ -0,0 +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
|
+
}
|
|
@@ -0,0 +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
|
+
}
|
|
@@ -0,0 +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
|
+
}
|
|
@@ -0,0 +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);
|
|
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
|
+
}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { PersonInterface, ContactInfoInterface } from "../interfaces";
|
|
2
|
+
import { CommonEnvironmentHelper } from "./CommonEnvironmentHelper";
|
|
3
|
+
|
|
4
|
+
export class PersonHelper {
|
|
5
|
+
|
|
6
|
+
static getPhotoUrl(person: PersonInterface) {
|
|
7
|
+
if (!person?.photo) return "/images/sample-profile.png"
|
|
8
|
+
else return person?.photo?.startsWith("data:image/png;base64,") ? person.photo : CommonEnvironmentHelper.ContentRoot + person.photo;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
static getAge(birthdate: Date): string {
|
|
12
|
+
if (birthdate !== undefined && birthdate !== null) {
|
|
13
|
+
let ageDifMs = Date.now() - new Date(birthdate).getTime();
|
|
14
|
+
let ageDate = new Date(ageDifMs);
|
|
15
|
+
let years = Math.abs(ageDate.getUTCFullYear() - 1970);
|
|
16
|
+
return years + " years";
|
|
17
|
+
}
|
|
18
|
+
else return "";
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
static getDisplayName(firstName: string, lastName: string, nickName: string): string {
|
|
22
|
+
if (nickName !== undefined && nickName !== null && nickName.length > 0) return firstName + ' "' + nickName + '" ' + lastName;
|
|
23
|
+
else return firstName + " " + lastName;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
public static compareAddress(address1: ContactInfoInterface, address2: ContactInfoInterface): boolean {
|
|
27
|
+
const displayAddress1: string = this.addressToString(address1).trim();
|
|
28
|
+
const displayAddress2: string = this.addressToString(address2).trim();
|
|
29
|
+
|
|
30
|
+
if (displayAddress1 !== displayAddress2) {
|
|
31
|
+
return true
|
|
32
|
+
}
|
|
33
|
+
return false
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
public static addressToString(address: ContactInfoInterface): string {
|
|
37
|
+
return `${address.address1 || ""} ${address.address2 || ""} ${address.city || ""}${(address.city && address.state) ? "," : ""} ${address.state || ""} ${address.zip || ""}`
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
public static changeOnlyAddress(contactInfo1: ContactInfoInterface, contactInfo2: ContactInfoInterface): ContactInfoInterface {
|
|
41
|
+
const updatedAddress: ContactInfoInterface = {
|
|
42
|
+
...contactInfo1,
|
|
43
|
+
address1: contactInfo2.address1,
|
|
44
|
+
address2: contactInfo2.address2,
|
|
45
|
+
city: contactInfo2.city,
|
|
46
|
+
state: contactInfo2.state,
|
|
47
|
+
zip: contactInfo2.zip
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
return updatedAddress
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
public static checkAddressAvailabilty(person: PersonInterface): boolean {
|
|
54
|
+
const addressString: string = this.addressToString(person.contactInfo).trim();
|
|
55
|
+
if (addressString !== "") {
|
|
56
|
+
return true;
|
|
57
|
+
}
|
|
58
|
+
return false;
|
|
59
|
+
}
|
|
60
|
+
}
|