@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,117 @@
|
|
|
1
|
+
import { Component, Injector, OnDestroy, OnInit } from '@angular/core';
|
|
2
|
+
import { UntypedFormGroup } from '@angular/forms';
|
|
3
|
+
import { AppSmartCrm } from '../../../../../shared/models/smart-crm.model';
|
|
4
|
+
import { CrmService } from '@posiwise/smart-crm-shared';
|
|
5
|
+
import { Observable } from 'rxjs';
|
|
6
|
+
|
|
7
|
+
import { CrmAction } from '../../../../../shared/interface/crm-action.interface';
|
|
8
|
+
import { AppBaseComponent } from '@posiwise/app-base-component';
|
|
9
|
+
import { Subscription, User } from '@posiwise/common-utilities';
|
|
10
|
+
import { HelperService } from '@posiwise/helper-service';
|
|
11
|
+
|
|
12
|
+
@Component({
|
|
13
|
+
selector: 'pw-smart-crm-settings-details',
|
|
14
|
+
templateUrl: './smart-crm-actions-details.component.html',
|
|
15
|
+
styleUrls: ['./smart-crm-actions-details.component.scss']
|
|
16
|
+
})
|
|
17
|
+
export class SmartCrmSettingsDetailsComponent
|
|
18
|
+
extends AppBaseComponent
|
|
19
|
+
implements OnInit, OnDestroy
|
|
20
|
+
{
|
|
21
|
+
form: UntypedFormGroup;
|
|
22
|
+
|
|
23
|
+
id: number;
|
|
24
|
+
|
|
25
|
+
submitted = false;
|
|
26
|
+
buttonBusy = false;
|
|
27
|
+
isLoading = true;
|
|
28
|
+
|
|
29
|
+
user: User;
|
|
30
|
+
|
|
31
|
+
data: CrmAction;
|
|
32
|
+
|
|
33
|
+
targetWeek = [];
|
|
34
|
+
|
|
35
|
+
targetWeekMin = [];
|
|
36
|
+
|
|
37
|
+
subscriptionId: number;
|
|
38
|
+
|
|
39
|
+
actions$: Observable<string>;
|
|
40
|
+
|
|
41
|
+
subscription: Subscription;
|
|
42
|
+
constructor(
|
|
43
|
+
private crmService: CrmService,
|
|
44
|
+
injector: Injector
|
|
45
|
+
) {
|
|
46
|
+
super(injector);
|
|
47
|
+
this.form = AppSmartCrm.getSettingsForm();
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
ngOnInit() {
|
|
51
|
+
this.targetWeek = HelperService.getNumbersRange(100);
|
|
52
|
+
this.targetWeekMin = HelperService.getNumbersRange(100);
|
|
53
|
+
this.getUserSubscription().subscribe(response => {
|
|
54
|
+
this.subscription = response;
|
|
55
|
+
if (this.subscription?.id) {
|
|
56
|
+
this.form.get('subscription_id').setValue(this.subscription?.id);
|
|
57
|
+
this.actions$ = this.crmService.getAllActions(this.subscription?.id);
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
this.route.params.subscribe(data => {
|
|
61
|
+
this.id = Number(data['id']);
|
|
62
|
+
});
|
|
63
|
+
if (this.id) {
|
|
64
|
+
this.getActionDetails();
|
|
65
|
+
} else {
|
|
66
|
+
this.isLoading = false;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
/** Function to get form controls */
|
|
71
|
+
get f() {
|
|
72
|
+
return this.form.controls;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
/** Function to get action details on edit form */
|
|
76
|
+
private getActionDetails() {
|
|
77
|
+
this.crmService.getAction(this.subscription?.id, this.id).subscribe({
|
|
78
|
+
next: resp => {
|
|
79
|
+
this.data = resp;
|
|
80
|
+
this.form.patchValue(resp);
|
|
81
|
+
this.isLoading = false;
|
|
82
|
+
},
|
|
83
|
+
error: error => this.toast.showToast(error)
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
/** Function to update existing action */
|
|
88
|
+
onSave() {
|
|
89
|
+
this.buttonBusy = true;
|
|
90
|
+
this.form.value['previous_action_id'] = this.form.value['previous_action_id']
|
|
91
|
+
? this.form.value['previous_action_id'].id
|
|
92
|
+
: null;
|
|
93
|
+
Number(this.form.get('target_week').value);
|
|
94
|
+
Number(this.form.get('target_week_min').value);
|
|
95
|
+
this.submitted = true;
|
|
96
|
+
const sub$ = this.id
|
|
97
|
+
? this.crmService.updateActionCon(this.subscription?.id, this.form.value, this.id)
|
|
98
|
+
: this.crmService.postNewAction(this.subscription?.id, this.form.value);
|
|
99
|
+
sub$.subscribe(() => {
|
|
100
|
+
this.toast.success(this.translation.translate('Crm.Settings.UpdatedMessage'));
|
|
101
|
+
this.back();
|
|
102
|
+
}).add(() => {
|
|
103
|
+
this.submitted = false;
|
|
104
|
+
this.buttonBusy = false;
|
|
105
|
+
});
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
onChange(event) {
|
|
109
|
+
if (event === true) {
|
|
110
|
+
this.form.get('visible').setValue(true);
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
override ngOnDestroy() {
|
|
115
|
+
super.ngOnDestroy();
|
|
116
|
+
}
|
|
117
|
+
}
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
<div class="row">
|
|
2
|
+
<div class="col-12 mb-3">
|
|
3
|
+
<p>
|
|
4
|
+
Please define the actions you want to associate with your contacts. For example you
|
|
5
|
+
could choose Phone Call, or Meeting, or Email Sent, etc.
|
|
6
|
+
</p>
|
|
7
|
+
<a *ngIf="data.object_count === 0 && data.unfiltered_count === 0 && isLoaded"
|
|
8
|
+
class="btn btn-sm btn-outline-primary float-end build-default-action-button"
|
|
9
|
+
(click)="buildDefaultActions()"
|
|
10
|
+
data-cy="add-action">
|
|
11
|
+
<i class="fa fa-plus-circle" aria-hidden="true"></i>
|
|
12
|
+
{{ 'Crm.Settings.BuildDefaultAction' | transloco }}
|
|
13
|
+
</a>
|
|
14
|
+
<a *ngIf="hasAccess"
|
|
15
|
+
class="btn btn-sm btn-outline-primary float-end"
|
|
16
|
+
[routerLink]="['/' + subscription?.slug + routers.configurationDetails + 'add']"
|
|
17
|
+
data-cy="add-action">
|
|
18
|
+
<i class="fa fa-plus-circle" aria-hidden="true"></i>
|
|
19
|
+
{{ 'Crm.Settings.AddAction' | transloco }}
|
|
20
|
+
</a>
|
|
21
|
+
</div>
|
|
22
|
+
<div class="w-100 text-center mt-3"
|
|
23
|
+
*ngIf="!isLoaded">
|
|
24
|
+
<p-progressSpinner strokeWidth="2"> </p-progressSpinner>
|
|
25
|
+
</div>
|
|
26
|
+
<div class="col-12">
|
|
27
|
+
<div class="primeng-datatable-container table-responsive"
|
|
28
|
+
[class.hideTable]="data.unfiltered_count === 0">
|
|
29
|
+
<p-table #dt
|
|
30
|
+
[value]="data.crm_actions"
|
|
31
|
+
[paginator]="data.object_count!==0"
|
|
32
|
+
[lazy]="true"
|
|
33
|
+
[rows]="100"
|
|
34
|
+
[totalRecords]="data.object_count"
|
|
35
|
+
[loading]="loading"
|
|
36
|
+
[filterDelay]="1000"
|
|
37
|
+
(onLazyLoad)="onLazyLoad($event)"
|
|
38
|
+
[customSort]="true">
|
|
39
|
+
<ng-template pTemplate="caption">
|
|
40
|
+
<div class="text-end">
|
|
41
|
+
<i class="fa fa-search mt-2 me-2" aria-hidden="true"></i>
|
|
42
|
+
<input type="text"
|
|
43
|
+
[(ngModel)]="searchText"
|
|
44
|
+
pInputText
|
|
45
|
+
size="50"
|
|
46
|
+
placeholder="Search action..."
|
|
47
|
+
(input)="dt.filterGlobal($event.target.value, 'contains')"
|
|
48
|
+
class="mw-90" />
|
|
49
|
+
</div>
|
|
50
|
+
</ng-template>
|
|
51
|
+
<ng-template pTemplate="header" >
|
|
52
|
+
<tr>
|
|
53
|
+
<th scope="true"
|
|
54
|
+
pSortableColumn="name">
|
|
55
|
+
{{ 'Crm.Settings.Name' | transloco }}
|
|
56
|
+
<p-sortIcon field="name"></p-sortIcon>
|
|
57
|
+
</th>
|
|
58
|
+
<th scope="true"
|
|
59
|
+
pSortableColumn="target_week">
|
|
60
|
+
{{ 'Crm.Settings.TargetWeek' | transloco }}
|
|
61
|
+
<p-sortIcon field="target_week"></p-sortIcon>
|
|
62
|
+
</th>
|
|
63
|
+
<th scope="true"
|
|
64
|
+
pSortableColumn="target_week_min">
|
|
65
|
+
{{ 'Crm.Settings.TargetWeekMin' | transloco }}
|
|
66
|
+
<p-sortIcon field="target_week_min"></p-sortIcon>
|
|
67
|
+
</th>
|
|
68
|
+
<th scope="true"
|
|
69
|
+
pSortableColumn="visible">
|
|
70
|
+
{{ 'Crm.Settings.Visible' | transloco }}
|
|
71
|
+
<p-sortIcon field="visible"></p-sortIcon>
|
|
72
|
+
</th>
|
|
73
|
+
<th scope="true"
|
|
74
|
+
*ngIf="hasAccess">{{ 'Label.Actions' | transloco }}</th>
|
|
75
|
+
</tr>
|
|
76
|
+
</ng-template>
|
|
77
|
+
<ng-template pTemplate="body"
|
|
78
|
+
let-action>
|
|
79
|
+
<tr>
|
|
80
|
+
<td data-head="Name">{{ action.name }}</td>
|
|
81
|
+
<td data-head="TargetWeek">{{ action.target_week }}</td>
|
|
82
|
+
<td data-head="TargetWeekMin">{{ action.target_week_min }}</td>
|
|
83
|
+
<td data-head="Visible">
|
|
84
|
+
<span [appDynamicBadge]="{
|
|
85
|
+
itemsArray: [true, false],
|
|
86
|
+
item: action?.visible
|
|
87
|
+
}"
|
|
88
|
+
color="success-danger"
|
|
89
|
+
class="badge">{{ !!action?.visible }}</span>
|
|
90
|
+
</td>
|
|
91
|
+
<td data-head="Action"
|
|
92
|
+
*ngIf="hasAccess">
|
|
93
|
+
<ul class="list-unstyled list-inline">
|
|
94
|
+
<li ngbTooltip="Edit"
|
|
95
|
+
class="me-2 me-sm-3"
|
|
96
|
+
[routerLink]="[
|
|
97
|
+
'/' + subscription?.slug + routers.configurationDetails,
|
|
98
|
+
action.id
|
|
99
|
+
]">
|
|
100
|
+
<i class="fa fa-edit edit-icon" aria-hidden="true"></i>
|
|
101
|
+
</li>
|
|
102
|
+
<li ngbTooltip="Delete"
|
|
103
|
+
class="me-2 me-sm-3">
|
|
104
|
+
<i
|
|
105
|
+
class="fa fa-trash delete-icon"
|
|
106
|
+
(click)="onDelete(action.id)"
|
|
107
|
+
aria-hidden="true"
|
|
108
|
+
></i>
|
|
109
|
+
</li>
|
|
110
|
+
</ul>
|
|
111
|
+
</td>
|
|
112
|
+
</tr>
|
|
113
|
+
</ng-template>
|
|
114
|
+
</p-table>
|
|
115
|
+
<div *ngIf="data.object_count === 0 && data.unfiltered_count !== 0">
|
|
116
|
+
<pw-no-data [withImage]="true" [message]="'Search.NoDataMessage'| transloco" [description]="'Search.NoDataDescription' | transloco" >
|
|
117
|
+
</pw-no-data>
|
|
118
|
+
</div>
|
|
119
|
+
<span class="total-records-count" *ngIf="data.object_count!==0">{{ 'Label.Total' | transloco }}: {{ data.object_count }}</span>
|
|
120
|
+
</div>
|
|
121
|
+
<div *ngIf="data.unfiltered_count === 0 && isLoaded">
|
|
122
|
+
<pw-no-data [withImage]="true" [message]="'Crm.Settings.NoActionMessage' | transloco"> </pw-no-data>
|
|
123
|
+
</div>
|
|
124
|
+
</div>
|
|
125
|
+
</div>
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
import { TestBed } from '@angular/core/testing';
|
|
2
|
+
import { CommonServicesModule, PermissionService, UserService } from '@posiwise/common-services';
|
|
3
|
+
import { SharedModule } from '@posiwise/shared-module';
|
|
4
|
+
import { CrmService } from '@posiwise/smart-crm-shared';
|
|
5
|
+
import { DEFAULT_USER, TestHelper } from '@posiwise/test-helpers';
|
|
6
|
+
import { MockProvider } from 'ng-mocks';
|
|
7
|
+
import { of } from 'rxjs';
|
|
8
|
+
import Swal from 'sweetalert2';
|
|
9
|
+
import { SmartCrmPrivateModule } from '../../../smart-crm-private.module';
|
|
10
|
+
import { SmartCrmActionsComponent } from './smart-crm-actions.component';
|
|
11
|
+
import { ToastrService } from 'ngx-toastr';
|
|
12
|
+
import { Subscription } from '@posiwise/common-utilities';
|
|
13
|
+
|
|
14
|
+
class UserServiceMock {
|
|
15
|
+
getUserState() {
|
|
16
|
+
return of({ currentUser: DEFAULT_USER });
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
describe('SmartCrmActionsComponent', () => {
|
|
21
|
+
const createComponent = TestHelper.createComponentFactory({
|
|
22
|
+
component: SmartCrmActionsComponent,
|
|
23
|
+
imports: [CommonServicesModule, SharedModule, SmartCrmPrivateModule],
|
|
24
|
+
providers: [
|
|
25
|
+
...TestHelper.TEST_PROVIDERS,
|
|
26
|
+
MockProvider(PermissionService, {
|
|
27
|
+
evaluatePermissions: () => {
|
|
28
|
+
return true;
|
|
29
|
+
}
|
|
30
|
+
}),
|
|
31
|
+
MockProvider(CrmService, {
|
|
32
|
+
getAllActions: () =>
|
|
33
|
+
of({
|
|
34
|
+
crm_actions: [
|
|
35
|
+
{
|
|
36
|
+
id: 9,
|
|
37
|
+
name: 'test',
|
|
38
|
+
subscription_id: 31,
|
|
39
|
+
target_week_min: 2,
|
|
40
|
+
target_week: 3,
|
|
41
|
+
visible: true,
|
|
42
|
+
previous_action_id: null,
|
|
43
|
+
contact_required: false
|
|
44
|
+
}
|
|
45
|
+
],
|
|
46
|
+
object_count: 1,
|
|
47
|
+
unfiltered_count: 1
|
|
48
|
+
}),
|
|
49
|
+
deleteAction: () => of({}),
|
|
50
|
+
buildDefaultActions: () => of({})
|
|
51
|
+
}),
|
|
52
|
+
{
|
|
53
|
+
provide: UserService,
|
|
54
|
+
useClass: UserServiceMock
|
|
55
|
+
}
|
|
56
|
+
]
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
beforeEach(() => {
|
|
60
|
+
TestHelper.setUpPermissionsAndUser();
|
|
61
|
+
});
|
|
62
|
+
|
|
63
|
+
it('should create', async () => {
|
|
64
|
+
TestHelper.setActivatedRoute({
|
|
65
|
+
parent: { params: of({ slug: 'posiwise-263' }) }
|
|
66
|
+
});
|
|
67
|
+
const spectator = await createComponent();
|
|
68
|
+
expect(spectator.component).toBeTruthy();
|
|
69
|
+
});
|
|
70
|
+
|
|
71
|
+
it('should delete action', async () => {
|
|
72
|
+
TestHelper.setActivatedRoute({
|
|
73
|
+
parent: { params: of({ slug: 'posiwise-263' }) }
|
|
74
|
+
});
|
|
75
|
+
const spectator = await createComponent();
|
|
76
|
+
const service = TestBed.inject(CrmService);
|
|
77
|
+
const spy = spyOn(service, 'deleteAction').and.callThrough();
|
|
78
|
+
spectator.click('tbody tr:first-child .fa-trash');
|
|
79
|
+
expect(Swal.isVisible()).toBeTruthy();
|
|
80
|
+
Swal.clickConfirm();
|
|
81
|
+
await TestHelper.stabilize(spectator);
|
|
82
|
+
expect(spy).toHaveBeenCalledTimes(1);
|
|
83
|
+
});
|
|
84
|
+
|
|
85
|
+
it('should call buildDefaultActions and display a success message', async () => {
|
|
86
|
+
TestHelper.setActivatedRoute({
|
|
87
|
+
parent: { params: of({ slug: 'posiwise-263' }) }
|
|
88
|
+
});
|
|
89
|
+
const spectator = await createComponent();
|
|
90
|
+
const crmService = TestBed.inject(CrmService);
|
|
91
|
+
const spyBuildDefaultActions = spyOn(crmService, 'buildDefaultActions').and.callThrough();
|
|
92
|
+
const toastService = TestBed.inject(ToastrService);
|
|
93
|
+
const spyToastSuccess = spyOn(toastService, 'success').and.callThrough();
|
|
94
|
+
|
|
95
|
+
// Only set the necessary property for the test
|
|
96
|
+
spectator.component.subscription = { id: 123 } as Subscription;
|
|
97
|
+
|
|
98
|
+
// Mock the CrmService response for getAllActions
|
|
99
|
+
const mockActions = {
|
|
100
|
+
crm_actions: [
|
|
101
|
+
{
|
|
102
|
+
id: 9,
|
|
103
|
+
name: 'test',
|
|
104
|
+
subscription_id: 31,
|
|
105
|
+
target_week_min: 2,
|
|
106
|
+
target_week: 3,
|
|
107
|
+
visible: true,
|
|
108
|
+
previous_action_id: null,
|
|
109
|
+
contact_required: false
|
|
110
|
+
}
|
|
111
|
+
],
|
|
112
|
+
object_count: 1,
|
|
113
|
+
unfiltered_count: 1
|
|
114
|
+
};
|
|
115
|
+
spyOn(crmService, 'getAllActions').and.returnValue(of(mockActions));
|
|
116
|
+
|
|
117
|
+
// Invoke the buildDefaultActions method
|
|
118
|
+
spectator.component.buildDefaultActions();
|
|
119
|
+
|
|
120
|
+
// Ensure buildDefaultActions was called with correct arguments
|
|
121
|
+
expect(spyBuildDefaultActions).toHaveBeenCalledWith(123);
|
|
122
|
+
|
|
123
|
+
// Verify the state change as a result of getActions being called
|
|
124
|
+
spectator.component.invokeGetActions({
|
|
125
|
+
page: 1,
|
|
126
|
+
page_size: 10
|
|
127
|
+
});
|
|
128
|
+
|
|
129
|
+
expect(spectator.component.data.crm_actions.length).toBe(1);
|
|
130
|
+
expect(spyToastSuccess).toHaveBeenCalledWith(
|
|
131
|
+
'Record Successfully Added',
|
|
132
|
+
'',
|
|
133
|
+
jasmine.objectContaining({ timeOut: 10000 })
|
|
134
|
+
);
|
|
135
|
+
});
|
|
136
|
+
});
|
|
@@ -0,0 +1,143 @@
|
|
|
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, Subscription } from '@posiwise/common-utilities';
|
|
14
|
+
import { CrmActionResponse } from '../../../../shared/interface/crm-action.interface';
|
|
15
|
+
import { AppBaseComponent } from '@posiwise/app-base-component';
|
|
16
|
+
import { HelperService } from '@posiwise/helper-service';
|
|
17
|
+
|
|
18
|
+
@Component({
|
|
19
|
+
selector: 'pw-smart-crm-actions',
|
|
20
|
+
templateUrl: './smart-crm-actions.component.html',
|
|
21
|
+
styleUrls: ['./smart-crm-actions.component.scss']
|
|
22
|
+
})
|
|
23
|
+
export class SmartCrmActionsComponent
|
|
24
|
+
extends AppBaseComponent
|
|
25
|
+
implements OnInit, OnDestroy, AfterViewChecked
|
|
26
|
+
{
|
|
27
|
+
data: CrmActionResponse = {
|
|
28
|
+
crm_actions: [],
|
|
29
|
+
object_count: 0,
|
|
30
|
+
unfiltered_count: 0
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
subscriptionId: number;
|
|
34
|
+
|
|
35
|
+
searchText = '';
|
|
36
|
+
|
|
37
|
+
loading = true;
|
|
38
|
+
|
|
39
|
+
userId: number;
|
|
40
|
+
|
|
41
|
+
hasAccess = false;
|
|
42
|
+
|
|
43
|
+
isLoaded = false;
|
|
44
|
+
|
|
45
|
+
private page = 1;
|
|
46
|
+
|
|
47
|
+
subscription: Subscription;
|
|
48
|
+
|
|
49
|
+
routers = ROUTERS;
|
|
50
|
+
|
|
51
|
+
constructor(
|
|
52
|
+
private crmService: CrmService,
|
|
53
|
+
injector: Injector,
|
|
54
|
+
private cdr: ChangeDetectorRef
|
|
55
|
+
) {
|
|
56
|
+
super(injector);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
ngOnInit(): void {
|
|
60
|
+
this.getUserSubscription().subscribe(response => {
|
|
61
|
+
this.subscription = response;
|
|
62
|
+
if (this.subscription?.id) {
|
|
63
|
+
this.hasAccess = this.hasAdminAccess(this.subscription?.id);
|
|
64
|
+
}
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
ngAfterViewChecked() {
|
|
69
|
+
this.cdr.detectChanges();
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
onLazyLoad(event: LazyLoadEvent) {
|
|
73
|
+
const pageDetails = HelperService.onTableLazyLoad(event);
|
|
74
|
+
this.page = pageDetails.page;
|
|
75
|
+
this.getActions({
|
|
76
|
+
page: this.page,
|
|
77
|
+
page_size: PAGE_SIZE,
|
|
78
|
+
order_by: pageDetails.sortField,
|
|
79
|
+
order_direction: pageDetails.sortOrder,
|
|
80
|
+
search: this.searchText
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
shouldShowTableContent(): boolean {
|
|
85
|
+
return this.data.unfiltered_count !== 0;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
/** Function to get and show all the actions */
|
|
89
|
+
private getActions(paging: Paging) {
|
|
90
|
+
this.getUserSubscriptionId().subscribe(response => {
|
|
91
|
+
this.subscriptionId = response;
|
|
92
|
+
if (this.subscriptionId) {
|
|
93
|
+
this.crmService
|
|
94
|
+
.getAllActions(this.subscriptionId, paging)
|
|
95
|
+
.subscribe(resp => {
|
|
96
|
+
this.data = resp;
|
|
97
|
+
})
|
|
98
|
+
.add(() => {
|
|
99
|
+
this.loading = false;
|
|
100
|
+
this.isLoaded = true;
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
public invokeGetActions(paging: Paging) {
|
|
107
|
+
this.getActions(paging);
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
buildDefaultActions() {
|
|
111
|
+
this.crmService.buildDefaultActions(this.subscription?.id).subscribe(() => {
|
|
112
|
+
this.getActions({
|
|
113
|
+
page: this.page,
|
|
114
|
+
page_size: PAGE_SIZE
|
|
115
|
+
});
|
|
116
|
+
this.toast.success(this.translation.translate('Crm.CommonMessage.AddedMessage'));
|
|
117
|
+
});
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
/** Function to delete existing setting */
|
|
121
|
+
onDelete(id: number) {
|
|
122
|
+
HelperService.raiseDeletePopup()
|
|
123
|
+
.then(resp => {
|
|
124
|
+
if (resp.value) {
|
|
125
|
+
this.crmService.deleteAction(this.subscription?.id, id).subscribe(() => {
|
|
126
|
+
this.toast.success(
|
|
127
|
+
this.translation.translate('Crm.Settings.DeletedMessage')
|
|
128
|
+
);
|
|
129
|
+
this.getActions({
|
|
130
|
+
page: this.page,
|
|
131
|
+
page_size: PAGE_SIZE,
|
|
132
|
+
search: this.searchText
|
|
133
|
+
});
|
|
134
|
+
});
|
|
135
|
+
}
|
|
136
|
+
})
|
|
137
|
+
.catch(error => this.toast.showToast(error));
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
override ngOnDestroy() {
|
|
141
|
+
super.ngOnDestroy();
|
|
142
|
+
}
|
|
143
|
+
}
|
package/src/lib/private/components/smart-crm-configuration/smart-crm-configuration.component.html
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
<div class="row">
|
|
2
|
+
<div class="col-12 mb-0">
|
|
3
|
+
<h2>CRM Configuration</h2>
|
|
4
|
+
</div>
|
|
5
|
+
</div>
|
|
6
|
+
<ul ngbNav
|
|
7
|
+
#nav="ngbNav"
|
|
8
|
+
[(activeId)]="activeTab"
|
|
9
|
+
(navChange)="onTabChange($event)"
|
|
10
|
+
class="nav-tabs">
|
|
11
|
+
<li [ngbNavItem]="'actions'"
|
|
12
|
+
*rbacAllow="'SubscriptionAdmin'">
|
|
13
|
+
<a ngbNavLink>Actions</a>
|
|
14
|
+
<ng-template ngbNavContent>
|
|
15
|
+
<pw-smart-crm-actions></pw-smart-crm-actions>
|
|
16
|
+
</ng-template>
|
|
17
|
+
</li>
|
|
18
|
+
|
|
19
|
+
<li [ngbNavItem]="'categories'"
|
|
20
|
+
*rbacAllow="'SubscriptionAdmin'">
|
|
21
|
+
<a ngbNavLink>Categories</a>
|
|
22
|
+
<ng-template ngbNavContent>
|
|
23
|
+
<pw-smart-crm-opportunity-categories></pw-smart-crm-opportunity-categories>
|
|
24
|
+
</ng-template>
|
|
25
|
+
</li>
|
|
26
|
+
|
|
27
|
+
<li [ngbNavItem]="'stage'"
|
|
28
|
+
*rbacAllow="'SubscriptionAdmin'">
|
|
29
|
+
<a ngbNavLink>Stages</a>
|
|
30
|
+
<ng-template ngbNavContent>
|
|
31
|
+
<pw-smart-crm-stages></pw-smart-crm-stages>
|
|
32
|
+
</ng-template>
|
|
33
|
+
</li>
|
|
34
|
+
|
|
35
|
+
<li [ngbNavItem]="'source'"
|
|
36
|
+
*rbacAllow="'SubscriptionAdmin'">
|
|
37
|
+
<a ngbNavLink>Sources</a>
|
|
38
|
+
<ng-template ngbNavContent>
|
|
39
|
+
<pw-smart-crm-source></pw-smart-crm-source>
|
|
40
|
+
</ng-template>
|
|
41
|
+
</li>
|
|
42
|
+
|
|
43
|
+
<li [ngbNavItem]="'widget'"
|
|
44
|
+
*rbacAllow="'SubscriptionAdmin' && 'SuperAdmin'">
|
|
45
|
+
<a ngbNavLink>Widgets</a>
|
|
46
|
+
<ng-template ngbNavContent>
|
|
47
|
+
<pw-smart-crm-widgets></pw-smart-crm-widgets>
|
|
48
|
+
</ng-template>
|
|
49
|
+
</li>
|
|
50
|
+
|
|
51
|
+
<li [ngbNavItem]="'admin'"
|
|
52
|
+
*rbacAllow="'SubscriptionAdmin' && 'SuperAdmin'">
|
|
53
|
+
<a ngbNavLink>Admin</a>
|
|
54
|
+
<ng-template ngbNavContent>
|
|
55
|
+
<pw-coming-soon message="Admin"></pw-coming-soon>
|
|
56
|
+
</ng-template>
|
|
57
|
+
</li>
|
|
58
|
+
</ul>
|
|
59
|
+
|
|
60
|
+
<div [ngbNavOutlet]="nav"></div>
|
package/src/lib/private/components/smart-crm-configuration/smart-crm-configuration.component.scss
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@import 'variables';
|
package/src/lib/private/components/smart-crm-configuration/smart-crm-configuration.component.spec.ts
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { CommonServicesModule, PermissionService, UserService } from '@posiwise/common-services';
|
|
2
|
+
import { SmartCrmPrivateModule } from '../../smart-crm-private.module';
|
|
3
|
+
import { SharedModule } from '@posiwise/shared-module';
|
|
4
|
+
import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
|
|
5
|
+
import { TestBed } from '@angular/core/testing';
|
|
6
|
+
import { Router } from '@angular/router';
|
|
7
|
+
import { DEFAULT_USER, TestHelper } from '@posiwise/test-helpers';
|
|
8
|
+
import { MockProvider } from 'ng-mocks';
|
|
9
|
+
import { of } from 'rxjs';
|
|
10
|
+
import { SmartCrmConfigurationComponent } from './smart-crm-configuration.component';
|
|
11
|
+
import { CrmService } from '@posiwise/smart-crm-shared';
|
|
12
|
+
|
|
13
|
+
class UserServiceMock {
|
|
14
|
+
getUserState() {
|
|
15
|
+
return of({ currentUser: DEFAULT_USER });
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
describe('SmartCrmConfigurationComponent', () => {
|
|
19
|
+
const createComponent = TestHelper.createComponentFactory({
|
|
20
|
+
component: SmartCrmConfigurationComponent,
|
|
21
|
+
imports: [CommonServicesModule, SharedModule, SmartCrmPrivateModule],
|
|
22
|
+
providers: [
|
|
23
|
+
...TestHelper.TEST_PROVIDERS,
|
|
24
|
+
MockProvider(PermissionService, {
|
|
25
|
+
evaluatePermissions: () => {
|
|
26
|
+
return true;
|
|
27
|
+
}
|
|
28
|
+
}),
|
|
29
|
+
MockProvider(CrmService, {
|
|
30
|
+
getAllActions: () =>
|
|
31
|
+
of({
|
|
32
|
+
crm_actions: [],
|
|
33
|
+
object_count: 0,
|
|
34
|
+
unfiltered_count: 0
|
|
35
|
+
})
|
|
36
|
+
}),
|
|
37
|
+
{
|
|
38
|
+
provide: UserService,
|
|
39
|
+
useClass: UserServiceMock
|
|
40
|
+
}
|
|
41
|
+
],
|
|
42
|
+
schemas: [CUSTOM_ELEMENTS_SCHEMA]
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
it('should create', async () => {
|
|
46
|
+
TestHelper.setActivatedRoute({
|
|
47
|
+
parent: { params: of({ slug: 'posiwise-263' }) }
|
|
48
|
+
});
|
|
49
|
+
const spectator = await createComponent();
|
|
50
|
+
expect(spectator.component).toBeTruthy();
|
|
51
|
+
const router = TestBed.inject(Router);
|
|
52
|
+
spyOn(router, 'navigate').and.stub();
|
|
53
|
+
spectator.component.onTabChange({ nextId: 1 });
|
|
54
|
+
});
|
|
55
|
+
});
|
package/src/lib/private/components/smart-crm-configuration/smart-crm-configuration.component.ts
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { Component, Injector, OnInit } from '@angular/core';
|
|
2
|
+
import { ROUTERS } from '../../../shared/routers/routers';
|
|
3
|
+
|
|
4
|
+
import { AppBaseComponent } from '@posiwise/app-base-component';
|
|
5
|
+
|
|
6
|
+
@Component({
|
|
7
|
+
selector: 'pw-configuration',
|
|
8
|
+
templateUrl: './smart-crm-configuration.component.html',
|
|
9
|
+
styleUrls: ['./smart-crm-configuration.component.scss']
|
|
10
|
+
})
|
|
11
|
+
export class SmartCrmConfigurationComponent extends AppBaseComponent implements OnInit {
|
|
12
|
+
activeTab = 'actions';
|
|
13
|
+
|
|
14
|
+
constructor(injector: Injector) {
|
|
15
|
+
super(injector);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
ngOnInit() {
|
|
19
|
+
this.route.params.subscribe(data => {
|
|
20
|
+
this.activeTab = data['tabId'] || 'actions';
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
onTabChange(event) {
|
|
25
|
+
this.getUserSubscription().subscribe(subscription => {
|
|
26
|
+
this.router.navigate([`${subscription.slug}${ROUTERS.configurations}${event.nextId}`]);
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
}
|