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