@posiwise/smart-crm 0.0.20 → 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 -599
  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 -470
  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 -335
  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 -6482
  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 -173
  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 -122
  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 -67
  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,568 @@
1
+ import { DOCUMENT } from '@angular/common';
2
+ import { Component, EventEmitter, Inject, Injector, OnDestroy, OnInit } from '@angular/core';
3
+ import { UntypedFormGroup, Validators } from '@angular/forms';
4
+ import { NgbModal } from '@ng-bootstrap/ng-bootstrap';
5
+ import { CRM_ACCOUNT_FILES_PATH } from '@posiwise/smart-crm-shared';
6
+ import { AppSmartCrm } from '../../../../../shared/models/smart-crm.model';
7
+ import { ROUTERS } from '../../../../../shared/routers/routers';
8
+ import { CrmService } from '@posiwise/smart-crm-shared';
9
+ import { UploadFile, UploadInput, UploadOutput, UploadStatus, UploaderOptions } from 'ngx-uploader';
10
+ import swal from 'sweetalert2';
11
+
12
+ import { DOCUMENT_TYPE_EXT, TOKEN_HEADER_KEY } from '@posiwise/common-utilities';
13
+ import { CrmAccount } from '../../../../../shared/interface/crm-account.interface';
14
+ import { CrmAction } from '../../../../../shared/interface/crm-action.interface';
15
+ import { CrmVersion } from '../../../../../shared/interface/crm-opportunity.interface';
16
+ import { AppBaseComponent } from '@posiwise/app-base-component';
17
+ import { Subscription } from '@posiwise/common-utilities';
18
+ import { AuthService } from '@posiwise/common-services';
19
+ import { HelperService } from '@posiwise/helper-service';
20
+ import { ValidateForm } from '@posiwise/utils';
21
+ import moment from 'moment';
22
+ import {
23
+ OpportunityComment,
24
+ OpportunityContact,
25
+ OpportunityData
26
+ } from 'libs/smart-crm/src/lib/shared/interface/smart-crm-module.interface';
27
+
28
+ @Component({
29
+ selector: 'pw-smart-crm-opportunities-info',
30
+ templateUrl: './smart-crm-opportunities-info.component.html',
31
+ styleUrls: ['./smart-crm-opportunities-info.component.scss']
32
+ })
33
+ export class SmartCrmOpportunitiesInfoComponent
34
+ extends AppBaseComponent
35
+ implements OnInit, OnDestroy
36
+ {
37
+ isLoaded = false;
38
+
39
+ isFormEdit = true;
40
+
41
+ opportunitiesId: number;
42
+
43
+ data: OpportunityData;
44
+
45
+ aboutControls: UntypedFormGroup;
46
+
47
+ submitted = false;
48
+ buttonBusy = false;
49
+
50
+ accounts: CrmAccount[];
51
+
52
+ filteredAccounts: CrmAccount[] = [];
53
+
54
+ subscriptionId: number;
55
+
56
+ actions: CrmAction[];
57
+
58
+ buttonDisable: boolean;
59
+
60
+ hasAccess: boolean;
61
+
62
+ options: UploaderOptions;
63
+
64
+ uploadInput: EventEmitter<UploadInput>;
65
+
66
+ files: UploadFile[];
67
+
68
+ token: string;
69
+
70
+ dragOver: boolean;
71
+
72
+ contactId: number;
73
+
74
+ accountId: number;
75
+
76
+ userId: number;
77
+
78
+ actionControls: UntypedFormGroup;
79
+
80
+ isDisabled = false;
81
+
82
+ updating = false;
83
+
84
+ actionId: number;
85
+
86
+ showFullComment = false;
87
+
88
+ commentId: number;
89
+
90
+ opportunitiesComments: OpportunityComment[];
91
+
92
+ dangerColor: boolean;
93
+
94
+ allContacts: OpportunityContact[];
95
+
96
+ filteredContacts: OpportunityContact[];
97
+
98
+ opportunitiesVersioning: CrmVersion[];
99
+
100
+ submitAction = false;
101
+
102
+ subscription: Subscription;
103
+
104
+ routers = ROUTERS;
105
+
106
+ constructor(
107
+ injector: Injector,
108
+ private crmService: CrmService,
109
+ private modalService: NgbModal,
110
+ private authService: AuthService,
111
+ @Inject(DOCUMENT) private document: Document
112
+ ) {
113
+ super(injector);
114
+ this.options = { concurrency: 1, maxUploads: 3 };
115
+ this.uploadInput = new EventEmitter<UploadInput>();
116
+ this.token = btoa(this.authService.getToken());
117
+ this.files = [];
118
+ this.actionControls = AppSmartCrm.getOpportunityActionsForm(this.isDisabled);
119
+ this.aboutControls = AppSmartCrm.getOpportunitiesForm();
120
+ }
121
+
122
+ ngOnInit(): void {
123
+ this.route.params.subscribe(data => {
124
+ this.opportunitiesId = Number(data['id']);
125
+ if (this.opportunitiesId) {
126
+ this.getOpportunityDetails();
127
+ this.actionControls.get('crm_opportunity_id').setValue(this.opportunitiesId);
128
+ }
129
+ });
130
+ this.getUserSubscription().subscribe(response => {
131
+ this.subscription = response;
132
+ if (this.subscription?.id) {
133
+ this.getActions();
134
+ this.getOpportunitiesComments();
135
+ }
136
+ });
137
+ this.onDateSelected();
138
+ this.getContactVersion();
139
+ this.userInfo();
140
+ }
141
+
142
+ /** Function to call user info */
143
+ private userInfo() {
144
+ this.userStore().subscribe(res => {
145
+ if (res) {
146
+ this.userId = res.id;
147
+ this.actionControls.get('owner_id').setValue(res.id);
148
+ }
149
+ });
150
+ }
151
+
152
+ /** Function to get opportunities details */
153
+ getOpportunityDetails() {
154
+ this.crmService
155
+ .getOpportunityDetails(this.subscriptionId, this.opportunitiesId)
156
+ .subscribe(response => {
157
+ if (response) {
158
+ if (response.crm_contact_id) {
159
+ response.crm_contact.displayName = `${response.crm_contact.first_name} ${response.crm_contact.last_name}`;
160
+ }
161
+ this.data = response;
162
+ // eslint-disable-next-line operator-assignment
163
+ this.data.monthly_amount = this.data.monthly_amount / 100;
164
+ // eslint-disable-next-line operator-assignment
165
+ this.data.one_time_amount = this.data.one_time_amount / 100;
166
+ this.contactId = response.crm_contact_id;
167
+ this.accountId = response.crm_account_id;
168
+ this.aboutControls.patchValue(response);
169
+ this.aboutControls.get('crm_contact_id').patchValue(response.crm_contact);
170
+ this.aboutControls.get('crm_account_id').patchValue(response.crm_account);
171
+ this.actionControls.get('crm_contact_id').setValue(this.contactId);
172
+ this.actionControls.get('crm_account_id').setValue(this.accountId);
173
+ }
174
+ });
175
+ }
176
+
177
+ /** Function to update opportunities */
178
+ updateOpportunities() {
179
+ if (this.aboutControls.invalid) {
180
+ this.submitted = true;
181
+ } else {
182
+ const formData = this.aboutControls;
183
+ formData.get('crm_account_id').setValue(formData.get('crm_account_id').value?.id);
184
+ formData.get('crm_contact_id').setValue(formData.get('crm_contact_id').value?.id);
185
+ formData.get('one_time_amount').setValue(formData.get('one_time_amount').value * 100);
186
+ formData.get('monthly_amount').setValue(formData.get('monthly_amount').value * 100);
187
+ this.crmService
188
+ .updateOpportunities(this.subscription?.id, this.opportunitiesId, formData.value)
189
+ .subscribe(() => {
190
+ this.toast.success(
191
+ this.translation.translate('Crm.OpportunitiesMessage.UpdatedMessage')
192
+ );
193
+ this.isFormEdit = true;
194
+ this.getOpportunityDetails();
195
+ })
196
+ .add(() => {
197
+ this.submitted = false;
198
+ });
199
+ }
200
+ }
201
+
202
+ /** Function to save comment */
203
+ @ValidateForm('actionControls')
204
+ onCommentSave() {
205
+ this.buttonBusy = true;
206
+ const data = this.actionControls.value;
207
+ data.when = HelperService.dateFormat(data?.when);
208
+ this.crmService
209
+ .postAccountComment(this.subscription?.id, data)
210
+ .subscribe(() => {
211
+ this.actionControls.get('comment').reset();
212
+ this.getOpportunitiesComments();
213
+ this.toast.success(
214
+ this.translation.translate('Crm.OpportunitiesMessage.CommentSubmittedMessage')
215
+ );
216
+ })
217
+ .add(() => {
218
+ this.submitAction = false;
219
+ this.buttonBusy = false;
220
+ });
221
+ }
222
+
223
+ showDatePicker(event, id) {
224
+ this.actionControls.get('when').setValidators([Validators.required]);
225
+ const actionButtons = this.document.getElementsByClassName('action-btn');
226
+ for (let i = 0; i < actionButtons.length; i++) {
227
+ actionButtons[i].classList.remove('active');
228
+ }
229
+ event.target.classList.add('active');
230
+ this.actionControls.get('crm_action_id').setValue(id);
231
+ }
232
+
233
+ onDateSelected() {
234
+ this.actionControls.get('when').valueChanges.subscribe(() => {
235
+ const selectedDate = this.document.getElementById('when')?.['value'];
236
+ const todayDate = moment(new Date()).format('DD-MMM-YYYY');
237
+ if (todayDate < selectedDate) {
238
+ this.isDisabled = true;
239
+ this.actionControls.get('completed').disable({ onlySelf: true });
240
+ this.actionControls.get('completed').setValue(false);
241
+ } else {
242
+ this.actionControls.get('completed').enable({ onlySelf: true });
243
+ this.isDisabled = false;
244
+ }
245
+ });
246
+ }
247
+
248
+ /** Function to get all comments */
249
+ private getOpportunitiesComments() {
250
+ this.crmService
251
+ .getOpportunitiesComments(this.opportunitiesId, this.subscription?.id)
252
+ .subscribe(resp => {
253
+ if (resp?.crm_account_actions?.length) {
254
+ this.opportunitiesComments = resp.crm_account_actions;
255
+
256
+ this.opportunitiesComments.forEach(data => {
257
+ data.when_short_date = moment(data.when).format('DD-MMM-YYYY');
258
+ const diff = moment(new Date(data.when)).diff(moment(new Date()), 'days');
259
+ if (moment(new Date(data.when)) < moment(new Date())) {
260
+ data['due'] = `Overdue by ${Math.abs(diff)} days`;
261
+ data['color'] = this.dangerColor;
262
+ } else {
263
+ data['due'] = `In ${diff} days`;
264
+ data['color'] = !this.dangerColor;
265
+ }
266
+ });
267
+
268
+ this.opportunitiesComments.sort((a, b) => {
269
+ return new Date(a.when).getTime() - new Date(b.when).getTime();
270
+ });
271
+ this.opportunitiesComments.forEach(item => {
272
+ item['when'] = moment(item['when']).format('DD-MMM-YYYY');
273
+ item['year'] = moment(item['when']).format('YYYY');
274
+ item['month'] = moment(item['when']).format('MM');
275
+ });
276
+ const completedCancelledActions: OpportunityComment[] =
277
+ this.opportunitiesComments.filter(
278
+ action => action.completed === true || action.cancelled === true
279
+ );
280
+ completedCancelledActions.reverse();
281
+ const notCompletedCancelledActions: OpportunityComment[] =
282
+ this.opportunitiesComments.filter(
283
+ action => action.completed === false && action.cancelled === false
284
+ );
285
+ this.opportunitiesComments =
286
+ notCompletedCancelledActions.concat(completedCancelledActions);
287
+ this.isLoaded = true;
288
+ } else {
289
+ this.isLoaded = true;
290
+ }
291
+ });
292
+ }
293
+
294
+ get f() {
295
+ return this.aboutControls.controls;
296
+ }
297
+
298
+ get actionFormControls() {
299
+ return this.actionControls.controls;
300
+ }
301
+
302
+ /** Function to get the list of accounts by subscriptionId */
303
+ getAccountsBySubscription() {
304
+ this.crmService.getAccountsBySubscription(this.subscription?.id).subscribe(res => {
305
+ this.accounts = res.accounts;
306
+ });
307
+ }
308
+
309
+ /** Function to get and show all the actions */
310
+ private getActions() {
311
+ this.crmService.getActionsBySubscriptionId(this.subscription?.id).subscribe(resp => {
312
+ if (resp && resp.crm_actions && resp.crm_actions.length > 0) {
313
+ this.actions = resp.crm_actions;
314
+ this.buttonDisable = this.actions.every(
315
+ x => x.visible === false || x.visible === null
316
+ );
317
+ } else {
318
+ this.buttonDisable = true;
319
+ }
320
+ });
321
+ this.hasAccess = this.hasAdminAccess(this.subscription?.id);
322
+ }
323
+
324
+ showEditControls(event) {
325
+ const comments = this.document.getElementsByClassName('card-header');
326
+ for (let i = 0; i < comments.length; i++) {
327
+ comments[i].classList.remove('show-controls');
328
+ }
329
+ if (event && event !== undefined) {
330
+ event.target.closest('.card-header').classList.add('show-controls');
331
+ }
332
+ }
333
+
334
+ /** Function to update the date */
335
+ onDateSelect(event, action) {
336
+ const commentObj = {
337
+ when: HelperService.dateFormat(event),
338
+ comment: action.comment,
339
+ completed: action.completed,
340
+ cancelled: action.cancelled,
341
+ crm_account_id: action.crm_account_id
342
+ };
343
+ this.crmService
344
+ .updateAccountComment(this.subscription?.id, action.id, commentObj)
345
+ .subscribe(() => {
346
+ this.toast.success('date updated successfully');
347
+ this.getOpportunitiesComments();
348
+ this.updating = false;
349
+ });
350
+ }
351
+
352
+ /** Function to show DatePicker */
353
+ showDatePickerUpdate(actionId) {
354
+ this.updating = !this.updating;
355
+ this.actionId = actionId;
356
+ }
357
+
358
+ /** Function to set the action as completed */
359
+ setAsCompletedOrUncompleted(id, action, completedOrUncompleted) {
360
+ const alertTitle = completedOrUncompleted ? 'InCompleted' : 'Completed';
361
+
362
+ return swal
363
+ .fire({
364
+ title: alertTitle,
365
+ html: `Are you sure you want to set as ${alertTitle}?`,
366
+ showCancelButton: true,
367
+ reverseButtons: true,
368
+ icon: 'warning'
369
+ })
370
+ .then(res => {
371
+ if (res.value) {
372
+ const actionObj = {
373
+ comment: action.comment,
374
+ completed: !completedOrUncompleted,
375
+ cancelled: action.cancelled,
376
+ crm_account_id: action.crm_account_id
377
+ };
378
+ this.crmService
379
+ .updateAccountComment(this.subscription?.id, id, actionObj)
380
+ .subscribe(() => {
381
+ this.toast.success(
382
+ this.translation.translate('Crm.Settings.UpdatedMessage')
383
+ );
384
+ this.actions.splice(action, 1);
385
+ this.getActions();
386
+ this.getOpportunitiesComments();
387
+ });
388
+ }
389
+ });
390
+ }
391
+
392
+ /** Function to update comment */
393
+ updateComment(item) {
394
+ const commentObj = {
395
+ comment: item.comment,
396
+ completed: item.completed,
397
+ cancelled: item.cancelled,
398
+ crm_account_id: item.crm_account_id
399
+ };
400
+ this.crmService
401
+ .updateAccountComment(this.subscription?.id, item.id, commentObj)
402
+ .subscribe(() => {
403
+ this.toast.success('comment updated successfully');
404
+ this.showEditControls(undefined);
405
+ this.getOpportunitiesComments();
406
+ });
407
+ }
408
+
409
+ /** Function to set the action as cancelled */
410
+ setAsCancelled(id, action) {
411
+ return swal
412
+ .fire({
413
+ title: 'Cancel',
414
+ html: `Are you sure you want to set as cancelled?`,
415
+ showCancelButton: true,
416
+ reverseButtons: true,
417
+ icon: 'warning'
418
+ })
419
+ .then(res => {
420
+ if (res.value) {
421
+ const actionObj = {
422
+ comment: action.comment,
423
+ completed: action.completed,
424
+ cancelled: true,
425
+ crm_account_id: action.crm_account_id
426
+ };
427
+ this.crmService
428
+ .updateAccountComment(this.subscription?.id, id, actionObj)
429
+ .subscribe(() => {
430
+ this.toast.success(
431
+ this.translation.translate('Crm.Settings.UpdatedMessage')
432
+ );
433
+ this.actions.splice(action, 1);
434
+ this.getActions();
435
+ this.getOpportunityDetails();
436
+ });
437
+ }
438
+ });
439
+ }
440
+
441
+ /** Function to call contacts */
442
+ getAllContacts() {
443
+ this.crmService.getAllContacts(this.subscription?.id, '').subscribe(response => {
444
+ this.allContacts = response.contacts;
445
+ this.allContacts.forEach(member => {
446
+ member.displayName = `${member.first_name || ''} ${member.last_name || ''} - ${
447
+ member.email
448
+ }`.trim();
449
+ });
450
+ });
451
+ }
452
+
453
+ /** search accounts */
454
+ accountSearch(event) {
455
+ let data = [];
456
+ if (event.query) {
457
+ data = this.accounts.filter((x: CrmAccount) => {
458
+ return x.name.toLowerCase().includes(event.query.toLowerCase());
459
+ });
460
+ } else {
461
+ this.accounts.forEach(element => {
462
+ data.push(element);
463
+ });
464
+ }
465
+ this.filteredContacts = data;
466
+ }
467
+
468
+ onContactSearch(event) {
469
+ let data = [];
470
+ if (event.query) {
471
+ data = this.allContacts.filter((x: OpportunityContact) => {
472
+ return x.displayName.toLowerCase().includes(event.query.toLowerCase());
473
+ });
474
+ } else {
475
+ this.allContacts.forEach(element => {
476
+ data.push(element);
477
+ });
478
+ }
479
+ this.filteredContacts = data;
480
+ }
481
+
482
+ openModal(content) {
483
+ this.modalService.open(content, { centered: true, windowClass: 'modal-holder' });
484
+ }
485
+
486
+ onClose() {
487
+ this.modalService.dismissAll();
488
+ }
489
+
490
+ /** Function to get opportunities versions */
491
+ private getContactVersion() {
492
+ this.crmService
493
+ .getContactVersion(this.subscription?.id, this.opportunitiesId, 'CrmOpportunity')
494
+ .subscribe(response => {
495
+ this.opportunitiesVersioning = response.versions;
496
+ });
497
+ }
498
+
499
+ onUploadOutput(output: UploadOutput): void {
500
+ switch (output.type) {
501
+ case 'allAddedToQueue':
502
+ if (this.files.length > 0) {
503
+ const event: UploadInput = {
504
+ type: 'uploadAll',
505
+ url: CRM_ACCOUNT_FILES_PATH,
506
+ method: 'POST',
507
+ data: {
508
+ owner_id: `${this.userId}`,
509
+ crm_account_id: `${this.accountId}`,
510
+ crm_contact_id: `${this.contactId}`,
511
+ crm_opportunity_id: `${this.opportunitiesId}`
512
+ },
513
+ headers: {
514
+ [TOKEN_HEADER_KEY]: this.token
515
+ }
516
+ };
517
+ this.uploadInput.emit(event);
518
+ }
519
+
520
+ break;
521
+ case 'addedToQueue':
522
+ if (typeof output.file !== 'undefined') {
523
+ const ext = output.file.name.split('.').pop();
524
+ if (DOCUMENT_TYPE_EXT.includes(ext)) {
525
+ this.files.push(output.file);
526
+ } else {
527
+ this.toast.error('file formats is not supported.');
528
+ }
529
+ }
530
+ break;
531
+ case 'uploading':
532
+ if (typeof output.file !== 'undefined') {
533
+ const index = this.files.findIndex(
534
+ file => typeof output.file !== 'undefined' && file.id === output.file.id
535
+ );
536
+ this.files[index] = output.file;
537
+ }
538
+ break;
539
+ case 'removed':
540
+ this.files = this.files.filter((file: UploadFile) => file !== output.file);
541
+ break;
542
+ case 'dragOver':
543
+ this.dragOver = true;
544
+ break;
545
+ case 'dragOut':
546
+ case 'drop':
547
+ this.dragOver = false;
548
+ break;
549
+ case 'done':
550
+ break;
551
+ default:
552
+ }
553
+
554
+ this.files.forEach(file => {
555
+ if (file.progress.status === UploadStatus.Done) {
556
+ file['uploaded'] = true;
557
+ }
558
+ });
559
+ // wait for 500ms before filter files
560
+ setTimeout(() => {
561
+ this.files = this.files.filter(file => file.progress.status !== UploadStatus.Done);
562
+ }, 500);
563
+ }
564
+
565
+ override ngOnDestroy() {
566
+ super.ngOnDestroy();
567
+ }
568
+ }