@churchapps/apphelper 0.1.5 → 0.1.7

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 (218) hide show
  1. package/.eslintignore +3 -3
  2. package/.eslintrc.json +22 -22
  3. package/LICENSE +21 -21
  4. package/README.md +24 -22
  5. package/dist/components/FormSubmissionEdit.js +1 -1
  6. package/dist/components/FormSubmissionEdit.js.map +1 -1
  7. package/dist/components/markdownEditor/editor.css +787 -787
  8. package/dist/components/markdownEditor/images/icons/arrow-clockwise.svg +3 -3
  9. package/dist/components/markdownEditor/images/icons/arrow-counterclockwise.svg +3 -3
  10. package/dist/components/markdownEditor/images/icons/chat-square-quote.svg +3 -3
  11. package/dist/components/markdownEditor/images/icons/chevron-down.svg +2 -2
  12. package/dist/components/markdownEditor/images/icons/code.svg +2 -2
  13. package/dist/components/markdownEditor/images/icons/journal-code.svg +4 -4
  14. package/dist/components/markdownEditor/images/icons/journal-text.svg +4 -4
  15. package/dist/components/markdownEditor/images/icons/justify.svg +2 -2
  16. package/dist/components/markdownEditor/images/icons/link.svg +3 -3
  17. package/dist/components/markdownEditor/images/icons/list-ol.svg +3 -3
  18. package/dist/components/markdownEditor/images/icons/list-ul.svg +2 -2
  19. package/dist/components/markdownEditor/images/icons/pencil-fill.svg +2 -2
  20. package/dist/components/markdownEditor/images/icons/text-center.svg +2 -2
  21. package/dist/components/markdownEditor/images/icons/text-left.svg +2 -2
  22. package/dist/components/markdownEditor/images/icons/text-paragraph.svg +2 -2
  23. package/dist/components/markdownEditor/images/icons/text-right.svg +2 -2
  24. package/dist/components/markdownEditor/images/icons/type-bold.svg +2 -2
  25. package/dist/components/markdownEditor/images/icons/type-h1.svg +2 -2
  26. package/dist/components/markdownEditor/images/icons/type-h2.svg +2 -2
  27. package/dist/components/markdownEditor/images/icons/type-h3.svg +2 -2
  28. package/dist/components/markdownEditor/images/icons/type-h4.svg +12 -12
  29. package/dist/components/markdownEditor/images/icons/type-italic.svg +2 -2
  30. package/dist/components/markdownEditor/images/icons/type-strikethrough.svg +2 -2
  31. package/dist/components/markdownEditor/images/icons/type-underline.svg +2 -2
  32. package/dist/components/notes/Notes.d.ts +1 -0
  33. package/dist/components/notes/Notes.d.ts.map +1 -1
  34. package/dist/components/notes/Notes.js +1 -1
  35. package/dist/components/notes/Notes.js.map +1 -1
  36. package/dist/components/wrapper/NotificationMenu.d.ts.map +1 -1
  37. package/dist/components/wrapper/NotificationMenu.js +28 -11
  38. package/dist/components/wrapper/NotificationMenu.js.map +1 -1
  39. package/dist/components/wrapper/Notifications.d.ts +1 -0
  40. package/dist/components/wrapper/Notifications.d.ts.map +1 -1
  41. package/dist/components/wrapper/Notifications.js +2 -0
  42. package/dist/components/wrapper/Notifications.js.map +1 -1
  43. package/dist/components/wrapper/PrivateMessageDetails.d.ts +1 -0
  44. package/dist/components/wrapper/PrivateMessageDetails.d.ts.map +1 -1
  45. package/dist/components/wrapper/PrivateMessageDetails.js +1 -1
  46. package/dist/components/wrapper/PrivateMessageDetails.js.map +1 -1
  47. package/dist/components/wrapper/PrivateMessages.d.ts +2 -0
  48. package/dist/components/wrapper/PrivateMessages.d.ts.map +1 -1
  49. package/dist/components/wrapper/PrivateMessages.js +6 -3
  50. package/dist/components/wrapper/PrivateMessages.js.map +1 -1
  51. package/dist/components/wrapper/SiteWrapper.d.ts.map +1 -1
  52. package/dist/components/wrapper/SiteWrapper.js +1 -0
  53. package/dist/components/wrapper/SiteWrapper.js.map +1 -1
  54. package/dist/helpers/DateHelper.d.ts.map +1 -1
  55. package/dist/helpers/DateHelper.js +2 -0
  56. package/dist/helpers/DateHelper.js.map +1 -1
  57. package/dist/helpers/SocketHelper.d.ts.map +1 -1
  58. package/dist/helpers/SocketHelper.js +4 -2
  59. package/dist/helpers/SocketHelper.js.map +1 -1
  60. package/dist/interfaces/Messaging.d.ts +10 -1
  61. package/dist/interfaces/Messaging.d.ts.map +1 -1
  62. package/package.json +86 -85
  63. package/src/components/CreatePerson.tsx +80 -80
  64. package/src/components/DisplayBox.tsx +68 -68
  65. package/src/components/ErrorMessages.tsx +26 -26
  66. package/src/components/ExportLink.tsx +67 -67
  67. package/src/components/FloatingSupport.tsx +16 -16
  68. package/src/components/FormSubmissionEdit.tsx +120 -120
  69. package/src/components/HelpIcon.tsx +10 -10
  70. package/src/components/ImageEditor.tsx +126 -126
  71. package/src/components/InputBox.tsx +73 -73
  72. package/src/components/Loading.tsx +29 -29
  73. package/src/components/PersonAdd.tsx +75 -75
  74. package/src/components/QuestionEdit.tsx +63 -63
  75. package/src/components/SmallButton.tsx +39 -39
  76. package/src/components/SupportModal.tsx +26 -26
  77. package/src/components/TabPanel.tsx +34 -34
  78. package/src/components/gallery/GalleryModal.tsx +102 -102
  79. package/src/components/gallery/StockPhotos.tsx +74 -74
  80. package/src/components/gallery/index.ts +1 -1
  81. package/src/components/iconPicker/IconNamesList.ts +2240 -2240
  82. package/src/components/iconPicker/IconPicker.tsx +153 -153
  83. package/src/components/index.tsx +24 -24
  84. package/src/components/markdownEditor/Editor.tsx +132 -132
  85. package/src/components/markdownEditor/MarkdownEditor.tsx +16 -16
  86. package/src/components/markdownEditor/MarkdownModal.tsx +46 -46
  87. package/src/components/markdownEditor/MarkdownPreview.tsx +14 -14
  88. package/src/components/markdownEditor/editor.css +787 -787
  89. package/src/components/markdownEditor/images/icons/arrow-clockwise.svg +3 -3
  90. package/src/components/markdownEditor/images/icons/arrow-counterclockwise.svg +3 -3
  91. package/src/components/markdownEditor/images/icons/chat-square-quote.svg +3 -3
  92. package/src/components/markdownEditor/images/icons/chevron-down.svg +2 -2
  93. package/src/components/markdownEditor/images/icons/code.svg +2 -2
  94. package/src/components/markdownEditor/images/icons/journal-code.svg +4 -4
  95. package/src/components/markdownEditor/images/icons/journal-text.svg +4 -4
  96. package/src/components/markdownEditor/images/icons/justify.svg +2 -2
  97. package/src/components/markdownEditor/images/icons/link.svg +3 -3
  98. package/src/components/markdownEditor/images/icons/list-ol.svg +3 -3
  99. package/src/components/markdownEditor/images/icons/list-ul.svg +2 -2
  100. package/src/components/markdownEditor/images/icons/pencil-fill.svg +2 -2
  101. package/src/components/markdownEditor/images/icons/text-center.svg +2 -2
  102. package/src/components/markdownEditor/images/icons/text-left.svg +2 -2
  103. package/src/components/markdownEditor/images/icons/text-paragraph.svg +2 -2
  104. package/src/components/markdownEditor/images/icons/text-right.svg +2 -2
  105. package/src/components/markdownEditor/images/icons/type-bold.svg +2 -2
  106. package/src/components/markdownEditor/images/icons/type-h1.svg +2 -2
  107. package/src/components/markdownEditor/images/icons/type-h2.svg +2 -2
  108. package/src/components/markdownEditor/images/icons/type-h3.svg +2 -2
  109. package/src/components/markdownEditor/images/icons/type-h4.svg +12 -12
  110. package/src/components/markdownEditor/images/icons/type-italic.svg +2 -2
  111. package/src/components/markdownEditor/images/icons/type-strikethrough.svg +2 -2
  112. package/src/components/markdownEditor/images/icons/type-underline.svg +2 -2
  113. package/src/components/markdownEditor/index.ts +2 -2
  114. package/src/components/markdownEditor/plugins/AutoLinkPlugin.tsx +35 -35
  115. package/src/components/markdownEditor/plugins/ControlledEditorPlugin.tsx +24 -24
  116. package/src/components/markdownEditor/plugins/ListMaxIndentLevelPlugin.tsx +68 -68
  117. package/src/components/markdownEditor/plugins/MarkdownTransformers.ts +106 -106
  118. package/src/components/markdownEditor/plugins/ReadOnlyPlugin.tsx +15 -15
  119. package/src/components/markdownEditor/plugins/ToolbarPlugin.tsx +401 -401
  120. package/src/components/markdownEditor/plugins/customLink/CustomLinkNode.tsx +224 -224
  121. package/src/components/markdownEditor/plugins/customLink/CustomLinkNodePlugin.tsx +32 -32
  122. package/src/components/markdownEditor/plugins/customLink/CustomLinkNodeTransformer.tsx +102 -102
  123. package/src/components/markdownEditor/plugins/customLink/FloatingLinkEditor.tsx +243 -243
  124. package/src/components/markdownEditor/plugins/customLink/FloatingLinkEditor.types.ts +11 -11
  125. package/src/components/markdownEditor/plugins/emoji/EmojiNode.tsx +95 -95
  126. package/src/components/markdownEditor/plugins/emoji/EmojiNodeTransform.ts +41 -41
  127. package/src/components/markdownEditor/plugins/emoji/EmojiPickerPlugin.tsx +152 -152
  128. package/src/components/markdownEditor/plugins/emoji/EmojisPlugin.tsx +65 -65
  129. package/src/components/markdownEditor/plugins/index.ts +6 -6
  130. package/src/components/markdownEditor/theme.ts +65 -65
  131. package/src/components/notes/AddNote.tsx +90 -90
  132. package/src/components/notes/Conversation.tsx +82 -82
  133. package/src/components/notes/Conversations.tsx +58 -58
  134. package/src/components/notes/NewConversation.tsx +78 -78
  135. package/src/components/notes/Note.tsx +44 -44
  136. package/src/components/notes/Notes.tsx +69 -68
  137. package/src/components/notes/index.ts +5 -5
  138. package/src/components/reporting/ChartReport.tsx +98 -98
  139. package/src/components/reporting/ReportFilter.tsx +54 -54
  140. package/src/components/reporting/ReportFilterField.tsx +160 -160
  141. package/src/components/reporting/ReportOutput.tsx +79 -79
  142. package/src/components/reporting/ReportWithFilter.tsx +70 -70
  143. package/src/components/reporting/TableReport.tsx +57 -57
  144. package/src/components/reporting/TreeReport.tsx +111 -111
  145. package/src/components/reporting/index.ts +4 -4
  146. package/src/components/wrapper/AppList.tsx +20 -20
  147. package/src/components/wrapper/ChurchList.tsx +22 -22
  148. package/src/components/wrapper/Drawers.tsx +60 -60
  149. package/src/components/wrapper/NavItem.tsx +41 -41
  150. package/src/components/wrapper/NewPrivateMessage.tsx +103 -103
  151. package/src/components/wrapper/NotificationMenu.tsx +96 -85
  152. package/src/components/wrapper/Notifications.tsx +53 -50
  153. package/src/components/wrapper/PrivateMessageDetails.tsx +24 -23
  154. package/src/components/wrapper/PrivateMessages.tsx +92 -87
  155. package/src/components/wrapper/SiteWrapper.tsx +97 -96
  156. package/src/components/wrapper/TabPanel.tsx +30 -30
  157. package/src/components/wrapper/UserMenu.tsx +106 -106
  158. package/src/components/wrapper/index.tsx +5 -5
  159. package/src/donationComponents/DonationPage.tsx +136 -136
  160. package/src/donationComponents/components/BankForm.tsx +159 -159
  161. package/src/donationComponents/components/CardForm.tsx +104 -104
  162. package/src/donationComponents/components/DonationForm.tsx +235 -235
  163. package/src/donationComponents/components/FundDonation.tsx +49 -49
  164. package/src/donationComponents/components/FundDonations.tsx +39 -39
  165. package/src/donationComponents/components/NonAuthDonation.tsx +31 -31
  166. package/src/donationComponents/components/NonAuthDonationInner.tsx +259 -259
  167. package/src/donationComponents/components/PaymentMethods.tsx +135 -135
  168. package/src/donationComponents/components/RecurringDonations.tsx +121 -121
  169. package/src/donationComponents/components/RecurringDonationsEdit.tsx +93 -93
  170. package/src/donationComponents/components/index.tsx +9 -9
  171. package/src/donationComponents/index.ts +3 -3
  172. package/src/donationComponents/modals/DonationPreviewModal.tsx +66 -66
  173. package/src/helpers/AnalyticsHelper.ts +33 -33
  174. package/src/helpers/ApiHelper.ts +125 -125
  175. package/src/helpers/AppearanceHelper.ts +69 -69
  176. package/src/helpers/ArrayHelper.ts +81 -81
  177. package/src/helpers/CommonEnvironmentHelper.ts +80 -80
  178. package/src/helpers/CurrencyHelper.ts +10 -10
  179. package/src/helpers/DateHelper.ts +109 -108
  180. package/src/helpers/DonationHelper.ts +26 -26
  181. package/src/helpers/ErrorHelper.ts +36 -36
  182. package/src/helpers/EventHelper.ts +52 -52
  183. package/src/helpers/FileHelper.ts +31 -31
  184. package/src/helpers/PersonHelper.ts +60 -60
  185. package/src/helpers/SocketHelper.ts +78 -76
  186. package/src/helpers/Themes.ts +14 -14
  187. package/src/helpers/UniqueIdHelper.ts +36 -36
  188. package/src/helpers/UserHelper.ts +59 -59
  189. package/src/helpers/createEmotionCache.ts +17 -17
  190. package/src/helpers/index.ts +18 -18
  191. package/src/hooks/index.ts +1 -1
  192. package/src/hooks/useMountedState.ts +16 -16
  193. package/src/index.ts +6 -6
  194. package/src/interfaces/Access.ts +24 -24
  195. package/src/interfaces/Attendance.ts +8 -8
  196. package/src/interfaces/Content.ts +10 -10
  197. package/src/interfaces/Doing.ts +24 -24
  198. package/src/interfaces/Donation.ts +45 -45
  199. package/src/interfaces/Error.ts +17 -17
  200. package/src/interfaces/Membership.ts +51 -51
  201. package/src/interfaces/Messaging.ts +11 -21
  202. package/src/interfaces/Permissions.ts +68 -68
  203. package/src/interfaces/Reporting.ts +7 -7
  204. package/src/interfaces/UserContextInterface.ts +13 -13
  205. package/src/interfaces/index.ts +13 -13
  206. package/src/pageComponents/LoginPage.tsx +244 -244
  207. package/src/pageComponents/LogoutPage.tsx +28 -28
  208. package/src/pageComponents/components/Forgot.tsx +79 -79
  209. package/src/pageComponents/components/Login.tsx +54 -54
  210. package/src/pageComponents/components/LoginSetPassword.tsx +63 -63
  211. package/src/pageComponents/components/Register.tsx +107 -107
  212. package/src/pageComponents/components/SelectChurchModal.tsx +41 -41
  213. package/src/pageComponents/components/SelectChurchRegister.tsx +88 -88
  214. package/src/pageComponents/components/SelectChurchSearch.tsx +69 -69
  215. package/src/pageComponents/components/SelectableChurch.tsx +38 -38
  216. package/src/pageComponents/index.ts +3 -3
  217. package/tsconfig.json +34 -34
  218. package/tslint.json +14 -14
