@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,238 @@
|
|
|
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 { ROUTERS } from '../../../../shared/routers/routers';
|
|
5
|
+
import { CrmService } from '@posiwise/smart-crm-shared';
|
|
6
|
+
import { Observable } from 'rxjs';
|
|
7
|
+
|
|
8
|
+
import { PAGE_SIZE, User, Subscription, Country } from '@posiwise/common-utilities';
|
|
9
|
+
import { CrmAccount } from '../../../../shared/interface/crm-account.interface';
|
|
10
|
+
import { AppBaseComponent } from '@posiwise/app-base-component';
|
|
11
|
+
import { CommonService, GeoService, SubscriptionService } from '@posiwise/common-services';
|
|
12
|
+
import {
|
|
13
|
+
OrganizationIndustry,
|
|
14
|
+
OrganizationSize,
|
|
15
|
+
OrganizationType,
|
|
16
|
+
SubscriptionMember
|
|
17
|
+
} from 'libs/smart-crm/src/lib/shared/interface/smart-crm-module.interface';
|
|
18
|
+
|
|
19
|
+
@Component({
|
|
20
|
+
selector: 'pw-company-details',
|
|
21
|
+
templateUrl: './smart-crm-account-details.component.html'
|
|
22
|
+
})
|
|
23
|
+
export class SmartCrmCompanyDetailsComponent extends AppBaseComponent implements OnInit, OnDestroy {
|
|
24
|
+
form: UntypedFormGroup;
|
|
25
|
+
|
|
26
|
+
user: User;
|
|
27
|
+
|
|
28
|
+
id: number;
|
|
29
|
+
|
|
30
|
+
submitted = false;
|
|
31
|
+
buttonBusy = false;
|
|
32
|
+
|
|
33
|
+
data: CrmAccount;
|
|
34
|
+
isLoading = true;
|
|
35
|
+
|
|
36
|
+
onEdit = false;
|
|
37
|
+
|
|
38
|
+
subscriptionMembers: [] = [];
|
|
39
|
+
|
|
40
|
+
organizationSizes$: Observable<OrganizationSize[]>;
|
|
41
|
+
|
|
42
|
+
organizationTypes$: Observable<OrganizationType[]>;
|
|
43
|
+
|
|
44
|
+
organizationIndustries$: Observable<OrganizationIndustry[]>;
|
|
45
|
+
|
|
46
|
+
private countries$: Observable<Country[]>;
|
|
47
|
+
|
|
48
|
+
allSubscriptionMembers: SubscriptionMember[];
|
|
49
|
+
|
|
50
|
+
subscriptionId: number;
|
|
51
|
+
|
|
52
|
+
hasAccess: boolean;
|
|
53
|
+
|
|
54
|
+
filteredOwners: SubscriptionMember[];
|
|
55
|
+
|
|
56
|
+
subscription: Subscription;
|
|
57
|
+
|
|
58
|
+
status = [];
|
|
59
|
+
|
|
60
|
+
priority = [];
|
|
61
|
+
|
|
62
|
+
source = [];
|
|
63
|
+
|
|
64
|
+
private countryNames = [];
|
|
65
|
+
|
|
66
|
+
filteredCountries: Country[];
|
|
67
|
+
|
|
68
|
+
constructor(
|
|
69
|
+
injector: Injector,
|
|
70
|
+
private subscriptionService: SubscriptionService,
|
|
71
|
+
private crmService: CrmService,
|
|
72
|
+
private commonService: CommonService,
|
|
73
|
+
private geoService: GeoService
|
|
74
|
+
) {
|
|
75
|
+
super(injector);
|
|
76
|
+
this.form = AppSmartCrm.getAccountsForm();
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
onSearchOwner(event) {
|
|
80
|
+
let values = [];
|
|
81
|
+
if (event.query) {
|
|
82
|
+
values = this.allSubscriptionMembers.filter((x: SubscriptionMember) => {
|
|
83
|
+
return x.first_name.toLowerCase().includes(event.query.toLowerCase());
|
|
84
|
+
});
|
|
85
|
+
} else {
|
|
86
|
+
this.allSubscriptionMembers.forEach(item => {
|
|
87
|
+
values.push(item);
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
this.filteredOwners = values;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
ngOnInit() {
|
|
94
|
+
this.organizationTypes$ = this.commonService.getOrganizationTypes();
|
|
95
|
+
this.organizationSizes$ = this.commonService.getOrganizationSizes();
|
|
96
|
+
this.organizationIndustries$ = this.commonService.getOrganizationIndustries();
|
|
97
|
+
this.countries$ = this.geoService.getCountries();
|
|
98
|
+
this.countries$.subscribe(res => {
|
|
99
|
+
this.countryNames = res;
|
|
100
|
+
});
|
|
101
|
+
this.route.params.subscribe(data => {
|
|
102
|
+
if (Number(data['id'])) {
|
|
103
|
+
this.id = Number(data['id']);
|
|
104
|
+
} else {
|
|
105
|
+
this.isLoading = false;
|
|
106
|
+
}
|
|
107
|
+
});
|
|
108
|
+
this.getUserSubscription().subscribe(response => {
|
|
109
|
+
this.subscription = response;
|
|
110
|
+
if (this.subscription?.id) {
|
|
111
|
+
this.hasAccess = this.hasAdminAccess(this.subscription?.id);
|
|
112
|
+
this.getUserInfo(this.subscription?.id, this.hasAccess);
|
|
113
|
+
this.accountDefaultValues(this.subscription?.id);
|
|
114
|
+
this.form.get('subscription_id').setValue(this.subscription?.id);
|
|
115
|
+
}
|
|
116
|
+
});
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
/** Function to call account default values */
|
|
120
|
+
private accountDefaultValues(id: number) {
|
|
121
|
+
this.crmService.getCrmAccountDefaultValues(id).subscribe(response => {
|
|
122
|
+
this.status = response.status;
|
|
123
|
+
this.priority = response.priority;
|
|
124
|
+
this.source = response.source;
|
|
125
|
+
});
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
/** Function to get subscription members */
|
|
129
|
+
private getAllSubscriptionMembers(id: number) {
|
|
130
|
+
this.subscriptionService
|
|
131
|
+
.getEnrolledSubscription(id, { page_size: PAGE_SIZE })
|
|
132
|
+
.subscribe(response => {
|
|
133
|
+
this.allSubscriptionMembers = response.members;
|
|
134
|
+
if (this.id) {
|
|
135
|
+
this.onEdit = true;
|
|
136
|
+
this.getAccountDetail();
|
|
137
|
+
} else {
|
|
138
|
+
this.onEdit = false;
|
|
139
|
+
}
|
|
140
|
+
if (this.id === 0) {
|
|
141
|
+
const currentUser = this.allSubscriptionMembers.find(
|
|
142
|
+
x => x.id === this.user.id
|
|
143
|
+
);
|
|
144
|
+
this.form.get('owner_id').setValue(currentUser);
|
|
145
|
+
}
|
|
146
|
+
});
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
// /** Function to get user info */
|
|
150
|
+
private getUserInfo(subscriptionId: number, hasAccess: boolean) {
|
|
151
|
+
this.userStore().subscribe(user => {
|
|
152
|
+
this.user = user;
|
|
153
|
+
if (hasAccess) {
|
|
154
|
+
this.form.get('owner_id').setValue(user);
|
|
155
|
+
this.getAllSubscriptionMembers(subscriptionId);
|
|
156
|
+
} else {
|
|
157
|
+
this.form.get('owner_id').setValue(user);
|
|
158
|
+
}
|
|
159
|
+
});
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
/** Function to get form controls */
|
|
163
|
+
get f() {
|
|
164
|
+
return this.form.controls;
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
/** Function to execute on form submit */
|
|
168
|
+
onSave() {
|
|
169
|
+
this.buttonBusy = true;
|
|
170
|
+
this.submitted = true;
|
|
171
|
+
if (this.form.valid) {
|
|
172
|
+
this.form.get('owner_id').setValue(this.form.get('owner_id').value.id);
|
|
173
|
+
this.form.get('country').setValue(this.form.get('country').value.code);
|
|
174
|
+
const sub$ = this.id
|
|
175
|
+
? this.crmService.updateAccount(this.subscription?.id, this.id, this.form.value)
|
|
176
|
+
: this.crmService.postAccount(this.form.value, this.subscription?.id);
|
|
177
|
+
sub$.subscribe(response => {
|
|
178
|
+
this.toast.success(this.translation.translate('Crm.AccountMessage.UpdatedMessage'));
|
|
179
|
+
this.router.navigate([
|
|
180
|
+
`/${this.subscription?.slug}${ROUTERS.accountInfo}${response.id}`
|
|
181
|
+
]);
|
|
182
|
+
}).add(() => {
|
|
183
|
+
this.buttonBusy = false;
|
|
184
|
+
});
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
/** Function to execute on location select */
|
|
189
|
+
handleAddressChange(event) {
|
|
190
|
+
this.form.get('location').setValue(event.formatted_address);
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
/** Function to get account detail on edit form */
|
|
194
|
+
private getAccountDetail() {
|
|
195
|
+
this.isLoading = true;
|
|
196
|
+
this.crmService.getAccountDetail(this.subscription?.id, this.id).subscribe(res => {
|
|
197
|
+
this.form.patchValue(res);
|
|
198
|
+
this.data = res;
|
|
199
|
+
this.allSubscriptionMembers.forEach(member => {
|
|
200
|
+
if (this.data.owner_id === member.id) {
|
|
201
|
+
this.form.get('owner_id').patchValue(member);
|
|
202
|
+
}
|
|
203
|
+
});
|
|
204
|
+
this.countryNames.forEach(x => {
|
|
205
|
+
if (x['code'] === res['country']) {
|
|
206
|
+
this.form.get('country').patchValue(x);
|
|
207
|
+
}
|
|
208
|
+
});
|
|
209
|
+
this.isLoading = false;
|
|
210
|
+
this.subscriptionService
|
|
211
|
+
.getEnrolledSubscription(this.subscription?.id, { page_size: PAGE_SIZE })
|
|
212
|
+
.subscribe({
|
|
213
|
+
next: response => {
|
|
214
|
+
this.subscriptionMembers = response.members;
|
|
215
|
+
},
|
|
216
|
+
error: error => this.toast.showToast(error)
|
|
217
|
+
});
|
|
218
|
+
});
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
onSearchCountry(event) {
|
|
222
|
+
let values = [];
|
|
223
|
+
if (event.query) {
|
|
224
|
+
values = this.countryNames.filter((x: Country) => {
|
|
225
|
+
return x.name.toLowerCase().includes(event.query.toLowerCase());
|
|
226
|
+
});
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
this.countryNames.forEach(item => {
|
|
230
|
+
values.push(item);
|
|
231
|
+
});
|
|
232
|
+
this.filteredCountries = values;
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
override ngOnDestroy() {
|
|
236
|
+
super.ngOnDestroy();
|
|
237
|
+
}
|
|
238
|
+
}
|
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
<div class="row d-none">
|
|
2
|
+
<div class="col-12 mb-3">
|
|
3
|
+
<h2>Account Files</h2>
|
|
4
|
+
</div>
|
|
5
|
+
</div>
|
|
6
|
+
<div class="row">
|
|
7
|
+
<div class="col-12 mb-3">
|
|
8
|
+
<a class="btn btn-sm btn-outline-primary float-end"
|
|
9
|
+
data-cy="add-file"
|
|
10
|
+
(click)="openModal(content)">
|
|
11
|
+
<i class="fa fa-plus-circle" aria-hidden="true"></i> {{ 'Add File' | transloco }}
|
|
12
|
+
</a>
|
|
13
|
+
</div>
|
|
14
|
+
</div>
|
|
15
|
+
<div class="w-100 text-center mt-3"
|
|
16
|
+
*ngIf="!isLoaded">
|
|
17
|
+
<p-progressSpinner strokeWidth="2"> </p-progressSpinner>
|
|
18
|
+
</div>
|
|
19
|
+
<div class="primeng-datatable-container table-responsive"
|
|
20
|
+
[class.hideTable]="totalRecordsUnFiltered === 0">
|
|
21
|
+
<p-table #dt
|
|
22
|
+
[value]="allFiles"
|
|
23
|
+
[paginator]="totalRecords !== 0"
|
|
24
|
+
[lazy]="true"
|
|
25
|
+
[rows]="PAGE_SIZE"
|
|
26
|
+
[totalRecords]="totalRecords"
|
|
27
|
+
[loading]="loading"
|
|
28
|
+
(onLazyLoad)="onLazyLoad($event)"
|
|
29
|
+
[customSort]="true">
|
|
30
|
+
<ng-template pTemplate="caption">
|
|
31
|
+
<div class="text-end">
|
|
32
|
+
<i class="fa fa-search mt-2 me-2" aria-hidden="true"></i>
|
|
33
|
+
<input type="text"
|
|
34
|
+
[(ngModel)]="searchText"
|
|
35
|
+
pInputText
|
|
36
|
+
size="50"
|
|
37
|
+
placeholder="Search Files..."
|
|
38
|
+
(input)="dt.filterGlobal($event.target.value, 'contains')"
|
|
39
|
+
class="mw-90" />
|
|
40
|
+
</div>
|
|
41
|
+
</ng-template>
|
|
42
|
+
<ng-template pTemplate="header">
|
|
43
|
+
<tr>
|
|
44
|
+
<th scope="true"
|
|
45
|
+
pSortableColumn="owner_id">
|
|
46
|
+
{{ 'Crm.AccountFilesMessage.Owner' | transloco }}
|
|
47
|
+
<p-sortIcon field="owner_id"></p-sortIcon>
|
|
48
|
+
</th>
|
|
49
|
+
<th scope="true"
|
|
50
|
+
pSortableColumn="crm_account_id">
|
|
51
|
+
{{ 'Crm.AccountFilesMessage.Account' | transloco }}
|
|
52
|
+
<p-sortIcon field="crm_account_id"></p-sortIcon>
|
|
53
|
+
</th>
|
|
54
|
+
<th scope="true"
|
|
55
|
+
pSortableColumn="crm_contact_id">
|
|
56
|
+
{{ 'Crm.AccountFilesMessage.Contact' | transloco }}
|
|
57
|
+
<p-sortIcon field="crm_contact_id"></p-sortIcon>
|
|
58
|
+
</th>
|
|
59
|
+
<th scope="true"
|
|
60
|
+
pSortableColumn="crm_opportunity_id">
|
|
61
|
+
{{ 'Crm.AccountFilesMessage.Opportunity' | transloco }}
|
|
62
|
+
<p-sortIcon field="crm_opportunity_id"></p-sortIcon>
|
|
63
|
+
</th>
|
|
64
|
+
<th scope="true"
|
|
65
|
+
pSortableColumn="file">
|
|
66
|
+
{{ 'Crm.AccountFilesMessage.File' | transloco }}
|
|
67
|
+
<p-sortIcon field="file"></p-sortIcon>
|
|
68
|
+
</th>
|
|
69
|
+
<th scope="true">{{ 'Label.Actions' | transloco }}</th>
|
|
70
|
+
</tr>
|
|
71
|
+
</ng-template>
|
|
72
|
+
<ng-template pTemplate="body"
|
|
73
|
+
let-file>
|
|
74
|
+
<tr>
|
|
75
|
+
<td data-head="Owner">{{ file.owner?.first_name }} {{ file.owner?.last_name }}</td>
|
|
76
|
+
<td data-head="Account">
|
|
77
|
+
<a *ngIf="file.crm_account_id"
|
|
78
|
+
[routerLink]="[
|
|
79
|
+
'/' + subscription?.slug + routers.accountInfo,
|
|
80
|
+
file.crm_account_id
|
|
81
|
+
]">{{ file.crm_account?.name }}</a>
|
|
82
|
+
</td>
|
|
83
|
+
<td data-head="Contact">
|
|
84
|
+
<a *ngIf="file.crm_contact_id"
|
|
85
|
+
[routerLink]="[
|
|
86
|
+
'/' + subscription?.slug + routers.contactInfo,
|
|
87
|
+
file.crm_contact_id
|
|
88
|
+
]">{{ file.crm_contact | ifNameNullShowEmail }}</a>
|
|
89
|
+
</td>
|
|
90
|
+
<td data-head="Opportunities">{{ file?.crm_opportunity?.title }}</td>
|
|
91
|
+
<td data-head="Files">
|
|
92
|
+
<a href="{{ file.file?.url }}"
|
|
93
|
+
target="blank">{{
|
|
94
|
+
file.file.url.split('?')[0].split('/')[
|
|
95
|
+
file.file.url.split('?')[0].split('/').length - 1
|
|
96
|
+
]
|
|
97
|
+
}}</a>
|
|
98
|
+
</td>
|
|
99
|
+
<td data-head="Action">
|
|
100
|
+
<ul class="list-unstyled list-inline">
|
|
101
|
+
<ng-container *ngIf="hasAccess || file.owner_id === userId">
|
|
102
|
+
<li ngbTooltip="Delete"
|
|
103
|
+
class="me-2 me-sm-3">
|
|
104
|
+
<i
|
|
105
|
+
class="fa fa-trash delete-icon"
|
|
106
|
+
(click)="onDelete(file.id)"
|
|
107
|
+
aria-hidden="true"
|
|
108
|
+
></i>
|
|
109
|
+
</li>
|
|
110
|
+
</ng-container>
|
|
111
|
+
</ul>
|
|
112
|
+
</td>
|
|
113
|
+
</tr>
|
|
114
|
+
</ng-template>
|
|
115
|
+
</p-table>
|
|
116
|
+
<div *ngIf="totalRecords === 0 && totalRecordsUnFiltered !== 0">
|
|
117
|
+
<pw-no-data [withImage]="true" [message]="'Search.NoDataMessage'| transloco" [description]="'Search.NoDataDescription' | transloco" >
|
|
118
|
+
</pw-no-data>
|
|
119
|
+
</div>
|
|
120
|
+
<span class="total-records-count" *ngIf="totalRecords !== 0">{{ 'Label.Total' | transloco }}: {{ totalRecords }}</span>
|
|
121
|
+
</div>
|
|
122
|
+
<div *ngIf="totalRecordsUnFiltered === 0 && isLoaded">
|
|
123
|
+
<pw-no-data [withImage]="true" [message]="'Crm.AccountFilesMessage.NoDataMessage' | transloco"> </pw-no-data>
|
|
124
|
+
</div>
|
|
125
|
+
|
|
126
|
+
<ng-template #content
|
|
127
|
+
let-modal>
|
|
128
|
+
<div class="modal-header">
|
|
129
|
+
<h3 class="modal-title mb-0 p-0">{{ 'Upload File' | transloco }}</h3>
|
|
130
|
+
<button type="button"
|
|
131
|
+
class="btn-close float-end"
|
|
132
|
+
aria-label="Close"
|
|
133
|
+
(click)="modal.dismiss()">
|
|
134
|
+
|
|
135
|
+
</button>
|
|
136
|
+
</div>
|
|
137
|
+
<div class="modal-body">
|
|
138
|
+
<small> {{ 'User.Profile.PictureMessage' | transloco }}</small>
|
|
139
|
+
<div class="row p-2">
|
|
140
|
+
<div class="col-12">
|
|
141
|
+
<div class="upload-box">
|
|
142
|
+
<div class="upload-box-content">
|
|
143
|
+
<div class="drop-container"
|
|
144
|
+
ngFileDrop
|
|
145
|
+
[options]="options"
|
|
146
|
+
(uploadOutput)="onUploadOutput($event)"
|
|
147
|
+
[uploadInput]="uploadInput">
|
|
148
|
+
<p>
|
|
149
|
+
Drag files here or
|
|
150
|
+
<label class="upload-button">
|
|
151
|
+
<input type="file"
|
|
152
|
+
ngFileSelect
|
|
153
|
+
[options]="options"
|
|
154
|
+
(uploadOutput)="onUploadOutput($event)"
|
|
155
|
+
[uploadInput]="uploadInput"
|
|
156
|
+
multiple />
|
|
157
|
+
browse
|
|
158
|
+
</label>
|
|
159
|
+
to upload.
|
|
160
|
+
</p>
|
|
161
|
+
</div>
|
|
162
|
+
<div class="upload-item"
|
|
163
|
+
*ngFor="let f of files; let i = index">
|
|
164
|
+
<div class="upload-item-content">
|
|
165
|
+
<div class="filename">
|
|
166
|
+
<div class="filename-left">
|
|
167
|
+
<i class="ionicon ion-ios-copy" aria-hidden="true"></i>
|
|
168
|
+
<span>{{ f.name }}</span>
|
|
169
|
+
</div>
|
|
170
|
+
</div>
|
|
171
|
+
<div class="progress-content">
|
|
172
|
+
<div class="progress">
|
|
173
|
+
<span class="bar"
|
|
174
|
+
[style.width]="f?.progress?.data?.percentage + '%'"
|
|
175
|
+
[class.is-done]="f['uploaded']"></span>
|
|
176
|
+
</div>
|
|
177
|
+
</div>
|
|
178
|
+
<div class="progress-text-content">
|
|
179
|
+
<span class="progress-text"
|
|
180
|
+
[class.is-done]="f['uploaded']">
|
|
181
|
+
<span *ngIf="!f['uploaded']">{{ f.progress?.data?.percentage - 1 }}%
|
|
182
|
+
</span>
|
|
183
|
+
<span *ngIf="f['uploaded']">100 %</span>
|
|
184
|
+
<span *ngIf="!f['uploaded']">Uploading...</span>
|
|
185
|
+
<span *ngIf="f['uploaded']">Done</span>
|
|
186
|
+
</span>
|
|
187
|
+
<span class="speed-and-eta-text"
|
|
188
|
+
*ngIf="f.progress?.data?.percentage !== 0 && !f['uploaded']">
|
|
189
|
+
<span>{{ f.progress?.data?.speedHuman }} </span>
|
|
190
|
+
<span>ETA {{ f.progress?.data?.etaHuman }}</span>
|
|
191
|
+
</span>
|
|
192
|
+
</div>
|
|
193
|
+
</div>
|
|
194
|
+
</div>
|
|
195
|
+
</div>
|
|
196
|
+
</div>
|
|
197
|
+
</div>
|
|
198
|
+
</div>
|
|
199
|
+
</div>
|
|
200
|
+
</ng-template>
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import { TestBed } from '@angular/core/testing';
|
|
2
|
+
import { CommonServicesModule, PermissionService, UserService } from '@posiwise/common-services';
|
|
3
|
+
import { CrmService } from '@posiwise/smart-crm-shared';
|
|
4
|
+
import { DEFAULT_USER, TestHelper } from '@posiwise/test-helpers';
|
|
5
|
+
import { MockProvider } from 'ng-mocks';
|
|
6
|
+
import { SharedModule } from '@posiwise/shared-module';
|
|
7
|
+
import { of } from 'rxjs';
|
|
8
|
+
import Swal from 'sweetalert2';
|
|
9
|
+
import { SmartCrmPrivateModule } from '../../../smart-crm-private.module';
|
|
10
|
+
import { SmartCrmCompanyFilesComponent } from './smart-crm-account-files.component';
|
|
11
|
+
|
|
12
|
+
class UserServiceMock {
|
|
13
|
+
getUserState() {
|
|
14
|
+
return of({ currentUser: DEFAULT_USER });
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
describe('SmartCrmCompanyFilesComponent', () => {
|
|
18
|
+
const file = {
|
|
19
|
+
id: '1',
|
|
20
|
+
fileIndex: 1,
|
|
21
|
+
lastModifiedDate: new Date(),
|
|
22
|
+
name: 'test-file.xlsx',
|
|
23
|
+
size: 1,
|
|
24
|
+
type: 'xlsx',
|
|
25
|
+
form: new FormData(),
|
|
26
|
+
progress: { status: 2 }
|
|
27
|
+
};
|
|
28
|
+
const createComponent = TestHelper.createComponentFactory({
|
|
29
|
+
component: SmartCrmCompanyFilesComponent,
|
|
30
|
+
imports: [SharedModule, SmartCrmPrivateModule, CommonServicesModule],
|
|
31
|
+
providers: [
|
|
32
|
+
...TestHelper.TEST_PROVIDERS,
|
|
33
|
+
MockProvider(PermissionService, {
|
|
34
|
+
evaluatePermissions: () => {
|
|
35
|
+
return true;
|
|
36
|
+
}
|
|
37
|
+
}),
|
|
38
|
+
MockProvider(CrmService, {
|
|
39
|
+
getAllAccountFiles: () =>
|
|
40
|
+
of({
|
|
41
|
+
crm_account_files: [
|
|
42
|
+
{
|
|
43
|
+
owner: {
|
|
44
|
+
first_name: 'test',
|
|
45
|
+
last_name: 'test'
|
|
46
|
+
},
|
|
47
|
+
crm_account_id: 1,
|
|
48
|
+
crm_contact_id: 1,
|
|
49
|
+
owner_id: 1,
|
|
50
|
+
file: {
|
|
51
|
+
url: ''
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
],
|
|
55
|
+
object_count: 1,
|
|
56
|
+
unfiltered_count: 1
|
|
57
|
+
}),
|
|
58
|
+
deleteAccountFiles: () => of({})
|
|
59
|
+
}),
|
|
60
|
+
{
|
|
61
|
+
provide: UserService,
|
|
62
|
+
useClass: UserServiceMock
|
|
63
|
+
}
|
|
64
|
+
]
|
|
65
|
+
});
|
|
66
|
+
|
|
67
|
+
beforeEach(() => {
|
|
68
|
+
TestHelper.setUpPermissionsAndUser();
|
|
69
|
+
});
|
|
70
|
+
|
|
71
|
+
it('should create', async () => {
|
|
72
|
+
TestHelper.setActivatedRoute({
|
|
73
|
+
params: { id: 1 },
|
|
74
|
+
parent: { params: of({ slug: 'posiwise-263' }) }
|
|
75
|
+
});
|
|
76
|
+
const spectator = await createComponent();
|
|
77
|
+
expect(spectator.component).toBeTruthy();
|
|
78
|
+
});
|
|
79
|
+
|
|
80
|
+
it('should delete file ', async () => {
|
|
81
|
+
TestHelper.setActivatedRoute({
|
|
82
|
+
params: { id: 1 },
|
|
83
|
+
parent: { params: of({ slug: 'posiwise-263' }) }
|
|
84
|
+
});
|
|
85
|
+
const spectator = await createComponent();
|
|
86
|
+
const service = TestBed.inject(CrmService);
|
|
87
|
+
const spy = spyOn(service, 'deleteAccountFiles').and.callThrough();
|
|
88
|
+
spectator.click('tbody tr:first-child .fa-trash');
|
|
89
|
+
expect(Swal.isVisible()).toBeTruthy();
|
|
90
|
+
Swal.clickConfirm();
|
|
91
|
+
await TestHelper.stabilize(spectator);
|
|
92
|
+
expect(spy).toHaveBeenCalledTimes(1);
|
|
93
|
+
});
|
|
94
|
+
|
|
95
|
+
it('should upload', async () => {
|
|
96
|
+
TestHelper.setActivatedRoute({
|
|
97
|
+
params: { id: 1 },
|
|
98
|
+
parent: { params: of({ slug: 'posiwise-263' }) }
|
|
99
|
+
});
|
|
100
|
+
const spectator = await createComponent();
|
|
101
|
+
expect(spectator.component).toBeTruthy();
|
|
102
|
+
spyOn(spectator.component.uploadInput, 'emit').and.stub();
|
|
103
|
+
spectator.component.files = [file];
|
|
104
|
+
spectator.component.onUploadOutput({ type: 'allAddedToQueue', file });
|
|
105
|
+
spectator.component.onUploadOutput({ type: 'addedToQueue', file });
|
|
106
|
+
spectator.component.onUploadOutput({ type: 'uploading', file });
|
|
107
|
+
spectator.component.onUploadOutput({ type: 'removed', file });
|
|
108
|
+
});
|
|
109
|
+
});
|