@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,391 @@
|
|
|
1
|
+
import { Component, Injector, OnDestroy, OnInit } from '@angular/core';
|
|
2
|
+
import { UntypedFormGroup } from '@angular/forms';
|
|
3
|
+
import { NgbDateStruct } from '@ng-bootstrap/ng-bootstrap';
|
|
4
|
+
import { AppSmartCrm } from '../../../../../shared/models/smart-crm.model';
|
|
5
|
+
import { CrmService } from '@posiwise/smart-crm-shared';
|
|
6
|
+
|
|
7
|
+
import { User } from '@posiwise/common-utilities';
|
|
8
|
+
import { AppBaseComponent } from '@posiwise/app-base-component';
|
|
9
|
+
import { HelperService } from '@posiwise/helper-service';
|
|
10
|
+
import {
|
|
11
|
+
CrmOpportunityData,
|
|
12
|
+
CrmopportunityContact
|
|
13
|
+
} from 'libs/smart-crm/src/lib/shared/interface/smart-crm-module.interface';
|
|
14
|
+
import { CrmAccount } from 'libs/smart-crm/src/lib/shared/interface/crm-account.interface';
|
|
15
|
+
|
|
16
|
+
@Component({
|
|
17
|
+
selector: 'pw-smart-crm-opportunities-details',
|
|
18
|
+
templateUrl: './smart-crm-opportunities-details.component.html',
|
|
19
|
+
styleUrls: ['./smart-crm-opportunities-details.component.scss']
|
|
20
|
+
})
|
|
21
|
+
export class SmartCrmOpportunitiesDetailsComponent
|
|
22
|
+
extends AppBaseComponent
|
|
23
|
+
implements OnInit, OnDestroy
|
|
24
|
+
{
|
|
25
|
+
form: UntypedFormGroup;
|
|
26
|
+
|
|
27
|
+
user: User;
|
|
28
|
+
|
|
29
|
+
id: number;
|
|
30
|
+
|
|
31
|
+
onEdit = false;
|
|
32
|
+
|
|
33
|
+
data;
|
|
34
|
+
|
|
35
|
+
submitted = false;
|
|
36
|
+
buttonBusy = false;
|
|
37
|
+
isLoading = true;
|
|
38
|
+
|
|
39
|
+
searchText = '';
|
|
40
|
+
|
|
41
|
+
subscriptionId: number;
|
|
42
|
+
|
|
43
|
+
allContacts: CrmopportunityContact[] = [];
|
|
44
|
+
|
|
45
|
+
contactId: number;
|
|
46
|
+
|
|
47
|
+
private opportunityData: CrmOpportunityData;
|
|
48
|
+
|
|
49
|
+
filteredUsers: CrmopportunityContact[] = [];
|
|
50
|
+
|
|
51
|
+
cancelledTrue: boolean;
|
|
52
|
+
|
|
53
|
+
winChance = [0, 10, 20, 30, 40, 50, 60, 70, 80, 90, 100];
|
|
54
|
+
|
|
55
|
+
opportunities = [];
|
|
56
|
+
|
|
57
|
+
WonField = false;
|
|
58
|
+
|
|
59
|
+
LostField = false;
|
|
60
|
+
|
|
61
|
+
isContactChange = false;
|
|
62
|
+
TrialStartField = false;
|
|
63
|
+
|
|
64
|
+
accounts = [];
|
|
65
|
+
|
|
66
|
+
filteredAccounts: CrmAccount[];
|
|
67
|
+
|
|
68
|
+
account_id: number;
|
|
69
|
+
|
|
70
|
+
masterStages = [];
|
|
71
|
+
|
|
72
|
+
stages = [];
|
|
73
|
+
|
|
74
|
+
categories = [];
|
|
75
|
+
accountValueCount = 0;
|
|
76
|
+
currentAccountId;
|
|
77
|
+
|
|
78
|
+
featureKeys = [];
|
|
79
|
+
|
|
80
|
+
/** Function to get form controls */
|
|
81
|
+
get f() {
|
|
82
|
+
return this.form.controls;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
constructor(
|
|
86
|
+
injector: Injector,
|
|
87
|
+
private crmService: CrmService
|
|
88
|
+
) {
|
|
89
|
+
super(injector);
|
|
90
|
+
this.form = AppSmartCrm.getOpportunitiesInfoForm();
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
ngOnInit() {
|
|
94
|
+
this.toggleStageField();
|
|
95
|
+
this.contactId = Number(this.route.snapshot.queryParamMap.get('contact_id'));
|
|
96
|
+
this.route.params.subscribe(data => {
|
|
97
|
+
this.id = Number(data['id']);
|
|
98
|
+
if (Number(data['id'])) {
|
|
99
|
+
this.getAccountContacts(true);
|
|
100
|
+
this.form.get('crm_account_id').valueChanges.subscribe(value => {
|
|
101
|
+
if (this.accountValueCount > 2) {
|
|
102
|
+
this.form.get('crm_contact_id').disable();
|
|
103
|
+
this.form.get('crm_contact_id').reset();
|
|
104
|
+
} else {
|
|
105
|
+
this.accountValueCount += 1;
|
|
106
|
+
}
|
|
107
|
+
if (value) {
|
|
108
|
+
this.getAccountContacts(false);
|
|
109
|
+
}
|
|
110
|
+
});
|
|
111
|
+
} else if (this.contactId) {
|
|
112
|
+
this.getAccountContacts(false);
|
|
113
|
+
this.form.get('crm_account_id').valueChanges.subscribe(value => {
|
|
114
|
+
if (this.accountValueCount > 1) {
|
|
115
|
+
this.form.get('crm_contact_id').disable();
|
|
116
|
+
this.form.get('crm_contact_id').reset();
|
|
117
|
+
} else {
|
|
118
|
+
this.accountValueCount += 1;
|
|
119
|
+
}
|
|
120
|
+
if (value) {
|
|
121
|
+
this.isContactChange = true;
|
|
122
|
+
this.getAccountContacts(false);
|
|
123
|
+
}
|
|
124
|
+
});
|
|
125
|
+
this.isLoading = false;
|
|
126
|
+
} else {
|
|
127
|
+
this.isLoading = false;
|
|
128
|
+
this.form.get('crm_contact_id').disable();
|
|
129
|
+
this.form.get('crm_account_id').disable();
|
|
130
|
+
|
|
131
|
+
this.form.get('crm_account_id').valueChanges.subscribe(value => {
|
|
132
|
+
if (value) {
|
|
133
|
+
this.getAccountContacts(false);
|
|
134
|
+
}
|
|
135
|
+
this.form.get('crm_contact_id').disable();
|
|
136
|
+
this.form.get('crm_contact_id').reset();
|
|
137
|
+
});
|
|
138
|
+
}
|
|
139
|
+
});
|
|
140
|
+
this.getUserSubscriptionId().subscribe(response => {
|
|
141
|
+
this.subscriptionId = response;
|
|
142
|
+
if (this.subscriptionId) {
|
|
143
|
+
this.getAvailableOpportunityStages(this.subscriptionId);
|
|
144
|
+
this.getAllOpportunityCategories();
|
|
145
|
+
}
|
|
146
|
+
});
|
|
147
|
+
this.form.get('crm_contact_id').setValue(null);
|
|
148
|
+
this.account_id = Number(this.route.snapshot.queryParamMap.get('account_id'));
|
|
149
|
+
this.getUserInfo();
|
|
150
|
+
this.getAllAccounts();
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
private getAvailableOpportunityStages(id) {
|
|
154
|
+
this.crmService.getAvailableOpportunityStages(id).subscribe(res => {
|
|
155
|
+
this.masterStages = res?.available_crm_opportunity_stages || [];
|
|
156
|
+
this.stages = res?.available_crm_opportunity_stages || [];
|
|
157
|
+
});
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
// /** Function to get user info */
|
|
161
|
+
private getUserInfo() {
|
|
162
|
+
this.userStore().subscribe(user => {
|
|
163
|
+
this.user = user;
|
|
164
|
+
});
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
/** Function to call accounts */
|
|
168
|
+
private getAllAccounts() {
|
|
169
|
+
this.crmService.getAllAccounts(this.subscriptionId).subscribe(response => {
|
|
170
|
+
this.accounts = response.accounts;
|
|
171
|
+
this.form.get('crm_account_id').enable();
|
|
172
|
+
if (this.account_id) {
|
|
173
|
+
const accountData = this.accounts.find(x => x.id === this.account_id);
|
|
174
|
+
this.form.get('crm_account_id').setValue(accountData);
|
|
175
|
+
}
|
|
176
|
+
});
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
/** Function to call contacts */
|
|
180
|
+
|
|
181
|
+
private getAccountContacts(isChange = false) {
|
|
182
|
+
this.getUserSubscriptionId().subscribe(id => {
|
|
183
|
+
this.subscriptionId = id;
|
|
184
|
+
if (this.subscriptionId) {
|
|
185
|
+
this.crmService
|
|
186
|
+
.getAccountContacts(
|
|
187
|
+
this.form.get('crm_account_id').value.id,
|
|
188
|
+
this.subscriptionId,
|
|
189
|
+
''
|
|
190
|
+
)
|
|
191
|
+
.subscribe(response => {
|
|
192
|
+
this.form.get('crm_contact_id').enable();
|
|
193
|
+
this.allContacts = response.contacts;
|
|
194
|
+
this.allContacts.forEach(member => {
|
|
195
|
+
member.displayName = `${member.first_name || ''} ${
|
|
196
|
+
member.last_name || ''
|
|
197
|
+
} - ${member.email}`.trim();
|
|
198
|
+
});
|
|
199
|
+
if (this.id) {
|
|
200
|
+
this.onEdit = true;
|
|
201
|
+
isChange && this.getOpportunityDetails(this.id);
|
|
202
|
+
} else {
|
|
203
|
+
this.onEdit = false;
|
|
204
|
+
}
|
|
205
|
+
if (this.contactId && !this.isContactChange) {
|
|
206
|
+
const contactData = this.allContacts.find(x => x.id === this.contactId);
|
|
207
|
+
this.form.get('crm_contact_id').setValue(contactData);
|
|
208
|
+
this.form.get('crm_account_id').setValue(contactData?.crm_account);
|
|
209
|
+
}
|
|
210
|
+
if (this.account_id) {
|
|
211
|
+
this.allContacts = this.allContacts.filter(
|
|
212
|
+
x => x.crm_account_id === this.account_id
|
|
213
|
+
);
|
|
214
|
+
}
|
|
215
|
+
});
|
|
216
|
+
}
|
|
217
|
+
});
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
/** Function to get opportunities data */
|
|
221
|
+
private getOpportunityDetails(id: number) {
|
|
222
|
+
this.crmService.getOpportunityDetails(this.subscriptionId, id).subscribe(response => {
|
|
223
|
+
this.isLoading = false;
|
|
224
|
+
this.opportunityData = response;
|
|
225
|
+
let startingAtObj: NgbDateStruct;
|
|
226
|
+
let trialStartAtObj: NgbDateStruct;
|
|
227
|
+
if (response.starting_at) {
|
|
228
|
+
startingAtObj = {
|
|
229
|
+
year: Number(response.starting_at.substring(0, 4)),
|
|
230
|
+
month: Number(response.starting_at.substring(5, 7)),
|
|
231
|
+
day: Number(response.starting_at.substring(8, 10))
|
|
232
|
+
};
|
|
233
|
+
}
|
|
234
|
+
if (response.trial_start_at) {
|
|
235
|
+
trialStartAtObj = {
|
|
236
|
+
year: Number(response.trial_start_at.substring(0, 4)),
|
|
237
|
+
month: Number(response.trial_start_at.substring(5, 7)),
|
|
238
|
+
day: Number(response.trial_start_at.substring(8, 10))
|
|
239
|
+
};
|
|
240
|
+
}
|
|
241
|
+
if (response.stage === 'Trailing') {
|
|
242
|
+
this.TrialStartField = true;
|
|
243
|
+
} else {
|
|
244
|
+
this.WonField = false;
|
|
245
|
+
}
|
|
246
|
+
if (response.stage === 'Won') {
|
|
247
|
+
this.LostField = true;
|
|
248
|
+
} else {
|
|
249
|
+
this.LostField = false;
|
|
250
|
+
}
|
|
251
|
+
if (response.stage === 'Lost') {
|
|
252
|
+
this.WonField = true;
|
|
253
|
+
} else {
|
|
254
|
+
this.WonField = false;
|
|
255
|
+
}
|
|
256
|
+
this.form.patchValue(this.opportunityData);
|
|
257
|
+
this.form.patchValue({
|
|
258
|
+
starting_at: startingAtObj,
|
|
259
|
+
trial_start_at: trialStartAtObj,
|
|
260
|
+
one_time_amount: response.one_time_amount / 100,
|
|
261
|
+
monthly_amount: response.monthly_amount / 100
|
|
262
|
+
});
|
|
263
|
+
|
|
264
|
+
this.allContacts.forEach(contact => {
|
|
265
|
+
if (this.opportunityData.crm_contact_id === contact.id) {
|
|
266
|
+
this.form.get('crm_contact_id').setValue(contact);
|
|
267
|
+
}
|
|
268
|
+
});
|
|
269
|
+
this.accounts.forEach(account => {
|
|
270
|
+
if (this.opportunityData.crm_account_id === account.id) {
|
|
271
|
+
this.form.get('crm_account_id').setValue(account);
|
|
272
|
+
}
|
|
273
|
+
});
|
|
274
|
+
});
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
/** Function to execute on submit opportunities form */
|
|
278
|
+
onSave() {
|
|
279
|
+
this.submitted = true;
|
|
280
|
+
this.buttonBusy = true;
|
|
281
|
+
const data = { ...this.form.value };
|
|
282
|
+
data.one_time_amount *= 100;
|
|
283
|
+
data.monthly_amount *= 100;
|
|
284
|
+
if (data.crm_contact_id) {
|
|
285
|
+
data.crm_contact_id = data.crm_contact_id.id;
|
|
286
|
+
}
|
|
287
|
+
data.crm_account_id = data.crm_account_id.id;
|
|
288
|
+
data.starting_at = HelperService.dateFormat(this.form.get('starting_at').value);
|
|
289
|
+
data.trial_start_at = HelperService.dateFormat(this.form.get('trial_start_at').value);
|
|
290
|
+
const sub$ = this.id
|
|
291
|
+
? this.crmService.updateOpportunities(this.subscriptionId, this.id, data)
|
|
292
|
+
: this.crmService.postOpportunities(this.subscriptionId, data);
|
|
293
|
+
sub$.subscribe(() => {
|
|
294
|
+
this.toast.success(
|
|
295
|
+
this.translation.translate('Crm.OpportunitiesMessage.UpdatedMessage')
|
|
296
|
+
);
|
|
297
|
+
this.back();
|
|
298
|
+
}).add(() => {
|
|
299
|
+
this.submitted = false;
|
|
300
|
+
this.buttonBusy = false;
|
|
301
|
+
});
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
/** Function to get all categories */
|
|
305
|
+
private getAllOpportunityCategories() {
|
|
306
|
+
this.crmService.getAllOpportunityCategories(this.subscriptionId).subscribe(response => {
|
|
307
|
+
const categories = response?.crm_opportunity_categories || [];
|
|
308
|
+
categories.forEach(val => {
|
|
309
|
+
const data = {
|
|
310
|
+
label: val.name,
|
|
311
|
+
value: val.id
|
|
312
|
+
};
|
|
313
|
+
this.categories.push(data);
|
|
314
|
+
});
|
|
315
|
+
this.getValues();
|
|
316
|
+
});
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
private getValues() {
|
|
320
|
+
if (!this.id) {
|
|
321
|
+
this.route.queryParams.subscribe(res => {
|
|
322
|
+
if ('stage_id' in res) {
|
|
323
|
+
const stageId = Number(res['stage_id']);
|
|
324
|
+
let category;
|
|
325
|
+
if (typeof res['category'] === 'string') {
|
|
326
|
+
category = res['category'].split(',').map(x => Number(x));
|
|
327
|
+
} else {
|
|
328
|
+
category = res['category']?.map(x => Number(x));
|
|
329
|
+
}
|
|
330
|
+
this.form.patchValue({
|
|
331
|
+
crm_opportunity_stage_id: stageId || '',
|
|
332
|
+
crm_opportunity_category_ids: category?.length ? category : ''
|
|
333
|
+
});
|
|
334
|
+
}
|
|
335
|
+
});
|
|
336
|
+
}
|
|
337
|
+
}
|
|
338
|
+
|
|
339
|
+
search(event) {
|
|
340
|
+
let data = [];
|
|
341
|
+
if (event.query) {
|
|
342
|
+
data = this.allContacts.filter((x: CrmopportunityContact) => {
|
|
343
|
+
return x.displayName.toLowerCase().includes(event.query.toLowerCase());
|
|
344
|
+
});
|
|
345
|
+
} else {
|
|
346
|
+
this.allContacts.forEach(item => {
|
|
347
|
+
data.push(item);
|
|
348
|
+
});
|
|
349
|
+
}
|
|
350
|
+
this.filteredUsers = data;
|
|
351
|
+
}
|
|
352
|
+
|
|
353
|
+
searchAccount(event) {
|
|
354
|
+
let data = [];
|
|
355
|
+
if (event.query) {
|
|
356
|
+
data = this.accounts.filter((x: CrmAccount) => {
|
|
357
|
+
return x.name.toLowerCase().includes(event.query.toLowerCase());
|
|
358
|
+
});
|
|
359
|
+
} else {
|
|
360
|
+
this.accounts.forEach(item => {
|
|
361
|
+
data.push(item);
|
|
362
|
+
});
|
|
363
|
+
}
|
|
364
|
+
this.filteredAccounts = data;
|
|
365
|
+
}
|
|
366
|
+
|
|
367
|
+
onCategoryChange(event) {
|
|
368
|
+
this.stages = [...this.masterStages];
|
|
369
|
+
if (event.value?.length) {
|
|
370
|
+
this.stages = this.stages.filter(x =>
|
|
371
|
+
x.crm_opportunity_category_ids?.some(item => event.value.includes(item))
|
|
372
|
+
);
|
|
373
|
+
}
|
|
374
|
+
}
|
|
375
|
+
|
|
376
|
+
private toggleStageField() {
|
|
377
|
+
this.form.get('crm_opportunity_stage_id').disable();
|
|
378
|
+
this.form.get('crm_opportunity_category_ids').valueChanges.subscribe(() => {
|
|
379
|
+
const val = this.form.get('crm_opportunity_category_ids').value;
|
|
380
|
+
if (!val?.length) {
|
|
381
|
+
this.form.get('crm_opportunity_stage_id').disable();
|
|
382
|
+
} else {
|
|
383
|
+
this.form.get('crm_opportunity_stage_id').enable();
|
|
384
|
+
}
|
|
385
|
+
});
|
|
386
|
+
}
|
|
387
|
+
|
|
388
|
+
override ngOnDestroy() {
|
|
389
|
+
super.ngOnDestroy();
|
|
390
|
+
}
|
|
391
|
+
}
|