@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,344 @@
1
+ import {
2
+ AfterViewChecked,
3
+ ChangeDetectorRef,
4
+ Component,
5
+ Injector,
6
+ OnDestroy,
7
+ OnInit
8
+ } from '@angular/core';
9
+ import { NavigationEnd } from '@angular/router';
10
+ import { ROUTERS } from '../../../shared/routers/routers';
11
+ import { CrmService } from '@posiwise/smart-crm-shared';
12
+ import { LazyLoadEvent } from 'primeng/api';
13
+ import { Subject } from 'rxjs';
14
+ import { takeUntil } from 'rxjs/operators';
15
+
16
+ import { PAGE_SIZE, Paging, Plotly, User, Subscription } from '@posiwise/common-utilities';
17
+ import { CrmContactResponse } from '../../../shared/interface/crm-contact.interface';
18
+ import { AppBaseComponent } from '@posiwise/app-base-component';
19
+ import { HelperService } from '@posiwise/helper-service';
20
+ import { OpportunityInsight } from '../../../shared/interface/smart-crm-module.interface';
21
+ import { CrmAccount } from '../../../shared/interface/crm-account.interface';
22
+
23
+ @Component({
24
+ selector: 'pw-crm-contacts',
25
+ templateUrl: './smart-crm-contacts.component.html',
26
+ styleUrls: ['./smart-crm-contacts.component.scss']
27
+ })
28
+ export class SmartCrmContactComponent
29
+ extends AppBaseComponent
30
+ implements OnInit, OnDestroy, AfterViewChecked
31
+ {
32
+ data: CrmContactResponse = {
33
+ contacts: [],
34
+ object_count: 0,
35
+ unfiltered_count: 0
36
+ };
37
+
38
+ searchText = '';
39
+
40
+ loading = true;
41
+
42
+ contactId: number;
43
+
44
+ accountData: CrmAccount;
45
+
46
+ accountId: number;
47
+
48
+ subscriptionId: number;
49
+
50
+ hasAccess = false;
51
+
52
+ userId: number;
53
+
54
+ isLoaded = false;
55
+
56
+ filterByPotentials: string;
57
+
58
+ potential = [];
59
+
60
+ labels = [];
61
+
62
+ filterByStatus: string;
63
+
64
+ user: User;
65
+
66
+ contactInsight: OpportunityInsight[];
67
+
68
+ contactGeography: Plotly.Figure;
69
+
70
+ private page = 1;
71
+
72
+ subscription: Subscription;
73
+
74
+ routers = ROUTERS;
75
+
76
+ selectedLabels = [];
77
+ selectedAccount = [];
78
+ accountDropDown = [];
79
+ crmAccountIds: string;
80
+ constructor(
81
+ private crmService: CrmService,
82
+ injector: Injector,
83
+ private cdr: ChangeDetectorRef
84
+ ) {
85
+ super(injector);
86
+ }
87
+
88
+ ngOnInit() {
89
+ this.route.params.subscribe(data => {
90
+ this.contactId = Number(data['accountId']);
91
+ });
92
+ this.getUserSubscription().subscribe(response => {
93
+ this.subscription = response;
94
+ if (this.subscription?.id) {
95
+ this.getDefaultValues(this.subscription?.id);
96
+ this.getTableState();
97
+ this.hasAccess = this.hasAdminAccess(this.subscription?.id);
98
+ this.getUserInfo();
99
+ this.getAccountsDropdown();
100
+ }
101
+ });
102
+ }
103
+
104
+ ngAfterViewChecked() {
105
+ this.cdr.detectChanges();
106
+ }
107
+ /**get accounts dropdown */
108
+ public getAccountsDropdown() {
109
+ this.crmService.getAllAccounts(this.subscription?.id).subscribe({
110
+ next: res => {
111
+ this.accountDropDown = res?.accounts.map(x => {
112
+ return {
113
+ id: x?.id,
114
+ name: x?.name
115
+ };
116
+ });
117
+ }
118
+ });
119
+ }
120
+ /**select option from account dropdown */
121
+ onSelectAccount() {
122
+ this.crmAccountIds = this.selectedAccount.map(y => y.id).join();
123
+ this.getAllContacts({
124
+ page: this.page,
125
+ page_size: PAGE_SIZE
126
+ });
127
+ }
128
+ private getTableState() {
129
+ this.searchText =
130
+ JSON.parse(this.localStorage.getItem('smart-crm-contacts'))?.filters?.global.value ||
131
+ '';
132
+ const data = JSON.parse(this.localStorage.getItem('crmContactsState'));
133
+ this.filterByStatus = data?.label;
134
+ this.filterByPotentials = data?.potential;
135
+ this.selectedLabels = data?.label ? data?.label.split(',') : [];
136
+ }
137
+
138
+ onLazyLoad(event: LazyLoadEvent) {
139
+ const pageDetails = HelperService.onTableLazyLoad(event);
140
+ this.page = pageDetails.page;
141
+ this.getData({
142
+ page: this.page,
143
+ page_size: PAGE_SIZE,
144
+ order_by: pageDetails.sortField,
145
+ order_direction: pageDetails.sortOrder,
146
+ search: this.searchText
147
+ });
148
+ }
149
+
150
+ private getData(paging: Paging) {
151
+ if (this.contactId > 0) {
152
+ this.getAccountContacts(paging);
153
+ this.getAccountDetail();
154
+ } else {
155
+ this.getAllContacts(paging);
156
+ }
157
+ }
158
+
159
+ /** Function to get user details */
160
+ private getUserInfo() {
161
+ this.userStore().subscribe(user => {
162
+ if (user) {
163
+ this.user = user;
164
+ this.userId = user.id;
165
+ if (this.permissionService.isGranted('Pages.Beta')) {
166
+ this.getContactInsight();
167
+ this.getContactGeography();
168
+ }
169
+ }
170
+ });
171
+ }
172
+
173
+ /** Function to get all contacts */
174
+ private getAllContacts(paging: Paging) {
175
+ this.getUserSubscriptionId().subscribe(id => {
176
+ this.subscriptionId = id;
177
+ if (this.subscriptionId) {
178
+ this.crmService
179
+ .getAllContacts(
180
+ this.subscriptionId,
181
+ this.filterByPotentials || '',
182
+ paging,
183
+ this.filterByStatus || '',
184
+ this.crmAccountIds || ''
185
+ )
186
+ .subscribe(response => {
187
+ this.data = response;
188
+ })
189
+ .add(() => {
190
+ this.isLoaded = true;
191
+ this.loading = false;
192
+ });
193
+ }
194
+ });
195
+ }
196
+
197
+ /** Function to get the contacts related to accounts */
198
+ private getAccountContacts(paging: Paging) {
199
+ this.data.contacts = [];
200
+ this.isLoaded = true;
201
+ this.getUserSubscriptionId().subscribe(id => {
202
+ this.subscriptionId = id;
203
+ if (this.subscriptionId) {
204
+ this.crmService
205
+ .getAccountContacts(
206
+ this.contactId,
207
+ this.subscriptionId,
208
+ this.filterByPotentials || '',
209
+ paging,
210
+ this.filterByStatus || ''
211
+ )
212
+ .subscribe(response => {
213
+ this.data = response;
214
+ this.loading = false;
215
+ });
216
+ }
217
+ });
218
+ }
219
+
220
+ /** Function to get the account name */
221
+ private getAccountDetail() {
222
+ this.crmService
223
+ .getAccountDetail(this.subscription?.id, this.contactId)
224
+ .subscribe(response => {
225
+ this.accountData = response;
226
+ this.accountId = response.id;
227
+ });
228
+ }
229
+
230
+ /** Function to delete contact */
231
+ onDelete(id: number) {
232
+ HelperService.raiseDeletePopup().then(resp => {
233
+ if (resp.value) {
234
+ this.crmService.deleteContact(this.subscription?.id, id).subscribe(() => {
235
+ this.toast.success(
236
+ this.translation.translate('Crm.ContactMessage.DeletedMessage')
237
+ );
238
+ this.data.contacts = [];
239
+ this.getAllContacts({
240
+ page: this.page,
241
+ page_size: PAGE_SIZE,
242
+ search: this.searchText
243
+ });
244
+ });
245
+ }
246
+ });
247
+ }
248
+
249
+ /** Function to filter by potential */
250
+ filterByPotential(event) {
251
+ this.filterByPotentials = event.target.value;
252
+ this.localStorage.setItem$(
253
+ 'crmContactsState',
254
+ JSON.stringify({ label: this.filterByStatus, potential: this.filterByPotentials })
255
+ );
256
+ if (this.contactId > 0) {
257
+ this.getAccountContacts({
258
+ page: this.page,
259
+ page_size: PAGE_SIZE
260
+ });
261
+ this.getAccountDetail();
262
+ } else {
263
+ this.getAllContacts({
264
+ page: this.page,
265
+ page_size: PAGE_SIZE
266
+ });
267
+ }
268
+ }
269
+
270
+ /** Function to call contact insight */
271
+ private getContactInsight() {
272
+ this.crmService
273
+ .getCrmAnalytics(this.subscription?.id, 'contacts_insights')
274
+ .subscribe(response => {
275
+ if (typeof response === 'object' && Object.keys(response).length === 0) {
276
+ this.contactInsight = [];
277
+ } else this.contactInsight = response;
278
+ });
279
+ }
280
+
281
+ /** Function to call contact geography */
282
+ getContactGeography() {
283
+ this.crmService
284
+ .getCrmAnalytics(this.subscription?.id, 'contacts_geography')
285
+ .subscribe(response => {
286
+ this.contactGeography = response;
287
+ });
288
+ }
289
+
290
+ navigateToOpportunities() {
291
+ this.router.navigate([`/${this.subscription?.slug}${this.routers.opportunityAdd}`], {
292
+ queryParams: { account_id: this.accountId }
293
+ });
294
+ }
295
+
296
+ getDefaultValues(id: number) {
297
+ this.crmService.getCrmContactDefaultValues(id).subscribe(res => {
298
+ this.potential = res['potential'];
299
+ const label = res['labels'];
300
+ label.forEach(val => {
301
+ const data = {
302
+ label: val,
303
+ value: val
304
+ };
305
+ this.labels.push(data);
306
+ });
307
+ this.getTableState();
308
+ });
309
+ }
310
+
311
+ onLabelChange(event) {
312
+ this.filterByStatus = event.value.join();
313
+ this.localStorage.setItem$(
314
+ 'crmContactsState',
315
+ JSON.stringify({ label: this.filterByStatus, potential: this.filterByPotentials })
316
+ );
317
+ if (this.contactId > 0) {
318
+ this.getAccountContacts({
319
+ page: this.page,
320
+ page_size: PAGE_SIZE
321
+ });
322
+ this.getAccountDetail();
323
+ } else {
324
+ this.getAllContacts({
325
+ page: this.page,
326
+ page_size: PAGE_SIZE
327
+ });
328
+ }
329
+ }
330
+
331
+ override ngOnDestroy() {
332
+ const notifier = new Subject();
333
+ this.router.events.pipe(takeUntil(notifier)).subscribe(event => {
334
+ if (event instanceof NavigationEnd) {
335
+ if (!event.urlAfterRedirects.includes('/contacts')) {
336
+ this.localStorage.removeItem$('smart-crm-contacts');
337
+ this.localStorage.removeItem$('crmContactsState');
338
+ notifier.complete();
339
+ }
340
+ }
341
+ });
342
+ super.ngOnDestroy();
343
+ }
344
+ }
@@ -0,0 +1 @@
1
+ <pw-coming-soon message="Customer Success"></pw-coming-soon>
@@ -0,0 +1,18 @@
1
+ import { CommonServicesModule } from '@posiwise/common-services';
2
+ import { SharedModule } from '@posiwise/shared-module';
3
+ import { TestHelper } from '@posiwise/test-helpers';
4
+ import { SmartCrmPrivateModule } from '../../../smart-crm-private.module';
5
+ import { SmartCrmCustomerSuccessComponent } from './smart-crm-customer-success.component';
6
+
7
+ describe('SmartCrmCustomerSuccessComponent', () => {
8
+ const createComponent = TestHelper.createComponentFactory({
9
+ component: SmartCrmCustomerSuccessComponent,
10
+ imports: [CommonServicesModule, SharedModule, SmartCrmPrivateModule]
11
+ });
12
+
13
+ it('should create', async () => {
14
+ const spectator = await createComponent();
15
+
16
+ expect(spectator.component).toBeTruthy();
17
+ });
18
+ });
@@ -0,0 +1,7 @@
1
+ import { Component } from '@angular/core';
2
+
3
+ @Component({
4
+ selector: 'pw-smart-crm-customer-success',
5
+ templateUrl: './smart-crm-customer-success.component.html'
6
+ })
7
+ export class SmartCrmCustomerSuccessComponent {}
@@ -0,0 +1,27 @@
1
+ <div class="row">
2
+ <div class="col-12 mb-0">
3
+ <h2>Insight</h2>
4
+ <p>
5
+ You'll find below some insights for your CRM. <br />
6
+ Please note that the graphs are refreshed every few hours.
7
+ </p>
8
+ <ul ngbNav
9
+ #nav="ngbNav"
10
+ class="nav-tabs">
11
+ <li [ngbNavItem]="1">
12
+ <a ngbNavLink>Overview</a>
13
+ <ng-template ngbNavContent>
14
+ <pw-smart-crm-overview></pw-smart-crm-overview>
15
+ </ng-template>
16
+ </li>
17
+ <li [ngbNavItem]="2">
18
+ <a ngbNavLink>Analysis</a>
19
+ <ng-template ngbNavContent>
20
+ <pw-coming-soon message="Analysis"></pw-coming-soon>
21
+ </ng-template>
22
+ </li>
23
+ </ul>
24
+
25
+ <div [ngbNavOutlet]="nav"></div>
26
+ </div>
27
+ </div>
@@ -0,0 +1,19 @@
1
+ import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
2
+ import { CommonServicesModule } from '@posiwise/common-services';
3
+ import { SharedModule } from '@posiwise/shared-module';
4
+ import { TestHelper } from '@posiwise/test-helpers';
5
+ import { SmartCrmInsightComponent } from './smart-crm-insight.component';
6
+ import { SmartCrmPrivateModule } from '../../smart-crm-private.module';
7
+
8
+ describe('SmartCrmInsightComponent', () => {
9
+ const createComponent = TestHelper.createComponentFactory({
10
+ component: SmartCrmInsightComponent,
11
+ imports: [CommonServicesModule, SharedModule, SmartCrmPrivateModule],
12
+ schemas: [CUSTOM_ELEMENTS_SCHEMA]
13
+ });
14
+
15
+ it('should create', async () => {
16
+ const spectator = await createComponent();
17
+ expect(spectator.component).toBeTruthy();
18
+ });
19
+ });
@@ -0,0 +1,7 @@
1
+ import { Component } from '@angular/core';
2
+
3
+ @Component({
4
+ selector: 'pw-smart-crm-insight',
5
+ templateUrl: './smart-crm-insight.component.html'
6
+ })
7
+ export class SmartCrmInsightComponent {}
@@ -0,0 +1,46 @@
1
+ <div class="row">
2
+ <div class="col-12 mb-3">
3
+ <div *ngIf="hasAccess">
4
+ <div class="row">
5
+ <div class="w-100 text-center mt-3"
6
+ *ngIf="!isLoaded">
7
+ <p-progressSpinner strokeWidth="2"> </p-progressSpinner>
8
+ </div>
9
+ <!-- Activities -->
10
+ <div class="col-12 col-lg-8 my-3 px-2">
11
+ <ng-template [ngIf]="graph">
12
+ <plotly-plot [data]="graph?.data"
13
+ [layout]="graph?.layout"></plotly-plot>
14
+ </ng-template>
15
+ </div>
16
+ <!-- Opportunities funnel -->
17
+ <div class="col-12 col-lg-4 my-3 px-2"
18
+ *rbacAllow="'Pages.Beta'">
19
+ <ng-template [ngIf]="graph">
20
+ <plotly-plot [data]="graph?.data"
21
+ [layout]="graph?.layout"></plotly-plot>
22
+ </ng-template>
23
+ </div>
24
+ <div class="col-12 col-lg-4 my-3 px-2"
25
+ *rbacAllow="'Pages.Beta'">
26
+ <ng-template [ngIf]="graph">
27
+ <plotly-plot [data]="graph?.data"
28
+ [layout]="graph?.layout"></plotly-plot>
29
+ </ng-template>
30
+ </div>
31
+ <!-- Opportunities timeline -->
32
+ <div class="col-12 col-lg-8 my-3 px-2"
33
+ *rbacAllow="'Pages.Beta'">
34
+ <ng-template [ngIf]="graph">
35
+ <plotly-plot [data]="graph?.data"
36
+ [layout]="graph?.layout"></plotly-plot>
37
+ </ng-template>
38
+ </div>
39
+ </div>
40
+ </div>
41
+ <div *ngIf="!hasAccess && isLoaded"
42
+ class="w-100">
43
+ <pw-no-data [withImage]="true" [message]="'Crm.Insight.NoDataMessage' | transloco"> </pw-no-data>
44
+ </div>
45
+ </div>
46
+ </div>
@@ -0,0 +1,50 @@
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 { SmartCrmOverviewComponent } from './smart-crm-overview.component';
9
+
10
+ class UserServiceMock {
11
+ getUserState() {
12
+ return of({ currentUser: DEFAULT_USER });
13
+ }
14
+ }
15
+ describe('SmartCrmOverviewComponent', () => {
16
+ const createComponent = TestHelper.createComponentFactory({
17
+ component: SmartCrmOverviewComponent,
18
+ imports: [CommonServicesModule, SharedModule, SmartCrmPrivateModule],
19
+ providers: [
20
+ ...TestHelper.TEST_PROVIDERS,
21
+ MockProvider(PermissionService, {
22
+ evaluatePermissions: () => {
23
+ return true;
24
+ },
25
+ isGranted: () => {
26
+ return true;
27
+ }
28
+ }),
29
+ MockProvider(CrmService, {
30
+ getChartData: () => of({ data: [], layout: {} })
31
+ }),
32
+ {
33
+ provide: UserService,
34
+ useClass: UserServiceMock
35
+ }
36
+ ]
37
+ });
38
+
39
+ beforeEach(() => {
40
+ TestHelper.setUpPermissionsAndUser();
41
+ });
42
+
43
+ it('should create', async () => {
44
+ TestHelper.setActivatedRoute({
45
+ parent: { params: of({ slug: 'posiwise-263' }) }
46
+ });
47
+ const spectator = await createComponent();
48
+ expect(spectator.component).toBeTruthy();
49
+ });
50
+ });
@@ -0,0 +1,60 @@
1
+ import { Component, Injector, OnDestroy, OnInit } from '@angular/core';
2
+ import { CrmService } from '@posiwise/smart-crm-shared';
3
+
4
+ import { AppBaseComponent } from '@posiwise/app-base-component';
5
+ import { Plotly } from '@posiwise/common-utilities';
6
+
7
+ @Component({
8
+ selector: 'pw-smart-crm-overview',
9
+ templateUrl: './smart-crm-overview.component.html'
10
+ })
11
+ export class SmartCrmOverviewComponent extends AppBaseComponent implements OnInit, OnDestroy {
12
+ graph: Plotly.Figure;
13
+
14
+ subscriptionId: number;
15
+
16
+ hasAccess = false;
17
+
18
+ userId: number;
19
+
20
+ isLoaded = false;
21
+
22
+ constructor(
23
+ private crmService: CrmService,
24
+ injector: Injector
25
+ ) {
26
+ super(injector);
27
+ }
28
+
29
+ ngOnInit() {
30
+ this.userStore().subscribe(user => {
31
+ if (user) {
32
+ if (this.permissionService.isGranted('Pages.Beta')) {
33
+ this.getChartData();
34
+ }
35
+ }
36
+ });
37
+ }
38
+
39
+ /** Function to get the data for the graph */
40
+ private getChartData() {
41
+ this.getUserSubscriptionId().subscribe(subscriptionId => {
42
+ this.subscriptionId = subscriptionId;
43
+ if (this.subscriptionId) {
44
+ this.hasAccess = this.hasAdminAccess(this.subscriptionId);
45
+ this.crmService
46
+ .getChartData(this.subscriptionId)
47
+ .subscribe(response => {
48
+ this.graph = response;
49
+ })
50
+ .add(() => {
51
+ this.isLoaded = true;
52
+ });
53
+ }
54
+ });
55
+ }
56
+
57
+ override ngOnDestroy() {
58
+ super.ngOnDestroy();
59
+ }
60
+ }