@posiwise/smart-crm 0.0.19 → 0.0.21

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 (279) hide show
  1. package/.eslintrc.json +22 -0
  2. package/ng-package.json +15 -0
  3. package/package.json +10 -23
  4. package/project.json +72 -0
  5. package/{index.d.ts → src/index.ts} +3 -0
  6. package/src/lib/private/components/smart-crm-accounts/smart-crm-account-details/smart-crm-account-details.component.html +200 -0
  7. package/src/lib/private/components/smart-crm-accounts/smart-crm-account-details/smart-crm-account-details.component.spec.ts +185 -0
  8. package/src/lib/private/components/smart-crm-accounts/smart-crm-account-details/smart-crm-account-details.component.ts +238 -0
  9. package/src/lib/private/components/smart-crm-accounts/smart-crm-account-files/smart-crm-account-files.component.html +200 -0
  10. package/src/lib/private/components/smart-crm-accounts/smart-crm-account-files/smart-crm-account-files.component.spec.ts +109 -0
  11. package/src/lib/private/components/smart-crm-accounts/smart-crm-account-files/smart-crm-account-files.component.ts +249 -0
  12. package/src/lib/private/components/smart-crm-accounts/smart-crm-account-info/smart-crm-account-info.component.html +785 -0
  13. package/src/lib/private/components/smart-crm-accounts/smart-crm-account-info/smart-crm-account-info.component.scss +123 -0
  14. package/src/lib/private/components/smart-crm-accounts/smart-crm-account-info/smart-crm-account-info.component.spec.ts +388 -0
  15. package/src/lib/private/components/smart-crm-accounts/smart-crm-account-info/smart-crm-account-info.component.ts +792 -0
  16. package/src/lib/private/components/smart-crm-accounts/smart-crm-accounts.component.html +292 -0
  17. package/src/lib/private/components/smart-crm-accounts/smart-crm-accounts.component.scss +63 -0
  18. package/src/lib/private/components/smart-crm-accounts/smart-crm-accounts.component.spec.ts +145 -0
  19. package/src/lib/private/components/smart-crm-accounts/smart-crm-accounts.component.ts +417 -0
  20. package/src/lib/private/components/smart-crm-competition/smart-crm-competition/smart-crm-competition.component.html +1 -0
  21. package/src/lib/private/components/smart-crm-competition/smart-crm-competition/smart-crm-competition.component.spec.ts +17 -0
  22. package/src/lib/private/components/smart-crm-competition/smart-crm-competition/smart-crm-competition.component.ts +7 -0
  23. package/src/lib/private/components/smart-crm-configuration/smart-crm-actions/smart-crm-actions-details/smart-crm-actions-details.component.html +75 -0
  24. package/src/lib/private/components/smart-crm-configuration/smart-crm-actions/smart-crm-actions-details/smart-crm-actions-details.component.scss +3 -0
  25. package/src/lib/private/components/smart-crm-configuration/smart-crm-actions/smart-crm-actions-details/smart-crm-actions-details.component.spec.ts +123 -0
  26. package/src/lib/private/components/smart-crm-configuration/smart-crm-actions/smart-crm-actions-details/smart-crm-actions-details.component.ts +117 -0
  27. package/src/lib/private/components/smart-crm-configuration/smart-crm-actions/smart-crm-actions.component.html +125 -0
  28. package/src/lib/private/components/smart-crm-configuration/smart-crm-actions/smart-crm-actions.component.scss +5 -0
  29. package/src/lib/private/components/smart-crm-configuration/smart-crm-actions/smart-crm-actions.component.spec.ts +136 -0
  30. package/src/lib/private/components/smart-crm-configuration/smart-crm-actions/smart-crm-actions.component.ts +143 -0
  31. package/src/lib/private/components/smart-crm-configuration/smart-crm-configuration.component.html +60 -0
  32. package/src/lib/private/components/smart-crm-configuration/smart-crm-configuration.component.scss +1 -0
  33. package/src/lib/private/components/smart-crm-configuration/smart-crm-configuration.component.spec.ts +55 -0
  34. package/src/lib/private/components/smart-crm-configuration/smart-crm-configuration.component.ts +29 -0
  35. package/src/lib/private/components/smart-crm-configuration/smart-crm-opportunity-categories/smart-crm-opportunity-categories-details/smart-crm-opportunity-categories-details.component.html +95 -0
  36. package/src/lib/private/components/smart-crm-configuration/smart-crm-opportunity-categories/smart-crm-opportunity-categories-details/smart-crm-opportunity-categories-details.component.spec.ts +105 -0
  37. package/src/lib/private/components/smart-crm-configuration/smart-crm-opportunity-categories/smart-crm-opportunity-categories-details/smart-crm-opportunity-categories-details.component.ts +95 -0
  38. package/src/lib/private/components/smart-crm-configuration/smart-crm-opportunity-categories/smart-crm-opportunity-categories.component.html +125 -0
  39. package/src/lib/private/components/smart-crm-configuration/smart-crm-opportunity-categories/smart-crm-opportunity-categories.component.scss +3 -0
  40. package/src/lib/private/components/smart-crm-configuration/smart-crm-opportunity-categories/smart-crm-opportunity-categories.component.spec.ts +132 -0
  41. package/src/lib/private/components/smart-crm-configuration/smart-crm-opportunity-categories/smart-crm-opportunity-categories.component.ts +145 -0
  42. package/src/lib/private/components/smart-crm-configuration/smart-crm-source/smart-crm-source-details/smart-crm-source-details.component.html +61 -0
  43. package/src/lib/private/components/smart-crm-configuration/smart-crm-source/smart-crm-source-details/smart-crm-source-details.component.spec.ts +81 -0
  44. package/src/lib/private/components/smart-crm-configuration/smart-crm-source/smart-crm-source-details/smart-crm-source-details.component.ts +88 -0
  45. package/src/lib/private/components/smart-crm-configuration/smart-crm-source/smart-crm-source.component.html +96 -0
  46. package/src/lib/private/components/smart-crm-configuration/smart-crm-source/smart-crm-source.component.scss +3 -0
  47. package/src/lib/private/components/smart-crm-configuration/smart-crm-source/smart-crm-source.component.spec.ts +109 -0
  48. package/src/lib/private/components/smart-crm-configuration/smart-crm-source/smart-crm-source.component.ts +129 -0
  49. package/src/lib/private/components/smart-crm-configuration/smart-crm-stages/smart-crm-stage-details/smart-crm-stage-details.component.html +108 -0
  50. package/src/lib/private/components/smart-crm-configuration/smart-crm-stages/smart-crm-stage-details/smart-crm-stage-details.component.scss +3 -0
  51. package/src/lib/private/components/smart-crm-configuration/smart-crm-stages/smart-crm-stage-details/smart-crm-stage-details.component.spec.ts +124 -0
  52. package/src/lib/private/components/smart-crm-configuration/smart-crm-stages/smart-crm-stage-details/smart-crm-stage-details.component.ts +111 -0
  53. package/src/lib/private/components/smart-crm-configuration/smart-crm-stages/smart-crm-stages.component.html +134 -0
  54. package/src/lib/private/components/smart-crm-configuration/smart-crm-stages/smart-crm-stages.component.scss +3 -0
  55. package/src/lib/private/components/smart-crm-configuration/smart-crm-stages/smart-crm-stages.component.spec.ts +103 -0
  56. package/src/lib/private/components/smart-crm-configuration/smart-crm-stages/smart-crm-stages.component.ts +166 -0
  57. package/src/lib/private/components/smart-crm-configuration/smart-crm-widgets/smart-crm-widgets-details/smart-crm-widgets-details.component.html +90 -0
  58. package/src/lib/private/components/smart-crm-configuration/smart-crm-widgets/smart-crm-widgets-details/smart-crm-widgets-details.component.scss +6 -0
  59. package/src/lib/private/components/smart-crm-configuration/smart-crm-widgets/smart-crm-widgets-details/smart-crm-widgets-details.component.spec.ts +105 -0
  60. package/src/lib/private/components/smart-crm-configuration/smart-crm-widgets/smart-crm-widgets-details/smart-crm-widgets-details.component.ts +118 -0
  61. package/src/lib/private/components/smart-crm-configuration/smart-crm-widgets/smart-crm-widgets.component.html +115 -0
  62. package/src/lib/private/components/smart-crm-configuration/smart-crm-widgets/smart-crm-widgets.component.spec.ts +93 -0
  63. package/src/lib/private/components/smart-crm-configuration/smart-crm-widgets/smart-crm-widgets.component.ts +150 -0
  64. package/src/lib/private/components/smart-crm-contacts/smart-crm-contact-details/smart-crm-contact-details.component.html +205 -0
  65. package/src/lib/private/components/smart-crm-contacts/smart-crm-contact-details/smart-crm-contact-details.component.spec.ts +149 -0
  66. package/src/lib/private/components/smart-crm-contacts/smart-crm-contact-details/smart-crm-contact-details.component.ts +184 -0
  67. package/src/lib/private/components/smart-crm-contacts/smart-crm-contact-info/smart-crm-contact-info.component.html +530 -0
  68. package/src/lib/private/components/smart-crm-contacts/smart-crm-contact-info/smart-crm-contact-info.component.scss +112 -0
  69. package/src/lib/private/components/smart-crm-contacts/smart-crm-contact-info/smart-crm-contact-info.component.spec.ts +284 -0
  70. package/src/lib/private/components/smart-crm-contacts/smart-crm-contact-info/smart-crm-contact-info.component.ts +553 -0
  71. package/src/lib/private/components/smart-crm-contacts/smart-crm-contacts.component.html +281 -0
  72. package/src/lib/private/components/smart-crm-contacts/smart-crm-contacts.component.scss +19 -0
  73. package/src/lib/private/components/smart-crm-contacts/smart-crm-contacts.component.spec.ts +138 -0
  74. package/src/lib/private/components/smart-crm-contacts/smart-crm-contacts.component.ts +344 -0
  75. package/src/lib/private/components/smart-crm-customer/smart-crm-customer-success/smart-crm-customer-success.component.html +1 -0
  76. package/src/lib/private/components/smart-crm-customer/smart-crm-customer-success/smart-crm-customer-success.component.spec.ts +18 -0
  77. package/src/lib/private/components/smart-crm-customer/smart-crm-customer-success/smart-crm-customer-success.component.ts +7 -0
  78. package/src/lib/private/components/smart-crm-insight/smart-crm-insight.component.html +27 -0
  79. package/src/lib/private/components/smart-crm-insight/smart-crm-insight.component.spec.ts +19 -0
  80. package/src/lib/private/components/smart-crm-insight/smart-crm-insight.component.ts +7 -0
  81. package/src/lib/private/components/smart-crm-insight/smart-crm-overview/smart-crm-overview.component.html +46 -0
  82. package/src/lib/private/components/smart-crm-insight/smart-crm-overview/smart-crm-overview.component.spec.ts +50 -0
  83. package/src/lib/private/components/smart-crm-insight/smart-crm-overview/smart-crm-overview.component.ts +60 -0
  84. package/src/lib/private/components/smart-crm-leads/smart-crm-leads-details/smart-crm-leads-details.component.html +142 -0
  85. package/src/lib/private/components/smart-crm-leads/smart-crm-leads-details/smart-crm-leads-details.component.spec.ts +125 -0
  86. package/src/lib/private/components/smart-crm-leads/smart-crm-leads-details/smart-crm-leads-details.component.ts +192 -0
  87. package/src/lib/private/components/smart-crm-leads/smart-crm-leads.component.html +176 -0
  88. package/src/lib/private/components/smart-crm-leads/smart-crm-leads.component.spec.ts +98 -0
  89. package/src/lib/private/components/smart-crm-leads/smart-crm-leads.component.ts +160 -0
  90. package/src/lib/private/components/smart-crm-marketing/smart-crm-marketing-list/smart-crm-marketing-contacts/smart-crm-marketing-contacts.component.html +90 -0
  91. package/src/lib/private/components/smart-crm-marketing/smart-crm-marketing-list/smart-crm-marketing-contacts/smart-crm-marketing-contacts.component.spec.ts +68 -0
  92. package/src/lib/private/components/smart-crm-marketing/smart-crm-marketing-list/smart-crm-marketing-contacts/smart-crm-marketing-contacts.component.ts +98 -0
  93. package/src/lib/private/components/smart-crm-marketing/smart-crm-marketing-list/smart-crm-marketing-details/smart-crm-marketing-details.component.html +322 -0
  94. package/src/lib/private/components/smart-crm-marketing/smart-crm-marketing-list/smart-crm-marketing-details/smart-crm-marketing-details.component.spec.ts +156 -0
  95. package/src/lib/private/components/smart-crm-marketing/smart-crm-marketing-list/smart-crm-marketing-details/smart-crm-marketing-details.component.ts +296 -0
  96. package/src/lib/private/components/smart-crm-marketing/smart-crm-marketing-list/smart-crm-marketing-list.component.html +215 -0
  97. package/src/lib/private/components/smart-crm-marketing/smart-crm-marketing-list/smart-crm-marketing-list.component.scss +3 -0
  98. package/src/lib/private/components/smart-crm-marketing/smart-crm-marketing-list/smart-crm-marketing-list.component.spec.ts +117 -0
  99. package/src/lib/private/components/smart-crm-marketing/smart-crm-marketing-list/smart-crm-marketing-list.component.ts +187 -0
  100. package/src/lib/private/components/smart-crm-marketing/smart-crm-marketing-list/smart-crm-marketing-view-details/smart-crm-marketing-view-details.component.html +33 -0
  101. package/src/lib/private/components/smart-crm-marketing/smart-crm-marketing-list/smart-crm-marketing-view-details/smart-crm-marketing-view-details.component.scss +82 -0
  102. package/src/lib/private/components/smart-crm-marketing/smart-crm-marketing-list/smart-crm-marketing-view-details/smart-crm-marketing-view-details.component.spec.ts +63 -0
  103. package/src/lib/private/components/smart-crm-marketing/smart-crm-marketing-list/smart-crm-marketing-view-details/smart-crm-marketing-view-details.component.ts +62 -0
  104. package/src/lib/private/components/smart-crm-marketing/smart-crm-marketing.component.html +27 -0
  105. package/src/lib/private/components/smart-crm-marketing/smart-crm-marketing.component.scss +3 -0
  106. package/src/lib/private/components/smart-crm-marketing/smart-crm-marketing.component.spec.ts +28 -0
  107. package/src/lib/private/components/smart-crm-marketing/smart-crm-marketing.component.ts +13 -0
  108. package/src/lib/private/components/smart-crm-opportunities/smart-crm-board/smart-crm-board.component.html +75 -0
  109. package/src/lib/private/components/smart-crm-opportunities/smart-crm-board/smart-crm-board.component.scss +223 -0
  110. package/src/lib/private/components/smart-crm-opportunities/smart-crm-board/smart-crm-board.component.spec.ts +184 -0
  111. package/src/lib/private/components/smart-crm-opportunities/smart-crm-board/smart-crm-board.component.ts +268 -0
  112. package/src/lib/private/components/smart-crm-opportunities/smart-crm-opportunities-list/smart-crm-opportunities-details/smart-crm-opportunities-details.component.html +273 -0
  113. package/src/lib/private/components/smart-crm-opportunities/smart-crm-opportunities-list/smart-crm-opportunities-details/smart-crm-opportunities-details.component.scss +11 -0
  114. package/src/lib/private/components/smart-crm-opportunities/smart-crm-opportunities-list/smart-crm-opportunities-details/smart-crm-opportunities-details.component.spec.ts +196 -0
  115. package/src/lib/private/components/smart-crm-opportunities/smart-crm-opportunities-list/smart-crm-opportunities-details/smart-crm-opportunities-details.component.ts +391 -0
  116. package/src/lib/private/components/smart-crm-opportunities/smart-crm-opportunities-list/smart-crm-opportunities-info/smart-crm-opportunities-info.component.html +489 -0
  117. package/src/lib/private/components/smart-crm-opportunities/smart-crm-opportunities-list/smart-crm-opportunities-info/smart-crm-opportunities-info.component.scss +104 -0
  118. package/src/lib/private/components/smart-crm-opportunities/smart-crm-opportunities-list/smart-crm-opportunities-info/smart-crm-opportunities-info.component.spec.ts +319 -0
  119. package/src/lib/private/components/smart-crm-opportunities/smart-crm-opportunities-list/smart-crm-opportunities-info/smart-crm-opportunities-info.component.ts +568 -0
  120. package/src/lib/private/components/smart-crm-opportunities/smart-crm-opportunities-list/smart-crm-opportunities-list.component.html +204 -0
  121. package/src/lib/private/components/smart-crm-opportunities/smart-crm-opportunities-list/smart-crm-opportunities-list.component.scss +11 -0
  122. package/src/lib/private/components/smart-crm-opportunities/smart-crm-opportunities-list/smart-crm-opportunities-list.component.spec.ts +123 -0
  123. package/src/lib/private/components/smart-crm-opportunities/smart-crm-opportunities-list/smart-crm-opportunities-list.component.ts +260 -0
  124. package/src/lib/private/components/smart-crm-opportunities/smart-crm-opportunities.component.html +25 -0
  125. package/src/lib/private/components/smart-crm-opportunities/smart-crm-opportunities.component.scss +7 -0
  126. package/src/lib/private/components/smart-crm-opportunities/smart-crm-opportunities.component.spec.ts +38 -0
  127. package/src/lib/private/components/smart-crm-opportunities/smart-crm-opportunities.component.ts +8 -0
  128. package/src/lib/private/components/smart-crm-summary/smart-crm-summary-actions/smart-crm-summary-actions.component.html +213 -0
  129. package/src/lib/private/components/smart-crm-summary/smart-crm-summary-actions/smart-crm-summary-actions.component.scss +73 -0
  130. package/src/lib/private/components/smart-crm-summary/smart-crm-summary-actions/smart-crm-summary-actions.component.spec.ts +147 -0
  131. package/src/lib/private/components/smart-crm-summary/smart-crm-summary-actions/smart-crm-summary-actions.component.ts +292 -0
  132. package/src/lib/private/components/smart-crm-summary/smart-crm-summary-others/smart-crm-summary-others.component.html +309 -0
  133. package/src/lib/private/components/smart-crm-summary/smart-crm-summary-others/smart-crm-summary-others.component.spec.ts +75 -0
  134. package/src/lib/private/components/smart-crm-summary/smart-crm-summary-others/smart-crm-summary-others.component.ts +161 -0
  135. package/src/lib/private/components/smart-crm-summary/smart-crm-summary.component.html +25 -0
  136. package/src/lib/private/components/smart-crm-summary/smart-crm-summary.component.scss +68 -0
  137. package/src/lib/private/components/smart-crm-summary/smart-crm-summary.component.spec.ts +32 -0
  138. package/src/lib/private/components/smart-crm-summary/smart-crm-summary.component.ts +8 -0
  139. package/src/lib/private/components/smart-crm-tabs/smart-crm-tabs.component.spec.ts +43 -0
  140. package/src/lib/private/components/smart-crm-tabs/smart-crm-tabs.component.ts +97 -0
  141. package/src/lib/private/smart-crm-private.module.ts +188 -0
  142. package/src/lib/private/smart-crm-private.routing.module.ts +303 -0
  143. package/src/lib/public/components/smart-crm-newsletter-confirmation/smart-crm-newsletter-confirmation.component.html +27 -0
  144. package/src/lib/public/components/smart-crm-newsletter-confirmation/smart-crm-newsletter-confirmation.component.scss +4 -0
  145. package/src/lib/public/components/smart-crm-newsletter-confirmation/smart-crm-newsletter-confirmation.component.spec.ts +40 -0
  146. package/src/lib/public/components/smart-crm-newsletter-confirmation/smart-crm-newsletter-confirmation.component.ts +57 -0
  147. package/src/lib/public/components/smart-crm-newsletter-unsubscribe/smart-crm-newsletter-unsubscribe.component.html +36 -0
  148. package/src/lib/public/components/smart-crm-newsletter-unsubscribe/smart-crm-newsletter-unsubscribe.component.spec.ts +42 -0
  149. package/src/lib/public/components/smart-crm-newsletter-unsubscribe/smart-crm-newsletter-unsubscribe.component.ts +57 -0
  150. package/src/lib/public/components/smart-crm-signup/smart-crm-signup.component.html +133 -0
  151. package/src/lib/public/components/smart-crm-signup/smart-crm-signup.component.scss +1 -0
  152. package/src/lib/public/components/smart-crm-signup/smart-crm-signup.component.spec.ts +37 -0
  153. package/src/lib/public/components/smart-crm-signup/smart-crm-signup.component.ts +41 -0
  154. package/src/lib/public/smart-crm-public.module.ts +30 -0
  155. package/src/lib/public/smart-crm-public.routing.module.ts +36 -0
  156. package/{lib/shared/interface/crm-account.interface.d.ts → src/lib/shared/interface/crm-account.interface.ts} +10 -3
  157. package/{lib/shared/interface/crm-action.interface.d.ts → src/lib/shared/interface/crm-action.interface.ts} +1 -0
  158. package/{lib/shared/interface/crm-contact.interface.d.ts → src/lib/shared/interface/crm-contact.interface.ts} +2 -0
  159. package/{lib/shared/interface/crm-lead.interface.d.ts → src/lib/shared/interface/crm-lead.interface.ts} +1 -0
  160. package/{lib/shared/interface/crm-newsletter.interface.d.ts → src/lib/shared/interface/crm-newsletter.interface.ts} +3 -1
  161. package/{lib/shared/interface/crm-opportunity.interface.d.ts → src/lib/shared/interface/crm-opportunity.interface.ts} +5 -0
  162. package/{lib/shared/interface/crm-source.interface.d.ts → src/lib/shared/interface/crm-source.interface.ts} +1 -0
  163. package/{lib/shared/interface/crm-stages.interface.d.ts → src/lib/shared/interface/crm-stages.interface.ts} +1 -0
  164. package/{lib/shared/interface/crm-widget.interface.d.ts → src/lib/shared/interface/crm-widget.interface.ts} +1 -0
  165. package/{lib/shared/interface/smart-crm-module.interface.d.ts → src/lib/shared/interface/smart-crm-module.interface.ts} +42 -1
  166. package/src/lib/shared/models/smart-crm.model.ts +199 -0
  167. package/src/lib/shared/routers/routers.ts +23 -0
  168. package/tsconfig.json +29 -0
  169. package/tsconfig.lib.json +25 -0
  170. package/tsconfig.lib.prod.json +9 -0
  171. package/tsconfig.spec.json +11 -0
  172. package/esm2022/index.mjs +0 -48
  173. package/esm2022/lib/private/components/smart-crm-accounts/smart-crm-account-details/smart-crm-account-details.component.mjs +0 -194
  174. package/esm2022/lib/private/components/smart-crm-accounts/smart-crm-account-files/smart-crm-account-files.component.mjs +0 -192
  175. package/esm2022/lib/private/components/smart-crm-accounts/smart-crm-account-info/smart-crm-account-info.component.mjs +0 -589
  176. package/esm2022/lib/private/components/smart-crm-accounts/smart-crm-accounts.component.mjs +0 -348
  177. package/esm2022/lib/private/components/smart-crm-competition/smart-crm-competition/smart-crm-competition.component.mjs +0 -12
  178. package/esm2022/lib/private/components/smart-crm-configuration/smart-crm-actions/smart-crm-actions-details/smart-crm-actions-details.component.mjs +0 -97
  179. package/esm2022/lib/private/components/smart-crm-configuration/smart-crm-actions/smart-crm-actions.component.mjs +0 -118
  180. package/esm2022/lib/private/components/smart-crm-configuration/smart-crm-configuration.component.mjs +0 -35
  181. package/esm2022/lib/private/components/smart-crm-configuration/smart-crm-opportunity-categories/smart-crm-opportunity-categories-details/smart-crm-opportunity-categories-details.component.mjs +0 -87
  182. package/esm2022/lib/private/components/smart-crm-configuration/smart-crm-opportunity-categories/smart-crm-opportunity-categories.component.mjs +0 -119
  183. package/esm2022/lib/private/components/smart-crm-configuration/smart-crm-source/smart-crm-source-details/smart-crm-source-details.component.mjs +0 -79
  184. package/esm2022/lib/private/components/smart-crm-configuration/smart-crm-source/smart-crm-source.component.mjs +0 -107
  185. package/esm2022/lib/private/components/smart-crm-configuration/smart-crm-stages/smart-crm-stage-details/smart-crm-stage-details.component.mjs +0 -96
  186. package/esm2022/lib/private/components/smart-crm-configuration/smart-crm-stages/smart-crm-stages.component.mjs +0 -139
  187. package/esm2022/lib/private/components/smart-crm-configuration/smart-crm-widgets/smart-crm-widgets-details/smart-crm-widgets-details.component.mjs +0 -98
  188. package/esm2022/lib/private/components/smart-crm-configuration/smart-crm-widgets/smart-crm-widgets.component.mjs +0 -125
  189. package/esm2022/lib/private/components/smart-crm-contacts/smart-crm-contact-details/smart-crm-contact-details.component.mjs +0 -159
  190. package/esm2022/lib/private/components/smart-crm-contacts/smart-crm-contact-info/smart-crm-contact-info.component.mjs +0 -465
  191. package/esm2022/lib/private/components/smart-crm-contacts/smart-crm-contacts.component.mjs +0 -281
  192. package/esm2022/lib/private/components/smart-crm-customer/smart-crm-customer-success/smart-crm-customer-success.component.mjs +0 -12
  193. package/esm2022/lib/private/components/smart-crm-insight/smart-crm-insight.component.mjs +0 -14
  194. package/esm2022/lib/private/components/smart-crm-insight/smart-crm-overview/smart-crm-overview.component.mjs +0 -55
  195. package/esm2022/lib/private/components/smart-crm-leads/smart-crm-leads-details/smart-crm-leads-details.component.mjs +0 -173
  196. package/esm2022/lib/private/components/smart-crm-leads/smart-crm-leads.component.mjs +0 -136
  197. package/esm2022/lib/private/components/smart-crm-marketing/smart-crm-marketing-list/smart-crm-marketing-contacts/smart-crm-marketing-contacts.component.mjs +0 -79
  198. package/esm2022/lib/private/components/smart-crm-marketing/smart-crm-marketing-list/smart-crm-marketing-details/smart-crm-marketing-details.component.mjs +0 -266
  199. package/esm2022/lib/private/components/smart-crm-marketing/smart-crm-marketing-list/smart-crm-marketing-list.component.mjs +0 -151
  200. package/esm2022/lib/private/components/smart-crm-marketing/smart-crm-marketing-list/smart-crm-marketing-view-details/smart-crm-marketing-view-details.component.mjs +0 -51
  201. package/esm2022/lib/private/components/smart-crm-marketing/smart-crm-marketing.component.mjs +0 -18
  202. package/esm2022/lib/private/components/smart-crm-opportunities/smart-crm-board/smart-crm-board.component.mjs +0 -230
  203. package/esm2022/lib/private/components/smart-crm-opportunities/smart-crm-opportunities-list/smart-crm-opportunities-details/smart-crm-opportunities-details.component.mjs +0 -317
  204. package/esm2022/lib/private/components/smart-crm-opportunities/smart-crm-opportunities-list/smart-crm-opportunities-info/smart-crm-opportunities-info.component.mjs +0 -477
  205. package/esm2022/lib/private/components/smart-crm-opportunities/smart-crm-opportunities-list/smart-crm-opportunities-list.component.mjs +0 -218
  206. package/esm2022/lib/private/components/smart-crm-opportunities/smart-crm-opportunities.component.mjs +0 -14
  207. package/esm2022/lib/private/components/smart-crm-summary/smart-crm-summary-actions/smart-crm-summary-actions.component.mjs +0 -255
  208. package/esm2022/lib/private/components/smart-crm-summary/smart-crm-summary-others/smart-crm-summary-others.component.mjs +0 -148
  209. package/esm2022/lib/private/components/smart-crm-summary/smart-crm-summary.component.mjs +0 -16
  210. package/esm2022/lib/private/components/smart-crm-tabs/smart-crm-tabs.component.mjs +0 -92
  211. package/esm2022/lib/private/smart-crm-private.module.mjs +0 -327
  212. package/esm2022/lib/private/smart-crm-private.routing.module.mjs +0 -310
  213. package/esm2022/lib/public/components/smart-crm-newsletter-confirmation/smart-crm-newsletter-confirmation.component.mjs +0 -56
  214. package/esm2022/lib/public/components/smart-crm-newsletter-unsubscribe/smart-crm-newsletter-unsubscribe.component.mjs +0 -57
  215. package/esm2022/lib/public/components/smart-crm-signup/smart-crm-signup.component.mjs +0 -35
  216. package/esm2022/lib/public/smart-crm-public.module.mjs +0 -46
  217. package/esm2022/lib/public/smart-crm-public.routing.module.mjs +0 -44
  218. package/esm2022/lib/shared/interface/crm-account.interface.mjs +0 -2
  219. package/esm2022/lib/shared/interface/crm-action.interface.mjs +0 -2
  220. package/esm2022/lib/shared/interface/crm-contact.interface.mjs +0 -2
  221. package/esm2022/lib/shared/interface/crm-lead.interface.mjs +0 -2
  222. package/esm2022/lib/shared/interface/crm-newsletter.interface.mjs +0 -2
  223. package/esm2022/lib/shared/interface/crm-opportunity.interface.mjs +0 -2
  224. package/esm2022/lib/shared/interface/crm-source.interface.mjs +0 -2
  225. package/esm2022/lib/shared/interface/crm-stages.interface.mjs +0 -2
  226. package/esm2022/lib/shared/interface/crm-widget.interface.mjs +0 -2
  227. package/esm2022/lib/shared/interface/smart-crm-module.interface.mjs +0 -2
  228. package/esm2022/lib/shared/models/smart-crm.model.mjs +0 -186
  229. package/esm2022/lib/shared/routers/routers.mjs +0 -23
  230. package/esm2022/posiwise-smart-crm.mjs +0 -5
  231. package/fesm2022/posiwise-smart-crm.mjs +0 -6449
  232. package/fesm2022/posiwise-smart-crm.mjs.map +0 -1
  233. package/lib/private/components/smart-crm-accounts/smart-crm-account-details/smart-crm-account-details.component.d.ts +0 -61
  234. package/lib/private/components/smart-crm-accounts/smart-crm-account-files/smart-crm-account-files.component.d.ts +0 -72
  235. package/lib/private/components/smart-crm-accounts/smart-crm-account-info/smart-crm-account-info.component.d.ts +0 -172
  236. package/lib/private/components/smart-crm-accounts/smart-crm-accounts.component.d.ts +0 -105
  237. package/lib/private/components/smart-crm-competition/smart-crm-competition/smart-crm-competition.component.d.ts +0 -5
  238. package/lib/private/components/smart-crm-configuration/smart-crm-actions/smart-crm-actions-details/smart-crm-actions-details.component.d.ts +0 -37
  239. package/lib/private/components/smart-crm-configuration/smart-crm-actions/smart-crm-actions.component.d.ts +0 -55
  240. package/lib/private/components/smart-crm-configuration/smart-crm-configuration.component.d.ts +0 -11
  241. package/lib/private/components/smart-crm-configuration/smart-crm-opportunity-categories/smart-crm-opportunity-categories-details/smart-crm-opportunity-categories-details.component.d.ts +0 -31
  242. package/lib/private/components/smart-crm-configuration/smart-crm-opportunity-categories/smart-crm-opportunity-categories.component.d.ts +0 -56
  243. package/lib/private/components/smart-crm-configuration/smart-crm-source/smart-crm-source-details/smart-crm-source-details.component.d.ts +0 -28
  244. package/lib/private/components/smart-crm-configuration/smart-crm-source/smart-crm-source.component.d.ts +0 -52
  245. package/lib/private/components/smart-crm-configuration/smart-crm-stages/smart-crm-stage-details/smart-crm-stage-details.component.d.ts +0 -34
  246. package/lib/private/components/smart-crm-configuration/smart-crm-stages/smart-crm-stages.component.d.ts +0 -58
  247. package/lib/private/components/smart-crm-configuration/smart-crm-widgets/smart-crm-widgets-details/smart-crm-widgets-details.component.d.ts +0 -36
  248. package/lib/private/components/smart-crm-configuration/smart-crm-widgets/smart-crm-widgets.component.d.ts +0 -58
  249. package/lib/private/components/smart-crm-contacts/smart-crm-contact-details/smart-crm-contact-details.component.d.ts +0 -48
  250. package/lib/private/components/smart-crm-contacts/smart-crm-contact-info/smart-crm-contact-info.component.d.ts +0 -121
  251. package/lib/private/components/smart-crm-contacts/smart-crm-contacts.component.d.ts +0 -89
  252. package/lib/private/components/smart-crm-customer/smart-crm-customer-success/smart-crm-customer-success.component.d.ts +0 -5
  253. package/lib/private/components/smart-crm-insight/smart-crm-insight.component.d.ts +0 -5
  254. package/lib/private/components/smart-crm-insight/smart-crm-overview/smart-crm-overview.component.d.ts +0 -20
  255. package/lib/private/components/smart-crm-leads/smart-crm-leads-details/smart-crm-leads-details.component.d.ts +0 -45
  256. package/lib/private/components/smart-crm-leads/smart-crm-leads.component.d.ts +0 -58
  257. package/lib/private/components/smart-crm-marketing/smart-crm-marketing-list/smart-crm-marketing-contacts/smart-crm-marketing-contacts.component.d.ts +0 -49
  258. package/lib/private/components/smart-crm-marketing/smart-crm-marketing-list/smart-crm-marketing-details/smart-crm-marketing-details.component.d.ts +0 -63
  259. package/lib/private/components/smart-crm-marketing/smart-crm-marketing-list/smart-crm-marketing-list.component.d.ts +0 -62
  260. package/lib/private/components/smart-crm-marketing/smart-crm-marketing-list/smart-crm-marketing-view-details/smart-crm-marketing-view-details.component.d.ts +0 -21
  261. package/lib/private/components/smart-crm-marketing/smart-crm-marketing.component.d.ts +0 -8
  262. package/lib/private/components/smart-crm-opportunities/smart-crm-board/smart-crm-board.component.d.ts +0 -63
  263. package/lib/private/components/smart-crm-opportunities/smart-crm-opportunities-list/smart-crm-opportunities-details/smart-crm-opportunities-details.component.d.ts +0 -66
  264. package/lib/private/components/smart-crm-opportunities/smart-crm-opportunities-list/smart-crm-opportunities-info/smart-crm-opportunities-info.component.d.ts +0 -122
  265. package/lib/private/components/smart-crm-opportunities/smart-crm-opportunities-list/smart-crm-opportunities-list.component.d.ts +0 -77
  266. package/lib/private/components/smart-crm-opportunities/smart-crm-opportunities.component.d.ts +0 -5
  267. package/lib/private/components/smart-crm-summary/smart-crm-summary-actions/smart-crm-summary-actions.component.d.ts +0 -72
  268. package/lib/private/components/smart-crm-summary/smart-crm-summary-others/smart-crm-summary-others.component.d.ts +0 -40
  269. package/lib/private/components/smart-crm-summary/smart-crm-summary.component.d.ts +0 -5
  270. package/lib/private/components/smart-crm-tabs/smart-crm-tabs.component.d.ts +0 -10
  271. package/lib/private/smart-crm-private.module.d.ts +0 -62
  272. package/lib/private/smart-crm-private.routing.module.d.ts +0 -7
  273. package/lib/public/components/smart-crm-newsletter-confirmation/smart-crm-newsletter-confirmation.component.d.ts +0 -18
  274. package/lib/public/components/smart-crm-newsletter-unsubscribe/smart-crm-newsletter-unsubscribe.component.d.ts +0 -17
  275. package/lib/public/components/smart-crm-signup/smart-crm-signup.component.d.ts +0 -15
  276. package/lib/public/smart-crm-public.module.d.ts +0 -14
  277. package/lib/public/smart-crm-public.routing.module.d.ts +0 -7
  278. package/lib/shared/models/smart-crm.model.d.ts +0 -16
  279. package/lib/shared/routers/routers.d.ts +0 -21