@@ -1 +1 @@
1
- {"version":3,"file":"DateHelper.d.ts","sourceRoot":"","sources":["../../src/helpers/DateHelper.ts"],"names":[],"mappings":"AAEA,qBAAa,UAAU;IAGrB,MAAM,CAAC,MAAM,CAAC,KAAK,EAAE,GAAG;IAIxB,MAAM,CAAC,UAAU,CAAC,KAAK,EAAE,GAAG;IAK5B,MAAM,CAAC,aAAa,CAAC,KAAK,EAAE,GAAG;IAI/B,MAAM,CAAC,OAAO,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM;IAKvC,MAAM,CAAC,UAAU,CAAC,IAAI,EAAE,IAAI;IAK5B,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,IAAI;IAKhC,MAAM,CAAC,UAAU,CAAC,IAAI,EAAE,IAAI;IAK5B,MAAM,CAAC,aAAa;IAMpB,MAAM,CAAC,aAAa,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM;IAO/C,M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;IAkB1C,MAAM,CAAC,YAAY,CAAC,CAAC,EAAE,IAAI,GAAG,MAAM;IAIpC,MAAM,CAAC,uBAAuB,CAAC,CAAC,EAAE,IAAI,GAAG,IAAI;IAM7C,OAAO,CAAC,MAAM,CAAC,cAAc;CAK9B"}
@@ -83,6 +83,8 @@ class DateHelper {
83
83
  let minutes = Math.floor(seconds / 60);
84
84
  return (minutes === 1) ? "1m" : minutes.toString() + "m";
85
85
  }
