@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,417 @@
|
|
|
1
|
+
import {
|
|
2
|
+
AfterViewChecked,
|
|
3
|
+
ChangeDetectorRef,
|
|
4
|
+
Component,
|
|
5
|
+
Injector,
|
|
6
|
+
OnDestroy,
|
|
7
|
+
OnInit
|
|
8
|
+
} from '@angular/core';
|
|
9
|
+
import { ROUTERS } from '../../../shared/routers/routers';
|
|
10
|
+
import { CrmService } from '@posiwise/smart-crm-shared';
|
|
11
|
+
import { LazyLoadEvent } from 'primeng/api';
|
|
12
|
+
|
|
13
|
+
import { PAGE_SIZE, Paging, Plotly, Subscription } from '@posiwise/common-utilities';
|
|
14
|
+
import { CrmAccountResponse } from '../../../shared/interface/crm-account.interface';
|
|
15
|
+
import { AppBaseComponent } from '@posiwise/app-base-component';
|
|
16
|
+
import { CommonService, LogoCacheService } from '@posiwise/common-services';
|
|
17
|
+
import { HelperService } from '@posiwise/helper-service';
|
|
18
|
+
import {
|
|
19
|
+
OpportunityCategory,
|
|
20
|
+
OrganizationType,
|
|
21
|
+
UserAccount
|
|
22
|
+
} from '../../../shared/interface/smart-crm-module.interface';
|
|
23
|
+
|
|
24
|
+
@Component({
|
|
25
|
+
selector: 'pw-smart-crm-companies',
|
|
26
|
+
templateUrl: './smart-crm-accounts.component.html',
|
|
27
|
+
styleUrls: ['./smart-crm-accounts.component.scss']
|
|
28
|
+
})
|
|
29
|
+
export class SmartCrmCompaniesComponent
|
|
30
|
+
extends AppBaseComponent
|
|
31
|
+
implements OnInit, OnDestroy, AfterViewChecked
|
|
32
|
+
{
|
|
33
|
+
data: CrmAccountResponse = {
|
|
34
|
+
accounts: [],
|
|
35
|
+
object_count: 0,
|
|
36
|
+
unfiltered_count: 0
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
searchText = '';
|
|
40
|
+
|
|
41
|
+
loading = true;
|
|
42
|
+
|
|
43
|
+
subscriptionId: number;
|
|
44
|
+
|
|
45
|
+
organizationSizes = [];
|
|
46
|
+
|
|
47
|
+
userId: number;
|
|
48
|
+
|
|
49
|
+
hasAccess = false;
|
|
50
|
+
|
|
51
|
+
isLoaded = false;
|
|
52
|
+
|
|
53
|
+
private allIndustries: OrganizationType[];
|
|
54
|
+
|
|
55
|
+
searchOptions: OpportunityCategory[] = [];
|
|
56
|
+
|
|
57
|
+
filterByIndustries = [];
|
|
58
|
+
|
|
59
|
+
status = [];
|
|
60
|
+
|
|
61
|
+
priority = [];
|
|
62
|
+
|
|
63
|
+
source = [];
|
|
64
|
+
|
|
65
|
+
filterBySource = [];
|
|
66
|
+
|
|
67
|
+
filterByStatus = [];
|
|
68
|
+
|
|
69
|
+
filterByPriority = [];
|
|
70
|
+
|
|
71
|
+
filterBySizeId = [];
|
|
72
|
+
|
|
73
|
+
searchLocationText: string;
|
|
74
|
+
|
|
75
|
+
private filterByLocation: string;
|
|
76
|
+
|
|
77
|
+
accountGeography: Plotly.Figure;
|
|
78
|
+
|
|
79
|
+
accountActivities = [];
|
|
80
|
+
|
|
81
|
+
accountLastInvoices: string[];
|
|
82
|
+
|
|
83
|
+
accountInsight: string[];
|
|
84
|
+
|
|
85
|
+
private page = 1;
|
|
86
|
+
|
|
87
|
+
subscription: Subscription;
|
|
88
|
+
|
|
89
|
+
routers = ROUTERS;
|
|
90
|
+
actionNames = [];
|
|
91
|
+
|
|
92
|
+
constructor(
|
|
93
|
+
private crmService: CrmService,
|
|
94
|
+
private commonService: CommonService,
|
|
95
|
+
private logoCacheService: LogoCacheService,
|
|
96
|
+
injector: Injector,
|
|
97
|
+
private cdr: ChangeDetectorRef
|
|
98
|
+
) {
|
|
99
|
+
super(injector);
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
ngOnInit() {
|
|
103
|
+
this.getUserSubscription().subscribe(response => {
|
|
104
|
+
this.subscription = response;
|
|
105
|
+
if (this.subscription?.id) {
|
|
106
|
+
this.accountDefaultValues(this.subscription.id);
|
|
107
|
+
this.hasAccess = this.hasAdminAccess(this.subscription.id);
|
|
108
|
+
this.getUserInfo();
|
|
109
|
+
}
|
|
110
|
+
});
|
|
111
|
+
this.getIndustries();
|
|
112
|
+
this.getAllOrganizationSize();
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
ngAfterViewChecked() {
|
|
116
|
+
this.cdr.detectChanges();
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
onLazyLoad(event: LazyLoadEvent) {
|
|
120
|
+
const pageDetails = HelperService.onTableLazyLoad(event);
|
|
121
|
+
this.page = pageDetails.page;
|
|
122
|
+
this.getAllAccounts({
|
|
123
|
+
page: this.page,
|
|
124
|
+
page_size: PAGE_SIZE,
|
|
125
|
+
order_by: pageDetails.sortField,
|
|
126
|
+
order_direction: pageDetails.sortOrder,
|
|
127
|
+
search: this.searchText
|
|
128
|
+
});
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
/** Function to get user details */
|
|
132
|
+
private getUserInfo() {
|
|
133
|
+
this.userStore().subscribe(user => {
|
|
134
|
+
if (user) {
|
|
135
|
+
this.userId = user?.id;
|
|
136
|
+
if (this.permissionService.isGranted('Pages.Beta')) {
|
|
137
|
+
this.getAccountGeography();
|
|
138
|
+
this.getAccountActivities();
|
|
139
|
+
this.getAccountLastInvoices();
|
|
140
|
+
this.getAccountInsight();
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
});
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
/** Function to call account default values */
|
|
147
|
+
private accountDefaultValues(id: number) {
|
|
148
|
+
this.crmService.getCrmAccountDefaultValues(id).subscribe(response => {
|
|
149
|
+
const { status } = response;
|
|
150
|
+
status.forEach(val => {
|
|
151
|
+
const data = {
|
|
152
|
+
label: val,
|
|
153
|
+
value: val
|
|
154
|
+
};
|
|
155
|
+
this.status.push(data);
|
|
156
|
+
});
|
|
157
|
+
const { priority } = response;
|
|
158
|
+
priority.forEach(val => {
|
|
159
|
+
const data = {
|
|
160
|
+
label: val,
|
|
161
|
+
value: val
|
|
162
|
+
};
|
|
163
|
+
this.priority.push(data);
|
|
164
|
+
});
|
|
165
|
+
const { source } = response;
|
|
166
|
+
source.forEach(val => {
|
|
167
|
+
const data = {
|
|
168
|
+
label: val.name,
|
|
169
|
+
value: val.id
|
|
170
|
+
};
|
|
171
|
+
this.source.push(data);
|
|
172
|
+
});
|
|
173
|
+
});
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
/** Function to get the accounts list */
|
|
177
|
+
private getAllAccounts(paging: Paging) {
|
|
178
|
+
this.data.accounts = [];
|
|
179
|
+
|
|
180
|
+
this.getUserSubscriptionId().subscribe(response => {
|
|
181
|
+
this.subscriptionId = response;
|
|
182
|
+
if (this.subscriptionId) {
|
|
183
|
+
this.crmService
|
|
184
|
+
.getAllAccounts(
|
|
185
|
+
this.subscriptionId,
|
|
186
|
+
paging,
|
|
187
|
+
this.filterByIndustries.join() || '',
|
|
188
|
+
this.filterBySizeId.join() || '',
|
|
189
|
+
this.filterByStatus.join() || '',
|
|
190
|
+
this.filterByPriority.join() || '',
|
|
191
|
+
this.filterBySource.join() || '',
|
|
192
|
+
this.filterByLocation || ''
|
|
193
|
+
)
|
|
194
|
+
.subscribe(res => {
|
|
195
|
+
this.data = res;
|
|
196
|
+
})
|
|
197
|
+
.add(() => {
|
|
198
|
+
this.isLoaded = true;
|
|
199
|
+
this.loading = false;
|
|
200
|
+
});
|
|
201
|
+
}
|
|
202
|
+
});
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
/** Function to call accounts size */
|
|
206
|
+
private getAllOrganizationSize() {
|
|
207
|
+
this.commonService.getOrganizationSizes().subscribe(response => {
|
|
208
|
+
const organizationSizes = response.organization_sizes;
|
|
209
|
+
organizationSizes.forEach(val => {
|
|
210
|
+
const data = {
|
|
211
|
+
label: val.name,
|
|
212
|
+
value: val.id
|
|
213
|
+
};
|
|
214
|
+
this.organizationSizes.push(data);
|
|
215
|
+
});
|
|
216
|
+
});
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
/** Function to get organization industries */
|
|
220
|
+
private getIndustries() {
|
|
221
|
+
this.commonService.getOrganizationIndustries().subscribe(response => {
|
|
222
|
+
this.allIndustries = response.organization_industries;
|
|
223
|
+
this.allIndustries.forEach(val => {
|
|
224
|
+
const industries = {
|
|
225
|
+
label: val.name,
|
|
226
|
+
value: val.id
|
|
227
|
+
};
|
|
228
|
+
this.searchOptions.push(industries);
|
|
229
|
+
});
|
|
230
|
+
});
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
/** Function to execute on delete button click */
|
|
234
|
+
onDelete(id: number, subscription_id: number) {
|
|
235
|
+
HelperService.raiseDeletePopup().then(res => {
|
|
236
|
+
if (res.value) {
|
|
237
|
+
this.crmService.deleteAccount(id, subscription_id).subscribe(() => {
|
|
238
|
+
this.getAllAccounts({
|
|
239
|
+
page: this.page,
|
|
240
|
+
page_size: PAGE_SIZE,
|
|
241
|
+
search: this.searchText
|
|
242
|
+
});
|
|
243
|
+
this.toast.success(
|
|
244
|
+
this.translation.translate('Crm.AccountMessage.DeletedMessage')
|
|
245
|
+
);
|
|
246
|
+
});
|
|
247
|
+
}
|
|
248
|
+
});
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
/** filtering accounts */
|
|
252
|
+
onSearchOptionChange(event, filterBy: string) {
|
|
253
|
+
if (filterBy === 'industry') {
|
|
254
|
+
this.filterByIndustries = event.value;
|
|
255
|
+
this.getAllAccounts({
|
|
256
|
+
page: this.page,
|
|
257
|
+
page_size: PAGE_SIZE
|
|
258
|
+
});
|
|
259
|
+
}
|
|
260
|
+
if (filterBy === 'size') {
|
|
261
|
+
this.filterBySizeId = event.value;
|
|
262
|
+
this.getAllAccounts({
|
|
263
|
+
page: this.page,
|
|
264
|
+
page_size: PAGE_SIZE
|
|
265
|
+
});
|
|
266
|
+
}
|
|
267
|
+
if (filterBy === 'status') {
|
|
268
|
+
this.filterByStatus = event.value;
|
|
269
|
+
this.getAllAccounts({
|
|
270
|
+
page: this.page,
|
|
271
|
+
page_size: PAGE_SIZE
|
|
272
|
+
});
|
|
273
|
+
}
|
|
274
|
+
if (filterBy === 'priority') {
|
|
275
|
+
this.filterByPriority = event.value;
|
|
276
|
+
this.getAllAccounts({
|
|
277
|
+
page: this.page,
|
|
278
|
+
page_size: PAGE_SIZE
|
|
279
|
+
});
|
|
280
|
+
}
|
|
281
|
+
if (filterBy === 'source') {
|
|
282
|
+
this.filterBySource = event.value;
|
|
283
|
+
this.getAllAccounts({
|
|
284
|
+
page: this.page,
|
|
285
|
+
page_size: PAGE_SIZE
|
|
286
|
+
});
|
|
287
|
+
}
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
/** Function to execute on location select */
|
|
291
|
+
handleAddressChange(event) {
|
|
292
|
+
this.filterByLocation = event.formatted_address;
|
|
293
|
+
this.getAllAccounts({
|
|
294
|
+
page: this.page,
|
|
295
|
+
page_size: PAGE_SIZE
|
|
296
|
+
});
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
/** Location filter while keyup */
|
|
300
|
+
locationSearch(event) {
|
|
301
|
+
if (event.target.value.length === 0) {
|
|
302
|
+
this.filterByLocation = '';
|
|
303
|
+
this.getAllAccounts({
|
|
304
|
+
page: this.page,
|
|
305
|
+
page_size: PAGE_SIZE
|
|
306
|
+
});
|
|
307
|
+
}
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
/** Function to clear all filters */
|
|
311
|
+
clearFilters() {
|
|
312
|
+
this.filterBySizeId = [];
|
|
313
|
+
this.filterByIndustries = [];
|
|
314
|
+
this.filterByPriority = [];
|
|
315
|
+
this.filterBySource = [];
|
|
316
|
+
this.filterByStatus = [];
|
|
317
|
+
this.searchText = '';
|
|
318
|
+
this.filterByLocation = '';
|
|
319
|
+
this.searchLocationText = '';
|
|
320
|
+
this.getAllAccounts({
|
|
321
|
+
page: this.page,
|
|
322
|
+
page_size: PAGE_SIZE
|
|
323
|
+
});
|
|
324
|
+
}
|
|
325
|
+
|
|
326
|
+
/** Function to call account geography */
|
|
327
|
+
private getAccountGeography() {
|
|
328
|
+
this.crmService
|
|
329
|
+
.getCrmAnalytics(this.subscription?.id, 'accounts_geography')
|
|
330
|
+
.subscribe(response => {
|
|
331
|
+
this.accountGeography = response;
|
|
332
|
+
});
|
|
333
|
+
}
|
|
334
|
+
|
|
335
|
+
getUserAccountInfo(account: UserAccount): { message: string; iconClass: string } {
|
|
336
|
+
if (account.signed_up_at !== null) {
|
|
337
|
+
if (account.unsubscribed_at === null) {
|
|
338
|
+
return { message: 'Paid Customer', iconClass: 'fas fa-dollar-sign money-icon' };
|
|
339
|
+
} else {
|
|
340
|
+
return {
|
|
341
|
+
message: 'Old Customer',
|
|
342
|
+
iconClass: 'fas fa-exclamation-triangle text-danger'
|
|
343
|
+
};
|
|
344
|
+
}
|
|
345
|
+
} else if (account.child_subscription_id !== null) {
|
|
346
|
+
return {
|
|
347
|
+
message: 'Account with existing subscription',
|
|
348
|
+
iconClass: 'fas fa-link account-link-icon'
|
|
349
|
+
};
|
|
350
|
+
}
|
|
351
|
+
return { message: null, iconClass: null };
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
formatMRR(mrrInCents: number) {
|
|
355
|
+
const mrrInDollars = (mrrInCents / 100).toFixed(2);
|
|
356
|
+
return '$' + mrrInDollars.replace(/\B(?=(\d{3})+(?!\d))/g, ',');
|
|
357
|
+
}
|
|
358
|
+
|
|
359
|
+
/** Function to call account activities */
|
|
360
|
+
private getAccountActivities() {
|
|
361
|
+
this.crmService
|
|
362
|
+
.getCrmAnalytics(this.subscription?.id, 'accounts_last_activities')
|
|
363
|
+
.subscribe(response => {
|
|
364
|
+
if (typeof response === 'object' && Object.keys(response).length === 0) {
|
|
365
|
+
this.accountActivities = [];
|
|
366
|
+
} else {
|
|
367
|
+
this.accountActivities = response;
|
|
368
|
+
this.actionNames = response?.map(action => {
|
|
369
|
+
return action?.crm_action?.name;
|
|
370
|
+
});
|
|
371
|
+
}
|
|
372
|
+
});
|
|
373
|
+
}
|
|
374
|
+
|
|
375
|
+
/** Function to call last invoice */
|
|
376
|
+
private getAccountLastInvoices() {
|
|
377
|
+
this.crmService
|
|
378
|
+
.getCrmAnalytics(this.subscription?.id, 'accounts_last_invoices')
|
|
379
|
+
.subscribe(response => {
|
|
380
|
+
if (typeof response === 'object' && Object.keys(response).length === 0) {
|
|
381
|
+
this.accountLastInvoices = [];
|
|
382
|
+
} else this.accountLastInvoices = response;
|
|
383
|
+
});
|
|
384
|
+
}
|
|
385
|
+
|
|
386
|
+
/** Function to call account insight */
|
|
387
|
+
private getAccountInsight() {
|
|
388
|
+
this.crmService
|
|
389
|
+
.getCrmAnalytics(this.subscription?.id, 'accounts_insights')
|
|
390
|
+
.subscribe(response => {
|
|
391
|
+
if (typeof response === 'object' && Object.keys(response).length === 0) {
|
|
392
|
+
this.accountInsight = [];
|
|
393
|
+
} else this.accountInsight = response;
|
|
394
|
+
});
|
|
395
|
+
}
|
|
396
|
+
|
|
397
|
+
getCountryFromLocation(location: string): string {
|
|
398
|
+
const parts = location?.split(',') || [];
|
|
399
|
+
return parts[parts.length - 1]?.trim() || '';
|
|
400
|
+
}
|
|
401
|
+
|
|
402
|
+
getAccountLogo(url: string) {
|
|
403
|
+
if (url) {
|
|
404
|
+
return this.logoCacheService.getLogo(
|
|
405
|
+
`https://logo.clearbit.com/${url?.split('.')[1]}.${
|
|
406
|
+
url?.split('.')[2]?.split('/')[0]
|
|
407
|
+
}`
|
|
408
|
+
);
|
|
409
|
+
}
|
|
410
|
+
|
|
411
|
+
return '';
|
|
412
|
+
}
|
|
413
|
+
|
|
414
|
+
override ngOnDestroy() {
|
|
415
|
+
super.ngOnDestroy();
|
|
416
|
+
}
|
|
417
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<pw-coming-soon message="Competition"></pw-coming-soon>
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { CommonServicesModule } from '@posiwise/common-services';
|
|
2
|
+
import { SharedModule } from '@posiwise/shared-module';
|
|
3
|
+
import { TestHelper } from '@posiwise/test-helpers';
|
|
4
|
+
import { SmartCrmPrivateModule } from '../../../smart-crm-private.module';
|
|
5
|
+
import { SmartCrmCompetitionComponent } from './smart-crm-competition.component';
|
|
6
|
+
|
|
7
|
+
describe('SmartCrmCompetitionComponent', () => {
|
|
8
|
+
const createComponent = TestHelper.createComponentFactory({
|
|
9
|
+
component: SmartCrmCompetitionComponent,
|
|
10
|
+
imports: [SharedModule, CommonServicesModule, SmartCrmPrivateModule]
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
it('should create', async () => {
|
|
14
|
+
const spectator = await createComponent();
|
|
15
|
+
expect(spectator.component).toBeTruthy();
|
|
16
|
+
});
|
|
17
|
+
});
|
|
@@ -0,0 +1,75 @@
|
|
|
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>Action: {{ isLoading ? '' : data?.name ? data?.name : ('Label.AddNew' | transloco) }}</span>
|
|
6
|
+
</h3>
|
|
7
|
+
</div>
|
|
8
|
+
<div class="w-100 text-center mt-3"
|
|
9
|
+
*ngIf="isLoading">
|
|
10
|
+
<p-progressSpinner strokeWidth="2"> </p-progressSpinner>
|
|
11
|
+
</div>
|
|
12
|
+
<div class="p-2 mt-3" *ngIf="!isLoading">
|
|
13
|
+
<form [formGroup]="form" (ngSubmit)="onSave()">
|
|
14
|
+
<div class="row">
|
|
15
|
+
<div class="col-12 col-md-3">
|
|
16
|
+
<pw-input-container [label]="'Crm.Settings.Name' | transloco" name="name"
|
|
17
|
+
[errorMsg]="'Crm.Settings.NameFieldErrorMessage' | transloco">
|
|
18
|
+
<input type="text" class="form-control" formControlName="name" id="name"
|
|
19
|
+
[ngClass]="{ 'is-invalid': submitted && f['name'].errors }" />
|
|
20
|
+
</pw-input-container>
|
|
21
|
+
</div>
|
|
22
|
+
<div class="col-12 col-sm-4 col-md-2">
|
|
23
|
+
<label class="info-circle mb-2">{{ 'Crm.Settings.TargetWeek' | transloco }} <span
|
|
24
|
+
class="tooltiptext gradient-custom-branding">{{ 'Crm.Settings.Tooltip.TargetWeek' | transloco }}</span>
|
|
25
|
+
</label>
|
|
26
|
+
<select formControlName="target_week" class="form-control form-select"
|
|
27
|
+
[ngClass]="{ 'is-invalid': submitted && f['target_week'].errors }">
|
|
28
|
+
<option *ngFor="let option of targetWeek" [value]="option">{{ option }}</option>
|
|
29
|
+
</select>
|
|
30
|
+
<div class="danger" *ngIf="
|
|
31
|
+
form.get('target_week').touched && form.get('target_week')?.errors?.required
|
|
32
|
+
">
|
|
33
|
+
<span> {{ 'Crm.Settings.TargetWeekErrorMessage' | transloco }} </span>
|
|
34
|
+
</div>
|
|
35
|
+
</div>
|
|
36
|
+
<div class="col-12 col-sm-4 col-md-2">
|
|
37
|
+
<label class="info-circle mb-2">{{ 'Crm.Settings.TargetWeekMin' | transloco }} <span
|
|
38
|
+
class="tooltiptext gradient-custom-branding">{{ 'Crm.Settings.Tooltip.TargetWeekMin' | transloco }}</span>
|
|
39
|
+
</label>
|
|
40
|
+
<select formControlName="target_week_min" class="form-control form-select"
|
|
41
|
+
[ngClass]="{ 'is-invalid': submitted && f['target_week_min'].errors }">
|
|
42
|
+
<option *ngFor="let option of targetWeekMin" [value]="option"> {{ option }} </option>
|
|
43
|
+
</select>
|
|
44
|
+
<div class="danger" *ngIf="
|
|
45
|
+
form.get('target_week_min').touched &&
|
|
46
|
+
form.get('target_week_min')?.errors?.required
|
|
47
|
+
">
|
|
48
|
+
<span> {{ 'Crm.Settings.TargetWeekMinErrorMessage' | transloco }} </span>
|
|
49
|
+
</div>
|
|
50
|
+
</div>
|
|
51
|
+
<div class="col-12 col-sm-4 col-md-2">
|
|
52
|
+
<pw-input-container [showTooltip]="true" [tooltipText]="'Crm.Settings.Tooltip.PreviousAction' | transloco"
|
|
53
|
+
[label]="'Crm.Settings.PreviousAction' | transloco" name="previous_action_id"
|
|
54
|
+
*ngIf="actions$ | async as actions">
|
|
55
|
+
<p-dropdown [options]="actions['crm_actions']" formControlName="previous_action_id" optionLabel="name"
|
|
56
|
+
[showClear]="true" placeholder="Select a PreviousAction"></p-dropdown>
|
|
57
|
+
</pw-input-container>
|
|
58
|
+
</div>
|
|
59
|
+
<div class="col-md-2 col-lg-2 pe-0 mx-2">
|
|
60
|
+
<div class="mb-3">
|
|
61
|
+
<label class="info-circle mb-2">{{ 'Crm.Settings.Visible' | transloco }} <span
|
|
62
|
+
class="tooltiptext gradient-custom-branding">{{ 'Crm.Settings.Tooltip.Visible' | transloco }}</span>
|
|
63
|
+
</label>
|
|
64
|
+
<ui-switch checked class="d-block" (change)="onChange($event)" name="visible" formControlName="visible">
|
|
65
|
+
</ui-switch>
|
|
66
|
+
</div>
|
|
67
|
+
</div>
|
|
68
|
+
<div class="col-12 text-end mt-3">
|
|
69
|
+
<button type="button" class="btn btn-outline-default me-2" (click)="back()"> {{ 'Button.Cancel' | transloco }}
|
|
70
|
+
</button>
|
|
71
|
+
<button type="submit" [buttonBusy]="buttonBusy" class="btn btn-primary"> {{ 'Button.Submit' | transloco }} </button>
|
|
72
|
+
</div>
|
|
73
|
+
</div>
|
|
74
|
+
</form>
|
|
75
|
+
</div>
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
// import { TestBed } from '@angular/core/testing';
|
|
2
|
+
// import { byText } from '@ngneat/spectator';
|
|
3
|
+
// import { SmartCrmSettingsDetailsComponent } from '@smart-crm/private/components/smart-crm-configuration/smart-crm-actions/smart-crm-actions-details/smart-crm-actions-details.component';
|
|
4
|
+
// import { MockProvider } from 'ng-mocks';
|
|
5
|
+
// import { of } from 'rxjs';
|
|
6
|
+
//
|
|
7
|
+
// import { AppModule } from '@app/app.module';
|
|
8
|
+
// import { SmartCrmPrivateModule } from '@app/modules/products/smart-crm/private/smart-crm-private.module';
|
|
9
|
+
// import { CrmService } from '@app/modules/products/smart-crm/shared/services/crm.service';
|
|
10
|
+
// import { PermissionService } from '@app/shared/services/permission.service';
|
|
11
|
+
// import { UserService } from '@app/shared/services/user.service';
|
|
12
|
+
// import { SharedModule } from '@app/shared/shared.module';
|
|
13
|
+
//
|
|
14
|
+
// import { DEFAULT_USER } from '@testing/data/database';
|
|
15
|
+
// import { TestHelper } from '@testing/test-helper';
|
|
16
|
+
//
|
|
17
|
+
// class UserServiceMock {
|
|
18
|
+
// getUserState() {
|
|
19
|
+
// return of({ currentUser: DEFAULT_USER });
|
|
20
|
+
// }
|
|
21
|
+
// }
|
|
22
|
+
// describe('SmartCrmSettingsDetailsComponent', () => {
|
|
23
|
+
// const createComponent = TestHelper.createComponentFactory({
|
|
24
|
+
// component: SmartCrmSettingsDetailsComponent,
|
|
25
|
+
// imports: [AppModule, SharedModule, SmartCrmPrivateModule],
|
|
26
|
+
// providers: [
|
|
27
|
+
// ...TestHelper.TEST_PROVIDERS,
|
|
28
|
+
// MockProvider(PermissionService, {
|
|
29
|
+
// evaluatePermissions: () => {
|
|
30
|
+
// return true;
|
|
31
|
+
// }
|
|
32
|
+
// }),
|
|
33
|
+
// MockProvider(CrmService, {
|
|
34
|
+
// getAllActions: () =>
|
|
35
|
+
// of({
|
|
36
|
+
// crm_actions: [
|
|
37
|
+
// {
|
|
38
|
+
// id: 9,
|
|
39
|
+
// name: 'test',
|
|
40
|
+
// subscription_id: 31,
|
|
41
|
+
// target_week_min: 2,
|
|
42
|
+
// target_week: 3,
|
|
43
|
+
// visible: true,
|
|
44
|
+
// previous_action_id: null,
|
|
45
|
+
// contact_required: false
|
|
46
|
+
// }
|
|
47
|
+
// ],
|
|
48
|
+
// object_count: 1,
|
|
49
|
+
// unfiltered_count: 1
|
|
50
|
+
// }),
|
|
51
|
+
// updateActionCon: () => of({}),
|
|
52
|
+
// getAction: () =>
|
|
53
|
+
// of({
|
|
54
|
+
// id: 9,
|
|
55
|
+
// name: 'test',
|
|
56
|
+
// subscription_id: 31,
|
|
57
|
+
// target_week_min: 2,
|
|
58
|
+
// target_week: 3,
|
|
59
|
+
// visible: true,
|
|
60
|
+
// previous_action_id: null,
|
|
61
|
+
// contact_required: false
|
|
62
|
+
// }),
|
|
63
|
+
// postNewAction: () => of({})
|
|
64
|
+
// }),
|
|
65
|
+
// {
|
|
66
|
+
// provide: UserService,
|
|
67
|
+
// useClass: UserServiceMock
|
|
68
|
+
// }
|
|
69
|
+
// ]
|
|
70
|
+
// });
|
|
71
|
+
//
|
|
72
|
+
// beforeEach(() => {
|
|
73
|
+
// TestHelper.setUpPermissionsAndUser();
|
|
74
|
+
// });
|
|
75
|
+
//
|
|
76
|
+
// it('should create', async () => {
|
|
77
|
+
// TestHelper.setActivatedRoute({
|
|
78
|
+
// parent: { params: of({ slug: 'posiwise-263' }) }
|
|
79
|
+
// });
|
|
80
|
+
// const spectator = await createComponent();
|
|
81
|
+
// expect(spectator.component).toBeTruthy();
|
|
82
|
+
// });
|
|
83
|
+
//
|
|
84
|
+
// it('should add submit form ', async () => {
|
|
85
|
+
// TestHelper.setActivatedRoute({
|
|
86
|
+
// parent: { params: of({ slug: 'posiwise-263' }) }
|
|
87
|
+
// });
|
|
88
|
+
// const spectator = await createComponent();
|
|
89
|
+
// const service = TestBed.inject(CrmService);
|
|
90
|
+
// const spy = spyOn(service, 'postNewAction').and.callThrough();
|
|
91
|
+
// spectator.typeInElement('test', 'input[formControlName="name"]');
|
|
92
|
+
// spectator.selectOption(
|
|
93
|
+
// 'select[formControlName="target_week"]',
|
|
94
|
+
// // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion
|
|
95
|
+
// spectator.query(byText('1')) as HTMLOptionElement
|
|
96
|
+
// );
|
|
97
|
+
// spectator.selectOption(
|
|
98
|
+
// 'select[formControlName="target_week_min"]',
|
|
99
|
+
// // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion
|
|
100
|
+
// spectator.query(byText('1')) as HTMLOptionElement
|
|
101
|
+
// );
|
|
102
|
+
// spectator.selectOption(
|
|
103
|
+
// 'select[formControlName="previous_action_id"]',
|
|
104
|
+
// // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion
|
|
105
|
+
// spectator.query(byText('test')) as HTMLOptionElement
|
|
106
|
+
// );
|
|
107
|
+
// spectator.click('button[type="submit"]');
|
|
108
|
+
// expect(spy).toHaveBeenCalledTimes(1);
|
|
109
|
+
// });
|
|
110
|
+
//
|
|
111
|
+
// it('should edit', async () => {
|
|
112
|
+
// TestHelper.setActivatedRoute({
|
|
113
|
+
// params: { id: 1 },
|
|
114
|
+
// parent: { params: of({ slug: 'posiwise-263' }) }
|
|
115
|
+
// });
|
|
116
|
+
// const spectator = await createComponent();
|
|
117
|
+
// const service = TestBed.inject(CrmService);
|
|
118
|
+
// const spy = spyOn(service, 'updateActionCon').and.callThrough();
|
|
119
|
+
// spectator.typeInElement('test2', 'input[formControlName="name"]');
|
|
120
|
+
// spectator.click('button[type="submit"]');
|
|
121
|
+
// expect(spy).toHaveBeenCalledTimes(1);
|
|
122
|
+
// });
|
|
123
|
+
// });
|