@@ -0,0 +1,292 @@
1
+ import { DOCUMENT } from '@angular/common';
2
+ import { Component, Inject, Injector, OnDestroy, OnInit } from '@angular/core';
3
+ import { ROUTERS } from '../../../../shared/routers/routers';
4
+ import { CrmService } from '@posiwise/smart-crm-shared';
5
+ import uniqBy from 'lodash/uniqBy';
6
+ import swal from 'sweetalert2';
7
+
8
+ import { AppBaseComponent } from '@posiwise/app-base-component';
9
+ import { Subscription } from '@posiwise/common-utilities';
10
+ import { HelperService } from '@posiwise/helper-service';
11
+ import moment from 'moment';
12
+
13
+ @Component({
14
+ selector: 'pw-smart-crm-summary-actions',
15
+ templateUrl: './smart-crm-summary-actions.component.html',
16
+ styleUrls: ['./smart-crm-summary-actions.component.scss']
17
+ })
18
+ export class SmartCrmSummaryActionsComponent extends AppBaseComponent implements OnInit, OnDestroy {
19
+ contactActions = [];
20
+
21
+ isLoaded = false;
22
+
23
+ contactId: number;
24
+
25
+ p: number;
26
+
27
+ p1: number;
28
+
29
+ accountActionSuggested = [];
30
+
31
+ updating = false;
32
+
33
+ actionId: number;
34
+
35
+ dangerColor: boolean;
36
+
37
+ isLoadedSuggested = false;
38
+
39
+ userId: number;
40
+
41
+ showFullComment = false;
42
+
43
+ commentId: number;
44
+
45
+ allSubscriptionMembers: string[];
46
+
47
+ contactActionsAll = [];
48
+
49
+ showFilter = false;
50
+
51
+ subscription: Subscription;
52
+
53
+ selector = '.pending-actions-wrapper';
54
+
55
+ private totalPendingActions = 0;
56
+
57
+ currentPage = 1;
58
+
59
+ routers = ROUTERS;
60
+
61
+ constructor(
62
+ private crmService: CrmService,
63
+ injector: Injector,
64
+ @Inject(DOCUMENT) private document: Document
65
+ ) {
66
+ super(injector);
67
+ }
68
+
69
+ ngOnInit(): void {
70
+ this.getUserSubscription().subscribe(response => {
71
+ this.subscription = response;
72
+ if (this.subscription?.id) {
73
+ this.getAccountActions();
74
+ this.getAccountActionSuggested(this.subscription?.id);
75
+ }
76
+ });
77
+ this.userStore().subscribe(res => {
78
+ if (res) {
79
+ this.userId = res.id;
80
+ }
81
+ });
82
+ }
83
+
84
+ onScrollPendingActions() {
85
+ this.currentPage++;
86
+ const totalPages = Math.ceil(this.totalPendingActions / 5);
87
+ // Prevent API call if all records have been fetched
88
+ if (this.currentPage <= totalPages) {
89
+ this.getAccountActions();
90
+ }
91
+ }
92
+
93
+ /** Function to get all actions */
94
+ private getAccountActions() {
95
+ this.crmService
96
+ .getAccountActions(this.subscription?.id, { page: this.currentPage, page_size: 5 })
97
+ .subscribe({
98
+ next: response => {
99
+ if (response?.crm_account_actions?.length) {
100
+ this.totalPendingActions = response?.object_count;
101
+ this.contactActionsAll = [
102
+ ...this.contactActionsAll,
103
+ ...response.crm_account_actions
104
+ ];
105
+ // unique values
106
+ this.contactActionsAll = [
107
+ ...uniqBy(this.contactActionsAll.reverse(), 'id').reverse()
108
+ ];
109
+ this.contactActionsAll.forEach(data => {
110
+ data.when_short_date = moment(data.when).format('DD-MMM-YYYY');
111
+ const diff = moment(new Date(data.when)).diff(
112
+ moment(new Date()),
113
+ 'days'
114
+ );
115
+ if (moment(new Date(data.when)) < moment(new Date())) {
116
+ data['due'] = `Overdue by ${Math.abs(diff)} days`;
117
+ data['color'] = this.dangerColor;
118
+ } else {
119
+ data['due'] = `In ${diff} days`;
120
+ data['color'] = !this.dangerColor;
121
+ }
122
+ });
123
+ this.contactActionsAll.sort((a, b) => {
124
+ return new Date(a.when).getTime() - new Date(b.when).getTime();
125
+ });
126
+ this.contactActions = [...this.contactActionsAll];
127
+ this.allSubscriptionMembers = [];
128
+ const ownerObject = {};
129
+ this.contactActionsAll.forEach(data => {
130
+ const { id } = data.owner;
131
+ ownerObject[id] = data.owner;
132
+ });
133
+ // eslint-disable-next-line no-restricted-syntax
134
+ for (const i of Object.keys(ownerObject)) {
135
+ this.allSubscriptionMembers.push(ownerObject[i]);
136
+ }
137
+ this.showFilter = false;
138
+ if (this.allSubscriptionMembers.length > 1) {
139
+ this.showFilter = true;
140
+ }
141
+ }
142
+ }
143
+ })
144
+ .add(() => {
145
+ this.isLoaded = true;
146
+ });
147
+ }
148
+
149
+ /** Function to get account action suggested */
150
+ private getAccountActionSuggested(subscription_id: number) {
151
+ this.crmService
152
+ .getAccountActionSuggested(subscription_id)
153
+ .subscribe(response => {
154
+ this.accountActionSuggested = response?.crm_account_actions || [];
155
+ })
156
+ .add(() => {
157
+ this.isLoadedSuggested = true;
158
+ });
159
+ }
160
+
161
+ editComment(event) {
162
+ const comments = this.document.getElementsByClassName('comment-section');
163
+ if (event !== undefined) {
164
+ if (event.target.closest('.comment-section').classList.contains('show-controls')) {
165
+ for (let i = 0; i < comments.length; i++) {
166
+ comments[i].classList.remove('show-controls');
167
+ }
168
+ } else {
169
+ event.target.closest('.comment-section').classList.add('show-controls');
170
+ }
171
+ } else {
172
+ for (let i = 0; i < comments.length; i++) {
173
+ comments[i].classList.remove('show-controls');
174
+ }
175
+ }
176
+
177
+ // if(event.target.closest('.comment-section').classList.find())
178
+ }
179
+
180
+ updateComment(action) {
181
+ const commentObj = {
182
+ comment: action.comment,
183
+ completed: action.completed,
184
+ cancelled: action.cancelled
185
+ };
186
+ this.crmService
187
+ .updateAccountComment(this.subscription?.id, action.id, commentObj)
188
+ .subscribe(() => {
189
+ this.toast.success('comment updated successfully');
190
+ this.editComment(undefined);
191
+ this.getAccountActions();
192
+ });
193
+ }
194
+
195
+ /** Function to set the action as completed */
196
+ setAsCompleted(id: number, action, index: number) {
197
+ return swal
198
+ .fire({
199
+ title: 'Completed',
200
+ html: `Are you sure you want to set as Completed?`,
201
+ showCancelButton: true,
202
+ reverseButtons: true,
203
+ icon: 'warning'
204
+ })
205
+ .then(res => {
206
+ if (res.value) {
207
+ const actionObj = {
208
+ comment: action.comment,
209
+ completed: true,
210
+ cancelled: action.cancelled
211
+ };
212
+ this.crmService
213
+ .updateAccountComment(this.subscription?.id, id, actionObj)
214
+ .subscribe(() => {
215
+ this.toast.success(
216
+ this.translation.translate('Crm.Settings.UpdatedMessage')
217
+ );
218
+ this.contactActions.splice(index, 1);
219
+ });
220
+ }
221
+ });
222
+ }
223
+
224
+ /** Function to set the action as cancelled */
225
+ setAsCancelled(id: number, action, index: number) {
226
+ return swal
227
+ .fire({
228
+ title: 'Cancel',
229
+ html: `Are you sure you want to set as cancelled?`,
230
+ showCancelButton: true,
231
+ reverseButtons: true,
232
+ icon: 'warning'
233
+ })
234
+ .then(res => {
235
+ if (res.value) {
236
+ const actionObj = {
237
+ comment: action.comment,
238
+ completed: action.completed,
239
+ cancelled: true
240
+ };
241
+ this.crmService
242
+ .updateAccountComment(this.subscription?.id, id, actionObj)
243
+ .subscribe(() => {
244
+ this.toast.success(
245
+ this.translation.translate('Crm.Settings.UpdatedMessage')
246
+ );
247
+ this.contactActions.splice(index, 1);
248
+ });
249
+ }
250
+ });
251
+ }
252
+
253
+ /** Function to show DatePicker */
254
+ showDatePicker(actionId: number) {
255
+ this.updating = !this.updating;
256
+ this.actionId = actionId;
257
+ }
258
+
259
+ /** Function to update the date */
260
+ onDateSelect(event, action) {
261
+ const commentObj = {
262
+ when: HelperService.dateFormat(event),
263
+ comment: action.comment,
264
+ completed: action.completed,
265
+ cancelled: action.cancelled
266
+ };
267
+ this.crmService
268
+ .updateAccountComment(this.subscription?.id, action.id, commentObj)
269
+ .subscribe(() => {
270
+ this.toast.success('date updated successfully');
271
+ this.getAccountActions();
272
+ this.updating = false;
273
+ });
274
+ }
275
+
276
+ /** Function to filter the data by user */
277
+ filterByUser(event) {
278
+ const userId = event.target.value;
279
+ if (userId !== '0') {
280
+ const filteredData = this.contactActionsAll.filter(
281
+ action => action.owner_id === Number(userId)
282
+ );
283
+ this.contactActions = filteredData;
284
+ } else {
285
+ this.contactActions = this.contactActionsAll;
286
+ }
287
+ }
288
+
289
+ override ngOnDestroy() {
290
+ super.ngOnDestroy();
291
+ }
292
+ }
@@ -0,0 +1,309 @@
1
+ <div class="row">
2
+ <ng-container class="mt-5"
3
+ *rbacAllow="'Pages.Beta'">
4
+ <!-- Signed up last 30 days -->
5
+ <div class="col-12 col-md-6 mb-3 analytics">
6
+ <h5 class="accordion-heading">Signed up Last 30 Days</h5>
7
+ <div class="w-100 text-center mt-3">
8
+ <ng-template [ngIf]="!signUpLastThirtyDaysLoaded">
9
+ <p-progressSpinner strokeWidth="2"> </p-progressSpinner>
10
+ </ng-template>
11
+ </div>
12
+ <div class="primeng-datatable-container table-responsive"
13
+ *ngIf="signedUpLastThirtyDays?.length">
14
+ <p-table class="table"
15
+ #dt
16
+ [value]="signedUpLastThirtyDays"
17
+ [paginator]="true"
18
+ [rows]="PAGE_SIZE"
19
+ [totalRecords]="signedUpLastThirtyDays.length"
20
+ [lazy]="true">
21
+ <ng-template pTemplate="header">
22
+ <tr>
23
+ <th scope="true">{{ 'Crm.Summary.Owner' | transloco }}</th>
24
+ <th scope="true">{{ 'Crm.Summary.ContactName' | transloco }}</th>
25
+ <th scope="true">{{ 'Crm.Summary.ContactEmail' | transloco }}</th>
26
+ </tr>
27
+ </ng-template>
28
+ <ng-template pTemplate="body"
29
+ let-signUp>
30
+ <tr>
31
+ <td data-head="Owner">
32
+ {{ signUp.owner?.first_name }} {{ signUp.owner?.last_name }}
33
+ </td>
34
+ <td data-head="Contact Name">
35
+ {{ signUp.contact_name }}
36
+ </td>
37
+ <td data-head="Contact Email">
38
+ {{ signUp.contact_email }}
39
+ </td>
40
+ </tr>
41
+ </ng-template>
42
+ </p-table>
43
+ <span class="total-records-count" *ngIf="signedUpLastThirtyDays.length!== 0">{{ 'Label.Total' | transloco }}: {{ signedUpLastThirtyDays.length }}</span>
44
+ </div>
45
+ <div *ngIf="signedUpLastThirtyDays?.length === 0">
46
+ <pw-no-data [withImage]="true" [message]="'Crm.Summary.NoInsightMessage' | transloco"> </pw-no-data>
47
+ </div>
48
+ </div>
49
+ <!-- Active Opportunities -->
50
+ <div class="col-12 col-md-6 mb-3 analytics">
51
+ <h5 class="accordion-heading">Active Opportunities</h5>
52
+ <div class="w-100 text-center mt-3">
53
+ <ng-template [ngIf]="!activeOpportunitiesLoaded">
54
+ <p-progressSpinner strokeWidth="2"> </p-progressSpinner>
55
+ </ng-template>
56
+ </div>
57
+ <div class="primeng-datatable-container table-responsive"
58
+ *ngIf="activeOpportunities?.length">
59
+ <p-table class="table"
60
+ #dt
61
+ [value]="activeOpportunities"
62
+ [paginator]="true"
63
+ [rows]="PAGE_SIZE"
64
+
65
+ [totalRecords]="activeOpportunities.length"
66
+ [lazy]="true">
67
+ <ng-template pTemplate="header">
68
+ <tr>
69
+ <th scope="true">{{ 'Crm.Summary.Title' | transloco }}</th>
70
+ <th scope="true">{{ 'Crm.Summary.ContactName' | transloco }}</th>
71
+ <th scope="true">{{ 'Crm.Summary.Account' | transloco }}</th>
72
+ <th scope="true">{{ 'Crm.Summary.OneTimeAmount' | transloco }}</th>
73
+ <th scope="true">{{ 'Crm.Summary.WinChance' | transloco }}</th>
74
+ <th scope="true">{{ 'Crm.Summary.MonthlyAmount' | transloco }}</th>
75
+ </tr>
76
+ </ng-template>
77
+ <ng-template pTemplate="body"
78
+ let-opportunities>
79
+ <tr>
80
+ <td data-head="Title">
81
+ {{ opportunities.title }}
82
+ </td>
83
+ <td data-head="Contact Name">
84
+ {{ opportunities.crm_contact?.first_name }}
85
+ {{ opportunities.crm_contact?.last_name }}
86
+ </td>
87
+ <td data-head="Account">
88
+ {{ opportunities.crm_account?.name }}
89
+ </td>
90
+ <td data-head="One Time Amount">
91
+ {{ opportunities.one_time_amount / 100 | currency }}
92
+ </td>
93
+ <td data-head="Monthly Amount">
94
+ {{ opportunities.monthly_amount / 100 | currency }}
95
+ </td>
96
+ <td data-head="Win Chance">
97
+ {{ opportunities.win_chances | percent }}
98
+ </td>
99
+ </tr>
100
+ </ng-template>
101
+ </p-table>
102
+ <span class="total-records-count" *ngIf="activeOpportunities.length !== 0">{{ 'Label.Total' | transloco }}: {{ activeOpportunities.length }}</span>
103
+ </div>
104
+ <div *ngIf="activeOpportunities?.length === 0">
105
+ <pw-no-data [withImage]="true" [message]="'Crm.Summary.NoInsightMessage' | transloco"> </pw-no-data>
106
+ </div>
107
+ </div>
108
+ <!-- Accounts at risk -->
109
+ <div class="col-12 col-md-6 mb-3 analytics">
110
+ <h5 class="accordion-heading">Accounts at Risk</h5>
111
+ <div class="w-100 text-center mt-3">
112
+ <ng-template [ngIf]="!accountAtRiskDetailsLoaded">
113
+ <p-progressSpinner strokeWidth="2"> </p-progressSpinner>
114
+ </ng-template>
115
+ </div>
116
+ <div class="primeng-datatable-container table-responsive"
117
+ *ngIf="accountAtRisk?.length">
118
+ <p-table class="table"
119
+ #dt
120
+ [value]="accountAtRisk"
121
+ [paginator]="true"
122
+ [rows]="PAGE_SIZE"
123
+
124
+ [totalRecords]="accountAtRisk.length"
125
+ [lazy]="true">
126
+ <ng-template pTemplate="header">
127
+ <tr>
128
+ <th scope="true">{{ 'Crm.Summary.Owner' | transloco }}</th>
129
+ <th scope="true">{{ 'Crm.Summary.ContactName' | transloco }}</th>
130
+ <th scope="true">{{ 'Crm.Summary.Organisation' | transloco }}</th>
131
+ <th scope="true">{{ 'Crm.Summary.ContactEmail' | transloco }}</th>
132
+ </tr>
133
+ </ng-template>
134
+ <ng-template pTemplate="body"
135
+ let-account>
136
+ <tr>
137
+ <td data-head="Owner">
138
+ {{ account.owner?.first_name }} {{ account.owner?.last_name }}
139
+ </td>
140
+ <td data-head="Contact Name">
141
+ {{ account.contact_name }}
142
+ </td>
143
+ <td data-head="Organisation">
144
+ {{ account.name }}
145
+ </td>
146
+ <td data-head="Contact Email">
147
+ {{ account.contact_email }}
148
+ </td>
149
+ </tr>
150
+ </ng-template>
151
+ </p-table>
152
+ <span class="total-records-count" *ngIf="accountAtRisk.length !== 0">{{ 'Label.Total' | transloco }}: {{ accountAtRisk.length }}</span>
153
+ </div>
154
+ <div *ngIf="accountAtRisk?.length === 0">
155
+ <pw-no-data [withImage]="true" [message]="'Crm.Summary.NoInsightMessage' | transloco"> </pw-no-data>
156
+ </div>
157
+ </div>
158
+ <!-- Contract renewal -->
159
+ <div class="col-12 col-md-6 mb-3 analytics">
160
+ <h5 class="accordion-heading">Contract Renewal</h5>
161
+ <div class="w-100 text-center mt-3">
162
+ <ng-template [ngIf]="!contactRenewalLoaded">
163
+ <p-progressSpinner strokeWidth="2"> </p-progressSpinner>
164
+ </ng-template>
165
+ </div>
166
+ <div class="primeng-datatable-container table-responsive"
167
+ *ngIf="ContractRenewal?.length">
168
+ <p-table class="table"
169
+ #dt
170
+ [value]="ContractRenewal"
171
+ [paginator]="true"
172
+ [rows]="PAGE_SIZE"
173
+
174
+ [totalRecords]="ContractRenewal.length"
175
+ [lazy]="true">
176
+ <ng-template pTemplate="header">
177
+ <tr>
178
+ <th scope="true">{{ 'Crm.Summary.Owner' | transloco }}</th>
179
+ <th scope="true">{{ 'Crm.Summary.ContactName' | transloco }}</th>
180
+ <th scope="true">{{ 'Crm.Summary.Organisation' | transloco }}</th>
181
+ <th scope="true">{{ 'Crm.Summary.ContactEmail' | transloco }}</th>
182
+ </tr>
183
+ </ng-template>
184
+ <ng-template pTemplate="body"
185
+ let-account>
186
+ <tr>
187
+ <td data-head="Owner">
188
+ {{ account.owner?.first_name }} {{ account.owner?.last_name }}
189
+ </td>
190
+ <td data-head="Contact Name">
191
+ {{ account.contact_name }}
192
+ </td>
193
+ <td data-head="Organisation">
194
+ {{ account.name }}
195
+ </td>
196
+ <td data-head="Contact Email">
197
+ {{ account.contact_email }}
198
+ </td>
199
+ </tr>
200
+ </ng-template>
201
+ </p-table>
202
+ <span class="total-records-count" *ngIf="ContractRenewal.length !== 0">{{ 'Label.Total' | transloco }}: {{ ContractRenewal.length }}</span>
203
+ </div>
204
+ <div *ngIf="ContractRenewal?.length === 0">
205
+ <pw-no-data [withImage]="true" [message]="'Crm.Summary.NoInsightMessage' | transloco"> </pw-no-data>
206
+ </div>
207
+ </div>
208
+ <!-- Credit Card Expiring -->
209
+ <div class="col-12 col-md-6 mb-3 analytics">
210
+ <h5 class="accordion-heading">Credit Card Expiring</h5>
211
+ <div class="w-100 text-center mt-3">
212
+ <ng-template [ngIf]="!creditCardExpiringDetailsLoaded">
213
+ <p-progressSpinner strokeWidth="2"> </p-progressSpinner>
214
+ </ng-template>
215
+ </div>
216
+ <div class="primeng-datatable-container table-responsive"
217
+ *ngIf="creditCardExpiring?.length">
218
+ <p-table class="table"
219
+ #dt
220
+ [value]="creditCardExpiring"
221
+ [paginator]="true"
222
+ [rows]="PAGE_SIZE"
223
+
224
+ [totalRecords]="creditCardExpiring.length"
225
+ [lazy]="true">
226
+ <ng-template pTemplate="header">
227
+ <tr>
228
+ <th scope="true">{{ 'Crm.Summary.Owner' | transloco }}</th>
229
+ <th scope="true">{{ 'Crm.Summary.ContactName' | transloco }}</th>
230
+ <th scope="true">{{ 'Crm.Summary.Organisation' | transloco }}</th>
231
+ <th scope="true">{{ 'Crm.Summary.ContactEmail' | transloco }}</th>
232
+ </tr>
233
+ </ng-template>
234
+ <ng-template pTemplate="body"
235
+ let-account>
236
+ <tr>
237
+ <td data-head="Owner">
238
+ {{ account.owner?.first_name }} {{ account.owner?.last_name }}
239
+ </td>
240
+ <td data-head="Contact Name">
241
+ {{ account.contact_name }}
242
+ </td>
243
+ <td data-head="Organisation">
244
+ {{ account.name }}
245
+ </td>
246
+ <td data-head="Contact Email">
247
+ {{ account.contact_email }}
248
+ </td>
249
+ </tr>
250
+ </ng-template>
251
+ </p-table>
252
+ <span class="total-records-count" *ngIf="creditCardExpiring.length !== 0">{{ 'Label.Total' | transloco }}: {{ creditCardExpiring.length }}</span>
253
+ </div>
254
+ <div *ngIf="creditCardExpiring?.length === 0">
255
+ <pw-no-data [withImage]="true" [message]="'Crm.Summary.NoInsightMessage' | transloco"> </pw-no-data>
256
+ </div>
257
+ </div>
258
+ <!-- Magic Moment -->
259
+ <div class="col-12 col-md-6 mb-3 analytics">
260
+ <h5 class="accordion-heading">Magic Moment</h5>
261
+ <div class="w-100 text-center mt-3">
262
+ <ng-template [ngIf]="!magicMomentLoaded">
263
+ <p-progressSpinner strokeWidth="2"> </p-progressSpinner>
264
+ </ng-template>
265
+ </div>
266
+ <div class="primeng-datatable-container table-responsive"
267
+ *ngIf="magicMoment?.length">
268
+ <p-table class="table"
269
+ #dt
270
+ [value]="magicMoment"
271
+ [paginator]="true"
272
+ [rows]="PAGE_SIZE"
273
+
274
+ [totalRecords]="magicMoment.length"
275
+ [lazy]="true">
276
+ <ng-template pTemplate="header">
277
+ <tr>
278
+ <th scope="true">{{ 'Crm.Summary.Owner' | transloco }}</th>
279
+ <th scope="true">{{ 'Crm.Summary.ContactName' | transloco }}</th>
280
+ <th scope="true">{{ 'Crm.Summary.Organisation' | transloco }}</th>
281
+ <th scope="true">{{ 'Crm.Summary.ContactEmail' | transloco }}</th>
282
+ </tr>
283
+ </ng-template>
284
+ <ng-template pTemplate="body"
285
+ let-account>
286
+ <tr>
287
+ <td data-head="Owner">
288
+ {{ account.owner?.first_name }} {{ account.owner?.last_name }}
289
+ </td>
290
+ <td data-head="Contact Name">
291
+ {{ account.contact_name }}
292
+ </td>
293
+ <td data-head="Organisation">
294
+ {{ account.name }}
295
+ </td>
296
+ <td data-head="Contact Email">
297
+ {{ account.contact_email }}
298
+ </td>
299
+ </tr>
300
+ </ng-template>
301
+ </p-table>
302
+ <span class="total-records-count" *ngIf="magicMoment.length !==0 ">{{ 'Label.Total' | transloco }}: {{ magicMoment.length }}</span>
303
+ </div>
304
+ <div *ngIf="magicMoment?.length === 0">
305
+ <pw-no-data [withImage]="true" [message]="'Crm.Summary.NoInsightMessage' | transloco"> </pw-no-data>
306
+ </div>
307
+ </div>
308
+ </ng-container>
309
+ </div>
@@ -0,0 +1,75 @@
1
+ import { CommonServicesModule, PermissionService, UserService } from '@posiwise/common-services';
2
+ import { SharedModule } from '@posiwise/shared-module';
3
+ import { CrmService } from '@posiwise/smart-crm-shared';
4
+ import { DEFAULT_USER, TestHelper } from '@posiwise/test-helpers';
5
+ import { MockProvider } from 'ng-mocks';
6
+ import { of } from 'rxjs';
7
+ import { SmartCrmPrivateModule } from '../../../smart-crm-private.module';
8
+ import { SmartCrmSummaryOthersComponent } from './smart-crm-summary-others.component';
9
+
10
+ class UserServiceMock {
11
+ getUserState() {
12
+ return of({ currentUser: DEFAULT_USER });
13
+ }
14
+ }
15
+
16
+ describe('SmartCrmSummaryOthersComponent', () => {
17
+ const createComponent = TestHelper.createComponentFactory({
18
+ component: SmartCrmSummaryOthersComponent,
19
+ imports: [CommonServicesModule, SharedModule, SmartCrmPrivateModule],
20
+ providers: [
21
+ ...TestHelper.TEST_PROVIDERS,
22
+ MockProvider(PermissionService, {
23
+ evaluatePermissions: () => {
24
+ return true;
25
+ },
26
+ isSuperAdmin: () => {
27
+ return true;
28
+ }
29
+ }),
30
+ MockProvider(CrmService, {
31
+ getCrmAnalytics: (_id: number, type: string) => {
32
+ if (type === 'accounts_active_opportunities') {
33
+ return of([
34
+ {
35
+ id: 1,
36
+ title: 'test ',
37
+ one_time_amount: 1000,
38
+ win_chances: 10,
39
+ starting_at: '2021-02-04T00:00:00.000+00:00',
40
+ owner: {
41
+ first_name: 'coming_soon',
42
+ last_name: 'coming_soon'
43
+ },
44
+ crm_account: {
45
+ id: 6,
46
+ name: 'saurabh'
47
+ },
48
+ crm_contact: null
49
+ }
50
+ ]);
51
+ }
52
+
53
+ return of([]);
54
+ }
55
+ }),
56
+ {
57
+ provide: UserService,
58
+ useClass: UserServiceMock
59
+ }
60
+ ]
61
+ });
62
+
63
+ beforeEach(() => {
64
+ TestHelper.setUpPermissionsAndUser();
65
+ });
66
+
67
+ it('should create', async () => {
68
+ TestHelper.setActivatedRoute({
69
+ parent: { params: of({ slug: 'posiwise-263' }) }
70
+ });
71
+ const spectator = await createComponent();
72
+ expect(spectator.component).toBeTruthy();
73
+ expect(spectator.component.activeOpportunities).toHaveLength(1);
74
+ });
75
+ });