@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.
- package/.eslintrc.json +22 -0
- package/ng-package.json +15 -0
- package/package.json +10 -23
- package/project.json +72 -0
- package/{index.d.ts → src/index.ts} +3 -0
- package/src/lib/private/components/smart-crm-accounts/smart-crm-account-details/smart-crm-account-details.component.html +200 -0
- package/src/lib/private/components/smart-crm-accounts/smart-crm-account-details/smart-crm-account-details.component.spec.ts +185 -0
- package/src/lib/private/components/smart-crm-accounts/smart-crm-account-details/smart-crm-account-details.component.ts +238 -0
- package/src/lib/private/components/smart-crm-accounts/smart-crm-account-files/smart-crm-account-files.component.html +200 -0
- package/src/lib/private/components/smart-crm-accounts/smart-crm-account-files/smart-crm-account-files.component.spec.ts +109 -0
- package/src/lib/private/components/smart-crm-accounts/smart-crm-account-files/smart-crm-account-files.component.ts +249 -0
- package/src/lib/private/components/smart-crm-accounts/smart-crm-account-info/smart-crm-account-info.component.html +785 -0
- package/src/lib/private/components/smart-crm-accounts/smart-crm-account-info/smart-crm-account-info.component.scss +123 -0
- package/src/lib/private/components/smart-crm-accounts/smart-crm-account-info/smart-crm-account-info.component.spec.ts +388 -0
- package/src/lib/private/components/smart-crm-accounts/smart-crm-account-info/smart-crm-account-info.component.ts +792 -0
- package/src/lib/private/components/smart-crm-accounts/smart-crm-accounts.component.html +292 -0
- package/src/lib/private/components/smart-crm-accounts/smart-crm-accounts.component.scss +63 -0
- package/src/lib/private/components/smart-crm-accounts/smart-crm-accounts.component.spec.ts +145 -0
- package/src/lib/private/components/smart-crm-accounts/smart-crm-accounts.component.ts +417 -0
- package/src/lib/private/components/smart-crm-competition/smart-crm-competition/smart-crm-competition.component.html +1 -0
- package/src/lib/private/components/smart-crm-competition/smart-crm-competition/smart-crm-competition.component.spec.ts +17 -0
- package/src/lib/private/components/smart-crm-competition/smart-crm-competition/smart-crm-competition.component.ts +7 -0
- package/src/lib/private/components/smart-crm-configuration/smart-crm-actions/smart-crm-actions-details/smart-crm-actions-details.component.html +75 -0
- package/src/lib/private/components/smart-crm-configuration/smart-crm-actions/smart-crm-actions-details/smart-crm-actions-details.component.scss +3 -0
- package/src/lib/private/components/smart-crm-configuration/smart-crm-actions/smart-crm-actions-details/smart-crm-actions-details.component.spec.ts +123 -0
- package/src/lib/private/components/smart-crm-configuration/smart-crm-actions/smart-crm-actions-details/smart-crm-actions-details.component.ts +117 -0
- package/src/lib/private/components/smart-crm-configuration/smart-crm-actions/smart-crm-actions.component.html +125 -0
- package/src/lib/private/components/smart-crm-configuration/smart-crm-actions/smart-crm-actions.component.scss +5 -0
- package/src/lib/private/components/smart-crm-configuration/smart-crm-actions/smart-crm-actions.component.spec.ts +136 -0
- package/src/lib/private/components/smart-crm-configuration/smart-crm-actions/smart-crm-actions.component.ts +143 -0
- package/src/lib/private/components/smart-crm-configuration/smart-crm-configuration.component.html +60 -0
- package/src/lib/private/components/smart-crm-configuration/smart-crm-configuration.component.scss +1 -0
- package/src/lib/private/components/smart-crm-configuration/smart-crm-configuration.component.spec.ts +55 -0
- package/src/lib/private/components/smart-crm-configuration/smart-crm-configuration.component.ts +29 -0
- 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
- 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
- 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
- package/src/lib/private/components/smart-crm-configuration/smart-crm-opportunity-categories/smart-crm-opportunity-categories.component.html +125 -0
- package/src/lib/private/components/smart-crm-configuration/smart-crm-opportunity-categories/smart-crm-opportunity-categories.component.scss +3 -0
- package/src/lib/private/components/smart-crm-configuration/smart-crm-opportunity-categories/smart-crm-opportunity-categories.component.spec.ts +132 -0
- package/src/lib/private/components/smart-crm-configuration/smart-crm-opportunity-categories/smart-crm-opportunity-categories.component.ts +145 -0
- package/src/lib/private/components/smart-crm-configuration/smart-crm-source/smart-crm-source-details/smart-crm-source-details.component.html +61 -0
- package/src/lib/private/components/smart-crm-configuration/smart-crm-source/smart-crm-source-details/smart-crm-source-details.component.spec.ts +81 -0
- package/src/lib/private/components/smart-crm-configuration/smart-crm-source/smart-crm-source-details/smart-crm-source-details.component.ts +88 -0
- package/src/lib/private/components/smart-crm-configuration/smart-crm-source/smart-crm-source.component.html +96 -0
- package/src/lib/private/components/smart-crm-configuration/smart-crm-source/smart-crm-source.component.scss +3 -0
- package/src/lib/private/components/smart-crm-configuration/smart-crm-source/smart-crm-source.component.spec.ts +109 -0
- package/src/lib/private/components/smart-crm-configuration/smart-crm-source/smart-crm-source.component.ts +129 -0
- package/src/lib/private/components/smart-crm-configuration/smart-crm-stages/smart-crm-stage-details/smart-crm-stage-details.component.html +108 -0
- package/src/lib/private/components/smart-crm-configuration/smart-crm-stages/smart-crm-stage-details/smart-crm-stage-details.component.scss +3 -0
- package/src/lib/private/components/smart-crm-configuration/smart-crm-stages/smart-crm-stage-details/smart-crm-stage-details.component.spec.ts +124 -0
- package/src/lib/private/components/smart-crm-configuration/smart-crm-stages/smart-crm-stage-details/smart-crm-stage-details.component.ts +111 -0
- package/src/lib/private/components/smart-crm-configuration/smart-crm-stages/smart-crm-stages.component.html +134 -0
- package/src/lib/private/components/smart-crm-configuration/smart-crm-stages/smart-crm-stages.component.scss +3 -0
- package/src/lib/private/components/smart-crm-configuration/smart-crm-stages/smart-crm-stages.component.spec.ts +103 -0
- package/src/lib/private/components/smart-crm-configuration/smart-crm-stages/smart-crm-stages.component.ts +166 -0
- package/src/lib/private/components/smart-crm-configuration/smart-crm-widgets/smart-crm-widgets-details/smart-crm-widgets-details.component.html +90 -0
- package/src/lib/private/components/smart-crm-configuration/smart-crm-widgets/smart-crm-widgets-details/smart-crm-widgets-details.component.scss +6 -0
- package/src/lib/private/components/smart-crm-configuration/smart-crm-widgets/smart-crm-widgets-details/smart-crm-widgets-details.component.spec.ts +105 -0
- package/src/lib/private/components/smart-crm-configuration/smart-crm-widgets/smart-crm-widgets-details/smart-crm-widgets-details.component.ts +118 -0
- package/src/lib/private/components/smart-crm-configuration/smart-crm-widgets/smart-crm-widgets.component.html +115 -0
- package/src/lib/private/components/smart-crm-configuration/smart-crm-widgets/smart-crm-widgets.component.spec.ts +93 -0
- package/src/lib/private/components/smart-crm-configuration/smart-crm-widgets/smart-crm-widgets.component.ts +150 -0
- package/src/lib/private/components/smart-crm-contacts/smart-crm-contact-details/smart-crm-contact-details.component.html +205 -0
- package/src/lib/private/components/smart-crm-contacts/smart-crm-contact-details/smart-crm-contact-details.component.spec.ts +149 -0
- package/src/lib/private/components/smart-crm-contacts/smart-crm-contact-details/smart-crm-contact-details.component.ts +184 -0
- package/src/lib/private/components/smart-crm-contacts/smart-crm-contact-info/smart-crm-contact-info.component.html +530 -0
- package/src/lib/private/components/smart-crm-contacts/smart-crm-contact-info/smart-crm-contact-info.component.scss +112 -0
- package/src/lib/private/components/smart-crm-contacts/smart-crm-contact-info/smart-crm-contact-info.component.spec.ts +284 -0
- package/src/lib/private/components/smart-crm-contacts/smart-crm-contact-info/smart-crm-contact-info.component.ts +553 -0
- package/src/lib/private/components/smart-crm-contacts/smart-crm-contacts.component.html +281 -0
- package/src/lib/private/components/smart-crm-contacts/smart-crm-contacts.component.scss +19 -0
- package/src/lib/private/components/smart-crm-contacts/smart-crm-contacts.component.spec.ts +138 -0
- package/src/lib/private/components/smart-crm-contacts/smart-crm-contacts.component.ts +344 -0
- package/src/lib/private/components/smart-crm-customer/smart-crm-customer-success/smart-crm-customer-success.component.html +1 -0
- package/src/lib/private/components/smart-crm-customer/smart-crm-customer-success/smart-crm-customer-success.component.spec.ts +18 -0
- package/src/lib/private/components/smart-crm-customer/smart-crm-customer-success/smart-crm-customer-success.component.ts +7 -0
- package/src/lib/private/components/smart-crm-insight/smart-crm-insight.component.html +27 -0
- package/src/lib/private/components/smart-crm-insight/smart-crm-insight.component.spec.ts +19 -0
- package/src/lib/private/components/smart-crm-insight/smart-crm-insight.component.ts +7 -0
- package/src/lib/private/components/smart-crm-insight/smart-crm-overview/smart-crm-overview.component.html +46 -0
- package/src/lib/private/components/smart-crm-insight/smart-crm-overview/smart-crm-overview.component.spec.ts +50 -0
- package/src/lib/private/components/smart-crm-insight/smart-crm-overview/smart-crm-overview.component.ts +60 -0
- package/src/lib/private/components/smart-crm-leads/smart-crm-leads-details/smart-crm-leads-details.component.html +142 -0
- package/src/lib/private/components/smart-crm-leads/smart-crm-leads-details/smart-crm-leads-details.component.spec.ts +125 -0
- package/src/lib/private/components/smart-crm-leads/smart-crm-leads-details/smart-crm-leads-details.component.ts +192 -0
- package/src/lib/private/components/smart-crm-leads/smart-crm-leads.component.html +176 -0
- package/src/lib/private/components/smart-crm-leads/smart-crm-leads.component.spec.ts +98 -0
- package/src/lib/private/components/smart-crm-leads/smart-crm-leads.component.ts +160 -0
- package/src/lib/private/components/smart-crm-marketing/smart-crm-marketing-list/smart-crm-marketing-contacts/smart-crm-marketing-contacts.component.html +90 -0
- 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
- package/src/lib/private/components/smart-crm-marketing/smart-crm-marketing-list/smart-crm-marketing-contacts/smart-crm-marketing-contacts.component.ts +98 -0
- package/src/lib/private/components/smart-crm-marketing/smart-crm-marketing-list/smart-crm-marketing-details/smart-crm-marketing-details.component.html +322 -0
- 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
- package/src/lib/private/components/smart-crm-marketing/smart-crm-marketing-list/smart-crm-marketing-details/smart-crm-marketing-details.component.ts +296 -0
- package/src/lib/private/components/smart-crm-marketing/smart-crm-marketing-list/smart-crm-marketing-list.component.html +215 -0
- package/src/lib/private/components/smart-crm-marketing/smart-crm-marketing-list/smart-crm-marketing-list.component.scss +3 -0
- package/src/lib/private/components/smart-crm-marketing/smart-crm-marketing-list/smart-crm-marketing-list.component.spec.ts +117 -0
- package/src/lib/private/components/smart-crm-marketing/smart-crm-marketing-list/smart-crm-marketing-list.component.ts +187 -0
- 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
- 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
- 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
- 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
- package/src/lib/private/components/smart-crm-marketing/smart-crm-marketing.component.html +27 -0
- package/src/lib/private/components/smart-crm-marketing/smart-crm-marketing.component.scss +3 -0
- package/src/lib/private/components/smart-crm-marketing/smart-crm-marketing.component.spec.ts +28 -0
- package/src/lib/private/components/smart-crm-marketing/smart-crm-marketing.component.ts +13 -0
- package/src/lib/private/components/smart-crm-opportunities/smart-crm-board/smart-crm-board.component.html +75 -0
- package/src/lib/private/components/smart-crm-opportunities/smart-crm-board/smart-crm-board.component.scss +223 -0
- package/src/lib/private/components/smart-crm-opportunities/smart-crm-board/smart-crm-board.component.spec.ts +184 -0
- package/src/lib/private/components/smart-crm-opportunities/smart-crm-board/smart-crm-board.component.ts +268 -0
- package/src/lib/private/components/smart-crm-opportunities/smart-crm-opportunities-list/smart-crm-opportunities-details/smart-crm-opportunities-details.component.html +273 -0
- package/src/lib/private/components/smart-crm-opportunities/smart-crm-opportunities-list/smart-crm-opportunities-details/smart-crm-opportunities-details.component.scss +11 -0
- 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
- package/src/lib/private/components/smart-crm-opportunities/smart-crm-opportunities-list/smart-crm-opportunities-details/smart-crm-opportunities-details.component.ts +391 -0
- package/src/lib/private/components/smart-crm-opportunities/smart-crm-opportunities-list/smart-crm-opportunities-info/smart-crm-opportunities-info.component.html +489 -0
- package/src/lib/private/components/smart-crm-opportunities/smart-crm-opportunities-list/smart-crm-opportunities-info/smart-crm-opportunities-info.component.scss +104 -0
- 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
- package/src/lib/private/components/smart-crm-opportunities/smart-crm-opportunities-list/smart-crm-opportunities-info/smart-crm-opportunities-info.component.ts +568 -0
- package/src/lib/private/components/smart-crm-opportunities/smart-crm-opportunities-list/smart-crm-opportunities-list.component.html +204 -0
- package/src/lib/private/components/smart-crm-opportunities/smart-crm-opportunities-list/smart-crm-opportunities-list.component.scss +11 -0
- package/src/lib/private/components/smart-crm-opportunities/smart-crm-opportunities-list/smart-crm-opportunities-list.component.spec.ts +123 -0
- package/src/lib/private/components/smart-crm-opportunities/smart-crm-opportunities-list/smart-crm-opportunities-list.component.ts +260 -0
- package/src/lib/private/components/smart-crm-opportunities/smart-crm-opportunities.component.html +25 -0
- package/src/lib/private/components/smart-crm-opportunities/smart-crm-opportunities.component.scss +7 -0
- package/src/lib/private/components/smart-crm-opportunities/smart-crm-opportunities.component.spec.ts +38 -0
- package/src/lib/private/components/smart-crm-opportunities/smart-crm-opportunities.component.ts +8 -0
- package/src/lib/private/components/smart-crm-summary/smart-crm-summary-actions/smart-crm-summary-actions.component.html +213 -0
- package/src/lib/private/components/smart-crm-summary/smart-crm-summary-actions/smart-crm-summary-actions.component.scss +73 -0
- package/src/lib/private/components/smart-crm-summary/smart-crm-summary-actions/smart-crm-summary-actions.component.spec.ts +147 -0
- package/src/lib/private/components/smart-crm-summary/smart-crm-summary-actions/smart-crm-summary-actions.component.ts +292 -0
- package/src/lib/private/components/smart-crm-summary/smart-crm-summary-others/smart-crm-summary-others.component.html +309 -0
- package/src/lib/private/components/smart-crm-summary/smart-crm-summary-others/smart-crm-summary-others.component.spec.ts +75 -0
- package/src/lib/private/components/smart-crm-summary/smart-crm-summary-others/smart-crm-summary-others.component.ts +161 -0
- package/src/lib/private/components/smart-crm-summary/smart-crm-summary.component.html +25 -0
- package/src/lib/private/components/smart-crm-summary/smart-crm-summary.component.scss +68 -0
- package/src/lib/private/components/smart-crm-summary/smart-crm-summary.component.spec.ts +32 -0
- package/src/lib/private/components/smart-crm-summary/smart-crm-summary.component.ts +8 -0
- package/src/lib/private/components/smart-crm-tabs/smart-crm-tabs.component.spec.ts +43 -0
- package/src/lib/private/components/smart-crm-tabs/smart-crm-tabs.component.ts +97 -0
- package/src/lib/private/smart-crm-private.module.ts +188 -0
- package/src/lib/private/smart-crm-private.routing.module.ts +303 -0
- package/src/lib/public/components/smart-crm-newsletter-confirmation/smart-crm-newsletter-confirmation.component.html +27 -0
- package/src/lib/public/components/smart-crm-newsletter-confirmation/smart-crm-newsletter-confirmation.component.scss +4 -0
- package/src/lib/public/components/smart-crm-newsletter-confirmation/smart-crm-newsletter-confirmation.component.spec.ts +40 -0
- package/src/lib/public/components/smart-crm-newsletter-confirmation/smart-crm-newsletter-confirmation.component.ts +57 -0
- package/src/lib/public/components/smart-crm-newsletter-unsubscribe/smart-crm-newsletter-unsubscribe.component.html +36 -0
- package/src/lib/public/components/smart-crm-newsletter-unsubscribe/smart-crm-newsletter-unsubscribe.component.spec.ts +42 -0
- package/src/lib/public/components/smart-crm-newsletter-unsubscribe/smart-crm-newsletter-unsubscribe.component.ts +57 -0
- package/src/lib/public/components/smart-crm-signup/smart-crm-signup.component.html +133 -0
- package/src/lib/public/components/smart-crm-signup/smart-crm-signup.component.scss +1 -0
- package/src/lib/public/components/smart-crm-signup/smart-crm-signup.component.spec.ts +37 -0
- package/src/lib/public/components/smart-crm-signup/smart-crm-signup.component.ts +41 -0
- package/src/lib/public/smart-crm-public.module.ts +30 -0
- package/src/lib/public/smart-crm-public.routing.module.ts +36 -0
- package/{lib/shared/interface/crm-account.interface.d.ts → src/lib/shared/interface/crm-account.interface.ts} +10 -3
- package/{lib/shared/interface/crm-action.interface.d.ts → src/lib/shared/interface/crm-action.interface.ts} +1 -0
- package/{lib/shared/interface/crm-contact.interface.d.ts → src/lib/shared/interface/crm-contact.interface.ts} +2 -0
- package/{lib/shared/interface/crm-lead.interface.d.ts → src/lib/shared/interface/crm-lead.interface.ts} +1 -0
- package/{lib/shared/interface/crm-newsletter.interface.d.ts → src/lib/shared/interface/crm-newsletter.interface.ts} +3 -1
- package/{lib/shared/interface/crm-opportunity.interface.d.ts → src/lib/shared/interface/crm-opportunity.interface.ts} +5 -0
- package/{lib/shared/interface/crm-source.interface.d.ts → src/lib/shared/interface/crm-source.interface.ts} +1 -0
- package/{lib/shared/interface/crm-stages.interface.d.ts → src/lib/shared/interface/crm-stages.interface.ts} +1 -0
- package/{lib/shared/interface/crm-widget.interface.d.ts → src/lib/shared/interface/crm-widget.interface.ts} +1 -0
- package/{lib/shared/interface/smart-crm-module.interface.d.ts → src/lib/shared/interface/smart-crm-module.interface.ts} +42 -1
- package/src/lib/shared/models/smart-crm.model.ts +199 -0
- package/src/lib/shared/routers/routers.ts +23 -0
- package/tsconfig.json +29 -0
- package/tsconfig.lib.json +25 -0
- package/tsconfig.lib.prod.json +9 -0
- package/tsconfig.spec.json +11 -0
- package/esm2022/index.mjs +0 -48
- package/esm2022/lib/private/components/smart-crm-accounts/smart-crm-account-details/smart-crm-account-details.component.mjs +0 -194
- package/esm2022/lib/private/components/smart-crm-accounts/smart-crm-account-files/smart-crm-account-files.component.mjs +0 -192
- package/esm2022/lib/private/components/smart-crm-accounts/smart-crm-account-info/smart-crm-account-info.component.mjs +0 -589
- package/esm2022/lib/private/components/smart-crm-accounts/smart-crm-accounts.component.mjs +0 -348
- package/esm2022/lib/private/components/smart-crm-competition/smart-crm-competition/smart-crm-competition.component.mjs +0 -12
- package/esm2022/lib/private/components/smart-crm-configuration/smart-crm-actions/smart-crm-actions-details/smart-crm-actions-details.component.mjs +0 -97
- package/esm2022/lib/private/components/smart-crm-configuration/smart-crm-actions/smart-crm-actions.component.mjs +0 -118
- package/esm2022/lib/private/components/smart-crm-configuration/smart-crm-configuration.component.mjs +0 -35
- 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
- package/esm2022/lib/private/components/smart-crm-configuration/smart-crm-opportunity-categories/smart-crm-opportunity-categories.component.mjs +0 -119
- package/esm2022/lib/private/components/smart-crm-configuration/smart-crm-source/smart-crm-source-details/smart-crm-source-details.component.mjs +0 -79
- package/esm2022/lib/private/components/smart-crm-configuration/smart-crm-source/smart-crm-source.component.mjs +0 -107
- package/esm2022/lib/private/components/smart-crm-configuration/smart-crm-stages/smart-crm-stage-details/smart-crm-stage-details.component.mjs +0 -96
- package/esm2022/lib/private/components/smart-crm-configuration/smart-crm-stages/smart-crm-stages.component.mjs +0 -139
- package/esm2022/lib/private/components/smart-crm-configuration/smart-crm-widgets/smart-crm-widgets-details/smart-crm-widgets-details.component.mjs +0 -98
- package/esm2022/lib/private/components/smart-crm-configuration/smart-crm-widgets/smart-crm-widgets.component.mjs +0 -125
- package/esm2022/lib/private/components/smart-crm-contacts/smart-crm-contact-details/smart-crm-contact-details.component.mjs +0 -159
- package/esm2022/lib/private/components/smart-crm-contacts/smart-crm-contact-info/smart-crm-contact-info.component.mjs +0 -465
- package/esm2022/lib/private/components/smart-crm-contacts/smart-crm-contacts.component.mjs +0 -281
- package/esm2022/lib/private/components/smart-crm-customer/smart-crm-customer-success/smart-crm-customer-success.component.mjs +0 -12
- package/esm2022/lib/private/components/smart-crm-insight/smart-crm-insight.component.mjs +0 -14
- package/esm2022/lib/private/components/smart-crm-insight/smart-crm-overview/smart-crm-overview.component.mjs +0 -55
- package/esm2022/lib/private/components/smart-crm-leads/smart-crm-leads-details/smart-crm-leads-details.component.mjs +0 -173
- package/esm2022/lib/private/components/smart-crm-leads/smart-crm-leads.component.mjs +0 -136
- package/esm2022/lib/private/components/smart-crm-marketing/smart-crm-marketing-list/smart-crm-marketing-contacts/smart-crm-marketing-contacts.component.mjs +0 -79
- package/esm2022/lib/private/components/smart-crm-marketing/smart-crm-marketing-list/smart-crm-marketing-details/smart-crm-marketing-details.component.mjs +0 -266
- package/esm2022/lib/private/components/smart-crm-marketing/smart-crm-marketing-list/smart-crm-marketing-list.component.mjs +0 -151
- 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
- package/esm2022/lib/private/components/smart-crm-marketing/smart-crm-marketing.component.mjs +0 -18
- package/esm2022/lib/private/components/smart-crm-opportunities/smart-crm-board/smart-crm-board.component.mjs +0 -230
- package/esm2022/lib/private/components/smart-crm-opportunities/smart-crm-opportunities-list/smart-crm-opportunities-details/smart-crm-opportunities-details.component.mjs +0 -317
- package/esm2022/lib/private/components/smart-crm-opportunities/smart-crm-opportunities-list/smart-crm-opportunities-info/smart-crm-opportunities-info.component.mjs +0 -477
- package/esm2022/lib/private/components/smart-crm-opportunities/smart-crm-opportunities-list/smart-crm-opportunities-list.component.mjs +0 -218
- package/esm2022/lib/private/components/smart-crm-opportunities/smart-crm-opportunities.component.mjs +0 -14
- package/esm2022/lib/private/components/smart-crm-summary/smart-crm-summary-actions/smart-crm-summary-actions.component.mjs +0 -255
- package/esm2022/lib/private/components/smart-crm-summary/smart-crm-summary-others/smart-crm-summary-others.component.mjs +0 -148
- package/esm2022/lib/private/components/smart-crm-summary/smart-crm-summary.component.mjs +0 -16
- package/esm2022/lib/private/components/smart-crm-tabs/smart-crm-tabs.component.mjs +0 -92
- package/esm2022/lib/private/smart-crm-private.module.mjs +0 -327
- package/esm2022/lib/private/smart-crm-private.routing.module.mjs +0 -310
- package/esm2022/lib/public/components/smart-crm-newsletter-confirmation/smart-crm-newsletter-confirmation.component.mjs +0 -56
- package/esm2022/lib/public/components/smart-crm-newsletter-unsubscribe/smart-crm-newsletter-unsubscribe.component.mjs +0 -57
- package/esm2022/lib/public/components/smart-crm-signup/smart-crm-signup.component.mjs +0 -35
- package/esm2022/lib/public/smart-crm-public.module.mjs +0 -46
- package/esm2022/lib/public/smart-crm-public.routing.module.mjs +0 -44
- package/esm2022/lib/shared/interface/crm-account.interface.mjs +0 -2
- package/esm2022/lib/shared/interface/crm-action.interface.mjs +0 -2
- package/esm2022/lib/shared/interface/crm-contact.interface.mjs +0 -2
- package/esm2022/lib/shared/interface/crm-lead.interface.mjs +0 -2
- package/esm2022/lib/shared/interface/crm-newsletter.interface.mjs +0 -2
- package/esm2022/lib/shared/interface/crm-opportunity.interface.mjs +0 -2
- package/esm2022/lib/shared/interface/crm-source.interface.mjs +0 -2
- package/esm2022/lib/shared/interface/crm-stages.interface.mjs +0 -2
- package/esm2022/lib/shared/interface/crm-widget.interface.mjs +0 -2
- package/esm2022/lib/shared/interface/smart-crm-module.interface.mjs +0 -2
- package/esm2022/lib/shared/models/smart-crm.model.mjs +0 -186
- package/esm2022/lib/shared/routers/routers.mjs +0 -23
- package/esm2022/posiwise-smart-crm.mjs +0 -5
- package/fesm2022/posiwise-smart-crm.mjs +0 -6449
- package/fesm2022/posiwise-smart-crm.mjs.map +0 -1
- package/lib/private/components/smart-crm-accounts/smart-crm-account-details/smart-crm-account-details.component.d.ts +0 -61
- package/lib/private/components/smart-crm-accounts/smart-crm-account-files/smart-crm-account-files.component.d.ts +0 -72
- package/lib/private/components/smart-crm-accounts/smart-crm-account-info/smart-crm-account-info.component.d.ts +0 -172
- package/lib/private/components/smart-crm-accounts/smart-crm-accounts.component.d.ts +0 -105
- package/lib/private/components/smart-crm-competition/smart-crm-competition/smart-crm-competition.component.d.ts +0 -5
- package/lib/private/components/smart-crm-configuration/smart-crm-actions/smart-crm-actions-details/smart-crm-actions-details.component.d.ts +0 -37
- package/lib/private/components/smart-crm-configuration/smart-crm-actions/smart-crm-actions.component.d.ts +0 -55
- package/lib/private/components/smart-crm-configuration/smart-crm-configuration.component.d.ts +0 -11
- 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
- package/lib/private/components/smart-crm-configuration/smart-crm-opportunity-categories/smart-crm-opportunity-categories.component.d.ts +0 -56
- package/lib/private/components/smart-crm-configuration/smart-crm-source/smart-crm-source-details/smart-crm-source-details.component.d.ts +0 -28
- package/lib/private/components/smart-crm-configuration/smart-crm-source/smart-crm-source.component.d.ts +0 -52
- package/lib/private/components/smart-crm-configuration/smart-crm-stages/smart-crm-stage-details/smart-crm-stage-details.component.d.ts +0 -34
- package/lib/private/components/smart-crm-configuration/smart-crm-stages/smart-crm-stages.component.d.ts +0 -58
- package/lib/private/components/smart-crm-configuration/smart-crm-widgets/smart-crm-widgets-details/smart-crm-widgets-details.component.d.ts +0 -36
- package/lib/private/components/smart-crm-configuration/smart-crm-widgets/smart-crm-widgets.component.d.ts +0 -58
- package/lib/private/components/smart-crm-contacts/smart-crm-contact-details/smart-crm-contact-details.component.d.ts +0 -48
- package/lib/private/components/smart-crm-contacts/smart-crm-contact-info/smart-crm-contact-info.component.d.ts +0 -121
- package/lib/private/components/smart-crm-contacts/smart-crm-contacts.component.d.ts +0 -89
- package/lib/private/components/smart-crm-customer/smart-crm-customer-success/smart-crm-customer-success.component.d.ts +0 -5
- package/lib/private/components/smart-crm-insight/smart-crm-insight.component.d.ts +0 -5
- package/lib/private/components/smart-crm-insight/smart-crm-overview/smart-crm-overview.component.d.ts +0 -20
- package/lib/private/components/smart-crm-leads/smart-crm-leads-details/smart-crm-leads-details.component.d.ts +0 -45
- package/lib/private/components/smart-crm-leads/smart-crm-leads.component.d.ts +0 -58
- package/lib/private/components/smart-crm-marketing/smart-crm-marketing-list/smart-crm-marketing-contacts/smart-crm-marketing-contacts.component.d.ts +0 -49
- package/lib/private/components/smart-crm-marketing/smart-crm-marketing-list/smart-crm-marketing-details/smart-crm-marketing-details.component.d.ts +0 -63
- package/lib/private/components/smart-crm-marketing/smart-crm-marketing-list/smart-crm-marketing-list.component.d.ts +0 -62
- 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
- package/lib/private/components/smart-crm-marketing/smart-crm-marketing.component.d.ts +0 -8
- package/lib/private/components/smart-crm-opportunities/smart-crm-board/smart-crm-board.component.d.ts +0 -63
- package/lib/private/components/smart-crm-opportunities/smart-crm-opportunities-list/smart-crm-opportunities-details/smart-crm-opportunities-details.component.d.ts +0 -66
- package/lib/private/components/smart-crm-opportunities/smart-crm-opportunities-list/smart-crm-opportunities-info/smart-crm-opportunities-info.component.d.ts +0 -122
- package/lib/private/components/smart-crm-opportunities/smart-crm-opportunities-list/smart-crm-opportunities-list.component.d.ts +0 -77
- package/lib/private/components/smart-crm-opportunities/smart-crm-opportunities.component.d.ts +0 -5
- package/lib/private/components/smart-crm-summary/smart-crm-summary-actions/smart-crm-summary-actions.component.d.ts +0 -72
- package/lib/private/components/smart-crm-summary/smart-crm-summary-others/smart-crm-summary-others.component.d.ts +0 -40
- package/lib/private/components/smart-crm-summary/smart-crm-summary.component.d.ts +0 -5
- package/lib/private/components/smart-crm-tabs/smart-crm-tabs.component.d.ts +0 -10
- package/lib/private/smart-crm-private.module.d.ts +0 -62
- package/lib/private/smart-crm-private.routing.module.d.ts +0 -7
- package/lib/public/components/smart-crm-newsletter-confirmation/smart-crm-newsletter-confirmation.component.d.ts +0 -18
- package/lib/public/components/smart-crm-newsletter-unsubscribe/smart-crm-newsletter-unsubscribe.component.d.ts +0 -17
- package/lib/public/components/smart-crm-signup/smart-crm-signup.component.d.ts +0 -15
- package/lib/public/smart-crm-public.module.d.ts +0 -14
- package/lib/public/smart-crm-public.routing.module.d.ts +0 -7
- package/lib/shared/models/smart-crm.model.d.ts +0 -16
- package/lib/shared/routers/routers.d.ts +0 -21
|
@@ -0,0 +1,223 @@
|
|
|
1
|
+
@import 'variables';
|
|
2
|
+
|
|
3
|
+
.card {
|
|
4
|
+
box-shadow: 2px 3px rgb(128 128 128);
|
|
5
|
+
padding-bottom: 0;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
.main-div {
|
|
9
|
+
border: 1px solid rgb(175 175 175);
|
|
10
|
+
border-radius: 5px;
|
|
11
|
+
margin-right: 10px;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.opportunities-board-title {
|
|
15
|
+
background-color: rgb(250 250 250);
|
|
16
|
+
|
|
17
|
+
h4 {
|
|
18
|
+
color: rgb(255 255 255);
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.edit-button {
|
|
23
|
+
cursor: pointer;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.items-container {
|
|
27
|
+
height: 500px;
|
|
28
|
+
overflow-y: scroll;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.list-container {
|
|
32
|
+
overflow: auto;
|
|
33
|
+
width: 100%;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.opportunities-container {
|
|
37
|
+
display: inline-block;
|
|
38
|
+
margin: 0 13px 13px 0;
|
|
39
|
+
max-width: 80%;
|
|
40
|
+
min-width: 280px;
|
|
41
|
+
vertical-align: top;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.opportunities-list {
|
|
45
|
+
background: rgb(255 255 255);
|
|
46
|
+
border: solid 1px rgb(204 204 204);
|
|
47
|
+
display: block;
|
|
48
|
+
min-height: 450px;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.footer-list {
|
|
52
|
+
background: rgb(255 255 255);
|
|
53
|
+
border: solid 1px rgb(204 204 204);
|
|
54
|
+
display: block;
|
|
55
|
+
min-height: 10px;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
.opportunities-box {
|
|
59
|
+
align-items: center;
|
|
60
|
+
background: rgb(255 255 255);
|
|
61
|
+
border: solid 1px rgb(204 204 204);
|
|
62
|
+
box-sizing: border-box;
|
|
63
|
+
color: rgb(0 0 0 / 87%);
|
|
64
|
+
cursor: move;
|
|
65
|
+
display: block;
|
|
66
|
+
flex-direction: row;
|
|
67
|
+
font-size: 14px;
|
|
68
|
+
justify-content: space-between;
|
|
69
|
+
margin: 5px;
|
|
70
|
+
padding: 10px 20px;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
.cdk-drag-preview {
|
|
74
|
+
border-radius: 4px;
|
|
75
|
+
box-shadow:
|
|
76
|
+
0 5px 5px -3px rgb(0 0 0 / 20%),
|
|
77
|
+
0 8px 10px 1px rgb(0 0 0 / 14%),
|
|
78
|
+
0 3px 14px 2px rgb(0 0 0 / 12%);
|
|
79
|
+
box-sizing: border-box;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
.cdk-drag-placeholder {
|
|
83
|
+
opacity: 0;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
.cdk-drag-animating {
|
|
87
|
+
transition: transform 250ms cubic-bezier(0, 0, 0.2, 1);
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
.opportunities-list.cdk-drop-list-dragging .opportunities-box:not(.cdk-drag-placeholder) {
|
|
91
|
+
transition: transform 250ms cubic-bezier(0, 0, 0.2, 1);
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
.footer-list.cdk-drop-list-dragging .opportunities-box:not(.cdk-drag-placeholder) {
|
|
95
|
+
transition: transform 250ms cubic-bezier(0, 0, 0.2, 1);
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
.add-opportunity-icon {
|
|
99
|
+
color: rgb(255 255 255);
|
|
100
|
+
font-size: 16px;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
.collapse-column-toggle {
|
|
104
|
+
background: rgb(230 223 223);
|
|
105
|
+
border-radius: 2px;
|
|
106
|
+
cursor: pointer;
|
|
107
|
+
font-size: 16px;
|
|
108
|
+
margin-left: 10px;
|
|
109
|
+
|
|
110
|
+
i {
|
|
111
|
+
padding: 0 8px;
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
.dynamic-columns-wrapper {
|
|
116
|
+
min-width: 50px;
|
|
117
|
+
width: 50px !important;
|
|
118
|
+
|
|
119
|
+
.opportunities-list {
|
|
120
|
+
display: none;
|
|
121
|
+
}
|
|
122
|
+
.footer-list {
|
|
123
|
+
display: none;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
.opportunities-board-title {
|
|
127
|
+
flex-direction: column;
|
|
128
|
+
height: 100%;
|
|
129
|
+
min-height: 450px;
|
|
130
|
+
|
|
131
|
+
.collapse-column-toggle {
|
|
132
|
+
margin-left: 0;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
.stage-name {
|
|
136
|
+
padding-left: 0 !important;
|
|
137
|
+
writing-mode: vertical-lr;
|
|
138
|
+
|
|
139
|
+
.badge {
|
|
140
|
+
padding: 8px 4px !important;
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
.add-opportunity-icon {
|
|
145
|
+
margin: 0 auto !important;
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
.crm-board-success {
|
|
151
|
+
border-top: 3px solid map-get($success, base);
|
|
152
|
+
|
|
153
|
+
.stage-name {
|
|
154
|
+
.badge {
|
|
155
|
+
background-color: map-get($success, base);
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
.crm-board-info {
|
|
161
|
+
border-top: 3px solid map-get($info, base);
|
|
162
|
+
|
|
163
|
+
.stage-name {
|
|
164
|
+
.badge {
|
|
165
|
+
background-color: map-get($info, base);
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
.crm-board-danger {
|
|
171
|
+
border-top: 3px solid map-get($danger, base);
|
|
172
|
+
|
|
173
|
+
.stage-name {
|
|
174
|
+
.badge {
|
|
175
|
+
background-color: map-get($danger, base);
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
.crm-board-warning {
|
|
181
|
+
border-top: 3px solid map-get($warning, base);
|
|
182
|
+
|
|
183
|
+
.stage-name {
|
|
184
|
+
.badge {
|
|
185
|
+
background-color: map-get($warning, base);
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
.footer {
|
|
190
|
+
background-color: #f8f9fa;
|
|
191
|
+
padding: 10px;
|
|
192
|
+
display: flex;
|
|
193
|
+
justify-content: space-between;
|
|
194
|
+
flex-direction: row;
|
|
195
|
+
align-items: center;
|
|
196
|
+
border-radius: 8px;
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
.footer-item {
|
|
200
|
+
display: flex;
|
|
201
|
+
flex-direction: column;
|
|
202
|
+
align-items: center;
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
.footer-label {
|
|
206
|
+
font-weight: bold;
|
|
207
|
+
color: #6c757d;
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
.footer-value {
|
|
211
|
+
color: #212529;
|
|
212
|
+
font-size: 1.1em;
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
.crm-board-primary {
|
|
216
|
+
border-top: 3px solid var(--border-color, $tabs-bg);
|
|
217
|
+
|
|
218
|
+
.stage-name {
|
|
219
|
+
.badge {
|
|
220
|
+
background-color: var(--background-color, $tabs-bg);
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
}
|
|
@@ -0,0 +1,184 @@
|
|
|
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 {
|
|
6
|
+
ContainerModel,
|
|
7
|
+
DEFAULT_USER,
|
|
8
|
+
DragDropEventFactory,
|
|
9
|
+
TestHelper
|
|
10
|
+
} from '@posiwise/test-helpers';
|
|
11
|
+
import { MockDirective, MockProvider } from 'ng-mocks';
|
|
12
|
+
import { GooglePlaceDirective } from 'ngx-google-places-autocomplete';
|
|
13
|
+
import { of } from 'rxjs';
|
|
14
|
+
import { SmartCrmPrivateModule } from '../../../smart-crm-private.module';
|
|
15
|
+
import { SmartCrmBoardComponent } from './smart-crm-board.component';
|
|
16
|
+
import { CdkDragDrop } from '@angular/cdk/drag-drop';
|
|
17
|
+
|
|
18
|
+
class UserServiceMock {
|
|
19
|
+
getUserState() {
|
|
20
|
+
return of({ currentUser: DEFAULT_USER });
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
describe('SmartCrmBoardComponent', () => {
|
|
25
|
+
const dragDropEventFactory = new DragDropEventFactory<object>();
|
|
26
|
+
|
|
27
|
+
const data = {
|
|
28
|
+
id: 11,
|
|
29
|
+
title: 'test stage',
|
|
30
|
+
one_time_amount: 100,
|
|
31
|
+
win_chances: 10,
|
|
32
|
+
starting_at: '2021-11-22T00:00:00.000+00:00',
|
|
33
|
+
monthly_amount: 100,
|
|
34
|
+
crm_account_id: 8,
|
|
35
|
+
owner_id: 1,
|
|
36
|
+
crm_opportunity_stage_id: 16,
|
|
37
|
+
crm_opportunity_category_ids: [9],
|
|
38
|
+
crm_account: {
|
|
39
|
+
id: 8,
|
|
40
|
+
name: 'test'
|
|
41
|
+
},
|
|
42
|
+
crm_opportunity_stage: {
|
|
43
|
+
id: 16,
|
|
44
|
+
subscription_id: 20,
|
|
45
|
+
name: 'test',
|
|
46
|
+
previous_stage_id: null,
|
|
47
|
+
visible: true,
|
|
48
|
+
is_default: false,
|
|
49
|
+
crm_opportunity_category_ids: [10]
|
|
50
|
+
},
|
|
51
|
+
owner: [
|
|
52
|
+
{
|
|
53
|
+
id: 1,
|
|
54
|
+
first_name: 'Enrico_SuperAdmin',
|
|
55
|
+
last_name: 'PosiWise',
|
|
56
|
+
slug: 'enrico_superadmin-42201',
|
|
57
|
+
user_avatar: [
|
|
58
|
+
{
|
|
59
|
+
width: 50,
|
|
60
|
+
height: 50,
|
|
61
|
+
url: ''
|
|
62
|
+
}
|
|
63
|
+
]
|
|
64
|
+
}
|
|
65
|
+
],
|
|
66
|
+
crm_opportunity_categories: [
|
|
67
|
+
{
|
|
68
|
+
id: 9,
|
|
69
|
+
subscription_id: 20,
|
|
70
|
+
name: 'testcategory222',
|
|
71
|
+
previous_category_id: null,
|
|
72
|
+
is_visible: true,
|
|
73
|
+
is_default: false
|
|
74
|
+
}
|
|
75
|
+
]
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
const createComponent = TestHelper.createComponentFactory({
|
|
79
|
+
component: SmartCrmBoardComponent,
|
|
80
|
+
imports: [CommonServicesModule, SharedModule, SmartCrmPrivateModule],
|
|
81
|
+
declarations: [MockDirective(GooglePlaceDirective)],
|
|
82
|
+
providers: [
|
|
83
|
+
...TestHelper.TEST_PROVIDERS,
|
|
84
|
+
MockProvider(PermissionService, {
|
|
85
|
+
evaluatePermissions: () => {
|
|
86
|
+
return true;
|
|
87
|
+
}
|
|
88
|
+
}),
|
|
89
|
+
MockProvider(CrmService, {
|
|
90
|
+
updateOpportunities: () => of({}),
|
|
91
|
+
getAllOpportunities: () =>
|
|
92
|
+
of({
|
|
93
|
+
crm_opportunities: [data],
|
|
94
|
+
object_count: 1,
|
|
95
|
+
unfiltered_count: 1
|
|
96
|
+
}),
|
|
97
|
+
deleteOpportunities: () => of({}),
|
|
98
|
+
getAvailableOpportunityStages: () =>
|
|
99
|
+
of({
|
|
100
|
+
available_crm_opportunity_stages: [
|
|
101
|
+
{
|
|
102
|
+
id: 16,
|
|
103
|
+
subscription_id: 20,
|
|
104
|
+
name: 'testoppor',
|
|
105
|
+
previous_stage_id: null,
|
|
106
|
+
visible: true,
|
|
107
|
+
is_default: false,
|
|
108
|
+
crm_opportunity_category_ids: [10]
|
|
109
|
+
},
|
|
110
|
+
{
|
|
111
|
+
id: 17,
|
|
112
|
+
subscription_id: 20,
|
|
113
|
+
name: 'test2oppor',
|
|
114
|
+
previous_stage_id: null,
|
|
115
|
+
visible: true,
|
|
116
|
+
is_default: false,
|
|
117
|
+
crm_opportunity_category_ids: [10]
|
|
118
|
+
}
|
|
119
|
+
]
|
|
120
|
+
}),
|
|
121
|
+
getAllOpportunityCategories: () =>
|
|
122
|
+
of({
|
|
123
|
+
crm_opportunity_categories: [
|
|
124
|
+
{
|
|
125
|
+
id: 10,
|
|
126
|
+
subscription_id: 20,
|
|
127
|
+
name: 'test category2',
|
|
128
|
+
previous_category_id: null,
|
|
129
|
+
is_visible: true,
|
|
130
|
+
is_default: false,
|
|
131
|
+
previous_category: null
|
|
132
|
+
}
|
|
133
|
+
],
|
|
134
|
+
object_count: 1,
|
|
135
|
+
unfiltered_count: 1
|
|
136
|
+
})
|
|
137
|
+
}),
|
|
138
|
+
{
|
|
139
|
+
provide: UserService,
|
|
140
|
+
useClass: UserServiceMock
|
|
141
|
+
}
|
|
142
|
+
]
|
|
143
|
+
});
|
|
144
|
+
|
|
145
|
+
beforeEach(() => {
|
|
146
|
+
TestHelper.setUpPermissionsAndUser();
|
|
147
|
+
});
|
|
148
|
+
|
|
149
|
+
it('should change category', async () => {
|
|
150
|
+
TestHelper.setActivatedRoute({
|
|
151
|
+
parent: { params: of({ slug: 'posiwise-263' }) }
|
|
152
|
+
});
|
|
153
|
+
const spectator = await createComponent();
|
|
154
|
+
expect(spectator.component).toBeTruthy();
|
|
155
|
+
spectator.component.onChangeCategory(1);
|
|
156
|
+
expect(spectator.component.totalCount).toEqual(0);
|
|
157
|
+
spectator.component.onChangeCategory(null);
|
|
158
|
+
expect(spectator.component.totalCount).toEqual(1);
|
|
159
|
+
});
|
|
160
|
+
|
|
161
|
+
it('should move item', async () => {
|
|
162
|
+
TestHelper.setActivatedRoute({
|
|
163
|
+
parent: { params: of({ slug: 'posiwise-263' }) }
|
|
164
|
+
});
|
|
165
|
+
const spectator = await createComponent();
|
|
166
|
+
expect(spectator.component).toBeTruthy();
|
|
167
|
+
const service = TestBed.inject(CrmService);
|
|
168
|
+
const spy = spyOn(service, 'updateOpportunities').and.callThrough();
|
|
169
|
+
const from: ContainerModel<object> = {
|
|
170
|
+
id: 'testoppor',
|
|
171
|
+
data: [data],
|
|
172
|
+
index: 0
|
|
173
|
+
};
|
|
174
|
+
const to: ContainerModel<object> = {
|
|
175
|
+
id: 'test2oppor',
|
|
176
|
+
data: [data],
|
|
177
|
+
index: 0
|
|
178
|
+
};
|
|
179
|
+
const dropevent: CdkDragDrop<object[], object[]> =
|
|
180
|
+
dragDropEventFactory.createCrossContainerEvent(from, to);
|
|
181
|
+
spectator.component.dropItem(dropevent);
|
|
182
|
+
expect(spy).toHaveBeenCalledTimes(1);
|
|
183
|
+
});
|
|
184
|
+
});
|
|
@@ -0,0 +1,268 @@
|
|
|
1
|
+
import { Component, Injector, OnDestroy, OnInit } from '@angular/core';
|
|
2
|
+
import { CdkDragDrop, moveItemInArray, transferArrayItem } from '@angular/cdk/drag-drop';
|
|
3
|
+
import { ROUTERS } from '../../../../shared/routers/routers';
|
|
4
|
+
import { CrmService } from '@posiwise/smart-crm-shared';
|
|
5
|
+
import { CrmOpportunity } from '../../../../shared/interface/crm-opportunity.interface';
|
|
6
|
+
import { CrmStage } from '../../../../shared/interface/crm-stages.interface';
|
|
7
|
+
import { AppBaseComponent } from '@posiwise/app-base-component';
|
|
8
|
+
import { Subscription } from '@posiwise/common-utilities';
|
|
9
|
+
import { HelperService } from '@posiwise/helper-service';
|
|
10
|
+
|
|
11
|
+
@Component({
|
|
12
|
+
selector: 'pw-smart-crm-board',
|
|
13
|
+
templateUrl: './smart-crm-board.component.html',
|
|
14
|
+
styleUrls: ['./smart-crm-board.component.scss']
|
|
15
|
+
})
|
|
16
|
+
export class SmartCrmBoardComponent extends AppBaseComponent implements OnInit, OnDestroy {
|
|
17
|
+
private draggedOpportunity: CrmOpportunity;
|
|
18
|
+
stages: CrmStage[];
|
|
19
|
+
allOpportunities: CrmOpportunity[];
|
|
20
|
+
opportunitiesGroup = [];
|
|
21
|
+
private changedStage: number | string;
|
|
22
|
+
isLoaded = false;
|
|
23
|
+
categories = [];
|
|
24
|
+
private availableOpportunities = [];
|
|
25
|
+
subscription: Subscription;
|
|
26
|
+
totalCount: number;
|
|
27
|
+
routers = ROUTERS;
|
|
28
|
+
masterStages: CrmStage[] = [];
|
|
29
|
+
selectedCategoryId = 0;
|
|
30
|
+
private pageSize = 5; // Show 5 cards initially
|
|
31
|
+
|
|
32
|
+
constructor(
|
|
33
|
+
private crmService: CrmService,
|
|
34
|
+
injector: Injector
|
|
35
|
+
) {
|
|
36
|
+
super(injector);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
ngOnInit() {
|
|
40
|
+
this.getUserSubscription().subscribe(response => {
|
|
41
|
+
this.subscription = response;
|
|
42
|
+
if (this.subscription?.id) {
|
|
43
|
+
this.getAllOpportunityCategories();
|
|
44
|
+
this.getStages();
|
|
45
|
+
}
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
private getAllOpportunityCategories() {
|
|
50
|
+
this.crmService.getAllOpportunityCategories(this.subscription?.id).subscribe(response => {
|
|
51
|
+
this.categories = response?.crm_opportunity_categories || [];
|
|
52
|
+
if (this.categories.length > 0) {
|
|
53
|
+
this.selectedCategoryId = this.categories[0].id;
|
|
54
|
+
}
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
private getStages() {
|
|
59
|
+
this.crmService.getAvailableOpportunityStages(this.subscription?.id).subscribe(response => {
|
|
60
|
+
this.stages = response.available_crm_opportunity_stages;
|
|
61
|
+
this.masterStages = response.available_crm_opportunity_stages;
|
|
62
|
+
this.getAllOpportunities();
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
private getAllOpportunities() {
|
|
67
|
+
this.crmService
|
|
68
|
+
.getAllOpportunities(this.subscription?.id)
|
|
69
|
+
.subscribe(response => {
|
|
70
|
+
this.allOpportunities = response?.crm_opportunities || [];
|
|
71
|
+
this.availableOpportunities = response?.crm_opportunities || [];
|
|
72
|
+
this.totalCount = this.allOpportunities?.length;
|
|
73
|
+
|
|
74
|
+
if (this.selectedCategoryId) {
|
|
75
|
+
this.allOpportunities = this.availableOpportunities.filter(opportunity =>
|
|
76
|
+
opportunity?.crm_opportunity_category_ids?.includes(this.selectedCategoryId)
|
|
77
|
+
);
|
|
78
|
+
this.totalCount = this.allOpportunities?.length;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
this.opportunitiesGroups(this.selectedCategoryId || null);
|
|
82
|
+
})
|
|
83
|
+
.add(() => {
|
|
84
|
+
this.isLoaded = true;
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
private treefy(list) {
|
|
89
|
+
const idAttr = 'id';
|
|
90
|
+
const parentAttr = 'previous_stage_id';
|
|
91
|
+
const childrenAttr = 'children';
|
|
92
|
+
|
|
93
|
+
const treeList = [];
|
|
94
|
+
const lookup = {};
|
|
95
|
+
list.forEach(obj => {
|
|
96
|
+
lookup[obj[idAttr]] = obj;
|
|
97
|
+
obj[childrenAttr] = [];
|
|
98
|
+
});
|
|
99
|
+
list.forEach(obj => {
|
|
100
|
+
if (obj[parentAttr] !== null) {
|
|
101
|
+
if (lookup[obj[parentAttr]] !== undefined) {
|
|
102
|
+
lookup[obj[parentAttr]][childrenAttr].push(obj);
|
|
103
|
+
} else {
|
|
104
|
+
treeList.push(obj);
|
|
105
|
+
}
|
|
106
|
+
} else {
|
|
107
|
+
treeList.push(obj);
|
|
108
|
+
}
|
|
109
|
+
});
|
|
110
|
+
|
|
111
|
+
return treeList;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
private flatten(arr) {
|
|
115
|
+
return arr.reduce((result, current) => {
|
|
116
|
+
if (current.children) {
|
|
117
|
+
const children = this.flatten(current.children);
|
|
118
|
+
delete current.children;
|
|
119
|
+
result.push(current);
|
|
120
|
+
result.push(...children);
|
|
121
|
+
} else {
|
|
122
|
+
result.push(current);
|
|
123
|
+
}
|
|
124
|
+
return result;
|
|
125
|
+
}, []);
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
private opportunitiesGroups(val?: number) {
|
|
129
|
+
this.opportunitiesGroup = [];
|
|
130
|
+
this.stages = this.masterStages;
|
|
131
|
+
if (val !== undefined && val !== 0) {
|
|
132
|
+
this.stages = this.stages.filter(stage =>
|
|
133
|
+
stage.crm_opportunity_category_ids.includes(val)
|
|
134
|
+
);
|
|
135
|
+
}
|
|
136
|
+
this.stages = this.stages.sort((a, b) => (a.id > b.id ? 1 : b.id > a.id ? -1 : 0));
|
|
137
|
+
const temp = this.treefy(this.stages);
|
|
138
|
+
this.stages = this.flatten(temp);
|
|
139
|
+
|
|
140
|
+
this.stages.forEach(stage => {
|
|
141
|
+
const opportunities = {
|
|
142
|
+
stage: null,
|
|
143
|
+
opportunities: [],
|
|
144
|
+
totals: { oneTime: 0, mrr: 0, count: 0 },
|
|
145
|
+
isLoadingMore: false
|
|
146
|
+
};
|
|
147
|
+
const data = this.allOpportunities.filter(
|
|
148
|
+
opportunity => opportunity.crm_opportunity_stage_id === stage.id
|
|
149
|
+
);
|
|
150
|
+
opportunities.opportunities = data.slice(0, this.pageSize); // Load initial items
|
|
151
|
+
opportunities.stage = stage;
|
|
152
|
+
opportunities.totals.oneTime = data.reduce((sum, opp) => sum + opp.one_time_amount, 0);
|
|
153
|
+
opportunities.totals.mrr = data.reduce((sum, opp) => sum + opp.monthly_amount, 0);
|
|
154
|
+
opportunities.totals.count = data.length;
|
|
155
|
+
this.opportunitiesGroup.push(opportunities);
|
|
156
|
+
});
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
onChangeCategory(event) {
|
|
160
|
+
const categories = Number(event);
|
|
161
|
+
this.selectedCategoryId = categories;
|
|
162
|
+
if (categories) {
|
|
163
|
+
this.allOpportunities = this.availableOpportunities.filter(opportunity =>
|
|
164
|
+
opportunity?.crm_opportunity_category_ids?.includes(categories)
|
|
165
|
+
);
|
|
166
|
+
this.totalCount = this.allOpportunities?.length;
|
|
167
|
+
this.opportunitiesGroups(categories);
|
|
168
|
+
} else {
|
|
169
|
+
this.allOpportunities = this.availableOpportunities;
|
|
170
|
+
this.totalCount = this.allOpportunities?.length;
|
|
171
|
+
this.opportunitiesGroups();
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
onColumnScroll(columnIndex: number) {
|
|
176
|
+
const group = this.opportunitiesGroup[columnIndex];
|
|
177
|
+
if (group.isLoadingMore || group.opportunities.length >= group.totals.count) {
|
|
178
|
+
return;
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
group.isLoadingMore = true;
|
|
182
|
+
|
|
183
|
+
setTimeout(() => {
|
|
184
|
+
const currentLength = group.opportunities.length;
|
|
185
|
+
const moreOpportunities = this.allOpportunities
|
|
186
|
+
.filter(opportunity => opportunity.crm_opportunity_stage_id === group.stage.id)
|
|
187
|
+
.slice(currentLength, currentLength + this.pageSize);
|
|
188
|
+
|
|
189
|
+
group.opportunities = group.opportunities.concat(moreOpportunities);
|
|
190
|
+
group.isLoadingMore = false;
|
|
191
|
+
}, 2000); // Show loader for 2 seconds
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
dropItem(event: CdkDragDrop<object[]>) {
|
|
195
|
+
if (event.previousContainer === event.container) {
|
|
196
|
+
moveItemInArray(event.container.data, event.previousIndex, event.currentIndex);
|
|
197
|
+
} else {
|
|
198
|
+
transferArrayItem(
|
|
199
|
+
event.previousContainer.data,
|
|
200
|
+
event.container.data,
|
|
201
|
+
event.previousIndex,
|
|
202
|
+
event.currentIndex
|
|
203
|
+
);
|
|
204
|
+
this.draggedOpportunity = event?.item?.data;
|
|
205
|
+
this.changedStage = this.stages.find(stage => stage.name === event?.container?.id)?.id;
|
|
206
|
+
if (this.draggedOpportunity) {
|
|
207
|
+
const opportunitiesDetails = { ...this.draggedOpportunity };
|
|
208
|
+
opportunitiesDetails['crm_opportunity_stage_id'] = this.changedStage;
|
|
209
|
+
HelperService.deleteProps(opportunitiesDetails, [
|
|
210
|
+
'crm_account',
|
|
211
|
+
'crm_opportunity_stage',
|
|
212
|
+
'crm_opportunity_categories',
|
|
213
|
+
'crm_contact',
|
|
214
|
+
'owner'
|
|
215
|
+
]);
|
|
216
|
+
this.crmService
|
|
217
|
+
.updateOpportunities(
|
|
218
|
+
this.subscription?.id,
|
|
219
|
+
opportunitiesDetails.id,
|
|
220
|
+
opportunitiesDetails
|
|
221
|
+
)
|
|
222
|
+
.subscribe({
|
|
223
|
+
next: () => {
|
|
224
|
+
this.getAllOpportunities();
|
|
225
|
+
this.toast.success(
|
|
226
|
+
this.translation.translate(
|
|
227
|
+
'Crm.OpportunitiesMessage.UpdatedMessage'
|
|
228
|
+
)
|
|
229
|
+
);
|
|
230
|
+
},
|
|
231
|
+
error: () => {
|
|
232
|
+
this.getAllOpportunities();
|
|
233
|
+
}
|
|
234
|
+
});
|
|
235
|
+
this.draggedOpportunity = null;
|
|
236
|
+
this.changedStage = '';
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
getConnectedList(): string[] {
|
|
242
|
+
return this.opportunitiesGroup.map(x => `${x.stage.name}`);
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
dropGroup(event: CdkDragDrop<string[]>) {
|
|
246
|
+
moveItemInArray(this.opportunitiesGroup, event.previousIndex, event.currentIndex);
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
toggleColumn(event, group) {
|
|
250
|
+
$(event.target).toggleClass('fa-angle-right fa-angle-down');
|
|
251
|
+
$(event.target).closest('.main-div').toggleClass('dynamic-columns-wrapper');
|
|
252
|
+
this.crmService
|
|
253
|
+
.editStage(this.subscription?.id, group.stage?.id, {
|
|
254
|
+
collapsed: !group.stage?.collapsed
|
|
255
|
+
})
|
|
256
|
+
.subscribe(() => {
|
|
257
|
+
this.getStages();
|
|
258
|
+
});
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
hasOpportunities(): boolean {
|
|
262
|
+
return this.opportunitiesGroup.some(group => group.opportunities.length > 0);
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
override ngOnDestroy() {
|
|
266
|
+
super.ngOnDestroy();
|
|
267
|
+
}
|
|
268
|
+
}
|