@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,792 @@
1
+ import { DOCUMENT } from '@angular/common';
2
+ import {
3
+ AfterViewChecked,
4
+ ChangeDetectorRef,
5
+ Component,
6
+ EventEmitter,
7
+ Inject,
8
+ Injector,
9
+ OnDestroy,
10
+ OnInit
11
+ } from '@angular/core';
12
+ import { UntypedFormGroup, Validators } from '@angular/forms';
13
+ import { NgbModal } from '@ng-bootstrap/ng-bootstrap';
14
+ import { CRM_ACCOUNT_FILES_PATH } from '@posiwise/smart-crm-shared';
15
+ import { AppSmartCrm } from '../../../../shared/models/smart-crm.model';
16
+ import { ROUTERS } from '../../../../shared/routers/routers';
17
+ import { CrmService } from '@posiwise/smart-crm-shared';
18
+ import { LogoCacheService } from '@posiwise/common-services';
19
+ import { UploadFile, UploadInput, UploadOutput, UploadStatus, UploaderOptions } from 'ngx-uploader';
20
+ import { LazyLoadEvent } from 'primeng/api';
21
+ import { Observable } from 'rxjs';
22
+ import swal from 'sweetalert2';
23
+
24
+ import {
25
+ DOCUMENT_TYPE_EXT,
26
+ PAGE_SIZE,
27
+ TOKEN_HEADER_KEY,
28
+ Paging,
29
+ Subscription,
30
+ User,
31
+ Country
32
+ } from '@posiwise/common-utilities';
33
+ import { AppBaseComponent } from '@posiwise/app-base-component';
34
+ import {
35
+ AuthService,
36
+ CommonService,
37
+ FormHelperService,
38
+ GeoService,
39
+ SubscriptionService
40
+ } from '@posiwise/common-services';
41
+ import { HelperService } from '@posiwise/helper-service';
42
+ import moment from 'moment';
43
+ import {
44
+ CrmOwner,
45
+ CrmopportunityContact,
46
+ FilteredCrmComment,
47
+ FilteredData,
48
+ OrganizationIndustry,
49
+ OrganizationSize,
50
+ OrganizationType,
51
+ SmartCrmAction
52
+ } from 'libs/smart-crm/src/lib/shared/interface/smart-crm-module.interface';
53
+ import { CrmAccount } from 'libs/smart-crm/src/lib/shared/interface/crm-account.interface';
54
+
55
+ interface SubscriptionMember {
56
+ id: number;
57
+ first_name: string;
58
+ last_name: string;
59
+ email: string;
60
+ // Other properties of SubscriptionMember
61
+ }
62
+
63
+ @Component({
64
+ selector: 'pw-smart-crm-company-info',
65
+ templateUrl: './smart-crm-account-info.component.html',
66
+ styleUrls: ['./smart-crm-account-info.component.scss']
67
+ })
68
+ export class SmartCrmCompanyInfoComponent
69
+ extends AppBaseComponent
70
+ implements OnInit, OnDestroy, AfterViewChecked
71
+ {
72
+ subscription: Subscription;
73
+
74
+ actionControls: UntypedFormGroup;
75
+
76
+ aboutControls: UntypedFormGroup;
77
+
78
+ accountId: number;
79
+
80
+ userId: number;
81
+
82
+ isFormEdit = true;
83
+
84
+ user: User;
85
+
86
+ allSubscriptionMembers: SubscriptionMember[];
87
+
88
+ filteredOwner: SubscriptionMember[];
89
+
90
+ data: CrmAccount;
91
+
92
+ isDataLoaded = false;
93
+
94
+ submitted = false;
95
+
96
+ accountComments = [];
97
+
98
+ hasAccess = false;
99
+
100
+ body: string;
101
+
102
+ editComment = false;
103
+
104
+ filteredContact: { displayName: string }[];
105
+
106
+ private isContactValid = true;
107
+
108
+ filteredContactComment: FilteredCrmComment[];
109
+
110
+ contactId: number;
111
+
112
+ isLoaded = false;
113
+
114
+ totalRecords: number;
115
+
116
+ totalRecordsUnFiltered = 0;
117
+
118
+ loading = true;
119
+
120
+ searchText = '';
121
+
122
+ potential = ['low', 'medium', 'high'];
123
+
124
+ filterByPotentials: string;
125
+
126
+ showFullComment = false;
127
+
128
+ commentId: number;
129
+
130
+ status: string[];
131
+
132
+ priority: FilteredData[];
133
+
134
+ source: FilteredData[];
135
+
136
+ organizationSizes$: Observable<OrganizationSize[]>;
137
+
138
+ organizationIndustries$: Observable<OrganizationIndustry[]>;
139
+
140
+ countries$: Observable<Country[]>;
141
+
142
+ organizationTypes$: Observable<OrganizationType[]>;
143
+
144
+ owner: CrmOwner;
145
+
146
+ actions: SmartCrmAction[];
147
+
148
+ buttonDisable: boolean;
149
+
150
+ isDisabled = false;
151
+
152
+ dangerColor: boolean;
153
+
154
+ updating = false;
155
+
156
+ actionId: number;
157
+
158
+ accountVersioning: string[];
159
+
160
+ contacts: CrmopportunityContact[];
161
+
162
+ options: UploaderOptions;
163
+
164
+ uploadInput: EventEmitter<UploadInput>;
165
+
166
+ files: UploadFile[];
167
+
168
+ token: string;
169
+
170
+ dragOver: boolean;
171
+
172
+ Done: boolean;
173
+
174
+ direction = '';
175
+
176
+ private page = 1;
177
+
178
+ currentPage = 1;
179
+
180
+ private totalContacts = 0;
181
+
182
+ selector = '.timeline-container';
183
+
184
+ submitAction = false;
185
+
186
+ subscriptionId: number;
187
+
188
+ routers = ROUTERS;
189
+ buttonBusy = false;
190
+
191
+ constructor(
192
+ injector: Injector,
193
+ private crmService: CrmService,
194
+ private subscriptionService: SubscriptionService,
195
+ private geoService: GeoService,
196
+ private commonService: CommonService,
197
+ private modalService: NgbModal,
198
+ private authService: AuthService,
199
+ private cdr: ChangeDetectorRef,
200
+ private logoCacheService: LogoCacheService,
201
+ @Inject(DOCUMENT) private document: Document
202
+ ) {
203
+ super(injector);
204
+ this.options = { concurrency: 1, maxUploads: 3 };
205
+ this.uploadInput = new EventEmitter<UploadInput>();
206
+ this.token = btoa(this.authService.getToken());
207
+ this.files = [];
208
+ this.actionControls = AppSmartCrm.getAccountActionsForm(this.isDisabled);
209
+ this.aboutControls = AppSmartCrm.getAccountsForm();
210
+ }
211
+
212
+ ngOnInit() {
213
+ this.countries$ = this.geoService.getCountries();
214
+ this.organizationIndustries$ = this.commonService.getOrganizationIndustries();
215
+ this.organizationTypes$ = this.commonService.getOrganizationTypes();
216
+ this.organizationSizes$ = this.commonService.getOrganizationSizes();
217
+ this.userStore().subscribe(res => {
218
+ if (res) {
219
+ this.userId = res.id;
220
+ this.actionControls.get('owner_id').setValue(res.id);
221
+ }
222
+ });
223
+ this.getUserSubscription().subscribe(response => {
224
+ this.subscription = response;
225
+ if (this.subscription?.id) {
226
+ this.hasAccess = this.hasAdminAccess(this.subscription.id);
227
+ this.getActions();
228
+ this.accountDefaultValues(this.subscription.id);
229
+ this.aboutControls.get('subscription_id').setValue(this.subscription?.id);
230
+ }
231
+ this.route.params.subscribe(data => {
232
+ this.accountId = Number(data['id']);
233
+ if (this.accountId) {
234
+ this.getAccountDetails();
235
+ this.getContactVersion();
236
+ }
237
+ });
238
+ });
239
+ this.getAllComments();
240
+ }
241
+
242
+ ngAfterViewChecked() {
243
+ this.cdr.detectChanges();
244
+ }
245
+
246
+ onLazyLoad(event: LazyLoadEvent) {
247
+ const pageDetails = HelperService.onTableLazyLoad(event);
248
+ this.page = pageDetails.page;
249
+ this.getAccountContacts({
250
+ page: this.page,
251
+ page_size: PAGE_SIZE,
252
+ order_by: pageDetails.sortField,
253
+ order_direction: pageDetails.sortOrder,
254
+ search: this.searchText
255
+ });
256
+ }
257
+
258
+ /** Function to call account default values */
259
+ private accountDefaultValues(id) {
260
+ this.crmService.getCrmAccountDefaultValues(id).subscribe(response => {
261
+ this.status = response.status;
262
+ this.priority = response.priority;
263
+ this.source = response.source;
264
+ });
265
+ }
266
+
267
+ /** Function to call account by ID */
268
+ getAccountDetails() {
269
+ this.isDataLoaded = false;
270
+ this.crmService
271
+ .getAccountDetail(this.subscription?.id, this.accountId)
272
+ .subscribe(response => {
273
+ this.data = response;
274
+ this.aboutControls.patchValue(response);
275
+ this.aboutControls.get('owner_id').setValue(response.owner);
276
+ })
277
+ .add(() => {
278
+ this.isDataLoaded = true;
279
+ });
280
+ }
281
+
282
+ get f() {
283
+ return this.aboutControls.controls;
284
+ }
285
+
286
+ updateAccountInfo() {
287
+ this.buttonBusy = true;
288
+ if (!this.aboutControls.valid) {
289
+ this.buttonBusy = false;
290
+ this.submitted = true;
291
+ } else {
292
+ this.aboutControls
293
+ .get('owner_id')
294
+ .setValue(this.aboutControls.get('owner_id').value.id);
295
+ this.crmService
296
+ .updateAccount(this.subscription?.id, this.accountId, this.aboutControls.value)
297
+ .subscribe(() => {
298
+ this.toast.success(
299
+ this.translation.translate('Crm.AccountMessage.UpdatedMessage')
300
+ );
301
+ this.isFormEdit = true;
302
+ this.getAccountDetails();
303
+ })
304
+ .add(() => {
305
+ this.buttonBusy = false;
306
+ this.submitted = false;
307
+ });
308
+ }
309
+ }
310
+
311
+ onScrollTimeline() {
312
+ this.currentPage++;
313
+ const totalPages = Math.ceil(this.totalContacts / 5);
314
+ // Prevent API call if all messages have been fetched
315
+ if (this.currentPage <= totalPages) {
316
+ this.getAllComments();
317
+ }
318
+ }
319
+
320
+ /** Function to save comment */
321
+ onSave() {
322
+ this.submitAction = true;
323
+ const form = this.actionControls.value;
324
+ form.owner_id = this.data?.owner_id;
325
+ form.crm_account_id = this.accountId;
326
+ form.crm_contact_id = form?.crm_contact_id?.id;
327
+ form.when = HelperService.dateFormat(form.when);
328
+ if (this.actionControls.invalid) {
329
+ FormHelperService.validateAllFormFields(this.actionControls);
330
+ } else {
331
+ this.buttonBusy = true;
332
+ this.crmService
333
+ .postAccountComment(this.subscription?.id, form)
334
+ .subscribe(() => {
335
+ this.actionControls.get('comment').reset();
336
+ this.getAllComments();
337
+ this.toast.success(
338
+ this.translation.translate('Crm.AccountMessage.CommentSubmittedMessage')
339
+ );
340
+ })
341
+ .add(() => {
342
+ this.submitAction = false;
343
+ this.buttonBusy = false;
344
+ });
345
+ }
346
+ }
347
+
348
+ showDatePicker(event, id) {
349
+ this.actionControls.get('when').setValidators([Validators.required]);
350
+ const actionButtons = this.document.getElementsByClassName('action-btn');
351
+ for (let i = 0; i < actionButtons.length; i++) {
352
+ actionButtons[i].classList.remove('active');
353
+ }
354
+ event.target.classList.add('active');
355
+ this.actionControls.get('crm_action_id').setValue(id);
356
+ }
357
+
358
+ /** Function to get comments */
359
+ private getAllComments() {
360
+ this.getUserSubscriptionId().subscribe(response => {
361
+ this.subscriptionId = response;
362
+ if (this.subscriptionId) {
363
+ this.crmService
364
+ .getAccountComments(this.accountId, this.subscriptionId, {
365
+ page: this.currentPage,
366
+ page_size: 5
367
+ })
368
+ .subscribe(resp => {
369
+ this.totalContacts = resp.object_count;
370
+ if (resp?.crm_account_actions?.length) {
371
+ const existingIds = new Set(
372
+ this.accountComments.map(comment => comment.id)
373
+ );
374
+
375
+ this.accountComments = [
376
+ ...this.accountComments,
377
+ ...resp.crm_account_actions.filter(
378
+ comment => !existingIds.has(comment.id)
379
+ )
380
+ ];
381
+
382
+ this.accountComments.forEach(data => {
383
+ data.when_short_date = moment(data.when).format('DD-MMM-YYYY');
384
+ const diff = moment(new Date(data.when)).diff(
385
+ moment(new Date()),
386
+ 'days'
387
+ );
388
+ if (moment(new Date(data.when)) < moment(new Date())) {
389
+ data['due'] = `Overdue by ${Math.abs(diff)} days`;
390
+ data['color'] = this.dangerColor;
391
+ } else {
392
+ data['due'] = `In ${diff} days`;
393
+ data['color'] = !this.dangerColor;
394
+ }
395
+ });
396
+
397
+ this.accountComments.sort((a, b) => {
398
+ return new Date(a.when).getTime() - new Date(b.when).getTime();
399
+ });
400
+ this.accountComments.forEach(item => {
401
+ item['when'] = moment(item['when']).format('DD-MMM-YYYY');
402
+ item['year'] = moment(item['when']).format('YYYY');
403
+ item['month'] = moment(item['when']).format('MM');
404
+ });
405
+ const completedCancelledActions: string[] = this.accountComments.filter(
406
+ action => action.completed === true || action.cancelled === true
407
+ );
408
+ completedCancelledActions.reverse();
409
+ const notCompletedCancelledActions: string[] =
410
+ this.accountComments.filter(
411
+ action =>
412
+ action.completed === false && action.cancelled === false
413
+ );
414
+ this.accountComments =
415
+ notCompletedCancelledActions.concat(completedCancelledActions);
416
+ this.isLoaded = true;
417
+ } else {
418
+ this.isLoaded = true;
419
+ }
420
+ });
421
+ }
422
+ });
423
+ }
424
+
425
+ /** Function to update comment */
426
+ updateComment(item) {
427
+ const commentObj = {
428
+ comment: item.comment,
429
+ completed: item.completed,
430
+ cancelled: item.cancelled,
431
+ crm_account_id: item.crm_account_id,
432
+ crm_contact_id: this.contactId
433
+ };
434
+ this.crmService
435
+ .updateAccountComment(this.subscription?.id, item.id, commentObj)
436
+ .subscribe(() => {
437
+ this.toast.success('comment updated successfully');
438
+ this.showEditControls(undefined, '');
439
+ this.getAllComments();
440
+ });
441
+ }
442
+
443
+ /** Function to execute on location select */
444
+ handleAddressChange(event) {
445
+ this.aboutControls.get('location').setValue(event.formatted_address);
446
+ }
447
+
448
+ /** Function to get subscription members */
449
+ getAllSubscriptionMembers() {
450
+ this.subscriptionService
451
+ .getEnrolledSubscription(this.subscription?.id)
452
+ .subscribe(member => {
453
+ this.allSubscriptionMembers = member.members;
454
+ });
455
+ }
456
+
457
+ /** Function to show edit comment section */
458
+ showEditControls(event, action) {
459
+ if (action && action.crm_contact) {
460
+ this.contactId = action.crm_contact.id;
461
+ }
462
+ const comments = this.document.getElementsByClassName('card-header');
463
+ for (let i = 0; i < comments.length; i++) {
464
+ comments[i].classList.remove('show-controls');
465
+ }
466
+ if (event && event !== undefined) {
467
+ event.target.closest('.card-header').classList.add('show-controls');
468
+ }
469
+ }
470
+
471
+ /** Function to get and show all the actions */
472
+ getActions() {
473
+ this.crmService.getActionsBySubscriptionId(this.subscription?.id).subscribe(resp => {
474
+ if (resp?.crm_actions?.length) {
475
+ this.actions = resp.crm_actions;
476
+ this.buttonDisable = this.actions.every(
477
+ x => x.visible === false || x.visible === null
478
+ );
479
+ } else {
480
+ this.buttonDisable = true;
481
+ }
482
+ });
483
+ this.hasAccess = this.hasAdminAccess(this.subscription?.id);
484
+ }
485
+
486
+ /** Function to set the action as completed */
487
+ setAsCompletedOrUncompleted(id: number, action, completedOrUncompleted: boolean) {
488
+ const alertTitle = completedOrUncompleted ? 'InCompleted' : 'Completed';
489
+
490
+ return swal
491
+ .fire({
492
+ title: alertTitle,
493
+ html: `Are you sure you want to set as ${alertTitle}?`,
494
+ showCancelButton: true,
495
+ reverseButtons: true,
496
+ icon: 'warning'
497
+ })
498
+ .then(res => {
499
+ if (res.value) {
500
+ const actionObj = {
501
+ comment: action.comment,
502
+ completed: !completedOrUncompleted,
503
+ cancelled: action.cancelled,
504
+ crm_account_id: action.crm_account_id
505
+ };
506
+ this.crmService
507
+ .updateAccountComment(this.subscription?.id, id, actionObj)
508
+ .subscribe(() => {
509
+ this.toast.success(
510
+ this.translation.translate('Crm.Settings.UpdatedMessage')
511
+ );
512
+ this.actions.splice(action, 1);
513
+ this.getActions();
514
+ this.getAllComments();
515
+ });
516
+ }
517
+ });
518
+ }
519
+
520
+ /** Function to set the action as cancelled */
521
+ setAsCancelled(id: number, action) {
522
+ return swal
523
+ .fire({
524
+ title: 'Cancel',
525
+ html: `Are you sure you want to set as cancelled?`,
526
+ showCancelButton: true,
527
+ reverseButtons: true,
528
+ icon: 'warning'
529
+ })
530
+ .then(res => {
531
+ if (res.value) {
532
+ const actionObj = {
533
+ comment: action.comment,
534
+ completed: action.completed,
535
+ cancelled: true,
536
+ crm_account_id: action.crm_account_id
537
+ };
538
+ this.crmService
539
+ .updateAccountComment(this.subscription?.id, id, actionObj)
540
+ .subscribe(() => {
541
+ this.toast.success(
542
+ this.translation.translate('Crm.Settings.UpdatedMessage')
543
+ );
544
+ this.actions.splice(action, 1);
545
+ this.getActions();
546
+ this.getAllComments();
547
+ });
548
+ }
549
+ });
550
+ }
551
+
552
+ /** Function to update the date */
553
+ onDateSelect(event, action) {
554
+ const commentObj = {
555
+ when: HelperService.dateFormat(event),
556
+ comment: action.comment,
557
+ completed: action.completed,
558
+ cancelled: action.cancelled,
559
+ crm_account_id: action.crm_account_id
560
+ };
561
+ this.crmService
562
+ .updateAccountComment(this.subscription?.id, action.id, commentObj)
563
+ .subscribe(() => {
564
+ this.toast.success('date updated successfully');
565
+ this.getAllComments();
566
+ this.updating = false;
567
+ });
568
+ }
569
+
570
+ /** Function to show DatePicker */
571
+ showDatePickerUpdate(actionId) {
572
+ this.updating = !this.updating;
573
+ this.actionId = actionId;
574
+ }
575
+
576
+ /** Function to get the contacts related to account */
577
+ private getAccountContacts(paging: Paging) {
578
+ this.getUserSubscriptionId().subscribe(id => {
579
+ this.subscriptionId = id;
580
+ if (this.subscriptionId) {
581
+ this.crmService
582
+ .getAccountContacts(
583
+ this.accountId,
584
+ this.subscriptionId,
585
+ this.filterByPotentials || '',
586
+ paging
587
+ )
588
+ .subscribe(response => {
589
+ if (response.contacts) {
590
+ this.contacts = response.contacts;
591
+ this.totalRecords = response.object_count;
592
+ this.totalRecordsUnFiltered = response.unfiltered_count;
593
+ this.contacts.forEach(member => {
594
+ member.displayName = `${member.first_name || ''} ${
595
+ member.last_name || ''
596
+ } - ${member.email}`.trim();
597
+ });
598
+ }
599
+ })
600
+ .add(() => {
601
+ this.loading = false;
602
+ });
603
+ }
604
+ });
605
+ }
606
+
607
+ /** Function when auto-complete dropdown selected */
608
+ onDropdownClick() {
609
+ if (this.contacts.length === 0) {
610
+ this.filteredContact = [{ displayName: 'No contact to choose' }];
611
+ this.filteredContactComment = [{ first_name: 'No contact to choose' }];
612
+ }
613
+ }
614
+
615
+ /** search owner */
616
+ search(event) {
617
+ const values = [];
618
+ if (event.query) {
619
+ this.filteredOwner = this.allSubscriptionMembers.filter((x: SubscriptionMember) => {
620
+ return x.first_name.toLowerCase().includes(event.query.toLowerCase());
621
+ });
622
+ } else {
623
+ this.allSubscriptionMembers.forEach(element => {
624
+ values.push(element);
625
+ });
626
+ }
627
+ this.filteredOwner = values;
628
+ }
629
+
630
+ searchContact(event) {
631
+ this.isContactValid = false;
632
+ let values = [];
633
+ if (event.query) {
634
+ values = this.contacts.filter((x: CrmopportunityContact) => {
635
+ return x.displayName.toLowerCase().includes(event.query.toLowerCase());
636
+ });
637
+ } else {
638
+ this.contacts.forEach(element => {
639
+ values.push(element);
640
+ });
641
+ }
642
+ this.filteredContact = values;
643
+ }
644
+
645
+ selectContact(event) {
646
+ this.isContactValid = this.contacts.some(x => x.id === event.id);
647
+ }
648
+
649
+ OnContactBlur() {
650
+ if (!this.isContactValid) {
651
+ this.actionControls.get('crm_contact_id').setValue('');
652
+ }
653
+ }
654
+
655
+ searchContactInComment(event) {
656
+ let values = [];
657
+ if (event.query) {
658
+ values = this.contacts.filter((x: CrmopportunityContact) => {
659
+ return x.displayName.toLowerCase().includes(event.query.toLowerCase());
660
+ });
661
+ } else {
662
+ this.contacts.forEach(element => {
663
+ values.push(element);
664
+ });
665
+ }
666
+ this.filteredContactComment = values;
667
+ }
668
+
669
+ selectCommentContact(event) {
670
+ this.contactId = event.id;
671
+ }
672
+
673
+ /** Function to delete contact */
674
+ onDeleteContact(id: number) {
675
+ HelperService.raiseDeletePopup().then(resp => {
676
+ if (resp.value) {
677
+ this.crmService.deleteContact(this.subscription?.id, id).subscribe(() => {
678
+ this.toast.success(
679
+ this.translation.translate('Crm.ContactMessage.DeletedMessage')
680
+ );
681
+ this.getAccountContacts({
682
+ page: this.page,
683
+ page_size: PAGE_SIZE
684
+ });
685
+ });
686
+ }
687
+ });
688
+ }
689
+
690
+ /** Function to get contact versions */
691
+ private getContactVersion() {
692
+ this.crmService
693
+ .getContactVersion(this.subscription?.id, this.accountId, 'CrmAccount')
694
+ .subscribe(response => {
695
+ this.accountVersioning = response.versions;
696
+ });
697
+ }
698
+
699
+ openModal(content) {
700
+ this.modalService.open(content, { centered: true, windowClass: 'modal-holder' });
701
+ }
702
+
703
+ onClose() {
704
+ this.modalService.dismissAll();
705
+ }
706
+
707
+ onUploadOutput(output: UploadOutput): void {
708
+ switch (output.type) {
709
+ case 'allAddedToQueue':
710
+ if (this.files.length > 0) {
711
+ const event: UploadInput = {
712
+ type: 'uploadAll',
713
+ url: CRM_ACCOUNT_FILES_PATH,
714
+ method: 'POST',
715
+ data: {
716
+ owner_id: `${this.userId}`,
717
+ crm_account_id: `${this.accountId}`
718
+ },
719
+ headers: {
720
+ [TOKEN_HEADER_KEY]: this.token
721
+ }
722
+ };
723
+ this.uploadInput.emit(event);
724
+ }
725
+
726
+ break;
727
+ case 'addedToQueue':
728
+ if (typeof output.file !== 'undefined') {
729
+ const ext = output.file.name.split('.').pop();
730
+ if (DOCUMENT_TYPE_EXT.includes(ext)) {
731
+ this.files.push(output.file);
732
+ } else {
733
+ this.toast.error('file formats is not supported.');
734
+ }
735
+ }
736
+ break;
737
+ case 'uploading':
738
+ if (typeof output.file !== 'undefined') {
739
+ const index = this.files.findIndex(
740
+ file => typeof output.file !== 'undefined' && file.id === output.file.id
741
+ );
742
+ this.files[index] = output.file;
743
+ }
744
+ break;
745
+ case 'removed':
746
+ this.files = this.files.filter((file: UploadFile) => file !== output.file);
747
+ break;
748
+ case 'dragOver':
749
+ this.dragOver = true;
750
+ break;
751
+ case 'dragOut':
752
+ case 'drop':
753
+ this.dragOver = false;
754
+ break;
755
+ case 'done':
756
+ break;
757
+ default:
758
+ }
759
+
760
+ this.files.forEach(file => {
761
+ if (file.progress.status === UploadStatus.Done) {
762
+ file['uploaded'] = true;
763
+ }
764
+ });
765
+ // wait for 500ms before filter files
766
+ setTimeout(() => {
767
+ this.files = this.files.filter(file => file.progress.status !== UploadStatus.Done);
768
+ }, 500);
769
+ }
770
+
771
+ getAccountLogo(url: string) {
772
+ if (url) {
773
+ return this.logoCacheService.getLogo(
774
+ `https://logo.clearbit.com/${url?.split('.')[1]}.${
775
+ url?.split('.')[2]?.split('/')[0]
776
+ }`
777
+ );
778
+ }
779
+
780
+ return '';
781
+ }
782
+
783
+ navigateToAddOpportunities() {
784
+ this.router.navigate([`/${this.subscription?.slug}${this.routers.opportunityAdd}`], {
785
+ queryParams: { account_id: this.accountId }
786
+ });
787
+ }
788
+
789
+ override ngOnDestroy() {
790
+ super.ngOnDestroy();
791
+ }
792
+ }