86
+ else if (seconds < 1)
87
+ return "now";
86
88
  else
87
89
  return (seconds === 1) ? "1s" : Math.floor(seconds).toString() + "s";
88
90
  }
@@ -1 +1 @@
1
- {"version":3,"file":"DateHelper.js","sourceRoot":"","sources":["../../src/helpers/DateHelper.ts"],"names":[],"mappings":";;;AAAA,uCAA+C;AAE/C,MAAa,UAAU;IAErB,oDAAoD;IACpD,MAAM,CAAC,MAAM,CAAC,KAAU;QACtB,OAAO,IAAI,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,QAAQ,EAAE,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC;IACjE,CAAC;IAED,MAAM,CAAC,UAAU,CAAC,KAAU;QAC1B,OAAO,IAAI,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC;IAChD,CAAC;IAED,uBAAuB;IACvB,MAAM,CAAC,aAAa,CAAC,KAAU;QAC7B,OAAO,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC;IAChC,CAAC;IAED,MAAM,CAAC,OAAO,CAAC,IAAU,EAAE,IAAY;QACrC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,EAAE,GAAG,IAAI,CAAC,CAAC;QACpC,OAAO,IAAI,CAAC;IACd,CAAC;IAED,MAAM,CAAC,UAAU,CAAC,IAAU;QAC1B,IAAI,IAAI,KAAK,SAAS,IAAI,IAAI,KAAK,IAAI;YAAE,OAAO,EAAE,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AAY,MAAM,MAAM,MAAM,wBAAwB,GAAG,KAAK,IAAI,UAIlF;IAED,MAAM,CAAC,aAAa,YAAa,sBAAsB,UAUtD;CAEF"}
1
+ {"version":3,"file":"SocketHelper.d.ts","sourceRoot":"","sources":["../../src/helpers/SocketHelper.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiD,4BAA4B,EAAE,sBAAsB,EAAuB,MAAM,eAAe,CAAC;AAKzJ,qBAAa,YAAY;IACvB,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC;IACzB,MAAM,CAAC,QAAQ,EAAE,MAAM,CAAC;IACxB,MAAM,CAAC,cAAc,EAAE,4BAA4B,EAAE,CAAM;IAC3D,OAAO,CAAC,MAAM,CAAC,gBAAgB,CAAkE;IAEjG,MAAM,CAAC,eAAe,OAAQ;QAAC,QAAQ,EAAC,MAAM,CAAC;QAAC,QAAQ,EAAC,MAAM,CAAA;KAAC,UAM/D;IAED,MAAM,CAAC,qBAAqB,aAK3B;IAED,MAAM,CAAC,IAAI,sBA8BV;IAED,MAAM,CAAC,UAAU,WAAY,MAAM,MAAM,MAAM,wBAAwB,GAAG,KAAK,IAAI,UAIlF;IAED,MAAM,CAAC,aAAa,YAAa,sBAAsB,UAWtD;CAEF"}
@@ -22,12 +22,13 @@ SocketHelper.actionHandlers = [];
22
22
  SocketHelper.personIdChurchId = { personId: "", churchId: "" };
23
23
  SocketHelper.setPersonChurch = (pc) => {
24
24
  if ((pc === null || pc === void 0 ? void 0 : pc.personId) && pc.personId && pc.churchId !== _a.personIdChurchId.churchId && pc.personId !== _a.personIdChurchId.personId) {
25
+ //if (pc?.personId && pc.personId!==this.personIdChurchId.personId && this.socketId!==undefined && this.socketId) {
25
26
  _a.personIdChurchId = pc;
26
27
  _a.createAlertConnection();
27
28
  }
28
29
  };
29
30
  SocketHelper.createAlertConnection = () => {
30
- if (_a.personIdChurchId.personId) {
31
+ if (_a.personIdChurchId.personId && _a.socketId) {
31
32
  const connection = { conversationId: "alerts", churchId: _a.personIdChurchId.churchId, displayName: "Test", socketId: _a.socketId, personId: _a.personIdChurchId.personId };
32
33
  ApiHelper_1.ApiHelper.postAnonymous("/connections", [connection], "MessagingApi");
33
34
  }
@@ -57,7 +58,7 @@ SocketHelper.init = () => __awaiter(void 0, void 0, void 0, function* () {
57
58
  //Silently reconnect
58
59
  if (_a.socket.readyState === _a.socket.CLOSED) {
59
60
  _a.init().then(() => {
60
- _a.createAlertConnection();
61
+ //SocketHelper.createAlertConnection();
61
62
  _a.handleMessage({ action: "reconnect", data: null });
62
63
  });
63
64
  }
@@ -77,6 +78,7 @@ SocketHelper.handleMessage = (payload) => {
77
78
  //console.log("MESSAGE", payload)
78
79
  if (payload.action === "socketId") {
79
80
  _a.socketId = payload.data;
81
+ _a.createAlertConnection();
80
82
  }
81
83
  else {
82
84
  ArrayHelper_1.ArrayHelper.getAll(_a.actionHandlers, "action", payload.action).forEach((handler) => {
@@ -1 +1 @@
1
- {"version":3,"file":"SocketHelper.js","sourceRoot":"","sources":["../../src/helpers/SocketHelper.ts"],"names":[],"mappings":";;;;;;;;;;;;;AACA,2CAAwC;AACxC,+CAA4C;AAC5C,uEAAoE;AAEpE,MAAa,YAAY;;AAAzB,oCAsEC;;AAnEQ,2BAAc,GAAmC,EAAE,AAArC,CAAsC;AAC5C,6BAAgB,GAAuC,EAAC,QAAQ,EAAC,EAAE,EAAE,QAAQ,EAAC,EAAE,EAAC,AAAjE,CAAkE;AAE1F,4BAAe,GAAG,CAAC,EAAsC,EAAE,EAAE;IAClE,IAAI,CAAA,EAAE,aAAF,EAAE,uBAAF,EAAE,CAAE,QAAQ,KAAI,EAAE,CAAC,QAAQ,IAAI,EAAE,CAAC,QAAQ,KAAG,EAAI,CAAC,gBAAgB,CAAC,QAAQ,IAAI,EAAE,CAAC,QAAQ,KAAG,EAAI,CAAC,gBAAgB,CAAC,QAAQ,EAAE;QAC/H,EAAI,CAAC,gBAAgB,GAAG,EAAE,CAAC;QAC3B,EAAI,CAAC,qBAAqB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I,CAAC,CAAC;QACtC,CAAC,CAAC,CAAC;KACJ;AACH,CAAC,AAXmB,CAWnB"}
@@ -42,8 +42,16 @@ export interface NotificationInterface {
42
42
  contentType?: string;
43
43
  contentId: string;
44
44
  timeSent?: Date;
45
- read: boolean;
45
+ isNew: boolean;
46
46
  message?: string;
47
+ deliveryMethod?: string;
48
+ }
49
+ export interface NotificationPreferenceInterface {
50
+ id?: string;
51
+ churchId?: string;
52
+ personId?: string;
53
+ allowPush: boolean;
54
+ emailFrequency: string;
47
55
  }
48
56
  export interface PrivateMessageInterface {
49
57
  id?: string;
@@ -54,6 +62,7 @@ export interface PrivateMessageInterface {
54
62
  notifyPersonId?: string;
55
63
  conversation?: ConversationInterface;
56
64
  person?: PersonInterface;
65
+ deliveryMethod?: string;
57
66
  }
58
67
  export interface SocketActionHandlerInterface {
59
68
  action: string;
@@ -1 +1 @@
1
- {"version":3,"file":"Messaging.d.ts","sourceRoot":"","sources":["../../src/interfaces/Messaging.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAE/C,MAAM,WAAW,mBAAmB;IAAG,EAAE,CAAC,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAAC,cAAc,CAAC,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAAC,UAAU,CAAC,EAAE,IAAI,CAAC;IAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;CAAE;AAC/K,MAAM,WAAW,qBAAqB;IACpC,EAAE,CAAC,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IAAC,WAAW,CAAC,EAAE,IAAI,CAAC;IAAC,OAAO,CAAC,EAAE,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AAC,EAAE,MAAM,CAAC;IAAC,UAAU,CAAC,EAAE,MAAM,CAAC;IAAC,cAAc,CAAC,EAAE,MAAM,CAAC;IAAC,cAAc,CAAC,EAAE,MAAM,CAAC;IAAC,YAAY,CAAC,EAAE,qBAAqB,CAAC;IAAC,MAAM,CAAC,EAAE,eAAe,CAAC;IAAC,cAAc,CAAC,EAAE,MAAM,CAAA;CAAE;AAClQ,MAAM,WAAW,4BAA4B;IAAG,MAAM,EAAC,MAAM,CAAC;IAAC,EAAE,EAAC,MAAM,CAAC;IAAC,aAAa,EAAC,CAAC,IAAI,EAAC,GAAG,KAAK,IAAI,CAAA;CAAE;AAC5G,MAAM,MAAM,mBAAmB,GAAG,SAAS,GAAG,eAAe,GAAG,SAAS,GAAG,YAAY,GAAG,eAAe,GAAG,UAAU,GAAG,gBAAgB,GAAG,kBAAkB,GAAG,iBAAiB,GAAG,WAAW,CAAC;AAClM,MAAM,WAAW,sBAAsB;IAAI,MAAM,EAAE,mBAAmB,CAAC;IAAC,IAAI,EAAE,GAAG,CAAA;CAAE"}
package/package.json CHANGED
@@ -1,85 +1,86 @@
1
- {
2
- "name": "@churchapps/apphelper",
3
- "version": "0.1.5",
4
- "description": "Library of helper functions for React and NextJS ChurchApps",
5
- "main": "dist/index.js",
6
- "scripts": {
7
- "test": "echo \"Error: no test specified\" && exit 1",
8
- "clean": "rimraf dist",
9
- "copy-css": "copyfiles -f src/components/markdownEditor/editor.css dist/components/markdownEditor",
10
- "copy-icons": "copyfiles -f src/components/markdownEditor/images/icons/* dist/components/markdownEditor/images/icons",
11
- "copy-emojis": "copyfiles -f src/components/markdownEditor/images/emoji/* dist/components/markdownEditor/images/emoji",
12
- "copy-assets": "npm-run-all copy-css copy-icons copy-emojis",
13
- "link": "link",
14
- "tsc": "tsc",
15
- "build": "npm-run-all clean tsc copy-assets"
16
- },
17
- "repository": {
18
- "type": "git",
19
- "url": "git+https://github.com/LiveChurchSolutions/AppHelper.git"
20
- },
21
- "keywords": [
22
- "ChurchApps"
23
- ],
24
- "author": "ChurchApps.org",
25
- "license": "MIT",
26
- "bugs": {
27
- "url": "https://github.com/LiveChurchSolutions/AppHelper/issues"
28
- },
29
- "homepage": "https://github.com/LiveChurchSolutions/AppHelper#readme",
30
- "peerDependencies": {
31
- "react": "^18.2.0",
32
- "react-dom": "^18.2.0",
33
- "react-router-dom": "^6.15.0"
34
- },
35
- "dependencies": {
36
- "@churchapps/helpers": "^1.0.6",
37
- "@emotion/cache": "^11.11.0",
38
- "@emotion/react": "^11.11.1",
39
- "@emotion/styled": "^11.11.0",
40
- "@lexical/code": "^0.12.0",
41
- "@lexical/link": "^0.12.0",
42
- "@lexical/list": "^0.12.0",
43
- "@lexical/markdown": "^0.12.0",
44
- "@lexical/react": "^0.12.0",
45
- "@lexical/rich-text": "^0.12.0",
46
- "@lexical/selection": "^0.12.0",
47
- "@lexical/table": "^0.12.0",
48
- "@lexical/utils": "^0.12.0",
49
- "@mui/lab": "^5.0.0-alpha.142",
50
- "@mui/material": "^5.14.7",
51
- "@stripe/react-stripe-js": "^2.1.2",
52
- "@stripe/stripe-js": "^2.1.1",
53
- "axios": "^1.5.0",
54
- "cropperjs": "^1.6.0",
55
- "date-fns": "^2.30.0",
56
- "flexsearch": "^0.7.31",
57
- "jwt-decode": "^3.1.2",
58
- "lexical": "^0.12.0",
59
- "material-symbols": "^0.11.0",
60
- "mui-tel-input": "^4.0.1",
61
- "react-activity": "^2.1.3",
62
- "react-cookie": "^6.1.0",
63
- "react-cropper": "^2.3.3",
64
- "react-csv": "^2.2.2",
65
- "react-ga4": "^2.1.0",
66
- "react-google-charts": "^3.0.15",
67
- "react-google-recaptcha": "^3.1.0",
68
- "react-to-print": "^2.14.13",
69
- "rrule": "^2.7.2"
70
- },
71
- "devDependencies": {
72
- "@types/node": "^20.5.9",
73
- "@types/react": "^18.2.21",
74
- "@types/react-csv": "^1.1.3",
75
- "@types/react-dom": "^18.2.7",
76
- "@types/react-google-recaptcha": "^2.1.5",
77
- "copyfiles": "^2.4.1",
78
- "eslint-config-react-app": "^7.0.1",
79
- "eslint-plugin-react": "^7.33.2",
80
- "npm-run-all": "^4.1.5",
81
- "rimraf": "^5.0.1",
82
- "tslint": "^6.1.2",
83
- "typescript": "^5.2.2"
84
- }
85
- }
1
+ {
2
+ "name": "@churchapps/apphelper",
3
+ "version": "0.1.7",
4
+ "description": "Library of helper functions for React and NextJS ChurchApps",
5
+ "main": "dist/index.js",
6
+ "scripts": {
7
+ "test": "echo \"Error: no test specified\" && exit 1",
8
+ "clean": "rimraf dist",
9
+ "copy-css": "copyfiles -f src/components/markdownEditor/editor.css dist/components/markdownEditor",
10
+ "copy-icons": "copyfiles -f src/components/markdownEditor/images/icons/* dist/components/markdownEditor/images/icons",
11
+ "copy-emojis": "copyfiles -f src/components/markdownEditor/images/emoji/* dist/components/markdownEditor/images/emoji",
12
+ "copy-assets": "npm-run-all copy-css copy-icons copy-emojis",
13
+ "link": "link",
14
+ "tsc": "tsc",
15
+ "build": "npm-run-all clean tsc copy-assets",
16
+ "updateLink": "npm-run-all clean tsc && npm rm @churchapps/apphelper -g && npm link"
17
+ },
18
+ "repository": {
19
+ "type": "git",
20
+ "url": "git+https://github.com/LiveChurchSolutions/AppHelper.git"
21
+ },
22
+ "keywords": [
23
+ "ChurchApps"
24
+ ],
25
+ "author": "ChurchApps.org",
26
+ "license": "MIT",
27
+ "bugs": {
28
+ "url": "https://github.com/LiveChurchSolutions/AppHelper/issues"
29
+ },
30
+ "homepage": "https://github.com/LiveChurchSolutions/AppHelper#readme",
31
+ "peerDependencies": {
32
+ "react": "^18.2.0",
33
+ "react-dom": "^18.2.0",
34
+ "react-router-dom": "^6.15.0"
35
+ },
36
+ "dependencies": {
37
+ "@churchapps/helpers": "^1.0.6",
38
+ "@emotion/cache": "^11.11.0",
39
+ "@emotion/react": "^11.11.1",
40
+ "@emotion/styled": "^11.11.0",
41
+ "@lexical/code": "^0.12.0",
42
+ "@lexical/link": "^0.12.0",
43
+ "@lexical/list": "^0.12.0",
44
+ "@lexical/markdown": "^0.12.0",
45
+ "@lexical/react": "^0.12.0",
46
+ "@lexical/rich-text": "^0.12.0",
47
+ "@lexical/selection": "^0.12.0",
48
+ "@lexical/table": "^0.12.0",
49
+ "@lexical/utils": "^0.12.0",
50
+ "@mui/lab": "^5.0.0-alpha.142",
51
+ "@mui/material": "^5.14.7",
52
+ "@stripe/react-stripe-js": "^2.1.2",
53
+ "@stripe/stripe-js": "^2.1.1",
54
+ "axios": "^1.5.0",
55
+ "cropperjs": "^1.6.0",
56
+ "date-fns": "^2.30.0",
57
+ "flexsearch": "^0.7.31",
58
+ "jwt-decode": "^3.1.2",
59
+ "lexical": "^0.12.0",
60
+ "material-symbols": "^0.11.0",
61
+ "mui-tel-input": "^4.0.1",
62
+ "react-activity": "^2.1.3",
63
+ "react-cookie": "^6.1.0",
64
+ "react-cropper": "^2.3.3",
65
+ "react-csv": "^2.2.2",
66
+ "react-ga4": "^2.1.0",
67
+ "react-google-charts": "^3.0.15",
68
+ "react-google-recaptcha": "^3.1.0",
69
+ "react-to-print": "^2.14.13",
70
+ "rrule": "^2.7.2"
71
+ },
72
+ "devDependencies": {
73
+ "@types/node": "^20.5.9",
74
+ "@types/react": "^18.2.21",
75
+ "@types/react-csv": "^1.1.3",
76
+ "@types/react-dom": "^18.2.7",
77
+ "@types/react-google-recaptcha": "^2.1.5",
78
+ "copyfiles": "^2.4.1",
79
+ "eslint-config-react-app": "^7.0.1",
80
+ "eslint-plugin-react": "^7.33.2",
81
+ "npm-run-all": "^4.1.5",
82
+ "rimraf": "^5.0.1",
83
+ "tslint": "^6.1.2",
84
+ "typescript": "^5.2.2"
85
+ }
86
+ }
@@ -1,80 +1,80 @@
1
- import React from "react"
2
- import { useNavigate } from "react-router-dom"
3
- import { UserHelper, ApiHelper } from "../helpers";
4
- import { Permissions, PersonInterface, HouseholdInterface } from "../interfaces";
5
- import { Button, Grid, TextField } from "@mui/material"
6
- import { ErrorMessages } from "./ErrorMessages"
7
- import { useMountedState } from "../hooks/useMountedState"
8
-
9
- interface Props {
10
- navigateOnCreate?: boolean;
11
- onCreate?: (person: PersonInterface) => void;
12
- }
13
-
14
- export function CreatePerson({ navigateOnCreate = true, onCreate = () => {} }: Props) {
15
- const navigate = useNavigate()
16
- const [person, setPerson] = React.useState<PersonInterface>({ name: { first: "", last: "" }, contactInfo: {} });
17
- const [errors, setErrors] = React.useState<string[]>([]);
18
- const [isSubmitting, setIsSubmitting] = React.useState(false);
19
- const isMounted = useMountedState()
20
-
21
- const validate = () => {
22
- const result = [];
23
- if (!person.name?.first) result.push("Please enter a first name.");
24
- if (!person.name?.last) result.push("Please enter a last name.");
25
- setErrors(result);
26
- return result.length === 0;
27
- }
28
-
29
- const handleChange = (e: React.ChangeEvent<HTMLInputElement | HTMLSelectElement | HTMLTextAreaElement>) => {
30
- setErrors([]);
31
- const p = { ...person } as PersonInterface;
32
- let value = e.target.value;
33
- switch (e.target.name) {
34
- case "first": p.name.first = value; break;
35
- case "last": p.name.last = value; break;
36
- }
37
- setPerson(p);
38
- }
39
-
40
- function handleSubmit() {
41
- let household = { name: person.name.last } as HouseholdInterface;
42
- if (validate()) {
43
- setIsSubmitting(true);
44
- ApiHelper.post("/households", [household], "MembershipApi").then(data => {
45
- household.id = data[0].id;
46
- person.householdId = household.id;
47
- person.name.display = [person.name.first, person.name.last].join(" ");
48
- ApiHelper.post("/people", [person], "MembershipApi").then(data => {
49
- person.id = data[0].id
50
- onCreate(person);
51
- setPerson({...person, name: { first: "", last: "" }});
52
- navigateOnCreate && navigate("/people/" + person.id);
53
- }).finally(() => {
54
- if (isMounted()) {
55
- setIsSubmitting(false);
56
- }
57
- });
58
- });
59
- }
60
- }
61
-
62
- if (!UserHelper.checkAccess(Permissions.membershipApi.people.edit)) return null;
63
- return (
64
- <div>
65
- <p className="pl-1 mb-3 text-dark"><b>Add a New Person</b></p>
66
- <ErrorMessages errors={errors} />
67
- <Grid container spacing={3} alignItems="center">
68
- <Grid item md={4} xs={12}>
69
- <TextField size="small" margin="none" fullWidth type="text" aria-label="firstName" label="First Name" name="first" value={person.name.first || ""} onChange={handleChange} onKeyDown={(e: React.KeyboardEvent<HTMLInputElement>) => e.key === "Enter" && handleSubmit} />
70
- </Grid>
71
- <Grid item md={4} xs={12}>
72
- <TextField size="small" margin="none" fullWidth type="text" aria-label="lastName" label="Last Name" name="last" value={person.name.last || ""} onChange={handleChange} onKeyDown={(e: React.KeyboardEvent<HTMLInputElement>) => e.key === "Enter" && handleSubmit} />
73
- </Grid>
74
- <Grid item md={4} xs={12}>
75
- <Button type="submit" fullWidth variant="contained" disabled={isSubmitting} onClick={handleSubmit}>Add</Button>
76
- </Grid>
77
- </Grid>
78
- </div>
79
- )
80
- }
1
+ import React from "react"
2
+ import { useNavigate } from "react-router-dom"
3
+ import { UserHelper, ApiHelper } from "../helpers";
4
+ import { Permissions, PersonInterface, HouseholdInterface } from "../interfaces";
5
+ import { Button, Grid, TextField } from "@mui/material"
6
+ import { ErrorMessages } from "./ErrorMessages"
7
+ import { useMountedState } from "../hooks/useMountedState"
8
+
9
+ interface Props {
10
+ navigateOnCreate?: boolean;
11
+ onCreate?: (person: PersonInterface) => void;
12
+ }
13
+
14
+ export function CreatePerson({ navigateOnCreate = true, onCreate = () => {} }: Props) {
15
+ const navigate = useNavigate()
16
+ const [person, setPerson] = React.useState<PersonInterface>({ name: { first: "", last: "" }, contactInfo: {} });
17
+ const [errors, setErrors] = React.useState<string[]>([]);
18
+ const [isSubmitting, setIsSubmitting] = React.useState(false);
19
+ const isMounted = useMountedState()
20
+
21
+ const validate = () => {
22
+ const result = [];
23
+ if (!person.name?.first) result.push("Please enter a first name.");
24
+ if (!person.name?.last) result.push("Please enter a last name.");
25
+ setErrors(result);
26
+ return result.length === 0;
27
+ }
28
+
29
+ const handleChange = (e: React.ChangeEvent<HTMLInputElement | HTMLSelectElement | HTMLTextAreaElement>) => {
30
+ setErrors([]);
31
+ const p = { ...person } as PersonInterface;
32
+ let value = e.target.value;
33
+ switch (e.target.name) {
34
+ case "first": p.name.first = value; break;
35
+ case "last": p.name.last = value; break;
36
+ }
37
+ setPerson(p);
38
+ }
39
+
40
+ function handleSubmit() {
41
+ let household = { name: person.name.last } as HouseholdInterface;
42
+ if (validate()) {
43
+ setIsSubmitting(true);
44
+ ApiHelper.post("/households", [household], "MembershipApi").then(data => {
45
+ household.id = data[0].id;
46
+ person.householdId = household.id;
47
+ person.name.display = [person.name.first, person.name.last].join(" ");
48
+ ApiHelper.post("/people", [person], "MembershipApi").then(data => {
49
+ person.id = data[0].id
50
+ onCreate(person);
51
+ setPerson({...person, name: { first: "", last: "" }});
52
+ navigateOnCreate && navigate("/people/" + person.id);
53
+ }).finally(() => {
54
+ if (isMounted()) {
55
+ setIsSubmitting(false);
56
+ }
57
+ });
58
+ });
59
+ }
60
+ }
61
+
62
+ if (!UserHelper.checkAccess(Permissions.membershipApi.people.edit)) return null;
63
+ return (
64
+ <div>
65
+ <p className="pl-1 mb-3 text-dark"><b>Add a New Person</b></p>
66
+ <ErrorMessages errors={errors} />
67
+ <Grid container spacing={3} alignItems="center">
68
+ <Grid item md={4} xs={12}>
69
+ <TextField size="small" margin="none" fullWidth type="text" aria-label="firstName" label="First Name" name="first" value={person.name.first || ""} onChange={handleChange} onKeyDown={(e: React.KeyboardEvent<HTMLInputElement>) => e.key === "Enter" && handleSubmit} />
70
+ </Grid>
71
+ <Grid item md={4} xs={12}>
72
+ <TextField size="small" margin="none" fullWidth type="text" aria-label="lastName" label="Last Name" name="last" value={person.name.last || ""} onChange={handleChange} onKeyDown={(e: React.KeyboardEvent<HTMLInputElement>) => e.key === "Enter" && handleSubmit} />
73
+ </Grid>
74
+ <Grid item md={4} xs={12}>
75
+ <Button type="submit" fullWidth variant="contained" disabled={isSubmitting} onClick={handleSubmit}>Add</Button>
76
+ </Grid>
77
+ </Grid>
78
+ </div>
79
+ )
80
+ }
@@ -1,68 +1,68 @@
1
- import React from "react";
2
- import { Paper, Box, Typography, styled, Icon } from "@mui/material";
3
- import { HelpIcon } from "./HelpIcon";
4
- import { SmallButton } from "./SmallButton";
5
-
6
- interface Props {
7
- id?: string,
8
- children: React.ReactNode,
9
- headerIcon?: string,
10
- headerText: string,
11
- editFunction?: () => void,
12
- editContent?: React.ReactNode,
13
- "data-cy"?: string,
14
- ariaLabel?: string,
15
- footerContent?: React.ReactNode,
16
- help?: string
17
- }
18
-
19
- /* "& p": { color: "#666" }, */
20
- const CustomContextBox = styled(Box)({
21
- marginTop: 10,
22
- overflowX: "hidden",
23
- "& label": { color: "#999" },
24
- "& ul": { paddingLeft: 0 },
25
- "& li": {
26
- listStyleType: "none",
27
- marginBottom: 10,
28
- "& i": { marginRight: 5 }
29
- },
30
- "& td": {
31
- "& i": { marginRight: 5 }
32
- },
33
- "& td:first-of-type": { paddingLeft: 0 },
34
- "& td:last-of-type": { paddingRight: 0 },
35
- "& th:first-of-type": { paddingLeft: 0 },
36
- "& th:last-of-type": { paddingRight: 0 }
37
- });
38
-
39
- export const DisplayBox = React.forwardRef<HTMLDivElement, Props>((props, ref) => {
40
-
41
- let editContent: React.ReactNode;
42
- if (props.editFunction !== undefined) {
43
- editContent = <SmallButton icon="edit" aria-label={props.ariaLabel || "editButton"} onClick={props.editFunction} />
44
- }
45
- else if (props.editContent !== undefined) editContent = props.editContent;
46
-
47
- return (
48
- <Paper sx={{ padding: 2, marginBottom: 4 }} id={props.id} data-cy={props["data-cy"] || ""}>
49
- {props.help && <HelpIcon article={props.help} />}
50
- <Box sx={{ display: "flex", justifyContent: "space-between", alignItems: "center" }}>
51
- <Box sx={{ display: "flex", alignItems: "center" }}>
52
- {props.headerIcon && <Icon sx={{ color: "#1976d2" }}>{props.headerIcon}</Icon>}
53
- <Typography component="h2" sx={{ display: "inline-block", marginLeft: props.headerIcon ? 1 : 0 }} variant="h6" color="primary">
54
- {props.headerText}
55
- </Typography>
56
-
57
- </Box>
58
- <Box>
59
- {editContent}
60
- </Box>
61
- </Box>
62
- <CustomContextBox ref={ref} data-cy="content">{props.children}</CustomContextBox>
63
- {props.footerContent && (<div style={{ marginLeft: -16, marginRight: -16, marginBottom: -15, marginTop: 15 }}>{props.footerContent}</div>)}
64
- </Paper>
65
- );
66
- })
67
-
68
- DisplayBox.displayName = "DisplayBox";
1
+ import React from "react";
2
+ import { Paper, Box, Typography, styled, Icon } from "@mui/material";
3
+ import { HelpIcon } from "./HelpIcon";
4
+ import { SmallButton } from "./SmallButton";
5
+
6
+ interface Props {
7
+ id?: string,
8
+ children: React.ReactNode,
9
+ headerIcon?: string,
10
+ headerText: string,
11
+ editFunction?: () => void,
12
+ editContent?: React.ReactNode,
13
+ "data-cy"?: string,
14
+ ariaLabel?: string,
15
+ footerContent?: React.ReactNode,
16
+ help?: string
17
+ }
18
+
19
+ /* "& p": { color: "#666" }, */
20
+ const CustomContextBox = styled(Box)({
21
+ marginTop: 10,
22
+ overflowX: "hidden",
23
+ "& label": { color: "#999" },
24
+ "& ul": { paddingLeft: 0 },
25
+ "& li": {
26
+ listStyleType: "none",
27
+ marginBottom: 10,
28
+ "& i": { marginRight: 5 }
29
+ },
30
+ "& td": {
31
+ "& i": { marginRight: 5 }
32
+ },
33
+ "& td:first-of-type": { paddingLeft: 0 },
34
+ "& td:last-of-type": { paddingRight: 0 },
35
+ "& th:first-of-type": { paddingLeft: 0 },
36
+ "& th:last-of-type": { paddingRight: 0 }
37
+ });
38
+
39
+ export const DisplayBox = React.forwardRef<HTMLDivElement, Props>((props, ref) => {
40
+
41
+ let editContent: React.ReactNode;
42
+ if (props.editFunction !== undefined) {
43
+ editContent = <SmallButton icon="edit" aria-label={props.ariaLabel || "editButton"} onClick={props.editFunction} />
44
+ }
45
+ else if (props.editContent !== undefined) editContent = props.editContent;
46
+
47
+ return (
48
+ <Paper sx={{ padding: 2, marginBottom: 4 }} id={props.id} data-cy={props["data-cy"] || ""}>
49
+ {props.help && <HelpIcon article={props.help} />}
50
+ <Box sx={{ display: "flex", justifyContent: "space-between", alignItems: "center" }}>
51
+ <Box sx={{ display: "flex", alignItems: "center" }}>
52
+ {props.headerIcon && <Icon sx={{ color: "#1976d2" }}>{props.headerIcon}</Icon>}
53
+ <Typography component="h2" sx={{ display: "inline-block", marginLeft: props.headerIcon ? 1 : 0 }} variant="h6" color="primary">
54
+ {props.headerText}
55
+ </Typography>
56
+
57
+ </Box>
58
+ <Box>
59
+ {editContent}
60
+ </Box>
61
+ </Box>
62
+ <CustomContextBox ref={ref} data-cy="content">{props.children}</CustomContextBox>
63
+ {props.footerContent && (<div style={{ marginLeft: -16, marginRight: -16, marginBottom: -15, marginTop: 15 }}>{props.footerContent}</div>)}
64
+ </Paper>
65
+ );
66
+ })
67
+
68
+ DisplayBox.displayName = "DisplayBox";