@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,142 @@
|
|
|
1
|
+
<div class="me-auto col-xs-6">
|
|
2
|
+
<a href="javascript:void(0)" (click)="back()" class="previous"><i class="fa fa-arrow-alt-circle-left"
|
|
3
|
+
aria-hidden="true"></i></a>
|
|
4
|
+
<h3 class="m-subheader__title m-subheader__title--separator">
|
|
5
|
+
<span>{{ 'Crm.LeadCrmLeads.' | transloco }}: {{ isLoading ? '' : (data?.first_name || data?.last_name ? data?.first_name ||
|
|
6
|
+
data?.last_name : ('Label.AddNew' | transloco)) }}</span>
|
|
7
|
+
</h3>
|
|
8
|
+
</div>
|
|
9
|
+
<div class="w-100 text-center mt-3"
|
|
10
|
+
*ngIf="isLoading">
|
|
11
|
+
<p-progressSpinner strokeWidth="2"> </p-progressSpinner>
|
|
12
|
+
</div>
|
|
13
|
+
<div class="p-2 mt-3" *ngIf="!isLoading">
|
|
14
|
+
<form [formGroup]="form" (ngSubmit)="onSave()">
|
|
15
|
+
<div class="row">
|
|
16
|
+
<div class="col-12 col-sm-4">
|
|
17
|
+
<pw-input-container [label]="'Crm.ContactMessage.FirstName' | transloco" name="first_name"
|
|
18
|
+
[errorMsg]="'Crm.ContactMessage.FirstNameErrorMessage' | transloco">
|
|
19
|
+
<input type="text" class="form-control" formControlName="first_name" id="first_name"
|
|
20
|
+
[ngClass]="{ 'is-invalid': submitted && f['first_name'].errors }" />
|
|
21
|
+
</pw-input-container>
|
|
22
|
+
</div>
|
|
23
|
+
<div class="col-12 col-sm-4">
|
|
24
|
+
<pw-input-container [label]="'Crm.ContactMessage.LastName' | transloco" name="last_name"
|
|
25
|
+
[errorMsg]="'Crm.ContactMessage.LastNameErrorMessage' | transloco">
|
|
26
|
+
<input type="text" class="form-control" formControlName="last_name" id="last_name"
|
|
27
|
+
[ngClass]="{ 'is-invalid': submitted && f['last_name'].errors }" />
|
|
28
|
+
</pw-input-container>
|
|
29
|
+
</div>
|
|
30
|
+
<div class="col-12 col-sm-4">
|
|
31
|
+
<pw-input-container [label]="'Crm.ContactMessage.Headline' | transloco" name="headline"
|
|
32
|
+
[errorMsg]="'Crm.ContactMessage.HeadlineErrorMessage' | transloco">
|
|
33
|
+
<input type="text" class="form-control" formControlName="headline" id="headline"
|
|
34
|
+
[ngClass]="{ 'is-invalid': submitted && f['headline'].errors }" />
|
|
35
|
+
</pw-input-container>
|
|
36
|
+
</div>
|
|
37
|
+
<div class="col-12 col-sm-4 col-lg-4">
|
|
38
|
+
<pw-input-container [label]="'Crm.ContactMessage.Tel' | transloco" name="tel"
|
|
39
|
+
[errorMsg]="'Crm.ContactMessage.TelErrorMessage' | transloco">
|
|
40
|
+
<input type="text" class="form-control" formControlName="tel" id="tel"
|
|
41
|
+
[ngClass]="{ 'is-invalid': submitted && f['tel'].errors }" />
|
|
42
|
+
</pw-input-container>
|
|
43
|
+
</div>
|
|
44
|
+
<div class="col-12 col-sm-4">
|
|
45
|
+
<div class="mb-3">
|
|
46
|
+
<label>{{ 'Crm.ContactMessage.Email' | transloco }} <span class="text-danger required-icon">*</span>
|
|
47
|
+
<span *ngIf="data && data.email_verified" class="text-success fw-bold">Verified</span>
|
|
48
|
+
</label>
|
|
49
|
+
<input type="text" class="form-control" formControlName="email"
|
|
50
|
+
[ngClass]="{ 'is-invalid': submitted && f['email'].errors }" />
|
|
51
|
+
<pw-field-error-display [displayError]="(submitted || f['email'].touched) && f['email'].errors" [errorMsg]="
|
|
52
|
+
f['email']?.errors?.required
|
|
53
|
+
? 'Please enter email'
|
|
54
|
+
: 'Please Enter valid email'
|
|
55
|
+
">
|
|
56
|
+
</pw-field-error-display>
|
|
57
|
+
</div>
|
|
58
|
+
</div>
|
|
59
|
+
<div class="col-12 col-sm-4">
|
|
60
|
+
<div class="mb-3">
|
|
61
|
+
<!-- <pw-input-container [label]="'Crm.ContactMessage.EmailVerfied' | transloco" class="nowrap"
|
|
62
|
+
<pw-input-containername="email_verified"> -->
|
|
63
|
+
<label class="info-circle mb-2">{{ 'Crm.ContactMessage.EmailVerified' | transloco }} <span
|
|
64
|
+
class="tooltiptext gradient-custom-branding"> {{'Crm.ContactMessage.Tooltip.EmailVerified'| transloco
|
|
65
|
+
}} </span>
|
|
66
|
+
</label>
|
|
67
|
+
<pw-input-container class="nowrap" name="email_verified">
|
|
68
|
+
<ui-switch formControlName="email_verified" name="email_verified"
|
|
69
|
+
[ngClass]="{ 'is-invalid': submitted && f['email_verified'].errors }">
|
|
70
|
+
</ui-switch>
|
|
71
|
+
</pw-input-container>
|
|
72
|
+
<!-- </pw-input-container> -->
|
|
73
|
+
</div>
|
|
74
|
+
</div>
|
|
75
|
+
<div class="col-12 col-sm-4">
|
|
76
|
+
<pw-input-container [label]="'Crm.ContactMessage.LinkedInUrl' | transloco" name="linkedin_url">
|
|
77
|
+
<input type="text" class="form-control" formControlName="linkedin_url" id="linkedin_url" />
|
|
78
|
+
</pw-input-container>
|
|
79
|
+
</div>
|
|
80
|
+
<div class="ui-fluid skills-modal col-sm-4">
|
|
81
|
+
<label class="info-circle mb-2">{{ 'Crm.ContactMessage.Account' | transloco }} <span
|
|
82
|
+
class="tooltiptext gradient-custom-branding">After assigning a company the contact will be visible in the
|
|
83
|
+
Contacts tabs</span></label>
|
|
84
|
+
<p-autoComplete [suggestions]="filteredAccounts" formControlName="crm_account_id" dataKey="id"
|
|
85
|
+
autocomplete="off" field="name" [dropdown]="true" (completeMethod)="search($event)" styleClass="w-100"
|
|
86
|
+
[inputStyle]="
|
|
87
|
+
submitted && f['crm_account_id'].errors
|
|
88
|
+
? { border: '1px solid #ff586b' }
|
|
89
|
+
: { border: '1px solid gray' }
|
|
90
|
+
" placeholder="Search accounts" [multiple]="false">
|
|
91
|
+
</p-autoComplete>
|
|
92
|
+
</div>
|
|
93
|
+
<div class="col-12 col-sm-4">
|
|
94
|
+
<label class="info-circle mb-2">{{ 'Crm.CrmLeads.Source' | transloco }} <span class="text-danger required-icon">*</span><span
|
|
95
|
+
class="tooltiptext gradient-custom-branding">{{ 'Crm.CrmLeads.Tooltip.Source' | transloco }}</span>
|
|
96
|
+
</label>
|
|
97
|
+
<pw-input-container name="crm_source_id" errorMsg="source is required" *ngIf="source$ | async as source">
|
|
98
|
+
<select class="form-select" formControlName="crm_source_id"
|
|
99
|
+
[ngClass]="{ 'is-invalid': submitted && f['crm_source_id'].errors }">
|
|
100
|
+
<option *ngFor="let option of source['crm_sources']" [value]="option.id"> {{ option.name }} </option>
|
|
101
|
+
</select>
|
|
102
|
+
</pw-input-container>
|
|
103
|
+
</div>
|
|
104
|
+
<div class="col-12 col-sm-4">
|
|
105
|
+
<pw-input-container [label]="'Crm.ContactMessage.DateOfBirth' | transloco" name="dob">
|
|
106
|
+
<div class="input-group">
|
|
107
|
+
<input class="form-control" placeholder="dd-mm-yyyy" formControlName="dob" ngbDatepicker
|
|
108
|
+
#d="ngbDatepicker" />
|
|
109
|
+
<div class="input-group-append">
|
|
110
|
+
<button class="btn btn-primary" (click)="d.toggle()" type="button">
|
|
111
|
+
<i class="fa fa-calendar" aria-hidden="true"></i>
|
|
112
|
+
</button>
|
|
113
|
+
</div>
|
|
114
|
+
</div>
|
|
115
|
+
</pw-input-container>
|
|
116
|
+
</div>
|
|
117
|
+
<div class="col-12 col-sm-4">
|
|
118
|
+
<label class="info-circle mb-2">{{ 'Crm.ContactMessage.Potential' | transloco }} <span
|
|
119
|
+
class="tooltiptext gradient-custom-branding"> {{ 'Crm.ContactMessage.Tooltip.Potential' | transloco
|
|
120
|
+
}}</span>
|
|
121
|
+
</label>
|
|
122
|
+
<select formControlName="potential" class="form-control form-select"
|
|
123
|
+
[ngClass]="{ 'is-invalid': submitted && f['potential'].errors }">
|
|
124
|
+
<option *ngFor="let option of potentials" [value]="option">{{ option }}</option>
|
|
125
|
+
</select>
|
|
126
|
+
</div>
|
|
127
|
+
<div class="col-12 col-sm-4">
|
|
128
|
+
<label class="info-circle mb-2">{{ 'Crm.ContactMessage.Labels' | transloco }} <span
|
|
129
|
+
class="tooltiptext gradient-custom-branding"> {{ 'Crm.ContactMessage.Tooltip.Labels' | transloco }}
|
|
130
|
+
</span>
|
|
131
|
+
</label>
|
|
132
|
+
<p-multiSelect [options]="labels" formControlName="labels" appendTo="body"></p-multiSelect>
|
|
133
|
+
</div>
|
|
134
|
+
<div class="col-12 text-end mt-3">
|
|
135
|
+
<button type="button" class="btn btn-outline-default me-2" (click)="back()"> {{ 'Button.Cancel' | transloco }}
|
|
136
|
+
</button>
|
|
137
|
+
<button type="submit" [buttonBusy]="buttonBusy" class="btn btn-primary" [disabled]="form.invalid"> {{ 'Button.Submit' | transloco }}
|
|
138
|
+
</button>
|
|
139
|
+
</div>
|
|
140
|
+
</div>
|
|
141
|
+
</form>
|
|
142
|
+
</div>
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
import { TestBed } from '@angular/core/testing';
|
|
2
|
+
import { byText } from '@ngneat/spectator';
|
|
3
|
+
import { CommonServicesModule, PermissionService, UserService } from '@posiwise/common-services';
|
|
4
|
+
import { SharedModule } from '@posiwise/shared-module';
|
|
5
|
+
import { CrmService } from '@posiwise/smart-crm-shared';
|
|
6
|
+
import { DEFAULT_USER, TestHelper } from '@posiwise/test-helpers';
|
|
7
|
+
import { MockProvider } from 'ng-mocks';
|
|
8
|
+
import { of } from 'rxjs';
|
|
9
|
+
import { SmartCrmPrivateModule } from '../../../smart-crm-private.module';
|
|
10
|
+
import { SmartCrmLeadsDetailsComponent } from './smart-crm-leads-details.component';
|
|
11
|
+
|
|
12
|
+
class UserServiceMock {
|
|
13
|
+
getUserState() {
|
|
14
|
+
return of({ currentUser: DEFAULT_USER });
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
describe('SmartCrmLeadsDetailsComponent', () => {
|
|
18
|
+
const createComponent = TestHelper.createComponentFactory({
|
|
19
|
+
component: SmartCrmLeadsDetailsComponent,
|
|
20
|
+
imports: [CommonServicesModule, SharedModule, SmartCrmPrivateModule],
|
|
21
|
+
providers: [
|
|
22
|
+
...TestHelper.TEST_PROVIDERS,
|
|
23
|
+
MockProvider(PermissionService, {
|
|
24
|
+
evaluatePermissions: () => {
|
|
25
|
+
return true;
|
|
26
|
+
}
|
|
27
|
+
}),
|
|
28
|
+
MockProvider(CrmService, {
|
|
29
|
+
getContactById: () =>
|
|
30
|
+
of({
|
|
31
|
+
id: 37,
|
|
32
|
+
first_name: 'test1',
|
|
33
|
+
last_name: 'test',
|
|
34
|
+
email: 'test3@gmail.com',
|
|
35
|
+
created_at: '2021-10-05T11:34:17.172+00:00',
|
|
36
|
+
headline: 'test',
|
|
37
|
+
linkedin_url: 'https://www.linkedin.com',
|
|
38
|
+
crm_source_id: 6,
|
|
39
|
+
subscription_id: 31,
|
|
40
|
+
labels: ['vip'],
|
|
41
|
+
email_verified: false,
|
|
42
|
+
newsletter_subscribed: true
|
|
43
|
+
}),
|
|
44
|
+
getAccountsBySubscription: () =>
|
|
45
|
+
of({
|
|
46
|
+
accounts: [
|
|
47
|
+
{
|
|
48
|
+
id: 6,
|
|
49
|
+
name: 'test'
|
|
50
|
+
}
|
|
51
|
+
],
|
|
52
|
+
object_count: 1,
|
|
53
|
+
unfiltered_count: 1
|
|
54
|
+
}),
|
|
55
|
+
getAllAccountSource: () =>
|
|
56
|
+
of({
|
|
57
|
+
crm_sources: [
|
|
58
|
+
{
|
|
59
|
+
id: 6,
|
|
60
|
+
name: 'test',
|
|
61
|
+
is_default: true,
|
|
62
|
+
subscription_id: 31
|
|
63
|
+
}
|
|
64
|
+
],
|
|
65
|
+
object_count: 1,
|
|
66
|
+
unfiltered_count: 1
|
|
67
|
+
}),
|
|
68
|
+
getCrmContactDefaultValues: () =>
|
|
69
|
+
of({
|
|
70
|
+
potential: [],
|
|
71
|
+
labels: ['vip', 'legal advisor']
|
|
72
|
+
}),
|
|
73
|
+
updateContact: () => of({}),
|
|
74
|
+
postCrmLead: () => of({})
|
|
75
|
+
}),
|
|
76
|
+
{
|
|
77
|
+
provide: UserService,
|
|
78
|
+
useClass: UserServiceMock
|
|
79
|
+
}
|
|
80
|
+
]
|
|
81
|
+
});
|
|
82
|
+
|
|
83
|
+
beforeEach(() => {
|
|
84
|
+
TestHelper.setUpPermissionsAndUser();
|
|
85
|
+
});
|
|
86
|
+
|
|
87
|
+
it('should create', async () => {
|
|
88
|
+
TestHelper.setActivatedRoute({
|
|
89
|
+
parent: { params: of({ slug: 'posiwise-263' }) }
|
|
90
|
+
});
|
|
91
|
+
const spectator = await createComponent();
|
|
92
|
+
expect(spectator.component).toBeTruthy();
|
|
93
|
+
});
|
|
94
|
+
|
|
95
|
+
it('should add submit form ', async () => {
|
|
96
|
+
TestHelper.setActivatedRoute({
|
|
97
|
+
parent: { params: of({ slug: 'posiwise-263' }) }
|
|
98
|
+
});
|
|
99
|
+
const spectator = await createComponent();
|
|
100
|
+
const service = TestBed.inject(CrmService);
|
|
101
|
+
const spy = spyOn(service, 'postCrmLead').and.callThrough();
|
|
102
|
+
spectator.typeInElement('test', 'input[formControlName="first_name"]');
|
|
103
|
+
spectator.typeInElement('test@gmail.com', 'input[formControlName="email"]');
|
|
104
|
+
spectator.selectOption(
|
|
105
|
+
'select[formControlName="crm_source_id"]',
|
|
106
|
+
// eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion
|
|
107
|
+
spectator.query(byText('test')) as HTMLOptionElement
|
|
108
|
+
);
|
|
109
|
+
spectator.click('button[type="submit"]');
|
|
110
|
+
expect(spy).toHaveBeenCalledTimes(1);
|
|
111
|
+
});
|
|
112
|
+
|
|
113
|
+
it('should edit', async () => {
|
|
114
|
+
TestHelper.setActivatedRoute({
|
|
115
|
+
params: { Id: 1 },
|
|
116
|
+
parent: { params: of({ slug: 'posiwise-263' }) }
|
|
117
|
+
});
|
|
118
|
+
const spectator = await createComponent();
|
|
119
|
+
const service = TestBed.inject(CrmService);
|
|
120
|
+
const spy = spyOn(service, 'updateContact').and.callThrough();
|
|
121
|
+
spectator.typeInElement('test2', 'input[formControlName="first_name"]');
|
|
122
|
+
spectator.click('button[type="submit"]');
|
|
123
|
+
expect(spy).toHaveBeenCalledTimes(1);
|
|
124
|
+
});
|
|
125
|
+
});
|
|
@@ -0,0 +1,192 @@
|
|
|
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
|
+
import { Observable } from 'rxjs';
|
|
7
|
+
|
|
8
|
+
import { CrmAccount } from '../../../../shared/interface/crm-account.interface';
|
|
9
|
+
import { CrmLead } from '../../../../shared/interface/crm-lead.interface';
|
|
10
|
+
import { AppBaseComponent } from '@posiwise/app-base-component';
|
|
11
|
+
import { HelperService } from '@posiwise/helper-service';
|
|
12
|
+
|
|
13
|
+
@Component({
|
|
14
|
+
selector: 'pw-smart-crm-leads-details',
|
|
15
|
+
templateUrl: './smart-crm-leads-details.component.html'
|
|
16
|
+
})
|
|
17
|
+
export class SmartCrmLeadsDetailsComponent extends AppBaseComponent implements OnInit, OnDestroy {
|
|
18
|
+
form: UntypedFormGroup;
|
|
19
|
+
|
|
20
|
+
data: CrmLead;
|
|
21
|
+
|
|
22
|
+
submitted = false;
|
|
23
|
+
buttonBusy = false;
|
|
24
|
+
isLoading = true;
|
|
25
|
+
|
|
26
|
+
id: number;
|
|
27
|
+
|
|
28
|
+
subscriptionId: number;
|
|
29
|
+
|
|
30
|
+
accounts: CrmAccount[];
|
|
31
|
+
|
|
32
|
+
filteredAccounts: string[] = [];
|
|
33
|
+
|
|
34
|
+
source$: Observable<string>;
|
|
35
|
+
|
|
36
|
+
potentials = [];
|
|
37
|
+
|
|
38
|
+
labels = [];
|
|
39
|
+
|
|
40
|
+
constructor(
|
|
41
|
+
injector: Injector,
|
|
42
|
+
private crmService: CrmService
|
|
43
|
+
) {
|
|
44
|
+
super(injector);
|
|
45
|
+
this.form = AppSmartCrm.getLeadsForm();
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
ngOnInit(): void {
|
|
49
|
+
this.route.params.subscribe(data => {
|
|
50
|
+
if (!Number(data['Id'])) {
|
|
51
|
+
this.isLoading = false;
|
|
52
|
+
}
|
|
53
|
+
this.id = Number(data['Id']);
|
|
54
|
+
});
|
|
55
|
+
this.getUserSubscriptionId().subscribe(response => {
|
|
56
|
+
this.subscriptionId = response;
|
|
57
|
+
if (this.subscriptionId) {
|
|
58
|
+
this.getDefaultValues(this.subscriptionId);
|
|
59
|
+
this.form.get('subscription_id').setValue(this.subscriptionId);
|
|
60
|
+
this.getAccountsBySubscription();
|
|
61
|
+
this.source$ = this.crmService.getAllAccountSource(this.subscriptionId);
|
|
62
|
+
}
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
/** Function to get the specific contact details on edit form */
|
|
67
|
+
private getLeadDetails() {
|
|
68
|
+
this.crmService.getContactById(this.subscriptionId, this.id).subscribe(response => {
|
|
69
|
+
this.data = response;
|
|
70
|
+
let dobObject: NgbDateStruct;
|
|
71
|
+
if (response.dob) {
|
|
72
|
+
dobObject = {
|
|
73
|
+
year: Number(response.dob.substring(0, 4)),
|
|
74
|
+
month: Number(response.dob.substring(5, 7)),
|
|
75
|
+
day: Number(response.dob.substring(8, 10))
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
this.isLoading = false;
|
|
79
|
+
this.form.patchValue(response);
|
|
80
|
+
this.form.patchValue({ dob: dobObject });
|
|
81
|
+
this.accounts.forEach(account => {
|
|
82
|
+
if (this.data.crm_account_id === account.id) {
|
|
83
|
+
this.form.get('crm_account_id').patchValue(account);
|
|
84
|
+
}
|
|
85
|
+
});
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
/** Function to execute on form submission */
|
|
90
|
+
onSave() {
|
|
91
|
+
this.submitted = true;
|
|
92
|
+
if (this.form.valid) {
|
|
93
|
+
const { form } = this;
|
|
94
|
+
this.buttonBusy = true;
|
|
95
|
+
if (form.value.crm_account_id) {
|
|
96
|
+
form.get('crm_account_id').setValue(form.get('crm_account_id').value.id);
|
|
97
|
+
form.value.crm_account_id = Number(form.value.crm_account_id);
|
|
98
|
+
}
|
|
99
|
+
if (this.id) {
|
|
100
|
+
this.onUpdateLead();
|
|
101
|
+
} else {
|
|
102
|
+
this.onPostLead();
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
/** Function to get form controls */
|
|
108
|
+
get f() {
|
|
109
|
+
return this.form.controls;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
/** Function to post the new lead */
|
|
113
|
+
private onPostLead() {
|
|
114
|
+
const data = { ...this.form.value };
|
|
115
|
+
data.dob = HelperService.dateFormat(this.form.get('dob').value);
|
|
116
|
+
data.is_manual = true;
|
|
117
|
+
this.crmService
|
|
118
|
+
.postCrmLead(this.subscriptionId, data)
|
|
119
|
+
.subscribe(() => {
|
|
120
|
+
this.toast.success(this.translation.translate('Crm.CrmLeads.AddedMessage'));
|
|
121
|
+
this.back();
|
|
122
|
+
})
|
|
123
|
+
.add(() => {
|
|
124
|
+
this.submitted = false;
|
|
125
|
+
this.buttonBusy = false;
|
|
126
|
+
});
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
/** Function to update the leads */
|
|
130
|
+
private onUpdateLead() {
|
|
131
|
+
const data = { ...this.form.value };
|
|
132
|
+
data.dob = HelperService.dateFormat(this.form.get('dob').value);
|
|
133
|
+
this.crmService
|
|
134
|
+
.updateContact(this.subscriptionId, this.id, data)
|
|
135
|
+
.subscribe(() => {
|
|
136
|
+
this.back();
|
|
137
|
+
this.toast.success(this.translation.translate('Crm.CrmLeads.UpdatedMessage'));
|
|
138
|
+
})
|
|
139
|
+
.add(() => {
|
|
140
|
+
this.buttonBusy = false;
|
|
141
|
+
});
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
/** Function to get the list of accounts by subscriptionId */
|
|
145
|
+
private getAccountsBySubscription() {
|
|
146
|
+
this.crmService
|
|
147
|
+
.getAccountsBySubscription(this.subscriptionId)
|
|
148
|
+
.subscribe(res => {
|
|
149
|
+
this.accounts = res.accounts;
|
|
150
|
+
if (this.id) {
|
|
151
|
+
this.getLeadDetails();
|
|
152
|
+
}
|
|
153
|
+
})
|
|
154
|
+
.add(() => {
|
|
155
|
+
this.submitted = false;
|
|
156
|
+
});
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
/** search accounts */
|
|
160
|
+
search(event) {
|
|
161
|
+
let data = [];
|
|
162
|
+
if (event.query) {
|
|
163
|
+
data = this.accounts?.filter((x: CrmAccount) => {
|
|
164
|
+
return x.name.toLowerCase().includes(event.query.toLowerCase());
|
|
165
|
+
});
|
|
166
|
+
} else {
|
|
167
|
+
this.accounts?.forEach(element => {
|
|
168
|
+
data.push(element);
|
|
169
|
+
});
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
this.filteredAccounts = data;
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
getDefaultValues(id: number) {
|
|
176
|
+
this.crmService.getCrmContactDefaultValues(id).subscribe(res => {
|
|
177
|
+
this.potentials = res['potential'];
|
|
178
|
+
const label = res['labels'];
|
|
179
|
+
label.forEach(val => {
|
|
180
|
+
const data = {
|
|
181
|
+
label: val,
|
|
182
|
+
value: val
|
|
183
|
+
};
|
|
184
|
+
this.labels.push(data);
|
|
185
|
+
});
|
|
186
|
+
});
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
override ngOnDestroy() {
|
|
190
|
+
super.ngOnDestroy();
|
|
191
|
+
}
|
|
192
|
+
}
|
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
<div class="row">
|
|
2
|
+
<div class="col-12 mb-3">
|
|
3
|
+
<h2>Leads</h2>
|
|
4
|
+
<p>
|
|
5
|
+
In this section you'll find a list of prospects we found for you - based on your domain
|
|
6
|
+
of activity - and we think you should reach out to.
|
|
7
|
+
</p>
|
|
8
|
+
<a class="btn btn-sm btn-outline-primary float-end"
|
|
9
|
+
data-cy="add-leads"
|
|
10
|
+
[routerLink]="['/' + subscription?.slug + routers.leadsDetails + 'add']">
|
|
11
|
+
<i class="fa fa-plus-circle" aria-hidden="true"></i>
|
|
12
|
+
{{ 'Crm.CrmLeads.AddLead' | transloco }}
|
|
13
|
+
</a>
|
|
14
|
+
</div>
|
|
15
|
+
</div>
|
|
16
|
+
<div class="w-100 text-center mt-3"
|
|
17
|
+
*ngIf="!isLoaded">
|
|
18
|
+
<p-progressSpinner strokeWidth="2"> </p-progressSpinner>
|
|
19
|
+
</div>
|
|
20
|
+
|
|
21
|
+
<div class="primeng-datatable-container table-responsive"
|
|
22
|
+
[class.hideTable]="data.unfiltered_count === 0">
|
|
23
|
+
<p-table #dt
|
|
24
|
+
[value]="data.crm_leads"
|
|
25
|
+
[paginator]="data.object_count !== 0"
|
|
26
|
+
[lazy]="true"
|
|
27
|
+
[rows]="PAGE_SIZE"
|
|
28
|
+
[totalRecords]="data.object_count"
|
|
29
|
+
[loading]="loading"
|
|
30
|
+
filterDelay="1000"
|
|
31
|
+
(onLazyLoad)="onLazyLoad($event)"
|
|
32
|
+
[customSort]="true">
|
|
33
|
+
<ng-template pTemplate="caption">
|
|
34
|
+
<div class="d-flex">
|
|
35
|
+
<div class="col-sm-3">
|
|
36
|
+
<p-multiSelect placeholder="Select Source"
|
|
37
|
+
[options]="crmSources"
|
|
38
|
+
[filter]="false"
|
|
39
|
+
(onChange)="onSourceChange($event)"
|
|
40
|
+
[showHeader]="true"
|
|
41
|
+
[showToggleAll]="true"
|
|
42
|
+
appendTo="body">
|
|
43
|
+
</p-multiSelect>
|
|
44
|
+
</div>
|
|
45
|
+
<div class="text-end ms-auto">
|
|
46
|
+
<i class="fa fa-search mt-2 me-2" aria-hidden="true"></i>
|
|
47
|
+
<input type="text"
|
|
48
|
+
[(ngModel)]="searchText"
|
|
49
|
+
pInputText
|
|
50
|
+
size="50"
|
|
51
|
+
placeholder="Search leads..."
|
|
52
|
+
(input)="dt.filterGlobal($event.target.value, 'contains')"
|
|
53
|
+
class="mw-90" />
|
|
54
|
+
</div>
|
|
55
|
+
</div>
|
|
56
|
+
</ng-template>
|
|
57
|
+
<ng-template pTemplate="header">
|
|
58
|
+
<tr>
|
|
59
|
+
<th scope="true"
|
|
60
|
+
pSortableColumn="first_name">
|
|
61
|
+
{{ 'Crm.ContactMessage.Name' | transloco }}
|
|
62
|
+
<p-sortIcon field="first_name"></p-sortIcon>
|
|
63
|
+
</th>
|
|
64
|
+
<th scope="true"
|
|
65
|
+
pSortableColumn="email">
|
|
66
|
+
{{ 'Crm.CrmLeads.Email' | transloco }}
|
|
67
|
+
<p-sortIcon field="email"></p-sortIcon>
|
|
68
|
+
</th>
|
|
69
|
+
<th scope="true">
|
|
70
|
+
{{ 'Crm.CrmLeads.EmailVerified' | transloco }}
|
|
71
|
+
</th>
|
|
72
|
+
<th scope="true"
|
|
73
|
+
pSortableColumn="created_at">
|
|
74
|
+
{{ 'Crm.CrmLeads.CreatedAt' | transloco }}
|
|
75
|
+
<p-sortIcon field="created_at"></p-sortIcon>
|
|
76
|
+
</th>
|
|
77
|
+
<th scope="true"
|
|
78
|
+
pSortableColumn="crm_source_id">
|
|
79
|
+
{{ 'Crm.CrmLeads.Source' | transloco }}
|
|
80
|
+
<p-sortIcon field="crm_source_id"></p-sortIcon>
|
|
81
|
+
</th>
|
|
82
|
+
<th scope="true">{{ 'Label.Actions' | transloco }}</th>
|
|
83
|
+
</tr>
|
|
84
|
+
</ng-template>
|
|
85
|
+
<ng-template pTemplate="body"
|
|
86
|
+
let-lead>
|
|
87
|
+
<tr>
|
|
88
|
+
<td data-head="Name"
|
|
89
|
+
class="contactname">
|
|
90
|
+
<a [routerLink]="['/' + subscription?.slug + routers.contactInfo, lead?.id]">
|
|
91
|
+
{{
|
|
92
|
+
!lead?.first_name && !lead.last_name
|
|
93
|
+
? 'N/A'
|
|
94
|
+
: ((lead?.first_name || '') + ' ' + (lead?.last_name || '') | textTruncate: 20)
|
|
95
|
+
}}
|
|
96
|
+
</a>
|
|
97
|
+
</td>
|
|
98
|
+
<td data-head="Email">
|
|
99
|
+
<a href="mailto:{{ lead?.email }}">{{ lead?.email }}</a>
|
|
100
|
+
<span *ngIf="lead?.enquiry"
|
|
101
|
+
class="ms-2"
|
|
102
|
+
[pTooltip]="lead?.enquiry"
|
|
103
|
+
tooltipPosition="top">
|
|
104
|
+
<i class="fas fa-info-circle"></i>
|
|
105
|
+
</span>
|
|
106
|
+
</td>
|
|
107
|
+
<td data-head="Email Verified">
|
|
108
|
+
<span [appDynamicBadge]="{
|
|
109
|
+
itemsArray: [true, false],
|
|
110
|
+
item: lead?.email_verified
|
|
111
|
+
}"
|
|
112
|
+
color="success-danger"
|
|
113
|
+
class="badge">{{ lead?.email_verified ? 'true' : 'false' }}</span>
|
|
114
|
+
<span class="ms-2 cursor-pointer"
|
|
115
|
+
[pTooltip]="'Crm.CrmLeads.Tooltip.NewsLetterUnsubscribed' | transloco"
|
|
116
|
+
tooltipPosition="top"
|
|
117
|
+
*ngIf="!lead?.newsletter_subscribed"><i class="fas fa-exclamation-triangle text-danger"></i></span>
|
|
118
|
+
</td>
|
|
119
|
+
<td data-head="Created At">
|
|
120
|
+
{{ lead?.created_at | dateFormat }}
|
|
121
|
+
</td>
|
|
122
|
+
<td>
|
|
123
|
+
<span class="badge"
|
|
124
|
+
[appDynamicBadge]="{ itemsArray: allSource, item: lead?.crm_source?.name }"
|
|
125
|
+
color="default">{{ lead?.crm_source?.name }}</span>
|
|
126
|
+
</td>
|
|
127
|
+
<td data-head="Action">
|
|
128
|
+
<ul class="list-unstyled list-inline">
|
|
129
|
+
<li ngbTooltip="Show"
|
|
130
|
+
class="me-2 me-sm-3"
|
|
131
|
+
[routerLink]="[
|
|
132
|
+
'/' + subscription?.slug + routers.contactInfo,
|
|
133
|
+
lead?.id
|
|
134
|
+
]">
|
|
135
|
+
<i class="fa fa-eye see-icon" aria-hidden="true"></i>
|
|
136
|
+
</li>
|
|
137
|
+
<li *ngIf="
|
|
138
|
+
hasAccess ||
|
|
139
|
+
lead?.owner_id === userId ||
|
|
140
|
+
lead?.crm_account?.owner_id === userId
|
|
141
|
+
"
|
|
142
|
+
ngbTooltip="Edit"
|
|
143
|
+
class="me-2 me-sm-3"
|
|
144
|
+
[routerLink]="[
|
|
145
|
+
'/' + subscription?.slug + routers.leadsDetails,
|
|
146
|
+
lead?.id
|
|
147
|
+
]">
|
|
148
|
+
<i class="fa fa-edit edit-icon" aria-hidden="true"></i>
|
|
149
|
+
</li>
|
|
150
|
+
<li *ngIf="
|
|
151
|
+
hasAccess ||
|
|
152
|
+
lead?.owner_id === userId ||
|
|
153
|
+
lead?.crm_account?.owner_id === userId
|
|
154
|
+
"
|
|
155
|
+
ngbTooltip="Delete"
|
|
156
|
+
class="me-2 me-sm-3">
|
|
157
|
+
<i
|
|
158
|
+
class="fa fa-trash delete-icon"
|
|
159
|
+
(click)="onDelete(lead.id)"
|
|
160
|
+
aria-hidden="true"
|
|
161
|
+
></i>
|
|
162
|
+
</li>
|
|
163
|
+
</ul>
|
|
164
|
+
</td>
|
|
165
|
+
</tr>
|
|
166
|
+
</ng-template>
|
|
167
|
+
</p-table>
|
|
168
|
+
<div *ngIf="data.object_count === 0 && data.unfiltered_count !== 0">
|
|
169
|
+
<pw-no-data [withImage]="true" [message]="'Search.NoDataMessage'| transloco" [description]="'Search.NoDataDescription' | transloco" >
|
|
170
|
+
</pw-no-data>
|
|
171
|
+
</div>
|
|
172
|
+
<span class="total-records-count" *ngIf="data.object_count !== 0">{{ 'Label.Total' | transloco }}: {{ data.object_count }}</span>
|
|
173
|
+
</div>
|
|
174
|
+
<div *ngIf="data.unfiltered_count === 0 && isLoaded">
|
|
175
|
+
<pw-no-data [withImage]="true" [message]="'Crm.CrmLeads.NoCrmLeadMessage' | transloco"> </pw-no-data>
|
|
176
|
+
</div>
|