@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,129 @@
1
+ import {
2
+ AfterViewChecked,
3
+ ChangeDetectorRef,
4
+ Component,
5
+ Injector,
6
+ OnDestroy,
7
+ OnInit
8
+ } from '@angular/core';
9
+ import { ROUTERS } from '../../../../shared/routers/routers';
10
+ import { CrmService } from '@posiwise/smart-crm-shared';
11
+ import { LazyLoadEvent } from 'primeng/api';
12
+
13
+ import { PAGE_SIZE, Paging, Subscription } from '@posiwise/common-utilities';
14
+ import { CrmSourceResponse } from '../../../../shared/interface/crm-source.interface';
15
+ import { AppBaseComponent } from '@posiwise/app-base-component';
16
+ import { HelperService } from '@posiwise/helper-service';
17
+
18
+ @Component({
19
+ selector: 'pw-smart-crm-source',
20
+ templateUrl: './smart-crm-source.component.html',
21
+ styleUrls: ['./smart-crm-source.component.scss']
22
+ })
23
+ export class SmartCrmCompanySourceComponent
24
+ extends AppBaseComponent
25
+ implements OnInit, OnDestroy, AfterViewChecked
26
+ {
27
+ searchText = '';
28
+
29
+ loading = true;
30
+
31
+ hasAccess = false;
32
+
33
+ isLoaded = false;
34
+
35
+ data: CrmSourceResponse = {
36
+ crm_sources: [],
37
+ object_count: 0,
38
+ unfiltered_count: 0
39
+ };
40
+
41
+ subscriptionId: number;
42
+
43
+ page = 1;
44
+
45
+ subscription: Subscription;
46
+
47
+ routers = ROUTERS;
48
+
49
+ constructor(
50
+ injector: Injector,
51
+ private crmService: CrmService,
52
+ private cdr: ChangeDetectorRef
53
+ ) {
54
+ super(injector);
55
+ }
56
+
57
+ ngOnInit() {
58
+ this.getUserSubscription().subscribe(subscription => {
59
+ this.subscription = subscription;
60
+ });
61
+ }
62
+
63
+ ngAfterViewChecked() {
64
+ this.cdr.detectChanges();
65
+ }
66
+
67
+ onLazyLoad(event: LazyLoadEvent) {
68
+ const pageDetails = HelperService.onTableLazyLoad(event);
69
+ this.page = pageDetails.page;
70
+ this.getAllSource({
71
+ page: this.page,
72
+ page_size: PAGE_SIZE,
73
+ order_by: pageDetails.sortField,
74
+ order_direction: pageDetails.sortOrder,
75
+ search: this.searchText
76
+ });
77
+ }
78
+
79
+ /** Function to all account source */
80
+ getAllSource(paging: Paging) {
81
+ this.getUserSubscription().subscribe(subscription => {
82
+ this.subscription = subscription;
83
+ if (this.subscription?.id) {
84
+ this.hasAccess = this.hasAdminAccess(this.subscription?.id);
85
+ this.crmService
86
+ .getAllAccountSource(subscription?.id, paging)
87
+ .subscribe(response => {
88
+ this.data = response;
89
+ })
90
+ .add(() => {
91
+ this.isLoaded = true;
92
+ this.loading = false;
93
+ });
94
+ }
95
+ });
96
+ }
97
+
98
+ buildAccountSource() {
99
+ this.crmService.buildAccountSources(this.subscription?.id).subscribe(() => {
100
+ this.getAllSource({
101
+ page: this.page,
102
+ page_size: PAGE_SIZE
103
+ });
104
+ this.toast.success(this.translation.translate('Crm.CommonMessage.AddedMessage'));
105
+ });
106
+ }
107
+
108
+ /** Function to delete account source */
109
+ onDelete(id) {
110
+ HelperService.raiseDeletePopup().then(res => {
111
+ if (res.value) {
112
+ this.crmService.deleteSource(this.subscription?.id, id).subscribe(() => {
113
+ this.getAllSource({
114
+ page: this.page,
115
+ page_size: PAGE_SIZE,
116
+ search: this.searchText
117
+ });
118
+ this.toast.success(
119
+ this.translation.translate('Crm.AccountSourceMessage.DeletedMessage')
120
+ );
121
+ });
122
+ }
123
+ });
124
+ }
125
+
126
+ override ngOnDestroy() {
127
+ super.ngOnDestroy();
128
+ }
129
+ }
@@ -0,0 +1,108 @@
1
+ <div class="col-12 d-flex ps-0">
2
+ <a href="javascript:void(0)"
3
+ (click)="back()"
4
+ class="previous"><i class="fa fa-arrow-alt-circle-left" aria-hidden="true"></i></a>
5
+ <div class="me-auto col-xs-6">
6
+ <h3 class="m-subheader__title m-subheader__title--separator">
7
+ <span>{{ 'Crm.StageMessages.Stage' | transloco }}:
8
+ {{ isLoading ? '' : (data?.name || ('Label.AddNew' | transloco)) }}</span>
9
+ </h3>
10
+ </div>
11
+ </div>
12
+ <div class="w-100 text-center mt-3"
13
+ *ngIf="isLoading">
14
+ <p-progressSpinner strokeWidth="2"> </p-progressSpinner>
15
+ </div>
16
+ <div class="container-fluid pw-tab">
17
+ <div class="p-2 mt-3">
18
+ <form [formGroup]="form"
19
+ *ngIf="!isLoading"
20
+ (ngSubmit)="onSave()">
21
+ <div class="row mb-3">
22
+ <div class="col-12 col-sm-4 col-md-3">
23
+ <pw-input-container [label]="'Crm.StageMessages.Name' | transloco"
24
+ name="name"
25
+ [errorMsg]="'Crm.StageMessages.NameRequired' | transloco">
26
+ <input type="text"
27
+ class="form-control"
28
+ formControlName="name"
29
+ [ngClass]="{ 'is-invalid': submitted && f['name'].errors }" />
30
+ </pw-input-container>
31
+ </div>
32
+ <div class="col-12 col-sm-4 col-md-3">
33
+ <pw-input-container [label]="'Crm.StageMessages.ColorCode' | transloco"
34
+ [showTooltip]="true"
35
+ [tooltipText]="'Crm.StageMessages.Tooltip.ColorCode' | transloco"
36
+ name="color_code">
37
+ <input type="color"
38
+ class="form-control color-code-stage account-color-code"
39
+ formControlName="color_code"
40
+ [ngClass]="{ 'is-invalid': submitted && f['color_code'].errors }" />
41
+ </pw-input-container>
42
+ </div>
43
+ <div class="col-12 col-sm-4 col-md-3">
44
+ <pw-input-container [showTooltip]="true"
45
+ [tooltipText]="'Crm.StageMessages.Tooltip.PreviousStage' | transloco"
46
+ [label]="'Crm.StageMessages.PreviousStage' | transloco"
47
+ name="previous_stage_id"
48
+ [errorMsg]="'Crm.StageMessages.PreviousStageRequired' | transloco"
49
+ *ngIf="stages$ | async as stages">
50
+ <select formControlName="previous_stage_id"
51
+ class="form-control form-select"
52
+ [ngClass]="{ 'is-invalid': submitted && f['previous_stage_id'].errors }">
53
+ <option value="">select previous stage</option>
54
+ <option *ngFor="let option of stages['crm_opportunity_stages']"
55
+ [value]="option.id">
56
+ {{ option.name }}
57
+ </option>
58
+ </select>
59
+ </pw-input-container>
60
+ </div>
61
+ <div class="col-12 col-sm-4 col-md-3" *ngIf="categories.length > 0">
62
+ <pw-input-container [showTooltip]="true"
63
+ [tooltipText]="'Crm.StageMessages.Tooltip.OpportunityCategory' | transloco"
64
+ [label]="'Crm.StageMessages.OpportunityCategory' | transloco"
65
+ name="crm_opportunity_category_ids"
66
+ errorMsg="category is required">
67
+ <p-multiSelect [options]="categories"
68
+ formControlName="crm_opportunity_category_ids"
69
+ appendTo="body"></p-multiSelect>
70
+ </pw-input-container>
71
+ </div>
72
+ <div class="col-12 col-sm-2 col-md-1">
73
+ <div class="mb-3">
74
+ <label class="info-circle mb-2">{{ 'Crm.StageMessages.Visible' | transloco
75
+ }}<span class="tooltiptext gradient-custom-branding">{{
76
+ 'Crm.StageMessages.Tooltip.Visible' | transloco
77
+ }}</span></label><br />
78
+ <ui-switch formControlName="visible"
79
+ name="visible"></ui-switch>
80
+ </div>
81
+ </div>
82
+ <div class="col-12 col-sm-2 col-md-1"
83
+ *rbacAllow="'SuperAdmin'">
84
+ <div class="mb-3">
85
+ <label class="info-circle mb-2">{{ 'Crm.StageMessages.Default' | transloco
86
+ }}<span class="tooltiptext gradient-custom-branding">{{
87
+ 'Crm.StageMessages.Tooltip.Default' | transloco
88
+ }}</span></label><br />
89
+ <ui-switch formControlName="is_default"
90
+ name="is_default"> </ui-switch>
91
+ </div>
92
+ </div>
93
+ <div class="col-12 text-end mt-3">
94
+ <button type="button"
95
+ class="btn btn-outline-default me-2"
96
+ (click)="back()">
97
+ {{ 'Button.Cancel' | transloco }}
98
+ </button>
99
+ <button type="submit"
100
+ [buttonBusy]="buttonBusy"
101
+ class="btn btn-primary">
102
+ {{ 'Button.Submit' | transloco }}
103
+ </button>
104
+ </div>
105
+ </div>
106
+ </form>
107
+ </div>
108
+ </div>
@@ -0,0 +1,124 @@
1
+ import { TestBed } from '@angular/core/testing';
2
+ import { CommonServicesModule, PermissionService, UserService } from '@posiwise/common-services';
3
+ import { SharedModule } from '@posiwise/shared-module';
4
+ import { CrmService } from '@posiwise/smart-crm-shared';
5
+ import { DEFAULT_USER, TestHelper } from '@posiwise/test-helpers';
6
+ import { MockProvider } from 'ng-mocks';
7
+ import { of } from 'rxjs';
8
+ import { SmartCrmPrivateModule } from '../../../../smart-crm-private.module';
9
+ import { SmartCrmStageDetailsComponent } from './smart-crm-stage-details.component';
10
+
11
+ class UserServiceMock {
12
+ getUserState() {
13
+ return of({ currentUser: DEFAULT_USER });
14
+ }
15
+ }
16
+ describe('SmartCrmStageDetailsComponent', () => {
17
+ const createComponent = TestHelper.createComponentFactory({
18
+ component: SmartCrmStageDetailsComponent,
19
+ imports: [CommonServicesModule, SharedModule, SmartCrmPrivateModule],
20
+ providers: [
21
+ ...TestHelper.TEST_PROVIDERS,
22
+ MockProvider(PermissionService, {
23
+ evaluatePermissions: () => {
24
+ return true;
25
+ }
26
+ }),
27
+ MockProvider(CrmService, {
28
+ getAllStages: () =>
29
+ of({
30
+ crm_opportunity_stages: [
31
+ {
32
+ id: 14,
33
+ subscription_id: 31,
34
+ name: 'test',
35
+ previous_stage_id: null,
36
+ visible: true,
37
+ is_default: true,
38
+ crm_opportunity_category_ids: [9]
39
+ }
40
+ ],
41
+ object_count: 1,
42
+ unfiltered_count: 1
43
+ }),
44
+ getAllOpportunityCategories: () =>
45
+ of({
46
+ crm_opportunity_categories: [
47
+ {
48
+ id: 9,
49
+ subscription_id: 20,
50
+ name: 'testcategory',
51
+ previous_category_id: null,
52
+ is_visible: true,
53
+ is_default: false,
54
+ previous_category: null
55
+ }
56
+ ],
57
+ object_count: 1,
58
+ unfiltered_count: 1
59
+ }),
60
+ getStageDetails: () =>
61
+ of({
62
+ id: 14,
63
+ subscription_id: 31,
64
+ name: 'test',
65
+ previous_stage_id: null,
66
+ visible: true,
67
+ is_default: true,
68
+ crm_opportunity_category_ids: [9]
69
+ }),
70
+ editStage: () => of({}),
71
+ postStage: () => of({})
72
+ }),
73
+ {
74
+ provide: UserService,
75
+ useClass: UserServiceMock
76
+ }
77
+ ]
78
+ });
79
+
80
+ beforeEach(() => {
81
+ TestHelper.setUpPermissionsAndUser();
82
+ });
83
+
84
+ it('should create', async () => {
85
+ TestHelper.setActivatedRoute({
86
+ parent: { params: of({ slug: 'posiwise-263' }) }
87
+ });
88
+ const spectator = await createComponent();
89
+ expect(spectator.component).toBeTruthy();
90
+ });
91
+
92
+ it('should add submit form ', async () => {
93
+ TestHelper.setActivatedRoute({
94
+ parent: { params: of({ slug: 'posiwise-263' }) }
95
+ });
96
+ const spectator = await createComponent();
97
+ const service = TestBed.inject(CrmService);
98
+ const spy = spyOn(service, 'postStage').and.callThrough();
99
+ spectator.typeInElement('test', 'input[formControlName="name"]');
100
+ spectator.click(
101
+ 'p-multiSelect[formcontrolname="crm_opportunity_category_ids"] .p-multiselect-trigger'
102
+ );
103
+ spectator.click(
104
+ spectator.query('.p-multiselect-items-wrapper >:first-child >:nth-child(1) > li', {
105
+ root: true
106
+ })
107
+ );
108
+ spectator.click('button[type="submit"]');
109
+ expect(spy).toHaveBeenCalledTimes(1);
110
+ });
111
+
112
+ it('should edit', async () => {
113
+ TestHelper.setActivatedRoute({
114
+ params: { id: 1 },
115
+ parent: { params: of({ slug: 'posiwise-263' }) }
116
+ });
117
+ const spectator = await createComponent();
118
+ const service = TestBed.inject(CrmService);
119
+ const spy = spyOn(service, 'editStage').and.callThrough();
120
+ spectator.typeInElement('test2', 'input[formControlName="name"]');
121
+ spectator.click('button[type="submit"]');
122
+ expect(spy).toHaveBeenCalledTimes(1);
123
+ });
124
+ });
@@ -0,0 +1,111 @@
1
+ import { Component, Injector, OnDestroy, OnInit } from '@angular/core';
2
+ import { UntypedFormGroup } from '@angular/forms';
3
+ import { AppSmartCrm } from '../../../../../shared/models/smart-crm.model';
4
+ import { CrmService } from '@posiwise/smart-crm-shared';
5
+ import { Observable } from 'rxjs';
6
+
7
+ import { CrmStage } from '../../../../../shared/interface/crm-stages.interface';
8
+ import { AppBaseComponent } from '@posiwise/app-base-component';
9
+
10
+ @Component({
11
+ selector: 'pw-smart-crm-stage-details',
12
+ templateUrl: './smart-crm-stage-details.component.html',
13
+ styleUrls: ['./smart-crm-stage-details.component.scss']
14
+ })
15
+ export class SmartCrmStageDetailsComponent extends AppBaseComponent implements OnInit, OnDestroy {
16
+ form: UntypedFormGroup;
17
+
18
+ data: CrmStage;
19
+
20
+ subscriptionId: number;
21
+
22
+ hasAccess: boolean;
23
+
24
+ submitted: boolean;
25
+ buttonBusy = false;
26
+ isLoading = true;
27
+
28
+ id: number;
29
+
30
+ stages$: Observable<string>;
31
+
32
+ categories = [];
33
+
34
+ constructor(
35
+ injector: Injector,
36
+ private crmService: CrmService
37
+ ) {
38
+ super(injector);
39
+ this.form = AppSmartCrm.getStageForm();
40
+ }
41
+
42
+ ngOnInit(): void {
43
+ this.getUserSubscriptionId().subscribe(response => {
44
+ if (response) {
45
+ this.subscriptionId = response;
46
+ this.hasAccess = this.hasAdminAccess(this.subscriptionId);
47
+ this.form.get('subscription_id').setValue(this.subscriptionId);
48
+ this.stages$ = this.crmService.getAllStages(this.subscriptionId);
49
+ this.getAllOpportunityCategories();
50
+ }
51
+ });
52
+ this.route.params.subscribe(data => {
53
+ this.id = Number(data['id']);
54
+ if (this.id) {
55
+ this.getStageDetails(this.id);
56
+ } else {
57
+ this.isLoading = false;
58
+ }
59
+ });
60
+ }
61
+
62
+ /** Function to get stage tDetails */
63
+ private getStageDetails(id) {
64
+ this.crmService.getStageDetails(this.subscriptionId, id).subscribe(response => {
65
+ this.isLoading = false;
66
+ this.data = response;
67
+ this.form.patchValue(response);
68
+ });
69
+ }
70
+
71
+ /** Function to get form controls */
72
+ get f() {
73
+ return this.form.controls;
74
+ }
75
+
76
+ onSave() {
77
+ if (this.form.valid) {
78
+ const data = this.form.value;
79
+ this.submitted = true;
80
+ this.buttonBusy = true;
81
+ const sub$ = this.id
82
+ ? this.crmService.editStage(this.subscriptionId, this.id, data)
83
+ : this.crmService.postStage(this.subscriptionId, data);
84
+ sub$.subscribe(() => {
85
+ this.toast.success(this.translation.translate('Crm.StageMessages.UpdatedMessage'));
86
+ this.back();
87
+ }).add(() => {
88
+ this.buttonBusy = false;
89
+ this.submitted = false;
90
+ });
91
+ }
92
+ }
93
+
94
+ /** Function to get all categories */
95
+ private getAllOpportunityCategories() {
96
+ this.crmService.getAllOpportunityCategories(this.subscriptionId).subscribe(response => {
97
+ const categories = response?.crm_opportunity_categories || [];
98
+ categories.forEach(val => {
99
+ const data = {
100
+ label: val.name,
101
+ value: val.id
102
+ };
103
+ this.categories.push(data);
104
+ });
105
+ });
106
+ }
107
+
108
+ override ngOnDestroy() {
109
+ super.ngOnDestroy();
110
+ }
111
+ }
@@ -0,0 +1,134 @@
1
+ <div class="row">
2
+ <div class="col-12">
3
+ <p>{{ 'Crm.StageMessages.StageTitle' | transloco }}</p>
4
+ <a *ngIf="data.object_count === 0 && data.unfiltered_count === 0 && isLoaded"
5
+ class="btn btn-sm btn-outline-primary float-end build-default-stage-button"
6
+ (click)="buildDefaultStages()"
7
+ data-cy="add-contact">
8
+ <i class="fa fa-plus-circle" aria-hidden="true"></i>
9
+ {{ 'Crm.StageMessages.BuildDefaultStage' | transloco }}
10
+ </a>
11
+ <a class="btn btn-sm btn-outline-primary float-end"
12
+ data-cy="add-contact"
13
+ [routerLink]="['/' + subscription?.slug + routers.stageDetails + 'add']">
14
+ <i class="fa fa-plus-circle" aria-hidden="true"></i>
15
+ {{ 'Crm.StageMessages.AddStage' | transloco }}
16
+ </a>
17
+ </div>
18
+ <div class="w-100 text-center mt-3">
19
+ <ng-template [ngIf]="!isLoaded">
20
+ <p-progressSpinner strokeWidth="2"> </p-progressSpinner>
21
+ </ng-template>
22
+ </div>
23
+ <div class="col-12">
24
+ <div class="primeng-datatable-container table-responsive"
25
+ [class.hideTable]="data.unfiltered_count === 0">
26
+ <p-table #dt
27
+ [value]="data.crm_opportunity_stages"
28
+ [paginator]="data.object_count !== 0"
29
+ [lazy]="true"
30
+ [rows]="PAGE_SIZE"
31
+ [totalRecords]="data.object_count"
32
+ [loading]="loading"
33
+ [filterDelay]="1000"
34
+ (onLazyLoad)="onLazyLoad($event)"
35
+ [customSort]="true">
36
+ <ng-template pTemplate="caption">
37
+ <div class="text-end">
38
+ <i class="fa fa-search mt-2 me-2" aria-hidden="true"></i>
39
+ <input type="text"
40
+ [(ngModel)]="searchText"
41
+ pInputText
42
+ size="50"
43
+ placeholder="Search stages..."
44
+ (input)="dt.filterGlobal($event.target.value, 'contains')"
45
+ class="mw-90" />
46
+ </div>
47
+ </ng-template>
48
+ <ng-template pTemplate="header">
49
+ <tr>
50
+ <th scope="true"
51
+ pSortableColumn="name">
52
+ {{ 'Crm.StageMessages.Name' | transloco }}
53
+ <p-sortIcon field="name"></p-sortIcon>
54
+ </th>
55
+ <th scope="true"
56
+ pSortableColumn="previous_stage_id">
57
+ {{ 'Crm.StageMessages.PreviousStage' | transloco }}
58
+ <p-sortIcon field="previous_stage_id"></p-sortIcon>
59
+ </th>
60
+ <th scope="true"
61
+ pSortableColumn="crm_opportunity_category_ids">
62
+ {{ 'Crm.StageMessages.OpportunityCategory' | transloco }}
63
+ <p-sortIcon field="crm_opportunity_category_ids"></p-sortIcon>
64
+ </th>
65
+ <th scope="true"
66
+ pSortableColumn="visible">
67
+ {{ 'Crm.StageMessages.Visible' | transloco }}
68
+ <p-sortIcon field="visible"></p-sortIcon>
69
+ </th>
70
+ <th scope="true">{{ 'Label.Actions' | transloco }}</th>
71
+ </tr>
72
+ </ng-template>
73
+ <ng-template pTemplate="body"
74
+ let-stage>
75
+ <tr>
76
+ <td data-head="Name">{{ stage?.name }}</td>
77
+ <td data-head="Previous Stage">
78
+ <span class="badge"
79
+ [appDynamicBadge]="{
80
+ itemsArray: stageNames,
81
+ item: stage?.crm_previous_stage?.name
82
+ }"
83
+ color="warning">{{ stage?.crm_previous_stage?.name }}</span>
84
+ </td>
85
+ <td data-head="Opportunity Category">
86
+ <span *ngFor="let category of stage?.crm_opportunity_categories"
87
+ class="badge ms-1"
88
+ [appDynamicBadge]="{ itemsArray: categories, item: category?.name }"
89
+ color="blue-grey">{{ category?.name }}</span>
90
+ </td>
91
+ <td data-head="Visible">
92
+ <span [appDynamicBadge]="{
93
+ itemsArray: [true, false],
94
+ item: stage?.visible
95
+ }"
96
+ color="success-danger"
97
+ class="badge">{{ !!stage?.visible }}</span>
98
+ </td>
99
+ <td data-head="Action">
100
+ <ul class="list-unstyled list-inline">
101
+ <ng-container *ngIf="hasAccess">
102
+ <li ngbTooltip="Edit"
103
+ class="me-2 me-sm-3"
104
+ [routerLink]="[
105
+ '/' + subscription?.slug + routers.stageDetails,
106
+ stage.id
107
+ ]">
108
+ <i class="fa fa-edit edit-icon" aria-hidden="true"></i>
109
+ </li>
110
+ <li ngbTooltip="Delete"
111
+ class="me-2 me-sm-3">
112
+ <i
113
+ class="fa fa-trash delete-icon"
114
+ (click)="onDelete(stage.id)"
115
+ aria-hidden="true"
116
+ ></i>
117
+ </li>
118
+ </ng-container>
119
+ </ul>
120
+ </td>
121
+ </tr>
122
+ </ng-template>
123
+ </p-table>
124
+ <div *ngIf="data.object_count === 0 && data.unfiltered_count !== 0">
125
+ <pw-no-data [withImage]="true" [message]="'Search.NoDataMessage'| transloco" [description]="'Search.NoDataDescription' | transloco" >
126
+ </pw-no-data>
127
+ </div>
128
+ <span class="total-records-count" *ngIf="data.object_count !== 0">{{ 'Label.Total' | transloco }}: {{ data.object_count }}</span>
129
+ </div>
130
+ </div>
131
+ </div>
132
+ <div *ngIf="data.unfiltered_count === 0 && isLoaded">
133
+ <pw-no-data [withImage]="true" [message]="'Crm.StageMessages.NoStageMessage' | transloco"> </pw-no-data>
134
+ </div>
@@ -0,0 +1,3 @@
1
+ .build-default-stage-button {
2
+ margin-left: 7px;
3
+ }