@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,145 @@
|
|
|
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 { CrmOpportunityCategoryResponse } from '../../../../shared/interface/crm-opportunity.interface';
|
|
15
|
+
import { AppBaseComponent } from '@posiwise/app-base-component';
|
|
16
|
+
import { User } from '@posiwise/common-utilities';
|
|
17
|
+
import { HelperService } from '@posiwise/helper-service';
|
|
18
|
+
|
|
19
|
+
@Component({
|
|
20
|
+
selector: 'pw-smart-crm-opportunity-categories',
|
|
21
|
+
templateUrl: './smart-crm-opportunity-categories.component.html',
|
|
22
|
+
styleUrls: ['./smart-crm-opportunity-categories.component.scss']
|
|
23
|
+
})
|
|
24
|
+
export class SmartCrmOpportunityCategoriesComponent
|
|
25
|
+
extends AppBaseComponent
|
|
26
|
+
implements OnInit, OnDestroy, AfterViewChecked
|
|
27
|
+
{
|
|
28
|
+
data: CrmOpportunityCategoryResponse = {
|
|
29
|
+
crm_opportunity_categories: [],
|
|
30
|
+
object_count: 0,
|
|
31
|
+
unfiltered_count: 0
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
searchText = '';
|
|
35
|
+
|
|
36
|
+
loading = true;
|
|
37
|
+
|
|
38
|
+
hasAccess = false;
|
|
39
|
+
|
|
40
|
+
isLoaded = false;
|
|
41
|
+
|
|
42
|
+
subscriptionId: number;
|
|
43
|
+
|
|
44
|
+
user: User;
|
|
45
|
+
|
|
46
|
+
private page = 1;
|
|
47
|
+
|
|
48
|
+
subscription: Subscription;
|
|
49
|
+
|
|
50
|
+
categoryNames = [];
|
|
51
|
+
|
|
52
|
+
routers = ROUTERS;
|
|
53
|
+
|
|
54
|
+
constructor(
|
|
55
|
+
injector: Injector,
|
|
56
|
+
private crmService: CrmService,
|
|
57
|
+
private cdr: ChangeDetectorRef
|
|
58
|
+
) {
|
|
59
|
+
super(injector);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
ngOnInit() {
|
|
63
|
+
this.getUserSubscription().subscribe(response => {
|
|
64
|
+
this.subscription = response;
|
|
65
|
+
if (this.subscription?.id) {
|
|
66
|
+
this.hasAccess = this.hasAdminAccess(this.subscription?.id);
|
|
67
|
+
}
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
ngAfterViewChecked() {
|
|
72
|
+
this.cdr.detectChanges();
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
onLazyLoad(event: LazyLoadEvent) {
|
|
76
|
+
const pageDetails = HelperService.onTableLazyLoad(event);
|
|
77
|
+
this.page = pageDetails.page;
|
|
78
|
+
this.getAllOpportunityCategories({
|
|
79
|
+
page: this.page,
|
|
80
|
+
page_size: PAGE_SIZE,
|
|
81
|
+
order_by: pageDetails.sortField,
|
|
82
|
+
order_direction: pageDetails.sortOrder,
|
|
83
|
+
search: this.searchText
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
/** Function to get all categories */
|
|
88
|
+
private getAllOpportunityCategories(paging: Paging) {
|
|
89
|
+
this.getUserSubscriptionId().subscribe(response => {
|
|
90
|
+
if (response) {
|
|
91
|
+
this.subscriptionId = response;
|
|
92
|
+
this.crmService
|
|
93
|
+
.getAllOpportunityCategories(this.subscriptionId, paging)
|
|
94
|
+
.subscribe(res => {
|
|
95
|
+
this.data = res;
|
|
96
|
+
this.categoryNames = res?.crm_opportunity_categories?.map(category => {
|
|
97
|
+
return category?.name;
|
|
98
|
+
});
|
|
99
|
+
})
|
|
100
|
+
.add(() => {
|
|
101
|
+
this.isLoaded = true;
|
|
102
|
+
this.loading = false;
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
});
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
public invokeGetAllOpportunityCategories(paging: Paging) {
|
|
109
|
+
this.getAllOpportunityCategories(paging);
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
/** Function to delete categories */
|
|
113
|
+
onDelete(id: number) {
|
|
114
|
+
HelperService.raiseDeletePopup().then(res => {
|
|
115
|
+
if (res.value) {
|
|
116
|
+
this.crmService
|
|
117
|
+
.deleteOpportunityCategory(this.subscription?.id, id)
|
|
118
|
+
.subscribe(() => {
|
|
119
|
+
this.getAllOpportunityCategories({
|
|
120
|
+
page: this.page,
|
|
121
|
+
page_size: PAGE_SIZE,
|
|
122
|
+
search: this.searchText
|
|
123
|
+
});
|
|
124
|
+
this.toast.success(
|
|
125
|
+
this.translation.translate('Crm.CommonMessage.DeletedMessage')
|
|
126
|
+
);
|
|
127
|
+
});
|
|
128
|
+
}
|
|
129
|
+
});
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
buildCategories() {
|
|
133
|
+
this.crmService.buildDefaultSettings(this.subscription?.id).subscribe(() => {
|
|
134
|
+
this.getAllOpportunityCategories({
|
|
135
|
+
page: this.page,
|
|
136
|
+
page_size: PAGE_SIZE
|
|
137
|
+
});
|
|
138
|
+
this.toast.success(this.translation.translate('Crm.CommonMessage.AddedMessage'));
|
|
139
|
+
});
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
override ngOnDestroy() {
|
|
143
|
+
super.ngOnDestroy();
|
|
144
|
+
}
|
|
145
|
+
}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
<div class="col-12 d-flex ps-0">
|
|
2
|
+
<a href="javascript:void(0)"
|
|
3
|
+
(click)="back()"
|
|
4
|
+
class="previous"><i class="fa fa-arrow-alt-circle-left" aria-hidden="true"></i></a>
|
|
5
|
+
<div class="me-auto col-xs-6">
|
|
6
|
+
<h3 class="m-subheader__title m-subheader__title--separator">
|
|
7
|
+
<span>{{ 'Crm.AccountSourceMessage.AccountSource' | transloco }}:
|
|
8
|
+
{{ isLoading ? '' : (data?.name ? data?.name : ('Label.AddNew' | transloco)) }}</span>
|
|
9
|
+
</h3>
|
|
10
|
+
</div>
|
|
11
|
+
</div>
|
|
12
|
+
|
|
13
|
+
<div class="w-100 text-center mt-3"
|
|
14
|
+
*ngIf="isLoading">
|
|
15
|
+
<p-progressSpinner strokeWidth="2"> </p-progressSpinner>
|
|
16
|
+
</div>
|
|
17
|
+
<div class="container-fluid pw-tab overflow-hidden">
|
|
18
|
+
<div class="p-2 mt-3">
|
|
19
|
+
<form [formGroup]="sourceForm"
|
|
20
|
+
*ngIf="!isLoading"
|
|
21
|
+
(ngSubmit)="onSave()">
|
|
22
|
+
<div class="row mb-3">
|
|
23
|
+
<div class="col-12 col-sm-4">
|
|
24
|
+
<pw-input-container [label]="'Crm.AccountSourceMessage.Name' | transloco"
|
|
25
|
+
name="name"
|
|
26
|
+
[errorMsg]="'name is required' | transloco">
|
|
27
|
+
<input type="text"
|
|
28
|
+
class="form-control"
|
|
29
|
+
formControlName="name"
|
|
30
|
+
id="name"
|
|
31
|
+
[ngClass]="{ 'is-invalid': submitted && f['name'].errors }" />
|
|
32
|
+
</pw-input-container>
|
|
33
|
+
</div>
|
|
34
|
+
<div class="col-md-3 col-lg-2 pe-0 cancel-button"
|
|
35
|
+
*rbacAllow="'SuperAdmin'">
|
|
36
|
+
<div class="mb-3">
|
|
37
|
+
<label class="d-sm-block vertical-bottom mb-2">{{
|
|
38
|
+
'Crm.AccountSourceMessage.IsDefault' | transloco
|
|
39
|
+
}}</label>
|
|
40
|
+
<ui-switch class="ms-3 ms-sm-0"
|
|
41
|
+
name="is_default"
|
|
42
|
+
formControlName="is_default">
|
|
43
|
+
</ui-switch>
|
|
44
|
+
</div>
|
|
45
|
+
</div>
|
|
46
|
+
<div class="col-12 text-end mt-3">
|
|
47
|
+
<button type="button"
|
|
48
|
+
class="btn btn-outline-default me-2"
|
|
49
|
+
(click)="back()">
|
|
50
|
+
{{ 'Button.Cancel' | transloco }}
|
|
51
|
+
</button>
|
|
52
|
+
<button type="submit"
|
|
53
|
+
[buttonBusy]="buttonBusy"
|
|
54
|
+
class="btn btn-primary">
|
|
55
|
+
{{ 'Button.Submit' | transloco }}
|
|
56
|
+
</button>
|
|
57
|
+
</div>
|
|
58
|
+
</div>
|
|
59
|
+
</form>
|
|
60
|
+
</div>
|
|
61
|
+
</div>
|
|
@@ -0,0 +1,81 @@
|
|
|
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 { SmartCrmPrivateModule } from '../../../../smart-crm-private.module';
|
|
9
|
+
import { SmartCrmSourceDetailsComponent } from './smart-crm-source-details.component';
|
|
10
|
+
|
|
11
|
+
class UserServiceMock {
|
|
12
|
+
getUserState() {
|
|
13
|
+
return of({ currentUser: DEFAULT_USER });
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
describe('SmartCrmSourceDetailsComponent', () => {
|
|
17
|
+
const createComponent = TestHelper.createComponentFactory({
|
|
18
|
+
component: SmartCrmSourceDetailsComponent,
|
|
19
|
+
imports: [CommonServicesModule, SharedModule, SmartCrmPrivateModule],
|
|
20
|
+
providers: [
|
|
21
|
+
...TestHelper.TEST_PROVIDERS,
|
|
22
|
+
MockProvider(PermissionService, {
|
|
23
|
+
evaluatePermissions: () => {
|
|
24
|
+
return true;
|
|
25
|
+
}
|
|
26
|
+
}),
|
|
27
|
+
MockProvider(CrmService, {
|
|
28
|
+
getAccountSourceDetails: () =>
|
|
29
|
+
of({
|
|
30
|
+
id: 1,
|
|
31
|
+
name: 'test2',
|
|
32
|
+
is_default: true,
|
|
33
|
+
subscription_id: 1
|
|
34
|
+
}),
|
|
35
|
+
updateAccountSource: () => of({}),
|
|
36
|
+
saveAccountSource: () => of({})
|
|
37
|
+
}),
|
|
38
|
+
{
|
|
39
|
+
provide: UserService,
|
|
40
|
+
useClass: UserServiceMock
|
|
41
|
+
}
|
|
42
|
+
]
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
beforeEach(() => {
|
|
46
|
+
TestHelper.setUpPermissionsAndUser();
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
it('should create', async () => {
|
|
50
|
+
TestHelper.setActivatedRoute({
|
|
51
|
+
parent: { params: of({ slug: 'posiwise-263' }) }
|
|
52
|
+
});
|
|
53
|
+
const spectator = await createComponent();
|
|
54
|
+
expect(spectator.component).toBeTruthy();
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
it('should add submit form ', async () => {
|
|
58
|
+
TestHelper.setActivatedRoute({
|
|
59
|
+
parent: { params: of({ slug: 'posiwise-263' }) }
|
|
60
|
+
});
|
|
61
|
+
const spectator = await createComponent();
|
|
62
|
+
const service = TestBed.inject(CrmService);
|
|
63
|
+
const spy = spyOn(service, 'saveAccountSource').and.callThrough();
|
|
64
|
+
spectator.typeInElement('test', 'input[formControlName="name"]');
|
|
65
|
+
spectator.click('button[type="submit"]');
|
|
66
|
+
expect(spy).toHaveBeenCalledTimes(1);
|
|
67
|
+
});
|
|
68
|
+
|
|
69
|
+
it('should edit', async () => {
|
|
70
|
+
TestHelper.setActivatedRoute({
|
|
71
|
+
params: { id: 1 },
|
|
72
|
+
parent: { params: of({ slug: 'posiwise-263' }) }
|
|
73
|
+
});
|
|
74
|
+
const spectator = await createComponent();
|
|
75
|
+
const service = TestBed.inject(CrmService);
|
|
76
|
+
const spy = spyOn(service, 'updateAccountSource').and.callThrough();
|
|
77
|
+
spectator.typeInElement('test2', 'input[formControlName="name"]');
|
|
78
|
+
spectator.click('button[type="submit"]');
|
|
79
|
+
expect(spy).toHaveBeenCalledTimes(1);
|
|
80
|
+
});
|
|
81
|
+
});
|
|
@@ -0,0 +1,88 @@
|
|
|
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
|
+
|
|
6
|
+
import { CrmSource } from '../../../../../shared/interface/crm-source.interface';
|
|
7
|
+
import { AppBaseComponent } from '@posiwise/app-base-component';
|
|
8
|
+
|
|
9
|
+
@Component({
|
|
10
|
+
selector: 'pw-smart-crm-source-details',
|
|
11
|
+
templateUrl: './smart-crm-source-details.component.html'
|
|
12
|
+
})
|
|
13
|
+
export class SmartCrmSourceDetailsComponent extends AppBaseComponent implements OnInit, OnDestroy {
|
|
14
|
+
subscriptionId: number;
|
|
15
|
+
|
|
16
|
+
submitted = false;
|
|
17
|
+
buttonBusy = false;
|
|
18
|
+
isLoading = true;
|
|
19
|
+
|
|
20
|
+
sourceForm: UntypedFormGroup;
|
|
21
|
+
|
|
22
|
+
data: CrmSource;
|
|
23
|
+
|
|
24
|
+
sourceId: number;
|
|
25
|
+
|
|
26
|
+
constructor(
|
|
27
|
+
injector: Injector,
|
|
28
|
+
private crmService: CrmService
|
|
29
|
+
) {
|
|
30
|
+
super(injector);
|
|
31
|
+
this.sourceForm = AppSmartCrm.getSourceForm();
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
ngOnInit(): void {
|
|
35
|
+
this.getUserSubscriptionId().subscribe(response => {
|
|
36
|
+
this.subscriptionId = response;
|
|
37
|
+
if (this.subscriptionId) {
|
|
38
|
+
this.sourceForm.get('subscription_id').setValue(this.subscriptionId);
|
|
39
|
+
}
|
|
40
|
+
});
|
|
41
|
+
this.route.params.subscribe(data => {
|
|
42
|
+
this.sourceId = Number(data['id']);
|
|
43
|
+
if (this.sourceId) {
|
|
44
|
+
this.getSourceDetails(this.sourceId);
|
|
45
|
+
} else {
|
|
46
|
+
this.isLoading = false;
|
|
47
|
+
}
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/** Function to get source details */
|
|
52
|
+
private getSourceDetails(id) {
|
|
53
|
+
this.crmService.getAccountSourceDetails(this.subscriptionId, id).subscribe(response => {
|
|
54
|
+
this.isLoading = false;
|
|
55
|
+
this.data = response;
|
|
56
|
+
this.sourceForm.patchValue(response);
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
onSave() {
|
|
61
|
+
this.buttonBusy = true;
|
|
62
|
+
this.submitted = true;
|
|
63
|
+
if (this.sourceForm.valid) {
|
|
64
|
+
const data = this.sourceForm.value;
|
|
65
|
+
const sub$ = this.sourceId
|
|
66
|
+
? this.crmService.updateAccountSource(this.subscriptionId, this.sourceId, data)
|
|
67
|
+
: this.crmService.saveAccountSource(this.subscriptionId, data);
|
|
68
|
+
sub$.subscribe(() => {
|
|
69
|
+
this.toast.success(
|
|
70
|
+
this.translation.translate('Crm.AccountSourceMessage.UpdatedMessage')
|
|
71
|
+
);
|
|
72
|
+
this.back();
|
|
73
|
+
}).add(() => {
|
|
74
|
+
this.submitted = false;
|
|
75
|
+
this.buttonBusy = false;
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
/** Function to get form controls */
|
|
81
|
+
get f() {
|
|
82
|
+
return this.sourceForm.controls;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
override ngOnDestroy() {
|
|
86
|
+
super.ngOnDestroy();
|
|
87
|
+
}
|
|
88
|
+
}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
<div class="row">
|
|
2
|
+
<div class="col-12 mb-3">
|
|
3
|
+
<p>Please define the sources that you want to associate with your prospect accounts.</p>
|
|
4
|
+
<a class="btn btn-sm btn-outline-primary float-end build-action-button"
|
|
5
|
+
*ngIf="data.object_count === 0 && data.unfiltered_count === 0 && isLoaded"
|
|
6
|
+
data-cy="build-contact"
|
|
7
|
+
(click)="buildAccountSource()">
|
|
8
|
+
<i class="fa fa-plus-circle" aria-hidden="true"></i>
|
|
9
|
+
{{ 'Crm.AccountSourceMessage.BuildAccountSource' | transloco }}
|
|
10
|
+
</a>
|
|
11
|
+
<a class="btn btn-sm btn-outline-primary float-end"
|
|
12
|
+
data-cy="add-contact"
|
|
13
|
+
[routerLink]="['/' + subscription?.slug + routers.sourceDetails + 'add']">
|
|
14
|
+
<i class="fa fa-plus-circle" aria-hidden="true"></i>
|
|
15
|
+
{{ 'Crm.AccountSourceMessage.AddAccountSource' | transloco }}
|
|
16
|
+
</a>
|
|
17
|
+
</div>
|
|
18
|
+
<div class="w-100 text-center mt-3"
|
|
19
|
+
*ngIf="!isLoaded">
|
|
20
|
+
<p-progressSpinner strokeWidth="2"> </p-progressSpinner>
|
|
21
|
+
</div>
|
|
22
|
+
<div class="col-12">
|
|
23
|
+
<div class="primeng-datatable-container table-responsive"
|
|
24
|
+
[class.hideTable]="data.unfiltered_count === 0">
|
|
25
|
+
<p-table #dt
|
|
26
|
+
[value]="data.crm_sources"
|
|
27
|
+
[paginator]="data.object_count !== 0"
|
|
28
|
+
[lazy]="true"
|
|
29
|
+
[rows]="PAGE_SIZE"
|
|
30
|
+
[totalRecords]="data.object_count"
|
|
31
|
+
[loading]="loading"
|
|
32
|
+
[filterDelay]="1000"
|
|
33
|
+
(onLazyLoad)="onLazyLoad($event)"
|
|
34
|
+
[customSort]="true">
|
|
35
|
+
<ng-template pTemplate="caption">
|
|
36
|
+
<div class="text-end">
|
|
37
|
+
<i class="fa fa-search mt-2 me-2" aria-hidden="true"></i>
|
|
38
|
+
<input type="text"
|
|
39
|
+
[(ngModel)]="searchText"
|
|
40
|
+
pInputText
|
|
41
|
+
size="50"
|
|
42
|
+
placeholder="Search source..."
|
|
43
|
+
(input)="dt.filterGlobal($event.target.value, 'contains')"
|
|
44
|
+
class="mw-90" />
|
|
45
|
+
</div>
|
|
46
|
+
</ng-template>
|
|
47
|
+
<ng-template pTemplate="header">
|
|
48
|
+
<tr>
|
|
49
|
+
<th scope="true"
|
|
50
|
+
pSortableColumn="name">
|
|
51
|
+
{{ 'Crm.AccountSourceMessage.Name' | transloco }}
|
|
52
|
+
<p-sortIcon field="name"></p-sortIcon>
|
|
53
|
+
</th>
|
|
54
|
+
<th scope="true">{{ 'Label.Actions' | transloco }}</th>
|
|
55
|
+
</tr>
|
|
56
|
+
</ng-template>
|
|
57
|
+
<ng-template pTemplate="body"
|
|
58
|
+
let-source>
|
|
59
|
+
<tr>
|
|
60
|
+
<td data-head="Name">{{ source.name }}</td>
|
|
61
|
+
<td data-head="Action">
|
|
62
|
+
<ul class="list-unstyled list-inline">
|
|
63
|
+
<ng-container *ngIf="hasAccess">
|
|
64
|
+
<li ngbTooltip="Edit"
|
|
65
|
+
class="me-2 me-sm-3"
|
|
66
|
+
[routerLink]="[
|
|
67
|
+
'/' + subscription?.slug + routers.sourceDetails,
|
|
68
|
+
source.id
|
|
69
|
+
]">
|
|
70
|
+
<i class="fa fa-edit edit-icon" aria-hidden="true"></i>
|
|
71
|
+
</li>
|
|
72
|
+
<li ngbTooltip="Delete"
|
|
73
|
+
class="me-2 me-sm-3">
|
|
74
|
+
<i
|
|
75
|
+
class="fa fa-trash delete-icon"
|
|
76
|
+
(click)="onDelete(source.id)"
|
|
77
|
+
aria-hidden="true"
|
|
78
|
+
></i>
|
|
79
|
+
</li>
|
|
80
|
+
</ng-container>
|
|
81
|
+
</ul>
|
|
82
|
+
</td>
|
|
83
|
+
</tr>
|
|
84
|
+
</ng-template>
|
|
85
|
+
</p-table>
|
|
86
|
+
<div *ngIf="data.object_count === 0 && data.unfiltered_count !== 0">
|
|
87
|
+
<pw-no-data [withImage]="true" [message]="'Search.NoDataMessage'| transloco" [description]="'Search.NoDataDescription' | transloco" >
|
|
88
|
+
</pw-no-data>
|
|
89
|
+
</div>
|
|
90
|
+
<span class="total-records-count" *ngIf="data.object_count !== 0">{{ 'Label.Total' | transloco }}: {{ data.object_count }}</span>
|
|
91
|
+
</div>
|
|
92
|
+
</div>
|
|
93
|
+
</div>
|
|
94
|
+
<div *ngIf="data.unfiltered_count === 0 && isLoaded">
|
|
95
|
+
<pw-no-data [withImage]="true" [message]="'Crm.AccountSourceMessage.NoDataMessage' | transloco"> </pw-no-data>
|
|
96
|
+
</div>
|
|
@@ -0,0 +1,109 @@
|
|
|
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 { SmartCrmCompanySourceComponent } from './smart-crm-source.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
|
+
describe('SmartCrmCompanySourceComponent', () => {
|
|
20
|
+
const createComponent = TestHelper.createComponentFactory({
|
|
21
|
+
component: SmartCrmCompanySourceComponent,
|
|
22
|
+
imports: [CommonServicesModule, SharedModule, SmartCrmPrivateModule],
|
|
23
|
+
providers: [
|
|
24
|
+
...TestHelper.TEST_PROVIDERS,
|
|
25
|
+
MockProvider(PermissionService, {
|
|
26
|
+
evaluatePermissions: () => {
|
|
27
|
+
return true;
|
|
28
|
+
}
|
|
29
|
+
}),
|
|
30
|
+
MockProvider(CrmService, {
|
|
31
|
+
getAllAccountSource: () =>
|
|
32
|
+
of({
|
|
33
|
+
crm_sources: [
|
|
34
|
+
{
|
|
35
|
+
id: 1,
|
|
36
|
+
name: 'test2',
|
|
37
|
+
is_default: true,
|
|
38
|
+
subscription_id: 1
|
|
39
|
+
}
|
|
40
|
+
],
|
|
41
|
+
object_count: 1,
|
|
42
|
+
unfiltered_count: 1
|
|
43
|
+
}),
|
|
44
|
+
deleteSource: () => of({}),
|
|
45
|
+
buildAccountSources: jasmine
|
|
46
|
+
.createSpy('buildAccountSources')
|
|
47
|
+
.and.returnValue(of({})) // Mocking buildDefaultActions
|
|
48
|
+
}),
|
|
49
|
+
{
|
|
50
|
+
provide: UserService,
|
|
51
|
+
useClass: UserServiceMock
|
|
52
|
+
}
|
|
53
|
+
]
|
|
54
|
+
});
|
|
55
|
+
|
|
56
|
+
beforeEach(() => {
|
|
57
|
+
TestHelper.setUpPermissionsAndUser();
|
|
58
|
+
});
|
|
59
|
+
|
|
60
|
+
it('should create', async () => {
|
|
61
|
+
TestHelper.setActivatedRoute({
|
|
62
|
+
parent: { params: of({ slug: 'posiwise-263' }) }
|
|
63
|
+
});
|
|
64
|
+
const spectator = await createComponent();
|
|
65
|
+
expect(spectator.component).toBeTruthy();
|
|
66
|
+
});
|
|
67
|
+
|
|
68
|
+
it('should delete', async () => {
|
|
69
|
+
TestHelper.setActivatedRoute({
|
|
70
|
+
parent: { params: of({ slug: 'posiwise-263' }) }
|
|
71
|
+
});
|
|
72
|
+
const spectator = await createComponent();
|
|
73
|
+
const service = TestBed.inject(CrmService);
|
|
74
|
+
const spy = spyOn(service, 'deleteSource').and.callThrough();
|
|
75
|
+
spectator.click('tbody tr:first-child .fa-trash');
|
|
76
|
+
expect(Swal.isVisible()).toBeTruthy();
|
|
77
|
+
Swal.clickConfirm();
|
|
78
|
+
await TestHelper.stabilize(spectator);
|
|
79
|
+
expect(spy).toHaveBeenCalledTimes(1);
|
|
80
|
+
});
|
|
81
|
+
|
|
82
|
+
it('should call buildDefaultAccountSource and display a success message', async () => {
|
|
83
|
+
TestHelper.setActivatedRoute({
|
|
84
|
+
parent: { params: of({ slug: 'posiwise-263' }) }
|
|
85
|
+
});
|
|
86
|
+
const spectator = await createComponent();
|
|
87
|
+
const crmService = TestBed.inject(CrmService);
|
|
88
|
+
const spyGetAllActions = spyOn(spectator.component, 'getAllSource').and.callThrough();
|
|
89
|
+
const toastService = TestBed.inject(ToastrService);
|
|
90
|
+
const spyToastSuccess = spyOn(toastService, 'success').and.callThrough(); // Ensure spy is properly set up
|
|
91
|
+
|
|
92
|
+
// Only set the necessary property for the test
|
|
93
|
+
spectator.component.subscription = { id: 123 } as Subscription;
|
|
94
|
+
|
|
95
|
+
// Invoke the buildDefaultActions method
|
|
96
|
+
spectator.component.buildAccountSource();
|
|
97
|
+
|
|
98
|
+
expect(crmService.buildAccountSources).toHaveBeenCalledWith(123);
|
|
99
|
+
expect(spyGetAllActions).toHaveBeenCalledWith({
|
|
100
|
+
page: spectator.component['page'],
|
|
101
|
+
page_size: spectator.component['PAGE_SIZE']
|
|
102
|
+
});
|
|
103
|
+
expect(spyToastSuccess).toHaveBeenCalledWith(
|
|
104
|
+
'Record Successfully Added',
|
|
105
|
+
'',
|
|
106
|
+
jasmine.objectContaining({ timeOut: 10000 })
|
|
107
|
+
);
|
|
108
|
+
});
|
|
109
|
+
});
|