@vendure/admin-ui 1.7.4 → 1.8.0
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/README.md +49 -0
- package/angular.json +196 -0
- package/i18n-coverage.json +71 -0
- package/package/bundles/vendure-admin-ui-catalog.umd.js +5689 -0
- package/package/bundles/vendure-admin-ui-catalog.umd.js.map +1 -0
- package/package/bundles/vendure-admin-ui-core.umd.js +16863 -0
- package/package/bundles/vendure-admin-ui-core.umd.js.map +1 -0
- package/package/bundles/vendure-admin-ui-customer.umd.js +1680 -0
- package/package/bundles/vendure-admin-ui-customer.umd.js.map +1 -0
- package/package/bundles/vendure-admin-ui-dashboard.umd.js +759 -0
- package/package/bundles/vendure-admin-ui-dashboard.umd.js.map +1 -0
- package/{bundles → package/bundles}/vendure-admin-ui-login.umd.js +0 -0
- package/{bundles → package/bundles}/vendure-admin-ui-login.umd.js.map +0 -0
- package/{bundles → package/bundles}/vendure-admin-ui-marketing.umd.js +0 -0
- package/{bundles → package/bundles}/vendure-admin-ui-marketing.umd.js.map +0 -0
- package/package/bundles/vendure-admin-ui-order.umd.js +4028 -0
- package/package/bundles/vendure-admin-ui-order.umd.js.map +1 -0
- package/package/bundles/vendure-admin-ui-settings.umd.js +3700 -0
- package/package/bundles/vendure-admin-ui-settings.umd.js.map +1 -0
- package/package/bundles/vendure-admin-ui-system.umd.js +524 -0
- package/{bundles → package/bundles}/vendure-admin-ui-system.umd.js.map +0 -0
- package/{bundles → package/bundles}/vendure-admin-ui.umd.js +0 -0
- package/{bundles → package/bundles}/vendure-admin-ui.umd.js.map +0 -0
- package/package/catalog/catalog.module.d.ts +5 -0
- package/{catalog → package/catalog}/catalog.routes.d.ts +0 -0
- package/{catalog → package/catalog}/components/apply-facet-dialog/apply-facet-dialog.component.d.ts +0 -0
- package/{catalog → package/catalog}/components/asset-detail/asset-detail.component.d.ts +0 -0
- package/{catalog → package/catalog}/components/asset-list/asset-list.component.d.ts +0 -0
- package/{catalog → package/catalog}/components/assets/assets.component.d.ts +0 -0
- package/{catalog → package/catalog}/components/assign-products-to-channel-dialog/assign-products-to-channel-dialog.component.d.ts +0 -0
- package/package/catalog/components/assign-to-channel-dialog/assign-to-channel-dialog.component.d.ts +17 -0
- package/package/catalog/components/bulk-add-facet-values-dialog/bulk-add-facet-values-dialog.component.d.ts +38 -0
- package/package/catalog/components/bulk-add-facet-values-dialog/bulk-add-facet-values-dialog.graphql.d.ts +4 -0
- package/{catalog → package/catalog}/components/collection-contents/collection-contents.component.d.ts +0 -0
- package/{catalog → package/catalog}/components/collection-detail/collection-detail.component.d.ts +0 -0
- package/package/catalog/components/collection-list/collection-list-bulk-actions.d.ts +6 -0
- package/package/catalog/components/collection-list/collection-list.component.d.ts +35 -0
- package/{catalog → package/catalog}/components/collection-tree/array-to-tree.d.ts +0 -0
- package/package/catalog/components/collection-tree/collection-tree-node.component.d.ts +40 -0
- package/package/catalog/components/collection-tree/collection-tree.component.d.ts +36 -0
- package/{catalog → package/catalog}/components/confirm-variant-deletion-dialog/confirm-variant-deletion-dialog.component.d.ts +0 -0
- package/{catalog → package/catalog}/components/facet-detail/facet-detail.component.d.ts +0 -0
- package/package/catalog/components/facet-list/facet-list-bulk-actions.d.ts +5 -0
- package/package/catalog/components/facet-list/facet-list.component.d.ts +25 -0
- package/{catalog → package/catalog}/components/generate-product-variants/generate-product-variants.component.d.ts +0 -0
- package/{catalog → package/catalog}/components/option-value-input/option-value-input.component.d.ts +0 -0
- package/{catalog → package/catalog}/components/product-detail/product-detail.component.d.ts +0 -0
- package/package/catalog/components/product-list/product-list-bulk-actions.d.ts +6 -0
- package/package/catalog/components/product-list/product-list.component.d.ts +30 -0
- package/{catalog → package/catalog}/components/product-options-editor/product-options-editor.component.d.ts +0 -0
- package/{catalog → package/catalog}/components/product-variants-editor/product-variants-editor.component.d.ts +0 -0
- package/{catalog → package/catalog}/components/product-variants-list/product-variants-list.component.d.ts +0 -0
- package/{catalog → package/catalog}/components/product-variants-table/product-variants-table.component.d.ts +0 -0
- package/{catalog → package/catalog}/components/update-product-option-dialog/update-product-option-dialog.component.d.ts +0 -0
- package/{catalog → package/catalog}/components/variant-price-detail/variant-price-detail.component.d.ts +0 -0
- package/{catalog → package/catalog}/package.json +0 -0
- package/{catalog → package/catalog}/providers/product-detail/product-detail.service.d.ts +0 -0
- package/{catalog → package/catalog}/providers/product-detail/replace-last.d.ts +0 -0
- package/{catalog → package/catalog}/providers/routing/asset-resolver.d.ts +0 -0
- package/{catalog → package/catalog}/providers/routing/collection-resolver.d.ts +0 -0
- package/{catalog → package/catalog}/providers/routing/facet-resolver.d.ts +0 -0
- package/{catalog → package/catalog}/providers/routing/product-resolver.d.ts +0 -0
- package/{catalog → package/catalog}/providers/routing/product-variants-resolver.d.ts +0 -0
- package/package/catalog/public_api.d.ts +39 -0
- package/{catalog → package/catalog}/vendure-admin-ui-catalog.d.ts +0 -0
- package/package/catalog/vendure-admin-ui-catalog.metadata.json +1 -0
- package/{core → package/core}/app.component.d.ts +0 -0
- package/{core → package/core}/app.component.module.d.ts +0 -0
- package/{core → package/core}/app.config.d.ts +0 -0
- package/{core → package/core}/common/base-detail.component.d.ts +0 -0
- package/{core → package/core}/common/base-entity-resolver.d.ts +0 -0
- package/{core → package/core}/common/base-list.component.d.ts +0 -0
- package/package/core/common/component-registry-types.d.ts +56 -0
- package/{core → package/core}/common/deactivate-aware.d.ts +0 -0
- package/{core → package/core}/common/detail-breadcrumb.d.ts +0 -0
- package/package/core/common/generated-types.d.ts +9748 -0
- package/{core → package/core}/common/introspection-result-wrapper.d.ts +0 -0
- package/{core → package/core}/common/introspection-result.d.ts +0 -0
- package/{core → package/core}/common/single-search-selection-model.d.ts +0 -0
- package/package/core/common/utilities/bulk-action-utils.d.ts +19 -0
- package/{core → package/core}/common/utilities/configurable-operation-utils.d.ts +0 -0
- package/{core → package/core}/common/utilities/create-updated-translatable.d.ts +0 -0
- package/{core → package/core}/common/utilities/find-translation.d.ts +0 -0
- package/{core → package/core}/common/utilities/flatten-facet-values.d.ts +0 -0
- package/{core → package/core}/common/utilities/get-default-ui-language.d.ts +0 -0
- package/{core → package/core}/common/utilities/interpolate-description.d.ts +0 -0
- package/package/core/common/utilities/selection-manager.d.ts +30 -0
- package/{core → package/core}/common/utilities/string-to-color.d.ts +0 -0
- package/package/core/common/version.d.ts +1 -0
- package/{core → package/core}/components/app-shell/app-shell.component.d.ts +0 -0
- package/{core → package/core}/components/breadcrumb/breadcrumb.component.d.ts +0 -0
- package/{core → package/core}/components/channel-switcher/channel-switcher.component.d.ts +0 -0
- package/{core → package/core}/components/main-nav/main-nav.component.d.ts +0 -0
- package/{core → package/core}/components/notification/notification.component.d.ts +0 -0
- package/{core → package/core}/components/overlay-host/overlay-host.component.d.ts +0 -0
- package/{core → package/core}/components/theme-switcher/theme-switcher.component.d.ts +0 -0
- package/{core → package/core}/components/ui-language-switcher-dialog/ui-language-switcher-dialog.component.d.ts +0 -0
- package/{core → package/core}/components/user-menu/user-menu.component.d.ts +0 -0
- package/{core → package/core}/core.module.d.ts +0 -0
- package/{core → package/core}/data/check-jobs-link.d.ts +0 -0
- package/{core → package/core}/data/client-state/client-defaults.d.ts +0 -0
- package/{core → package/core}/data/client-state/client-resolvers.d.ts +0 -0
- package/{core → package/core}/data/data.module.d.ts +0 -0
- package/{core → package/core}/data/definitions/administrator-definitions.d.ts +0 -0
- package/{core → package/core}/data/definitions/auth-definitions.d.ts +0 -0
- package/{core → package/core}/data/definitions/client-definitions.d.ts +0 -0
- package/package/core/data/definitions/collection-definitions.d.ts +13 -0
- package/{core → package/core}/data/definitions/customer-definitions.d.ts +0 -0
- package/package/core/data/definitions/facet-definitions.d.ts +13 -0
- package/package/core/data/definitions/order-definitions.d.ts +39 -0
- package/package/core/data/definitions/product-definitions.d.ts +46 -0
- package/{core → package/core}/data/definitions/promotion-definitions.d.ts +0 -0
- package/{core → package/core}/data/definitions/settings-definitions.d.ts +0 -0
- package/{core → package/core}/data/definitions/shared-definitions.d.ts +0 -0
- package/{core → package/core}/data/definitions/shipping-definitions.d.ts +0 -0
- package/{core → package/core}/data/omit-typename-link.d.ts +0 -0
- package/{core → package/core}/data/providers/administrator-data.service.d.ts +0 -0
- package/{core → package/core}/data/providers/auth-data.service.d.ts +0 -0
- package/{core → package/core}/data/providers/base-data.service.d.ts +0 -0
- package/{core → package/core}/data/providers/client-data.service.d.ts +0 -0
- package/package/core/data/providers/collection-data.service.d.ts +28 -0
- package/{core → package/core}/data/providers/customer-data.service.d.ts +0 -0
- package/{core → package/core}/data/providers/data.service.d.ts +0 -0
- package/package/core/data/providers/facet-data.service.d.ts +24 -0
- package/{core → package/core}/data/providers/fetch-adapter.d.ts +0 -0
- package/{core → package/core}/data/providers/interceptor.d.ts +0 -0
- package/package/core/data/providers/order-data.service.d.ts +52 -0
- package/package/core/data/providers/product-data.service.d.ts +82 -0
- package/{core → package/core}/data/providers/promotion-data.service.d.ts +0 -0
- package/{core → package/core}/data/providers/settings-data.service.d.ts +0 -0
- package/{core → package/core}/data/providers/shipping-method-data.service.d.ts +0 -0
- package/{core → package/core}/data/query-result.d.ts +0 -0
- package/{core → package/core}/data/server-config.d.ts +0 -0
- package/{core → package/core}/data/utils/add-custom-fields.d.ts +0 -0
- package/{core → package/core}/data/utils/get-server-location.d.ts +0 -0
- package/{core → package/core}/data/utils/remove-readonly-custom-fields.d.ts +0 -0
- package/{core → package/core}/data/utils/transform-relation-custom-field-inputs.d.ts +0 -0
- package/{core → package/core}/package.json +0 -0
- package/{core → package/core}/providers/auth/auth.service.d.ts +0 -0
- package/package/core/providers/bulk-action-registry/bulk-action-registry.service.d.ts +6 -0
- package/package/core/providers/bulk-action-registry/bulk-action-types.d.ts +149 -0
- package/package/core/providers/bulk-action-registry/register-bulk-action.d.ts +53 -0
- package/{core → package/core}/providers/component-registry/component-registry.service.d.ts +0 -0
- package/{core → package/core}/providers/custom-detail-component/custom-detail-component-types.d.ts +0 -0
- package/{core → package/core}/providers/custom-detail-component/custom-detail-component.service.d.ts +0 -0
- package/{core → package/core}/providers/custom-field-component/custom-field-component.service.d.ts +0 -0
- package/{core → package/core}/providers/dashboard-widget/dashboard-widget-types.d.ts +0 -0
- package/{core → package/core}/providers/dashboard-widget/dashboard-widget.service.d.ts +0 -0
- package/{core → package/core}/providers/dashboard-widget/register-dashboard-widget.d.ts +0 -0
- package/{core → package/core}/providers/guard/auth.guard.d.ts +0 -0
- package/{core → package/core}/providers/health-check/health-check.service.d.ts +0 -0
- package/{core → package/core}/providers/i18n/custom-http-loader.d.ts +0 -0
- package/{core → package/core}/providers/i18n/custom-message-format-compiler.d.ts +0 -0
- package/{core → package/core}/providers/i18n/i18n.service.d.ts +0 -0
- package/{core → package/core}/providers/job-queue/job-queue.service.d.ts +0 -0
- package/{core → package/core}/providers/local-storage/local-storage.service.d.ts +0 -0
- package/package/core/providers/modal/modal.service.d.ts +134 -0
- package/package/core/providers/nav-builder/nav-builder-types.d.ts +92 -0
- package/{core → package/core}/providers/nav-builder/nav-builder.service.d.ts +0 -0
- package/{core → package/core}/providers/notification/notification.service.d.ts +0 -0
- package/{core → package/core}/providers/overlay-host/overlay-host.service.d.ts +0 -0
- package/package/core/public_api.d.ts +239 -0
- package/{core → package/core}/shared/components/action-bar/action-bar.component.d.ts +0 -0
- package/{core → package/core}/shared/components/action-bar-items/action-bar-items.component.d.ts +0 -0
- package/{core → package/core}/shared/components/address-form/address-form.component.d.ts +0 -0
- package/{core → package/core}/shared/components/affixed-input/affixed-input.component.d.ts +0 -0
- package/{core → package/core}/shared/components/affixed-input/percentage-suffix-input.component.d.ts +0 -0
- package/{core → package/core}/shared/components/asset-file-input/asset-file-input.component.d.ts +0 -0
- package/package/core/shared/components/asset-gallery/asset-gallery.component.d.ts +67 -0
- package/{core → package/core}/shared/components/asset-picker-dialog/asset-picker-dialog.component.d.ts +0 -0
- package/{core → package/core}/shared/components/asset-preview/asset-preview.component.d.ts +0 -0
- package/{core → package/core}/shared/components/asset-preview-dialog/asset-preview-dialog.component.d.ts +0 -0
- package/{core → package/core}/shared/components/asset-preview-links/asset-preview-links.component.d.ts +0 -0
- package/{core → package/core}/shared/components/asset-search-input/asset-search-input.component.d.ts +0 -0
- package/package/core/shared/components/bulk-action-menu/bulk-action-menu.component.d.ts +29 -0
- package/{core → package/core}/shared/components/channel-assignment-control/channel-assignment-control.component.d.ts +0 -0
- package/{core → package/core}/shared/components/channel-badge/channel-badge.component.d.ts +0 -0
- package/{core → package/core}/shared/components/chip/chip.component.d.ts +0 -0
- package/{core → package/core}/shared/components/configurable-input/configurable-input.component.d.ts +0 -0
- package/{core → package/core}/shared/components/currency-input/currency-input.component.d.ts +0 -0
- package/{core → package/core}/shared/components/custom-detail-component-host/custom-detail-component-host.component.d.ts +0 -0
- package/{core → package/core}/shared/components/custom-field-control/custom-field-control.component.d.ts +0 -0
- package/{core → package/core}/shared/components/customer-label/customer-label.component.d.ts +0 -0
- package/{core → package/core}/shared/components/data-table/data-table-column.component.d.ts +0 -0
- package/package/core/shared/components/data-table/data-table.component.d.ts +101 -0
- package/{core → package/core}/shared/components/datetime-picker/constants.d.ts +0 -0
- package/{core → package/core}/shared/components/datetime-picker/datetime-picker.component.d.ts +0 -0
- package/{core → package/core}/shared/components/datetime-picker/datetime-picker.service.d.ts +0 -0
- package/{core → package/core}/shared/components/datetime-picker/types.d.ts +0 -0
- package/{core → package/core}/shared/components/dropdown/dropdown-item.directive.d.ts +0 -0
- package/package/core/shared/components/dropdown/dropdown-menu.component.d.ts +31 -0
- package/{core → package/core}/shared/components/dropdown/dropdown-trigger.directive.d.ts +0 -0
- package/{core → package/core}/shared/components/dropdown/dropdown.component.d.ts +0 -0
- package/{core → package/core}/shared/components/edit-note-dialog/edit-note-dialog.component.d.ts +0 -0
- package/{core → package/core}/shared/components/empty-placeholder/empty-placeholder.component.d.ts +0 -0
- package/{core → package/core}/shared/components/entity-info/entity-info.component.d.ts +0 -0
- package/{core → package/core}/shared/components/extension-host/extension-host-config.d.ts +0 -0
- package/{core → package/core}/shared/components/extension-host/extension-host.component.d.ts +0 -0
- package/{core → package/core}/shared/components/extension-host/extension-host.service.d.ts +0 -0
- package/{core → package/core}/shared/components/extension-host/host-external-frame.d.ts +0 -0
- package/{core → package/core}/shared/components/facet-value-chip/facet-value-chip.component.d.ts +0 -0
- package/{core → package/core}/shared/components/facet-value-selector/facet-value-selector.component.d.ts +0 -0
- package/{core → package/core}/shared/components/focal-point-control/focal-point-control.component.d.ts +0 -0
- package/{core → package/core}/shared/components/form-field/form-field-control.directive.d.ts +0 -0
- package/{core → package/core}/shared/components/form-field/form-field.component.d.ts +0 -0
- package/{core → package/core}/shared/components/form-item/form-item.component.d.ts +0 -0
- package/{core → package/core}/shared/components/formatted-address/formatted-address.component.d.ts +0 -0
- package/{core → package/core}/shared/components/help-tooltip/help-tooltip.component.d.ts +0 -0
- package/{core → package/core}/shared/components/history-entry-detail/history-entry-detail.component.d.ts +0 -0
- package/{core → package/core}/shared/components/items-per-page-controls/items-per-page-controls.component.d.ts +0 -0
- package/{core → package/core}/shared/components/labeled-data/labeled-data.component.d.ts +0 -0
- package/{core → package/core}/shared/components/language-selector/language-selector.component.d.ts +0 -0
- package/{core → package/core}/shared/components/manage-tags-dialog/manage-tags-dialog.component.d.ts +0 -0
- package/{core → package/core}/shared/components/modal-dialog/dialog-buttons.directive.d.ts +0 -0
- package/{core → package/core}/shared/components/modal-dialog/dialog-component-outlet.component.d.ts +0 -0
- package/{core → package/core}/shared/components/modal-dialog/dialog-title.directive.d.ts +0 -0
- package/{core → package/core}/shared/components/modal-dialog/modal-dialog.component.d.ts +0 -0
- package/{core → package/core}/shared/components/object-tree/object-tree.component.d.ts +0 -0
- package/{core → package/core}/shared/components/order-state-label/order-state-label.component.d.ts +0 -0
- package/{core → package/core}/shared/components/pagination-controls/pagination-controls.component.d.ts +0 -0
- package/{core → package/core}/shared/components/product-multi-selector-dialog/product-multi-selector-dialog.component.d.ts +0 -0
- package/{core → package/core}/shared/components/product-search-input/product-search-input.component.d.ts +0 -0
- package/{core → package/core}/shared/components/product-selector/product-selector.component.d.ts +0 -0
- package/package/core/shared/components/radio-card/radio-card-fieldset.component.d.ts +21 -0
- package/package/core/shared/components/radio-card/radio-card.component.d.ts +19 -0
- package/{core → package/core}/shared/components/rich-text-editor/external-image-dialog/external-image-dialog.component.d.ts +0 -0
- package/{core → package/core}/shared/components/rich-text-editor/link-dialog/link-dialog.component.d.ts +0 -0
- package/package/core/shared/components/rich-text-editor/prosemirror/context-menu/context-menu.component.d.ts +28 -0
- package/package/core/shared/components/rich-text-editor/prosemirror/context-menu/context-menu.service.d.ts +31 -0
- package/package/core/shared/components/rich-text-editor/prosemirror/custom-nodes.d.ts +4 -0
- package/package/core/shared/components/rich-text-editor/prosemirror/inputrules.d.ts +8 -0
- package/{core → package/core}/shared/components/rich-text-editor/prosemirror/keymap.d.ts +0 -0
- package/package/core/shared/components/rich-text-editor/prosemirror/menu/links.d.ts +4 -0
- package/package/core/shared/components/rich-text-editor/prosemirror/menu/menu-common.d.ts +16 -0
- package/package/core/shared/components/rich-text-editor/prosemirror/menu/menu-plugin.d.ts +9 -0
- package/{core → package/core}/shared/components/rich-text-editor/prosemirror/menu/menu.d.ts +0 -0
- package/package/core/shared/components/rich-text-editor/prosemirror/menu/sub-menu-with-icon.d.ts +14 -0
- package/package/core/shared/components/rich-text-editor/prosemirror/plugins/image-plugin.d.ts +7 -0
- package/package/core/shared/components/rich-text-editor/prosemirror/plugins/link-select-plugin.d.ts +5 -0
- package/package/core/shared/components/rich-text-editor/prosemirror/plugins/raw-editor-plugin.d.ts +7 -0
- package/package/core/shared/components/rich-text-editor/prosemirror/plugins/tables-plugin.d.ts +13 -0
- package/package/core/shared/components/rich-text-editor/prosemirror/prosemirror.service.d.ts +25 -0
- package/package/core/shared/components/rich-text-editor/prosemirror/types.d.ts +9 -0
- package/{core → package/core}/shared/components/rich-text-editor/prosemirror/utils.d.ts +0 -0
- package/package/core/shared/components/rich-text-editor/raw-html-dialog/raw-html-dialog.component.d.ts +18 -0
- package/package/core/shared/components/rich-text-editor/rich-text-editor.component.d.ts +39 -0
- package/{core → package/core}/shared/components/select-toggle/select-toggle.component.d.ts +0 -0
- package/{core → package/core}/shared/components/simple-dialog/simple-dialog.component.d.ts +0 -0
- package/{core → package/core}/shared/components/status-badge/status-badge.component.d.ts +0 -0
- package/{core → package/core}/shared/components/tabbed-custom-fields/tabbed-custom-fields.component.d.ts +0 -0
- package/{core → package/core}/shared/components/table-row-action/table-row-action.component.d.ts +0 -0
- package/{core → package/core}/shared/components/tag-selector/tag-selector.component.d.ts +0 -0
- package/{core → package/core}/shared/components/timeline-entry/timeline-entry.component.d.ts +0 -0
- package/{core → package/core}/shared/components/title-input/title-input.component.d.ts +0 -0
- package/{core → package/core}/shared/components/ui-extension-point/ui-extension-point.component.d.ts +0 -0
- package/{core → package/core}/shared/directives/disabled.directive.d.ts +0 -0
- package/{core → package/core}/shared/directives/if-default-channel-active.directive.d.ts +0 -0
- package/{core → package/core}/shared/directives/if-directive-base.d.ts +0 -0
- package/{core → package/core}/shared/directives/if-multichannel.directive.d.ts +0 -0
- package/{core → package/core}/shared/directives/if-permissions.directive.d.ts +0 -0
- package/{core → package/core}/shared/dynamic-form-inputs/boolean-form-input/boolean-form-input.component.d.ts +0 -0
- package/package/core/shared/dynamic-form-inputs/code-editor-form-input/base-code-editor-form-input.component.d.ts +27 -0
- package/package/core/shared/dynamic-form-inputs/code-editor-form-input/html-editor-form-input.component.d.ts +19 -0
- package/package/core/shared/dynamic-form-inputs/code-editor-form-input/json-editor-form-input.component.d.ts +20 -0
- package/{core → package/core}/shared/dynamic-form-inputs/combination-mode-form-input/combination-mode-form-input.component.d.ts +0 -0
- package/{core → package/core}/shared/dynamic-form-inputs/currency-form-input/currency-form-input.component.d.ts +0 -0
- package/{core → package/core}/shared/dynamic-form-inputs/customer-group-form-input/customer-group-form-input.component.d.ts +0 -0
- package/{core → package/core}/shared/dynamic-form-inputs/date-form-input/date-form-input.component.d.ts +0 -0
- package/{core → package/core}/shared/dynamic-form-inputs/dynamic-form-input/dynamic-form-input.component.d.ts +0 -0
- package/{core → package/core}/shared/dynamic-form-inputs/facet-value-form-input/facet-value-form-input.component.d.ts +0 -0
- package/{core → package/core}/shared/dynamic-form-inputs/number-form-input/number-form-input.component.d.ts +0 -0
- package/{core → package/core}/shared/dynamic-form-inputs/password-form-input/password-form-input.component.d.ts +0 -0
- package/{core → package/core}/shared/dynamic-form-inputs/product-multi-selector-form-input/product-multi-selector-form-input.component.d.ts +0 -0
- package/{core → package/core}/shared/dynamic-form-inputs/product-selector-form-input/product-selector-form-input.component.d.ts +0 -0
- package/package/core/shared/dynamic-form-inputs/register-dynamic-input-components.d.ts +90 -0
- package/{core → package/core}/shared/dynamic-form-inputs/relation-form-input/asset/relation-asset-input.component.d.ts +0 -0
- package/{core → package/core}/shared/dynamic-form-inputs/relation-form-input/customer/relation-customer-input.component.d.ts +0 -0
- package/{core → package/core}/shared/dynamic-form-inputs/relation-form-input/generic/relation-generic-input.component.d.ts +0 -0
- package/{core → package/core}/shared/dynamic-form-inputs/relation-form-input/product/relation-product-input.component.d.ts +0 -0
- package/{core → package/core}/shared/dynamic-form-inputs/relation-form-input/product-variant/relation-product-variant-input.component.d.ts +0 -0
- package/{core → package/core}/shared/dynamic-form-inputs/relation-form-input/relation-card/relation-card.component.d.ts +0 -0
- package/{core → package/core}/shared/dynamic-form-inputs/relation-form-input/relation-form-input.component.d.ts +0 -0
- package/{core → package/core}/shared/dynamic-form-inputs/relation-form-input/relation-selector-dialog/relation-selector-dialog.component.d.ts +0 -0
- package/{core → package/core}/shared/dynamic-form-inputs/rich-text-form-input/rich-text-form-input.component.d.ts +0 -0
- package/{core → package/core}/shared/dynamic-form-inputs/select-form-input/select-form-input.component.d.ts +0 -0
- package/{core → package/core}/shared/dynamic-form-inputs/text-form-input/text-form-input.component.d.ts +0 -0
- package/{core → package/core}/shared/dynamic-form-inputs/textarea-form-input/textarea-form-input.component.d.ts +0 -0
- package/{core → package/core}/shared/pipes/asset-preview.pipe.d.ts +0 -0
- package/{core → package/core}/shared/pipes/channel-label.pipe.d.ts +0 -0
- package/{core → package/core}/shared/pipes/custom-field-label.pipe.d.ts +0 -0
- package/{core → package/core}/shared/pipes/duration.pipe.d.ts +0 -0
- package/{core → package/core}/shared/pipes/file-size.pipe.d.ts +0 -0
- package/{core → package/core}/shared/pipes/has-permission.pipe.d.ts +0 -0
- package/{core → package/core}/shared/pipes/locale-base.pipe.d.ts +0 -0
- package/{core → package/core}/shared/pipes/locale-currency-name.pipe.d.ts +0 -0
- package/{core → package/core}/shared/pipes/locale-currency.pipe.d.ts +0 -0
- package/{core → package/core}/shared/pipes/locale-date.pipe.d.ts +0 -0
- package/{core → package/core}/shared/pipes/locale-language-name.pipe.d.ts +0 -0
- package/{core → package/core}/shared/pipes/locale-region-name.pipe.d.ts +0 -0
- package/{core → package/core}/shared/pipes/sentence-case.pipe.d.ts +0 -0
- package/{core → package/core}/shared/pipes/sort.pipe.d.ts +0 -0
- package/{core → package/core}/shared/pipes/state-i18n-token.pipe.d.ts +0 -0
- package/{core → package/core}/shared/pipes/string-to-color.pipe.d.ts +0 -0
- package/{core → package/core}/shared/pipes/time-ago.pipe.d.ts +0 -0
- package/{core → package/core}/shared/providers/routing/can-deactivate-detail-guard.d.ts +0 -0
- package/{core → package/core}/shared/shared.module.d.ts +0 -0
- package/{core → package/core}/validators/unicode-pattern.validator.d.ts +0 -0
- package/{core → package/core}/vendure-admin-ui-core.d.ts +0 -0
- package/package/core/vendure-admin-ui-core.metadata.json +1 -0
- package/{customer → package/customer}/components/add-customer-to-group-dialog/add-customer-to-group-dialog.component.d.ts +0 -0
- package/{customer → package/customer}/components/address-card/address-card.component.d.ts +0 -0
- package/{customer → package/customer}/components/address-detail-dialog/address-detail-dialog.component.d.ts +0 -0
- package/{customer → package/customer}/components/customer-detail/customer-detail.component.d.ts +0 -0
- package/{customer → package/customer}/components/customer-group-detail-dialog/customer-group-detail-dialog.component.d.ts +0 -0
- package/{customer → package/customer}/components/customer-group-list/customer-group-list.component.d.ts +0 -0
- package/package/customer/components/customer-group-member-list/customer-group-member-list.component.d.ts +44 -0
- package/{customer → package/customer}/components/customer-history/customer-history.component.d.ts +0 -0
- package/{customer → package/customer}/components/customer-list/customer-list.component.d.ts +0 -0
- package/{customer → package/customer}/components/customer-status-label/customer-status-label.component.d.ts +0 -0
- package/{customer → package/customer}/components/select-customer-group-dialog/select-customer-group-dialog.component.d.ts +0 -0
- package/{customer → package/customer}/customer.module.d.ts +0 -0
- package/{customer → package/customer}/customer.routes.d.ts +0 -0
- package/{customer → package/customer}/package.json +0 -0
- package/{customer → package/customer}/providers/routing/customer-resolver.d.ts +0 -0
- package/{customer → package/customer}/public_api.d.ts +0 -0
- package/{customer → package/customer}/vendure-admin-ui-customer.d.ts +0 -0
- package/package/customer/vendure-admin-ui-customer.metadata.json +1 -0
- package/{dashboard → package/dashboard}/components/dashboard/dashboard.component.d.ts +0 -0
- package/{dashboard → package/dashboard}/components/dashboard-widget/dashboard-widget.component.d.ts +0 -0
- package/{dashboard → package/dashboard}/dashboard.module.d.ts +0 -0
- package/{dashboard → package/dashboard}/dashboard.routes.d.ts +0 -0
- package/{dashboard → package/dashboard}/default-widgets.d.ts +0 -0
- package/{dashboard → package/dashboard}/package.json +0 -0
- package/{dashboard → package/dashboard}/public_api.d.ts +0 -0
- package/{dashboard → package/dashboard}/vendure-admin-ui-dashboard.d.ts +0 -0
- package/{dashboard → package/dashboard}/vendure-admin-ui-dashboard.metadata.json +0 -0
- package/{dashboard → package/dashboard}/widgets/latest-orders-widget/latest-orders-widget.component.d.ts +0 -0
- package/{dashboard → package/dashboard}/widgets/order-summary-widget/order-summary-widget.component.d.ts +0 -0
- package/{dashboard → package/dashboard}/widgets/test-widget/test-widget.component.d.ts +0 -0
- package/{dashboard → package/dashboard}/widgets/welcome-widget/welcome-widget.component.d.ts +0 -0
- package/package/esm2015/catalog/catalog.module.js +85 -0
- package/{esm2015 → package/esm2015}/catalog/catalog.routes.js +0 -0
- package/{esm2015 → package/esm2015}/catalog/components/apply-facet-dialog/apply-facet-dialog.component.js +0 -0
- package/{esm2015 → package/esm2015}/catalog/components/asset-detail/asset-detail.component.js +0 -0
- package/{esm2015 → package/esm2015}/catalog/components/asset-list/asset-list.component.js +0 -0
- package/{esm2015 → package/esm2015}/catalog/components/assets/assets.component.js +0 -0
- package/package/esm2015/catalog/components/assign-products-to-channel-dialog/assign-products-to-channel-dialog.component.js +112 -0
- package/package/esm2015/catalog/components/assign-to-channel-dialog/assign-to-channel-dialog.component.js +51 -0
- package/package/esm2015/catalog/components/bulk-add-facet-values-dialog/bulk-add-facet-values-dialog.component.js +89 -0
- package/package/esm2015/catalog/components/bulk-add-facet-values-dialog/bulk-add-facet-values-dialog.graphql.js +69 -0
- package/{esm2015 → package/esm2015}/catalog/components/collection-contents/collection-contents.component.js +0 -0
- package/package/esm2015/catalog/components/collection-detail/collection-detail.component.js +244 -0
- package/package/esm2015/catalog/components/collection-list/collection-list-bulk-actions.js +147 -0
- package/package/esm2015/catalog/components/collection-list/collection-list.component.js +154 -0
- package/{esm2015 → package/esm2015}/catalog/components/collection-tree/array-to-tree.js +0 -0
- package/package/esm2015/catalog/components/collection-tree/collection-tree-node.component.js +126 -0
- package/package/esm2015/catalog/components/collection-tree/collection-tree.component.js +77 -0
- package/{esm2015 → package/esm2015}/catalog/components/confirm-variant-deletion-dialog/confirm-variant-deletion-dialog.component.js +0 -0
- package/{esm2015 → package/esm2015}/catalog/components/facet-detail/facet-detail.component.js +0 -0
- package/package/esm2015/catalog/components/facet-list/facet-list-bulk-actions.js +208 -0
- package/package/esm2015/catalog/components/facet-list/facet-list.component.js +116 -0
- package/{esm2015 → package/esm2015}/catalog/components/generate-product-variants/generate-product-variants.component.js +0 -0
- package/{esm2015 → package/esm2015}/catalog/components/option-value-input/option-value-input.component.js +0 -0
- package/package/esm2015/catalog/components/product-detail/product-detail.component.js +527 -0
- package/package/esm2015/catalog/components/product-list/product-list-bulk-actions.js +173 -0
- package/package/esm2015/catalog/components/product-list/product-list.component.js +158 -0
- package/{esm2015 → package/esm2015}/catalog/components/product-options-editor/product-options-editor.component.js +0 -0
- package/{esm2015 → package/esm2015}/catalog/components/product-variants-editor/product-variants-editor.component.js +0 -0
- package/package/esm2015/catalog/components/product-variants-list/product-variants-list.component.js +214 -0
- package/{esm2015 → package/esm2015}/catalog/components/product-variants-table/product-variants-table.component.js +0 -0
- package/{esm2015 → package/esm2015}/catalog/components/update-product-option-dialog/update-product-option-dialog.component.js +0 -0
- package/{esm2015 → package/esm2015}/catalog/components/variant-price-detail/variant-price-detail.component.js +0 -0
- package/{esm2015 → package/esm2015}/catalog/providers/product-detail/product-detail.service.js +0 -0
- package/{esm2015 → package/esm2015}/catalog/providers/product-detail/replace-last.js +0 -0
- package/{esm2015 → package/esm2015}/catalog/providers/routing/asset-resolver.js +0 -0
- package/package/esm2015/catalog/providers/routing/collection-resolver.js +39 -0
- package/{esm2015 → package/esm2015}/catalog/providers/routing/facet-resolver.js +0 -0
- package/{esm2015 → package/esm2015}/catalog/providers/routing/product-resolver.js +0 -0
- package/{esm2015 → package/esm2015}/catalog/providers/routing/product-variants-resolver.js +0 -0
- package/package/esm2015/catalog/public_api.js +41 -0
- package/{esm2015 → package/esm2015}/catalog/vendure-admin-ui-catalog.js +0 -0
- package/{esm2015 → package/esm2015}/core/app.component.js +0 -0
- package/{esm2015 → package/esm2015}/core/app.component.module.js +0 -0
- package/{esm2015 → package/esm2015}/core/app.config.js +0 -0
- package/{esm2015 → package/esm2015}/core/common/base-detail.component.js +0 -0
- package/{esm2015 → package/esm2015}/core/common/base-entity-resolver.js +0 -0
- package/{esm2015 → package/esm2015}/core/common/base-list.component.js +0 -0
- package/package/esm2015/core/common/component-registry-types.js +2 -0
- package/{esm2015 → package/esm2015}/core/common/deactivate-aware.js +0 -0
- package/{esm2015 → package/esm2015}/core/common/detail-breadcrumb.js +0 -0
- package/package/esm2015/core/common/generated-types.js +987 -0
- package/{esm2015 → package/esm2015}/core/common/introspection-result-wrapper.js +0 -0
- package/package/esm2015/core/common/introspection-result.js +300 -0
- package/{esm2015 → package/esm2015}/core/common/single-search-selection-model.js +0 -0
- package/package/esm2015/core/common/utilities/bulk-action-utils.js +44 -0
- package/{esm2015 → package/esm2015}/core/common/utilities/configurable-operation-utils.js +0 -0
- package/{esm2015 → package/esm2015}/core/common/utilities/create-updated-translatable.js +0 -0
- package/{esm2015 → package/esm2015}/core/common/utilities/find-translation.js +0 -0
- package/{esm2015 → package/esm2015}/core/common/utilities/flatten-facet-values.js +0 -0
- package/{esm2015 → package/esm2015}/core/common/utilities/get-default-ui-language.js +0 -0
- package/{esm2015 → package/esm2015}/core/common/utilities/interpolate-description.js +0 -0
- package/package/esm2015/core/common/utilities/selection-manager.js +96 -0
- package/{esm2015 → package/esm2015}/core/common/utilities/string-to-color.js +0 -0
- package/package/esm2015/core/common/version.js +3 -0
- package/{esm2015 → package/esm2015}/core/components/app-shell/app-shell.component.js +0 -0
- package/package/esm2015/core/components/breadcrumb/breadcrumb.component.js +126 -0
- package/{esm2015 → package/esm2015}/core/components/channel-switcher/channel-switcher.component.js +0 -0
- package/{esm2015 → package/esm2015}/core/components/main-nav/main-nav.component.js +0 -0
- package/{esm2015 → package/esm2015}/core/components/notification/notification.component.js +0 -0
- package/{esm2015 → package/esm2015}/core/components/overlay-host/overlay-host.component.js +0 -0
- package/{esm2015 → package/esm2015}/core/components/theme-switcher/theme-switcher.component.js +0 -0
- package/{esm2015 → package/esm2015}/core/components/ui-language-switcher-dialog/ui-language-switcher-dialog.component.js +0 -0
- package/{esm2015 → package/esm2015}/core/components/user-menu/user-menu.component.js +0 -0
- package/{esm2015 → package/esm2015}/core/core.module.js +0 -0
- package/{esm2015 → package/esm2015}/core/data/check-jobs-link.js +0 -0
- package/{esm2015 → package/esm2015}/core/data/client-state/client-defaults.js +0 -0
- package/{esm2015 → package/esm2015}/core/data/client-state/client-resolvers.js +0 -0
- package/{esm2015 → package/esm2015}/core/data/data.module.js +0 -0
- package/{esm2015 → package/esm2015}/core/data/definitions/administrator-definitions.js +0 -0
- package/{esm2015 → package/esm2015}/core/data/definitions/auth-definitions.js +0 -0
- package/{esm2015 → package/esm2015}/core/data/definitions/client-definitions.js +0 -0
- package/package/esm2015/core/data/definitions/collection-definitions.js +173 -0
- package/{esm2015 → package/esm2015}/core/data/definitions/customer-definitions.js +0 -0
- package/package/esm2015/core/data/definitions/facet-definitions.js +140 -0
- package/package/esm2015/core/data/definitions/order-definitions.js +585 -0
- package/package/esm2015/core/data/definitions/product-definitions.js +759 -0
- package/{esm2015 → package/esm2015}/core/data/definitions/promotion-definitions.js +0 -0
- package/{esm2015 → package/esm2015}/core/data/definitions/settings-definitions.js +0 -0
- package/{esm2015 → package/esm2015}/core/data/definitions/shared-definitions.js +0 -0
- package/{esm2015 → package/esm2015}/core/data/definitions/shipping-definitions.js +0 -0
- package/{esm2015 → package/esm2015}/core/data/omit-typename-link.js +0 -0
- package/{esm2015 → package/esm2015}/core/data/providers/administrator-data.service.js +0 -0
- package/{esm2015 → package/esm2015}/core/data/providers/auth-data.service.js +0 -0
- package/{esm2015 → package/esm2015}/core/data/providers/base-data.service.js +0 -0
- package/{esm2015 → package/esm2015}/core/data/providers/client-data.service.js +0 -0
- package/package/esm2015/core/data/providers/collection-data.service.js +90 -0
- package/package/esm2015/core/data/providers/customer-data.service.js +121 -0
- package/{esm2015 → package/esm2015}/core/data/providers/data.service.js +0 -0
- package/package/esm2015/core/data/providers/facet-data.service.js +76 -0
- package/{esm2015 → package/esm2015}/core/data/providers/fetch-adapter.js +0 -0
- package/{esm2015 → package/esm2015}/core/data/providers/interceptor.js +0 -0
- package/package/esm2015/core/data/providers/order-data.service.js +139 -0
- package/package/esm2015/core/data/providers/product-data.service.js +240 -0
- package/{esm2015 → package/esm2015}/core/data/providers/promotion-data.service.js +0 -0
- package/{esm2015 → package/esm2015}/core/data/providers/settings-data.service.js +0 -0
- package/{esm2015 → package/esm2015}/core/data/providers/shipping-method-data.service.js +0 -0
- package/{esm2015 → package/esm2015}/core/data/query-result.js +0 -0
- package/{esm2015 → package/esm2015}/core/data/server-config.js +0 -0
- package/{esm2015 → package/esm2015}/core/data/utils/add-custom-fields.js +0 -0
- package/{esm2015 → package/esm2015}/core/data/utils/get-server-location.js +0 -0
- package/package/esm2015/core/data/utils/remove-readonly-custom-fields.js +95 -0
- package/{esm2015 → package/esm2015}/core/data/utils/transform-relation-custom-field-inputs.js +0 -0
- package/{esm2015 → package/esm2015}/core/providers/auth/auth.service.js +0 -0
- package/package/esm2015/core/providers/bulk-action-registry/bulk-action-registry.service.js +27 -0
- package/package/esm2015/core/providers/bulk-action-registry/bulk-action-types.js +2 -0
- package/package/esm2015/core/providers/bulk-action-registry/register-bulk-action.js +63 -0
- package/{esm2015 → package/esm2015}/core/providers/component-registry/component-registry.service.js +0 -0
- package/{esm2015 → package/esm2015}/core/providers/custom-detail-component/custom-detail-component-types.js +0 -0
- package/{esm2015 → package/esm2015}/core/providers/custom-detail-component/custom-detail-component.service.js +0 -0
- package/{esm2015 → package/esm2015}/core/providers/custom-field-component/custom-field-component.service.js +0 -0
- package/{esm2015 → package/esm2015}/core/providers/dashboard-widget/dashboard-widget-types.js +0 -0
- package/package/esm2015/core/providers/dashboard-widget/dashboard-widget.service.js +94 -0
- package/{esm2015 → package/esm2015}/core/providers/dashboard-widget/register-dashboard-widget.js +0 -0
- package/{esm2015 → package/esm2015}/core/providers/guard/auth.guard.js +0 -0
- package/{esm2015 → package/esm2015}/core/providers/health-check/health-check.service.js +0 -0
- package/{esm2015 → package/esm2015}/core/providers/i18n/custom-http-loader.js +0 -0
- package/{esm2015 → package/esm2015}/core/providers/i18n/custom-message-format-compiler.js +0 -0
- package/{esm2015 → package/esm2015}/core/providers/i18n/i18n.service.js +0 -0
- package/{esm2015 → package/esm2015}/core/providers/job-queue/job-queue.service.js +0 -0
- package/{esm2015 → package/esm2015}/core/providers/local-storage/local-storage.service.js +0 -0
- package/package/esm2015/core/providers/modal/modal.service.js +101 -0
- package/package/esm2015/core/providers/nav-builder/nav-builder-types.js +2 -0
- package/{esm2015 → package/esm2015}/core/providers/nav-builder/nav-builder.service.js +0 -0
- package/{esm2015 → package/esm2015}/core/providers/notification/notification.service.js +0 -0
- package/{esm2015 → package/esm2015}/core/providers/overlay-host/overlay-host.service.js +0 -0
- package/package/esm2015/core/public_api.js +241 -0
- package/package/esm2015/core/shared/components/action-bar/action-bar.component.js +43 -0
- package/{esm2015 → package/esm2015}/core/shared/components/action-bar-items/action-bar-items.component.js +0 -0
- package/{esm2015 → package/esm2015}/core/shared/components/address-form/address-form.component.js +0 -0
- package/{esm2015 → package/esm2015}/core/shared/components/affixed-input/affixed-input.component.js +0 -0
- package/{esm2015 → package/esm2015}/core/shared/components/affixed-input/percentage-suffix-input.component.js +0 -0
- package/{esm2015 → package/esm2015}/core/shared/components/asset-file-input/asset-file-input.component.js +0 -0
- package/package/esm2015/core/shared/components/asset-gallery/asset-gallery.component.js +84 -0
- package/{esm2015 → package/esm2015}/core/shared/components/asset-picker-dialog/asset-picker-dialog.component.js +0 -0
- package/{esm2015 → package/esm2015}/core/shared/components/asset-preview/asset-preview.component.js +0 -0
- package/{esm2015 → package/esm2015}/core/shared/components/asset-preview-dialog/asset-preview-dialog.component.js +0 -0
- package/{esm2015 → package/esm2015}/core/shared/components/asset-preview-links/asset-preview-links.component.js +0 -0
- package/{esm2015 → package/esm2015}/core/shared/components/asset-search-input/asset-search-input.component.js +0 -0
- package/package/esm2015/core/shared/components/bulk-action-menu/bulk-action-menu.component.js +99 -0
- package/{esm2015 → package/esm2015}/core/shared/components/channel-assignment-control/channel-assignment-control.component.js +0 -0
- package/{esm2015 → package/esm2015}/core/shared/components/channel-badge/channel-badge.component.js +0 -0
- package/{esm2015 → package/esm2015}/core/shared/components/chip/chip.component.js +0 -0
- package/{esm2015 → package/esm2015}/core/shared/components/configurable-input/configurable-input.component.js +0 -0
- package/{esm2015 → package/esm2015}/core/shared/components/currency-input/currency-input.component.js +0 -0
- package/{esm2015 → package/esm2015}/core/shared/components/custom-detail-component-host/custom-detail-component-host.component.js +0 -0
- package/{esm2015 → package/esm2015}/core/shared/components/custom-field-control/custom-field-control.component.js +0 -0
- package/{esm2015 → package/esm2015}/core/shared/components/customer-label/customer-label.component.js +0 -0
- package/{esm2015 → package/esm2015}/core/shared/components/data-table/data-table-column.component.js +0 -0
- package/package/esm2015/core/shared/components/data-table/data-table.component.js +162 -0
- package/{esm2015 → package/esm2015}/core/shared/components/datetime-picker/constants.js +0 -0
- package/{esm2015 → package/esm2015}/core/shared/components/datetime-picker/datetime-picker.component.js +0 -0
- package/{esm2015 → package/esm2015}/core/shared/components/datetime-picker/datetime-picker.service.js +0 -0
- package/{esm2015 → package/esm2015}/core/shared/components/datetime-picker/types.js +0 -0
- package/{esm2015 → package/esm2015}/core/shared/components/dropdown/dropdown-item.directive.js +0 -0
- package/package/esm2015/core/shared/components/dropdown/dropdown-menu.component.js +122 -0
- package/{esm2015 → package/esm2015}/core/shared/components/dropdown/dropdown-trigger.directive.js +0 -0
- package/{esm2015 → package/esm2015}/core/shared/components/dropdown/dropdown.component.js +0 -0
- package/{esm2015 → package/esm2015}/core/shared/components/edit-note-dialog/edit-note-dialog.component.js +0 -0
- package/{esm2015 → package/esm2015}/core/shared/components/empty-placeholder/empty-placeholder.component.js +0 -0
- package/{esm2015 → package/esm2015}/core/shared/components/entity-info/entity-info.component.js +0 -0
- package/{esm2015 → package/esm2015}/core/shared/components/extension-host/extension-host-config.js +0 -0
- package/{esm2015 → package/esm2015}/core/shared/components/extension-host/extension-host.component.js +0 -0
- package/{esm2015 → package/esm2015}/core/shared/components/extension-host/extension-host.service.js +0 -0
- package/{esm2015 → package/esm2015}/core/shared/components/extension-host/host-external-frame.js +0 -0
- package/{esm2015 → package/esm2015}/core/shared/components/facet-value-chip/facet-value-chip.component.js +0 -0
- package/package/esm2015/core/shared/components/facet-value-selector/facet-value-selector.component.js +117 -0
- package/{esm2015 → package/esm2015}/core/shared/components/focal-point-control/focal-point-control.component.js +0 -0
- package/{esm2015 → package/esm2015}/core/shared/components/form-field/form-field-control.directive.js +0 -0
- package/{esm2015 → package/esm2015}/core/shared/components/form-field/form-field.component.js +0 -0
- package/{esm2015 → package/esm2015}/core/shared/components/form-item/form-item.component.js +0 -0
- package/{esm2015 → package/esm2015}/core/shared/components/formatted-address/formatted-address.component.js +0 -0
- package/{esm2015 → package/esm2015}/core/shared/components/help-tooltip/help-tooltip.component.js +0 -0
- package/{esm2015 → package/esm2015}/core/shared/components/history-entry-detail/history-entry-detail.component.js +0 -0
- package/{esm2015 → package/esm2015}/core/shared/components/items-per-page-controls/items-per-page-controls.component.js +0 -0
- package/{esm2015 → package/esm2015}/core/shared/components/labeled-data/labeled-data.component.js +0 -0
- package/package/esm2015/core/shared/components/language-selector/language-selector.component.js +21 -0
- package/{esm2015 → package/esm2015}/core/shared/components/manage-tags-dialog/manage-tags-dialog.component.js +0 -0
- package/{esm2015 → package/esm2015}/core/shared/components/modal-dialog/dialog-buttons.directive.js +0 -0
- package/{esm2015 → package/esm2015}/core/shared/components/modal-dialog/dialog-component-outlet.component.js +0 -0
- package/{esm2015 → package/esm2015}/core/shared/components/modal-dialog/dialog-title.directive.js +0 -0
- package/{esm2015 → package/esm2015}/core/shared/components/modal-dialog/modal-dialog.component.js +0 -0
- package/{esm2015 → package/esm2015}/core/shared/components/object-tree/object-tree.component.js +0 -0
- package/package/esm2015/core/shared/components/order-state-label/order-state-label.component.js +44 -0
- package/{esm2015 → package/esm2015}/core/shared/components/pagination-controls/pagination-controls.component.js +0 -0
- package/{esm2015 → package/esm2015}/core/shared/components/product-multi-selector-dialog/product-multi-selector-dialog.component.js +0 -0
- package/package/esm2015/core/shared/components/product-search-input/product-search-input.component.js +104 -0
- package/package/esm2015/core/shared/components/product-selector/product-selector.component.js +61 -0
- package/package/esm2015/core/shared/components/radio-card/radio-card-fieldset.component.js +57 -0
- package/package/esm2015/core/shared/components/radio-card/radio-card.component.js +54 -0
- package/package/esm2015/core/shared/components/rich-text-editor/external-image-dialog/external-image-dialog.component.js +32 -0
- package/{esm2015 → package/esm2015}/core/shared/components/rich-text-editor/link-dialog/link-dialog.component.js +0 -0
- package/package/esm2015/core/shared/components/rich-text-editor/prosemirror/context-menu/context-menu.component.js +140 -0
- package/package/esm2015/core/shared/components/rich-text-editor/prosemirror/context-menu/context-menu.service.js +45 -0
- package/package/esm2015/core/shared/components/rich-text-editor/prosemirror/custom-nodes.js +60 -0
- package/{esm2015 → package/esm2015}/core/shared/components/rich-text-editor/prosemirror/inputrules.js +0 -0
- package/{esm2015 → package/esm2015}/core/shared/components/rich-text-editor/prosemirror/keymap.js +0 -0
- package/package/esm2015/core/shared/components/rich-text-editor/prosemirror/menu/links.js +69 -0
- package/package/esm2015/core/shared/components/rich-text-editor/prosemirror/menu/menu-common.js +42 -0
- package/package/esm2015/core/shared/components/rich-text-editor/prosemirror/menu/menu-plugin.js +12 -0
- package/package/esm2015/core/shared/components/rich-text-editor/prosemirror/menu/menu.js +247 -0
- package/package/esm2015/core/shared/components/rich-text-editor/prosemirror/menu/sub-menu-with-icon.js +16 -0
- package/package/esm2015/core/shared/components/rich-text-editor/prosemirror/plugins/image-plugin.js +100 -0
- package/{esm2015 → package/esm2015}/core/shared/components/rich-text-editor/prosemirror/plugins/link-select-plugin.js +0 -0
- package/package/esm2015/core/shared/components/rich-text-editor/prosemirror/plugins/raw-editor-plugin.js +97 -0
- package/package/esm2015/core/shared/components/rich-text-editor/prosemirror/plugins/tables-plugin.js +166 -0
- package/package/esm2015/core/shared/components/rich-text-editor/prosemirror/prosemirror.service.js +142 -0
- package/package/esm2015/core/shared/components/rich-text-editor/prosemirror/types.js +2 -0
- package/{esm2015 → package/esm2015}/core/shared/components/rich-text-editor/prosemirror/utils.js +0 -0
- package/package/esm2015/core/shared/components/rich-text-editor/raw-html-dialog/raw-html-dialog.component.js +57 -0
- package/package/esm2015/core/shared/components/rich-text-editor/rich-text-editor.component.js +97 -0
- package/{esm2015 → package/esm2015}/core/shared/components/select-toggle/select-toggle.component.js +0 -0
- package/package/esm2015/core/shared/components/simple-dialog/simple-dialog.component.js +21 -0
- package/{esm2015 → package/esm2015}/core/shared/components/status-badge/status-badge.component.js +0 -0
- package/{esm2015 → package/esm2015}/core/shared/components/tabbed-custom-fields/tabbed-custom-fields.component.js +0 -0
- package/{esm2015 → package/esm2015}/core/shared/components/table-row-action/table-row-action.component.js +0 -0
- package/{esm2015 → package/esm2015}/core/shared/components/tag-selector/tag-selector.component.js +0 -0
- package/{esm2015 → package/esm2015}/core/shared/components/timeline-entry/timeline-entry.component.js +0 -0
- package/{esm2015 → package/esm2015}/core/shared/components/title-input/title-input.component.js +0 -0
- package/{esm2015 → package/esm2015}/core/shared/components/ui-extension-point/ui-extension-point.component.js +0 -0
- package/{esm2015 → package/esm2015}/core/shared/directives/disabled.directive.js +0 -0
- package/{esm2015 → package/esm2015}/core/shared/directives/if-default-channel-active.directive.js +0 -0
- package/{esm2015 → package/esm2015}/core/shared/directives/if-directive-base.js +0 -0
- package/{esm2015 → package/esm2015}/core/shared/directives/if-multichannel.directive.js +0 -0
- package/{esm2015 → package/esm2015}/core/shared/directives/if-permissions.directive.js +0 -0
- package/{esm2015 → package/esm2015}/core/shared/dynamic-form-inputs/boolean-form-input/boolean-form-input.component.js +0 -0
- package/package/esm2015/core/shared/dynamic-form-inputs/code-editor-form-input/base-code-editor-form-input.component.js +59 -0
- package/package/esm2015/core/shared/dynamic-form-inputs/code-editor-form-input/html-editor-form-input.component.js +66 -0
- package/package/esm2015/core/shared/dynamic-form-inputs/code-editor-form-input/json-editor-form-input.component.js +88 -0
- package/{esm2015 → package/esm2015}/core/shared/dynamic-form-inputs/combination-mode-form-input/combination-mode-form-input.component.js +0 -0
- package/{esm2015 → package/esm2015}/core/shared/dynamic-form-inputs/currency-form-input/currency-form-input.component.js +0 -0
- package/{esm2015 → package/esm2015}/core/shared/dynamic-form-inputs/customer-group-form-input/customer-group-form-input.component.js +0 -0
- package/{esm2015 → package/esm2015}/core/shared/dynamic-form-inputs/date-form-input/date-form-input.component.js +0 -0
- package/package/esm2015/core/shared/dynamic-form-inputs/dynamic-form-input/dynamic-form-input.component.js +266 -0
- package/{esm2015 → package/esm2015}/core/shared/dynamic-form-inputs/facet-value-form-input/facet-value-form-input.component.js +0 -0
- package/{esm2015 → package/esm2015}/core/shared/dynamic-form-inputs/number-form-input/number-form-input.component.js +0 -0
- package/{esm2015 → package/esm2015}/core/shared/dynamic-form-inputs/password-form-input/password-form-input.component.js +0 -0
- package/{esm2015 → package/esm2015}/core/shared/dynamic-form-inputs/product-multi-selector-form-input/product-multi-selector-form-input.component.js +0 -0
- package/{esm2015 → package/esm2015}/core/shared/dynamic-form-inputs/product-selector-form-input/product-selector-form-input.component.js +0 -0
- package/package/esm2015/core/shared/dynamic-form-inputs/register-dynamic-input-components.js +136 -0
- package/{esm2015 → package/esm2015}/core/shared/dynamic-form-inputs/relation-form-input/asset/relation-asset-input.component.js +0 -0
- package/{esm2015 → package/esm2015}/core/shared/dynamic-form-inputs/relation-form-input/customer/relation-customer-input.component.js +0 -0
- package/{esm2015 → package/esm2015}/core/shared/dynamic-form-inputs/relation-form-input/generic/relation-generic-input.component.js +0 -0
- package/{esm2015 → package/esm2015}/core/shared/dynamic-form-inputs/relation-form-input/product/relation-product-input.component.js +0 -0
- package/{esm2015 → package/esm2015}/core/shared/dynamic-form-inputs/relation-form-input/product-variant/relation-product-variant-input.component.js +0 -0
- package/{esm2015 → package/esm2015}/core/shared/dynamic-form-inputs/relation-form-input/relation-card/relation-card.component.js +0 -0
- package/{esm2015 → package/esm2015}/core/shared/dynamic-form-inputs/relation-form-input/relation-form-input.component.js +0 -0
- package/{esm2015 → package/esm2015}/core/shared/dynamic-form-inputs/relation-form-input/relation-selector-dialog/relation-selector-dialog.component.js +0 -0
- package/{esm2015 → package/esm2015}/core/shared/dynamic-form-inputs/rich-text-form-input/rich-text-form-input.component.js +0 -0
- package/{esm2015 → package/esm2015}/core/shared/dynamic-form-inputs/select-form-input/select-form-input.component.js +0 -0
- package/{esm2015 → package/esm2015}/core/shared/dynamic-form-inputs/text-form-input/text-form-input.component.js +0 -0
- package/{esm2015 → package/esm2015}/core/shared/dynamic-form-inputs/textarea-form-input/textarea-form-input.component.js +0 -0
- package/{esm2015 → package/esm2015}/core/shared/pipes/asset-preview.pipe.js +0 -0
- package/{esm2015 → package/esm2015}/core/shared/pipes/channel-label.pipe.js +0 -0
- package/{esm2015 → package/esm2015}/core/shared/pipes/custom-field-label.pipe.js +0 -0
- package/{esm2015 → package/esm2015}/core/shared/pipes/duration.pipe.js +0 -0
- package/{esm2015 → package/esm2015}/core/shared/pipes/file-size.pipe.js +0 -0
- package/{esm2015 → package/esm2015}/core/shared/pipes/has-permission.pipe.js +0 -0
- package/{esm2015 → package/esm2015}/core/shared/pipes/locale-base.pipe.js +0 -0
- package/{esm2015 → package/esm2015}/core/shared/pipes/locale-currency-name.pipe.js +0 -0
- package/{esm2015 → package/esm2015}/core/shared/pipes/locale-currency.pipe.js +0 -0
- package/{esm2015 → package/esm2015}/core/shared/pipes/locale-date.pipe.js +0 -0
- package/{esm2015 → package/esm2015}/core/shared/pipes/locale-language-name.pipe.js +0 -0
- package/{esm2015 → package/esm2015}/core/shared/pipes/locale-region-name.pipe.js +0 -0
- package/{esm2015 → package/esm2015}/core/shared/pipes/sentence-case.pipe.js +0 -0
- package/{esm2015 → package/esm2015}/core/shared/pipes/sort.pipe.js +0 -0
- package/package/esm2015/core/shared/pipes/state-i18n-token.pipe.js +47 -0
- package/{esm2015 → package/esm2015}/core/shared/pipes/string-to-color.pipe.js +0 -0
- package/{esm2015 → package/esm2015}/core/shared/pipes/time-ago.pipe.js +0 -0
- package/{esm2015 → package/esm2015}/core/shared/providers/routing/can-deactivate-detail-guard.js +0 -0
- package/package/esm2015/core/shared/shared.module.js +287 -0
- package/{esm2015 → package/esm2015}/core/validators/unicode-pattern.validator.js +0 -0
- package/{esm2015 → package/esm2015}/core/vendure-admin-ui-core.js +0 -0
- package/{esm2015 → package/esm2015}/customer/components/add-customer-to-group-dialog/add-customer-to-group-dialog.component.js +0 -0
- package/{esm2015 → package/esm2015}/customer/components/address-card/address-card.component.js +0 -0
- package/{esm2015 → package/esm2015}/customer/components/address-detail-dialog/address-detail-dialog.component.js +0 -0
- package/{esm2015 → package/esm2015}/customer/components/customer-detail/customer-detail.component.js +0 -0
- package/{esm2015 → package/esm2015}/customer/components/customer-group-detail-dialog/customer-group-detail-dialog.component.js +0 -0
- package/package/esm2015/customer/components/customer-group-list/customer-group-list.component.js +198 -0
- package/package/esm2015/customer/components/customer-group-member-list/customer-group-member-list.component.js +101 -0
- package/{esm2015 → package/esm2015}/customer/components/customer-history/customer-history.component.js +0 -0
- package/package/esm2015/customer/components/customer-list/customer-list.component.js +81 -0
- package/{esm2015 → package/esm2015}/customer/components/customer-status-label/customer-status-label.component.js +0 -0
- package/{esm2015 → package/esm2015}/customer/components/select-customer-group-dialog/select-customer-group-dialog.component.js +0 -0
- package/{esm2015 → package/esm2015}/customer/customer.module.js +0 -0
- package/{esm2015 → package/esm2015}/customer/customer.routes.js +0 -0
- package/{esm2015 → package/esm2015}/customer/providers/routing/customer-resolver.js +0 -0
- package/{esm2015 → package/esm2015}/customer/public_api.js +0 -0
- package/{esm2015 → package/esm2015}/customer/vendure-admin-ui-customer.js +0 -0
- package/{esm2015 → package/esm2015}/dashboard/components/dashboard/dashboard.component.js +0 -0
- package/{esm2015 → package/esm2015}/dashboard/components/dashboard-widget/dashboard-widget.component.js +0 -0
- package/package/esm2015/dashboard/dashboard.module.js +29 -0
- package/{esm2015 → package/esm2015}/dashboard/dashboard.routes.js +0 -0
- package/{esm2015 → package/esm2015}/dashboard/default-widgets.js +0 -0
- package/{esm2015 → package/esm2015}/dashboard/public_api.js +0 -0
- package/{esm2015 → package/esm2015}/dashboard/vendure-admin-ui-dashboard.js +0 -0
- package/{esm2015 → package/esm2015}/dashboard/widgets/latest-orders-widget/latest-orders-widget.component.js +0 -0
- package/{esm2015 → package/esm2015}/dashboard/widgets/order-summary-widget/order-summary-widget.component.js +0 -0
- package/{esm2015 → package/esm2015}/dashboard/widgets/test-widget/test-widget.component.js +0 -0
- package/{esm2015 → package/esm2015}/dashboard/widgets/welcome-widget/welcome-widget.component.js +0 -0
- package/{esm2015 → package/esm2015}/login/components/login/login.component.js +0 -0
- package/{esm2015 → package/esm2015}/login/login.module.js +0 -0
- package/{esm2015 → package/esm2015}/login/login.routes.js +0 -0
- package/{esm2015 → package/esm2015}/login/providers/login.guard.js +0 -0
- package/{esm2015 → package/esm2015}/login/public_api.js +0 -0
- package/{esm2015 → package/esm2015}/login/vendure-admin-ui-login.js +0 -0
- package/{esm2015 → package/esm2015}/marketing/components/promotion-detail/promotion-detail.component.js +0 -0
- package/{esm2015 → package/esm2015}/marketing/components/promotion-list/promotion-list.component.js +0 -0
- package/{esm2015 → package/esm2015}/marketing/marketing.module.js +0 -0
- package/{esm2015 → package/esm2015}/marketing/marketing.routes.js +0 -0
- package/{esm2015 → package/esm2015}/marketing/providers/routing/promotion-resolver.js +0 -0
- package/{esm2015 → package/esm2015}/marketing/public_api.js +0 -0
- package/{esm2015 → package/esm2015}/marketing/vendure-admin-ui-marketing.js +0 -0
- package/{esm2015 → package/esm2015}/order/components/add-manual-payment-dialog/add-manual-payment-dialog.component.js +0 -0
- package/{esm2015 → package/esm2015}/order/components/cancel-order-dialog/cancel-order-dialog.component.js +0 -0
- package/package/esm2015/order/components/coupon-code-selector/coupon-code-selector.component.js +42 -0
- package/package/esm2015/order/components/draft-order-detail/draft-order-detail.component.js +195 -0
- package/package/esm2015/order/components/draft-order-variant-selector/draft-order-variant-selector.component.js +59 -0
- package/{esm2015 → package/esm2015}/order/components/fulfill-order-dialog/fulfill-order-dialog.component.js +0 -0
- package/{esm2015 → package/esm2015}/order/components/fulfillment-card/fulfillment-card.component.js +0 -0
- package/{esm2015 → package/esm2015}/order/components/fulfillment-detail/fulfillment-detail.component.js +0 -0
- package/{esm2015 → package/esm2015}/order/components/fulfillment-state-label/fulfillment-state-label.component.js +0 -0
- package/{esm2015 → package/esm2015}/order/components/line-fulfillment/line-fulfillment.component.js +0 -0
- package/{esm2015 → package/esm2015}/order/components/line-refunds/line-refunds.component.js +0 -0
- package/{esm2015 → package/esm2015}/order/components/modification-detail/modification-detail.component.js +0 -0
- package/{esm2015 → package/esm2015}/order/components/order-custom-fields-card/order-custom-fields-card.component.js +0 -0
- package/package/esm2015/order/components/order-detail/order-detail.component.js +550 -0
- package/package/esm2015/order/components/order-editor/order-editor.component.js +375 -0
- package/{esm2015 → package/esm2015}/order/components/order-edits-preview-dialog/order-edits-preview-dialog.component.js +0 -0
- package/{esm2015 → package/esm2015}/order/components/order-history/order-history.component.js +0 -0
- package/package/esm2015/order/components/order-list/order-list.component.js +211 -0
- package/{esm2015 → package/esm2015}/order/components/order-payment-card/order-payment-card.component.js +0 -0
- package/{esm2015 → package/esm2015}/order/components/order-process-graph/constants.js +0 -0
- package/{esm2015 → package/esm2015}/order/components/order-process-graph/order-process-edge.component.js +0 -0
- package/{esm2015 → package/esm2015}/order/components/order-process-graph/order-process-graph.component.js +0 -0
- package/{esm2015 → package/esm2015}/order/components/order-process-graph/order-process-node.component.js +0 -0
- package/{esm2015 → package/esm2015}/order/components/order-process-graph/types.js +0 -0
- package/{esm2015 → package/esm2015}/order/components/order-process-graph-dialog/order-process-graph-dialog.component.js +0 -0
- package/{esm2015 → package/esm2015}/order/components/order-state-select-dialog/order-state-select-dialog.component.js +0 -0
- package/package/esm2015/order/components/order-table/order-table.component.js +87 -0
- package/{esm2015 → package/esm2015}/order/components/payment-detail/payment-detail.component.js +0 -0
- package/{esm2015 → package/esm2015}/order/components/payment-state-label/payment-state-label.component.js +0 -0
- package/{esm2015 → package/esm2015}/order/components/refund-order-dialog/refund-order-dialog.component.js +0 -0
- package/{esm2015 → package/esm2015}/order/components/refund-state-label/refund-state-label.component.js +0 -0
- package/package/esm2015/order/components/select-address-dialog/select-address-dialog.component.js +91 -0
- package/package/esm2015/order/components/select-address-dialog/select-address-dialog.graphql.js +14 -0
- package/package/esm2015/order/components/select-customer-dialog/select-customer-dialog.component.js +59 -0
- package/package/esm2015/order/components/select-shipping-method-dialog/select-shipping-method-dialog.component.js +30 -0
- package/{esm2015 → package/esm2015}/order/components/settle-refund-dialog/settle-refund-dialog.component.js +0 -0
- package/{esm2015 → package/esm2015}/order/components/simple-item-list/simple-item-list.component.js +0 -0
- package/package/esm2015/order/order.module.js +82 -0
- package/package/esm2015/order/order.routes.js +73 -0
- package/{esm2015 → package/esm2015}/order/providers/order-transition.service.js +0 -0
- package/package/esm2015/order/providers/routing/order-resolver.js +50 -0
- package/package/esm2015/order/providers/routing/order.guard.js +41 -0
- package/package/esm2015/order/public_api.js +44 -0
- package/{esm2015 → package/esm2015}/order/vendure-admin-ui-order.js +0 -0
- package/{esm2015 → package/esm2015}/public_api.js +0 -0
- package/{esm2015 → package/esm2015}/settings/components/add-country-to-zone-dialog/add-country-to-zone-dialog.component.js +0 -0
- package/{esm2015 → package/esm2015}/settings/components/admin-detail/admin-detail.component.js +0 -0
- package/{esm2015 → package/esm2015}/settings/components/administrator-list/administrator-list.component.js +0 -0
- package/{esm2015 → package/esm2015}/settings/components/channel-detail/channel-detail.component.js +0 -0
- package/{esm2015 → package/esm2015}/settings/components/channel-list/channel-list.component.js +0 -0
- package/{esm2015 → package/esm2015}/settings/components/country-detail/country-detail.component.js +0 -0
- package/package/esm2015/settings/components/country-list/country-list.component.js +82 -0
- package/{esm2015 → package/esm2015}/settings/components/global-settings/global-settings.component.js +0 -0
- package/{esm2015 → package/esm2015}/settings/components/payment-method-detail/payment-method-detail.component.js +0 -0
- package/{esm2015 → package/esm2015}/settings/components/payment-method-list/payment-method-list.component.js +0 -0
- package/{esm2015 → package/esm2015}/settings/components/permission-grid/permission-grid.component.js +0 -0
- package/package/esm2015/settings/components/profile/profile.component.js +82 -0
- package/{esm2015 → package/esm2015}/settings/components/role-detail/role-detail.component.js +0 -0
- package/{esm2015 → package/esm2015}/settings/components/role-list/role-list.component.js +0 -0
- package/{esm2015 → package/esm2015}/settings/components/shipping-eligibility-test-result/shipping-eligibility-test-result.component.js +0 -0
- package/{esm2015 → package/esm2015}/settings/components/shipping-method-detail/shipping-method-detail.component.js +0 -0
- package/{esm2015 → package/esm2015}/settings/components/shipping-method-list/shipping-method-list.component.js +0 -0
- package/{esm2015 → package/esm2015}/settings/components/shipping-method-test-result/shipping-method-test-result.component.js +0 -0
- package/{esm2015 → package/esm2015}/settings/components/tax-category-detail/tax-category-detail.component.js +0 -0
- package/{esm2015 → package/esm2015}/settings/components/tax-category-list/tax-category-list.component.js +0 -0
- package/{esm2015 → package/esm2015}/settings/components/tax-rate-detail/tax-rate-detail.component.js +0 -0
- package/{esm2015 → package/esm2015}/settings/components/tax-rate-list/tax-rate-list.component.js +0 -0
- package/{esm2015 → package/esm2015}/settings/components/test-address-form/test-address-form.component.js +0 -0
- package/{esm2015 → package/esm2015}/settings/components/test-order-builder/test-order-builder.component.js +0 -0
- package/{esm2015 → package/esm2015}/settings/components/zone-detail-dialog/zone-detail-dialog.component.js +0 -0
- package/package/esm2015/settings/components/zone-list/zone-list.component.js +160 -0
- package/{esm2015 → package/esm2015}/settings/components/zone-member-list/zone-member-controls.directive.js +0 -0
- package/{esm2015 → package/esm2015}/settings/components/zone-member-list/zone-member-list-header.directive.js +0 -0
- package/package/esm2015/settings/components/zone-member-list/zone-member-list.component.js +63 -0
- package/{esm2015 → package/esm2015}/settings/providers/routing/administrator-resolver.js +0 -0
- package/{esm2015 → package/esm2015}/settings/providers/routing/channel-resolver.js +0 -0
- package/{esm2015 → package/esm2015}/settings/providers/routing/country-resolver.js +0 -0
- package/{esm2015 → package/esm2015}/settings/providers/routing/global-settings-resolver.js +0 -0
- package/{esm2015 → package/esm2015}/settings/providers/routing/payment-method-resolver.js +0 -0
- package/{esm2015 → package/esm2015}/settings/providers/routing/profile-resolver.js +0 -0
- package/{esm2015 → package/esm2015}/settings/providers/routing/role-resolver.js +0 -0
- package/{esm2015 → package/esm2015}/settings/providers/routing/shipping-method-resolver.js +0 -0
- package/{esm2015 → package/esm2015}/settings/providers/routing/tax-category-resolver.js +0 -0
- package/{esm2015 → package/esm2015}/settings/providers/routing/tax-rate-resolver.js +0 -0
- package/{esm2015 → package/esm2015}/settings/public_api.js +0 -0
- package/{esm2015 → package/esm2015}/settings/settings.module.js +0 -0
- package/{esm2015 → package/esm2015}/settings/settings.routes.js +0 -0
- package/{esm2015 → package/esm2015}/settings/vendure-admin-ui-settings.js +0 -0
- package/package/esm2015/system/components/health-check/health-check.component.js +19 -0
- package/{esm2015 → package/esm2015}/system/components/job-list/job-list.component.js +0 -0
- package/{esm2015 → package/esm2015}/system/components/job-state-label/job-state-label.component.js +0 -0
- package/{esm2015 → package/esm2015}/system/public_api.js +0 -0
- package/{esm2015 → package/esm2015}/system/system.module.js +0 -0
- package/{esm2015 → package/esm2015}/system/system.routes.js +0 -0
- package/{esm2015 → package/esm2015}/system/vendure-admin-ui-system.js +0 -0
- package/{esm2015 → package/esm2015}/vendure-admin-ui.js +0 -0
- package/package/fesm2015/vendure-admin-ui-catalog.js +4768 -0
- package/package/fesm2015/vendure-admin-ui-catalog.js.map +1 -0
- package/package/fesm2015/vendure-admin-ui-core.js +17900 -0
- package/package/fesm2015/vendure-admin-ui-core.js.map +1 -0
- package/package/fesm2015/vendure-admin-ui-customer.js +1184 -0
- package/package/fesm2015/vendure-admin-ui-customer.js.map +1 -0
- package/package/fesm2015/vendure-admin-ui-dashboard.js +375 -0
- package/package/fesm2015/vendure-admin-ui-dashboard.js.map +1 -0
- package/{fesm2015 → package/fesm2015}/vendure-admin-ui-login.js +0 -0
- package/{fesm2015 → package/fesm2015}/vendure-admin-ui-login.js.map +0 -0
- package/{fesm2015 → package/fesm2015}/vendure-admin-ui-marketing.js +0 -0
- package/{fesm2015 → package/fesm2015}/vendure-admin-ui-marketing.js.map +0 -0
- package/package/fesm2015/vendure-admin-ui-order.js +3155 -0
- package/package/fesm2015/vendure-admin-ui-order.js.map +1 -0
- package/package/fesm2015/vendure-admin-ui-settings.js +2977 -0
- package/package/fesm2015/vendure-admin-ui-settings.js.map +1 -0
- package/package/fesm2015/vendure-admin-ui-system.js +171 -0
- package/{fesm2015 → package/fesm2015}/vendure-admin-ui-system.js.map +0 -0
- package/{fesm2015 → package/fesm2015}/vendure-admin-ui.js +0 -0
- package/{fesm2015 → package/fesm2015}/vendure-admin-ui.js.map +0 -0
- package/{login → package/login}/components/login/login.component.d.ts +0 -0
- package/{login → package/login}/login.module.d.ts +0 -0
- package/{login → package/login}/login.routes.d.ts +0 -0
- package/{login → package/login}/package.json +0 -0
- package/{login → package/login}/providers/login.guard.d.ts +0 -0
- package/{login → package/login}/public_api.d.ts +0 -0
- package/{login → package/login}/vendure-admin-ui-login.d.ts +0 -0
- package/{login → package/login}/vendure-admin-ui-login.metadata.json +0 -0
- package/{marketing → package/marketing}/components/promotion-detail/promotion-detail.component.d.ts +0 -0
- package/{marketing → package/marketing}/components/promotion-list/promotion-list.component.d.ts +0 -0
- package/{marketing → package/marketing}/marketing.module.d.ts +0 -0
- package/{marketing → package/marketing}/marketing.routes.d.ts +0 -0
- package/{marketing → package/marketing}/package.json +0 -0
- package/{marketing → package/marketing}/providers/routing/promotion-resolver.d.ts +0 -0
- package/{marketing → package/marketing}/public_api.d.ts +0 -0
- package/{marketing → package/marketing}/vendure-admin-ui-marketing.d.ts +0 -0
- package/{marketing → package/marketing}/vendure-admin-ui-marketing.metadata.json +0 -0
- package/{order → package/order}/components/add-manual-payment-dialog/add-manual-payment-dialog.component.d.ts +0 -0
- package/{order → package/order}/components/cancel-order-dialog/cancel-order-dialog.component.d.ts +0 -0
- package/package/order/components/coupon-code-selector/coupon-code-selector.component.d.ts +18 -0
- package/package/order/components/draft-order-detail/draft-order-detail.component.d.ts +49 -0
- package/package/order/components/draft-order-variant-selector/draft-order-variant-selector.component.d.ts +21 -0
- package/{order → package/order}/components/fulfill-order-dialog/fulfill-order-dialog.component.d.ts +0 -0
- package/{order → package/order}/components/fulfillment-card/fulfillment-card.component.d.ts +0 -0
- package/{order → package/order}/components/fulfillment-detail/fulfillment-detail.component.d.ts +0 -0
- package/{order → package/order}/components/fulfillment-state-label/fulfillment-state-label.component.d.ts +0 -0
- package/{order → package/order}/components/line-fulfillment/line-fulfillment.component.d.ts +0 -0
- package/{order → package/order}/components/line-refunds/line-refunds.component.d.ts +0 -0
- package/{order → package/order}/components/modification-detail/modification-detail.component.d.ts +0 -0
- package/{order → package/order}/components/order-custom-fields-card/order-custom-fields-card.component.d.ts +0 -0
- package/{order → package/order}/components/order-detail/order-detail.component.d.ts +0 -0
- package/package/order/components/order-editor/order-editor.component.d.ts +71 -0
- package/{order → package/order}/components/order-edits-preview-dialog/order-edits-preview-dialog.component.d.ts +0 -0
- package/{order → package/order}/components/order-history/order-history.component.d.ts +0 -0
- package/package/order/components/order-list/order-list.component.d.ts +35 -0
- package/{order → package/order}/components/order-payment-card/order-payment-card.component.d.ts +0 -0
- package/{order → package/order}/components/order-process-graph/constants.d.ts +0 -0
- package/{order → package/order}/components/order-process-graph/order-process-edge.component.d.ts +0 -0
- package/{order → package/order}/components/order-process-graph/order-process-graph.component.d.ts +0 -0
- package/{order → package/order}/components/order-process-graph/order-process-node.component.d.ts +0 -0
- package/{order → package/order}/components/order-process-graph/types.d.ts +0 -0
- package/{order → package/order}/components/order-process-graph-dialog/order-process-graph-dialog.component.d.ts +0 -0
- package/{order → package/order}/components/order-state-select-dialog/order-state-select-dialog.component.d.ts +0 -0
- package/package/order/components/order-table/order-table.component.d.ts +37 -0
- package/{order → package/order}/components/payment-detail/payment-detail.component.d.ts +0 -0
- package/{order → package/order}/components/payment-state-label/payment-state-label.component.d.ts +0 -0
- package/{order → package/order}/components/refund-order-dialog/refund-order-dialog.component.d.ts +0 -0
- package/{order → package/order}/components/refund-state-label/refund-state-label.component.d.ts +0 -0
- package/package/order/components/select-address-dialog/select-address-dialog.component.d.ts +24 -0
- package/package/order/components/select-address-dialog/select-address-dialog.graphql.d.ts +1 -0
- package/package/order/components/select-customer-dialog/select-customer-dialog.component.d.ts +22 -0
- package/package/order/components/select-shipping-method-dialog/select-shipping-method-dialog.component.d.ts +16 -0
- package/{order → package/order}/components/settle-refund-dialog/settle-refund-dialog.component.d.ts +0 -0
- package/{order → package/order}/components/simple-item-list/simple-item-list.component.d.ts +0 -0
- package/{order → package/order}/order.module.d.ts +0 -0
- package/{order → package/order}/order.routes.d.ts +0 -0
- package/{order → package/order}/package.json +0 -0
- package/{order → package/order}/providers/order-transition.service.d.ts +0 -0
- package/package/order/providers/routing/order-resolver.d.ts +13 -0
- package/package/order/providers/routing/order.guard.d.ts +9 -0
- package/package/order/public_api.d.ts +42 -0
- package/{order → package/order}/vendure-admin-ui-order.d.ts +0 -0
- package/package/order/vendure-admin-ui-order.metadata.json +1 -0
- package/package/package.json +59 -0
- package/{public_api.d.ts → package/public_api.d.ts} +0 -0
- package/{settings → package/settings}/components/add-country-to-zone-dialog/add-country-to-zone-dialog.component.d.ts +0 -0
- package/{settings → package/settings}/components/admin-detail/admin-detail.component.d.ts +0 -0
- package/{settings → package/settings}/components/administrator-list/administrator-list.component.d.ts +0 -0
- package/{settings → package/settings}/components/channel-detail/channel-detail.component.d.ts +0 -0
- package/{settings → package/settings}/components/channel-list/channel-list.component.d.ts +0 -0
- package/{settings → package/settings}/components/country-detail/country-detail.component.d.ts +0 -0
- package/{settings → package/settings}/components/country-list/country-list.component.d.ts +0 -0
- package/{settings → package/settings}/components/global-settings/global-settings.component.d.ts +0 -0
- package/{settings → package/settings}/components/payment-method-detail/payment-method-detail.component.d.ts +0 -0
- package/{settings → package/settings}/components/payment-method-list/payment-method-list.component.d.ts +0 -0
- package/{settings → package/settings}/components/permission-grid/permission-grid.component.d.ts +0 -0
- package/{settings → package/settings}/components/profile/profile.component.d.ts +0 -0
- package/{settings → package/settings}/components/role-detail/role-detail.component.d.ts +0 -0
- package/{settings → package/settings}/components/role-list/role-list.component.d.ts +0 -0
- package/{settings → package/settings}/components/shipping-eligibility-test-result/shipping-eligibility-test-result.component.d.ts +0 -0
- package/{settings → package/settings}/components/shipping-method-detail/shipping-method-detail.component.d.ts +0 -0
- package/{settings → package/settings}/components/shipping-method-list/shipping-method-list.component.d.ts +0 -0
- package/{settings → package/settings}/components/shipping-method-test-result/shipping-method-test-result.component.d.ts +0 -0
- package/{settings → package/settings}/components/tax-category-detail/tax-category-detail.component.d.ts +0 -0
- package/{settings → package/settings}/components/tax-category-list/tax-category-list.component.d.ts +0 -0
- package/{settings → package/settings}/components/tax-rate-detail/tax-rate-detail.component.d.ts +0 -0
- package/{settings → package/settings}/components/tax-rate-list/tax-rate-list.component.d.ts +0 -0
- package/{settings → package/settings}/components/test-address-form/test-address-form.component.d.ts +0 -0
- package/{settings → package/settings}/components/test-order-builder/test-order-builder.component.d.ts +0 -0
- package/{settings → package/settings}/components/zone-detail-dialog/zone-detail-dialog.component.d.ts +0 -0
- package/{settings → package/settings}/components/zone-list/zone-list.component.d.ts +0 -0
- package/{settings → package/settings}/components/zone-member-list/zone-member-controls.directive.d.ts +0 -0
- package/{settings → package/settings}/components/zone-member-list/zone-member-list-header.directive.d.ts +0 -0
- package/package/settings/components/zone-member-list/zone-member-list.component.d.ts +23 -0
- package/{settings → package/settings}/package.json +0 -0
- package/{settings → package/settings}/providers/routing/administrator-resolver.d.ts +0 -0
- package/{settings → package/settings}/providers/routing/channel-resolver.d.ts +0 -0
- package/{settings → package/settings}/providers/routing/country-resolver.d.ts +0 -0
- package/{settings → package/settings}/providers/routing/global-settings-resolver.d.ts +0 -0
- package/{settings → package/settings}/providers/routing/payment-method-resolver.d.ts +0 -0
- package/{settings → package/settings}/providers/routing/profile-resolver.d.ts +0 -0
- package/{settings → package/settings}/providers/routing/role-resolver.d.ts +0 -0
- package/{settings → package/settings}/providers/routing/shipping-method-resolver.d.ts +0 -0
- package/{settings → package/settings}/providers/routing/tax-category-resolver.d.ts +0 -0
- package/{settings → package/settings}/providers/routing/tax-rate-resolver.d.ts +0 -0
- package/{settings → package/settings}/public_api.d.ts +0 -0
- package/{settings → package/settings}/settings.module.d.ts +0 -0
- package/{settings → package/settings}/settings.routes.d.ts +0 -0
- package/{settings → package/settings}/vendure-admin-ui-settings.d.ts +0 -0
- package/package/settings/vendure-admin-ui-settings.metadata.json +1 -0
- package/{static → package/static}/assets/.gitkeep +0 -0
- package/{static → package/static}/assets/logo-300px.png +0 -0
- package/{static → package/static}/assets/logo-75px.png +0 -0
- package/{static → package/static}/favicon.ico +0 -0
- package/package/static/i18n-messages/cs.json +721 -0
- package/package/static/i18n-messages/de.json +721 -0
- package/package/static/i18n-messages/en.json +721 -0
- package/package/static/i18n-messages/es.json +721 -0
- package/package/static/i18n-messages/fr.json +721 -0
- package/package/static/i18n-messages/it.json +721 -0
- package/package/static/i18n-messages/pl.json +721 -0
- package/package/static/i18n-messages/pt_BR.json +721 -0
- package/package/static/i18n-messages/pt_PT.json +721 -0
- package/package/static/i18n-messages/ru.json +721 -0
- package/package/static/i18n-messages/uk.json +721 -0
- package/package/static/i18n-messages/zh_Hans.json +721 -0
- package/package/static/i18n-messages/zh_Hant.json +721 -0
- package/{static → package/static}/index.html +0 -0
- package/{static → package/static}/polyfills.ts +0 -0
- package/{static → package/static}/styles/_mixins.scss +0 -0
- package/{static → package/static}/styles/_variables.scss +0 -0
- package/package/static/styles/global/_forms.scss +148 -0
- package/package/static/styles/global/_overrides.scss +72 -0
- package/{static → package/static}/styles/global/_sass-overrides.scss +0 -0
- package/package/static/styles/global/_utilities.scss +131 -0
- package/{static → package/static}/styles/styles.scss +0 -0
- package/{static → package/static}/styles/theme/dark.scss +0 -0
- package/{static → package/static}/styles/theme/default.scss +0 -0
- package/{static → package/static}/styles/ui-extension-theme.scss +0 -0
- package/package/static/theme.min.css +8 -0
- package/{static → package/static}/vendure-ui-config.json +0 -0
- package/{system → package/system}/components/health-check/health-check.component.d.ts +0 -0
- package/{system → package/system}/components/job-list/job-list.component.d.ts +0 -0
- package/{system → package/system}/components/job-state-label/job-state-label.component.d.ts +0 -0
- package/{system → package/system}/package.json +0 -0
- package/{system → package/system}/public_api.d.ts +0 -0
- package/{system → package/system}/system.module.d.ts +0 -0
- package/{system → package/system}/system.routes.d.ts +0 -0
- package/{system → package/system}/vendure-admin-ui-system.d.ts +0 -0
- package/package/system/vendure-admin-ui-system.metadata.json +1 -0
- package/{vendure-admin-ui.d.ts → package/vendure-admin-ui.d.ts} +0 -0
- package/{vendure-admin-ui.metadata.json → package/vendure-admin-ui.metadata.json} +0 -0
- package/package.json +59 -21
- package/tsconfig.json +61 -0
- package/tsconfig.lib.json +26 -0
- package/tsconfig.lib.prod.json +14 -0
- package/tslint.json +33 -0
- package/LICENSE +0 -9
- package/bundles/vendure-admin-ui-catalog.umd.js +0 -4861
- package/bundles/vendure-admin-ui-catalog.umd.js.map +0 -1
- package/bundles/vendure-admin-ui-core.umd.js +0 -15291
- package/bundles/vendure-admin-ui-core.umd.js.map +0 -1
- package/bundles/vendure-admin-ui-customer.umd.js +0 -1679
- package/bundles/vendure-admin-ui-customer.umd.js.map +0 -1
- package/bundles/vendure-admin-ui-dashboard.umd.js +0 -757
- package/bundles/vendure-admin-ui-dashboard.umd.js.map +0 -1
- package/bundles/vendure-admin-ui-order.umd.js +0 -3422
- package/bundles/vendure-admin-ui-order.umd.js.map +0 -1
- package/bundles/vendure-admin-ui-settings.umd.js +0 -3699
- package/bundles/vendure-admin-ui-settings.umd.js.map +0 -1
- package/bundles/vendure-admin-ui-system.umd.js +0 -524
- package/catalog/catalog.module.d.ts +0 -2
- package/catalog/components/collection-list/collection-list.component.d.ts +0 -33
- package/catalog/components/collection-tree/collection-tree-node.component.d.ts +0 -36
- package/catalog/components/collection-tree/collection-tree.component.d.ts +0 -35
- package/catalog/components/facet-list/facet-list.component.d.ts +0 -24
- package/catalog/components/product-list/product-list.component.d.ts +0 -29
- package/catalog/public_api.d.ts +0 -33
- package/catalog/vendure-admin-ui-catalog.metadata.json +0 -1
- package/core/common/component-registry-types.d.ts +0 -56
- package/core/common/generated-types.d.ts +0 -9142
- package/core/common/utilities/selection-manager.d.ts +0 -23
- package/core/common/version.d.ts +0 -1
- package/core/data/definitions/collection-definitions.d.ts +0 -10
- package/core/data/definitions/facet-definitions.d.ts +0 -10
- package/core/data/definitions/order-definitions.d.ts +0 -27
- package/core/data/definitions/product-definitions.d.ts +0 -45
- package/core/data/providers/collection-data.service.d.ts +0 -25
- package/core/data/providers/facet-data.service.d.ts +0 -21
- package/core/data/providers/order-data.service.d.ts +0 -35
- package/core/data/providers/product-data.service.d.ts +0 -81
- package/core/providers/modal/modal.service.d.ts +0 -132
- package/core/providers/nav-builder/nav-builder-types.d.ts +0 -91
- package/core/public_api.d.ts +0 -222
- package/core/shared/components/asset-gallery/asset-gallery.component.d.ts +0 -67
- package/core/shared/components/data-table/data-table.component.d.ts +0 -82
- package/core/shared/components/dropdown/dropdown-menu.component.d.ts +0 -30
- package/core/shared/components/rich-text-editor/prosemirror/inputrules.d.ts +0 -8
- package/core/shared/components/rich-text-editor/prosemirror/menu/images.d.ts +0 -4
- package/core/shared/components/rich-text-editor/prosemirror/menu/links.d.ts +0 -4
- package/core/shared/components/rich-text-editor/prosemirror/menu/menu-common.d.ts +0 -4
- package/core/shared/components/rich-text-editor/prosemirror/plugins/link-select-plugin.d.ts +0 -5
- package/core/shared/components/rich-text-editor/prosemirror/prosemirror.service.d.ts +0 -21
- package/core/shared/components/rich-text-editor/prosemirror/types.d.ts +0 -11
- package/core/shared/components/rich-text-editor/rich-text-editor.component.d.ts +0 -35
- package/core/shared/dynamic-form-inputs/code-editor-form-input/json-editor-form-input.component.d.ts +0 -32
- package/core/shared/dynamic-form-inputs/register-dynamic-input-components.d.ts +0 -89
- package/core/vendure-admin-ui-core.metadata.json +0 -1
- package/customer/components/customer-group-member-list/customer-group-member-list.component.d.ts +0 -37
- package/customer/vendure-admin-ui-customer.metadata.json +0 -1
- package/esm2015/catalog/catalog.module.js +0 -62
- package/esm2015/catalog/components/assign-products-to-channel-dialog/assign-products-to-channel-dialog.component.js +0 -109
- package/esm2015/catalog/components/collection-detail/collection-detail.component.js +0 -244
- package/esm2015/catalog/components/collection-list/collection-list.component.js +0 -145
- package/esm2015/catalog/components/collection-tree/collection-tree-node.component.js +0 -117
- package/esm2015/catalog/components/collection-tree/collection-tree.component.js +0 -76
- package/esm2015/catalog/components/facet-list/facet-list.component.js +0 -107
- package/esm2015/catalog/components/product-detail/product-detail.component.js +0 -515
- package/esm2015/catalog/components/product-list/product-list.component.js +0 -153
- package/esm2015/catalog/components/product-variants-list/product-variants-list.component.js +0 -214
- package/esm2015/catalog/providers/routing/collection-resolver.js +0 -38
- package/esm2015/catalog/public_api.js +0 -35
- package/esm2015/core/common/component-registry-types.js +0 -2
- package/esm2015/core/common/generated-types.js +0 -983
- package/esm2015/core/common/introspection-result.js +0 -195
- package/esm2015/core/common/utilities/selection-manager.js +0 -64
- package/esm2015/core/common/version.js +0 -3
- package/esm2015/core/components/breadcrumb/breadcrumb.component.js +0 -126
- package/esm2015/core/data/definitions/collection-definitions.js +0 -144
- package/esm2015/core/data/definitions/facet-definitions.js +0 -110
- package/esm2015/core/data/definitions/order-definitions.js +0 -472
- package/esm2015/core/data/definitions/product-definitions.js +0 -745
- package/esm2015/core/data/providers/collection-data.service.js +0 -75
- package/esm2015/core/data/providers/customer-data.service.js +0 -117
- package/esm2015/core/data/providers/facet-data.service.js +0 -60
- package/esm2015/core/data/providers/order-data.service.js +0 -103
- package/esm2015/core/data/providers/product-data.service.js +0 -235
- package/esm2015/core/data/utils/remove-readonly-custom-fields.js +0 -91
- package/esm2015/core/providers/dashboard-widget/dashboard-widget.service.js +0 -97
- package/esm2015/core/providers/modal/modal.service.js +0 -100
- package/esm2015/core/providers/nav-builder/nav-builder-types.js +0 -2
- package/esm2015/core/public_api.js +0 -224
- package/esm2015/core/shared/components/action-bar/action-bar.component.js +0 -47
- package/esm2015/core/shared/components/asset-gallery/asset-gallery.component.js +0 -84
- package/esm2015/core/shared/components/data-table/data-table.component.js +0 -113
- package/esm2015/core/shared/components/dropdown/dropdown-menu.component.js +0 -121
- package/esm2015/core/shared/components/facet-value-selector/facet-value-selector.component.js +0 -117
- package/esm2015/core/shared/components/language-selector/language-selector.component.js +0 -21
- package/esm2015/core/shared/components/order-state-label/order-state-label.component.js +0 -43
- package/esm2015/core/shared/components/product-search-input/product-search-input.component.js +0 -104
- package/esm2015/core/shared/components/product-selector/product-selector.component.js +0 -61
- package/esm2015/core/shared/components/rich-text-editor/external-image-dialog/external-image-dialog.component.js +0 -32
- package/esm2015/core/shared/components/rich-text-editor/prosemirror/menu/images.js +0 -36
- package/esm2015/core/shared/components/rich-text-editor/prosemirror/menu/links.js +0 -69
- package/esm2015/core/shared/components/rich-text-editor/prosemirror/menu/menu-common.js +0 -20
- package/esm2015/core/shared/components/rich-text-editor/prosemirror/menu/menu.js +0 -192
- package/esm2015/core/shared/components/rich-text-editor/prosemirror/prosemirror.service.js +0 -112
- package/esm2015/core/shared/components/rich-text-editor/prosemirror/types.js +0 -2
- package/esm2015/core/shared/components/rich-text-editor/rich-text-editor.component.js +0 -86
- package/esm2015/core/shared/components/simple-dialog/simple-dialog.component.js +0 -21
- package/esm2015/core/shared/dynamic-form-inputs/code-editor-form-input/json-editor-form-input.component.js +0 -125
- package/esm2015/core/shared/dynamic-form-inputs/dynamic-form-input/dynamic-form-input.component.js +0 -266
- package/esm2015/core/shared/dynamic-form-inputs/register-dynamic-input-components.js +0 -134
- package/esm2015/core/shared/pipes/state-i18n-token.pipe.js +0 -46
- package/esm2015/core/shared/shared.module.js +0 -275
- package/esm2015/customer/components/customer-group-list/customer-group-list.component.js +0 -198
- package/esm2015/customer/components/customer-group-member-list/customer-group-member-list.component.js +0 -101
- package/esm2015/customer/components/customer-list/customer-list.component.js +0 -81
- package/esm2015/dashboard/dashboard.module.js +0 -25
- package/esm2015/order/components/order-detail/order-detail.component.js +0 -550
- package/esm2015/order/components/order-editor/order-editor.component.js +0 -381
- package/esm2015/order/components/order-list/order-list.component.js +0 -195
- package/esm2015/order/components/order-table/order-table.component.js +0 -76
- package/esm2015/order/order.module.js +0 -70
- package/esm2015/order/order.routes.js +0 -54
- package/esm2015/order/providers/routing/order-resolver.js +0 -33
- package/esm2015/order/public_api.js +0 -36
- package/esm2015/settings/components/country-list/country-list.component.js +0 -82
- package/esm2015/settings/components/profile/profile.component.js +0 -82
- package/esm2015/settings/components/zone-list/zone-list.component.js +0 -160
- package/esm2015/settings/components/zone-member-list/zone-member-list.component.js +0 -63
- package/esm2015/system/components/health-check/health-check.component.js +0 -19
- package/fesm2015/vendure-admin-ui-catalog.js +0 -3994
- package/fesm2015/vendure-admin-ui-catalog.js.map +0 -1
- package/fesm2015/vendure-admin-ui-core.js +0 -16292
- package/fesm2015/vendure-admin-ui-core.js.map +0 -1
- package/fesm2015/vendure-admin-ui-customer.js +0 -1184
- package/fesm2015/vendure-admin-ui-customer.js.map +0 -1
- package/fesm2015/vendure-admin-ui-dashboard.js +0 -371
- package/fesm2015/vendure-admin-ui-dashboard.js.map +0 -1
- package/fesm2015/vendure-admin-ui-order.js +0 -2607
- package/fesm2015/vendure-admin-ui-order.js.map +0 -1
- package/fesm2015/vendure-admin-ui-settings.js +0 -2977
- package/fesm2015/vendure-admin-ui-settings.js.map +0 -1
- package/fesm2015/vendure-admin-ui-system.js +0 -171
- package/order/components/order-editor/order-editor.component.d.ts +0 -76
- package/order/components/order-list/order-list.component.d.ts +0 -34
- package/order/components/order-table/order-table.component.d.ts +0 -28
- package/order/providers/routing/order-resolver.d.ts +0 -10
- package/order/public_api.d.ts +0 -34
- package/order/vendure-admin-ui-order.metadata.json +0 -1
- package/settings/components/zone-member-list/zone-member-list.component.d.ts +0 -21
- package/settings/vendure-admin-ui-settings.metadata.json +0 -1
- package/static/i18n-messages/cs.json +0 -688
- package/static/i18n-messages/de.json +0 -688
- package/static/i18n-messages/en.json +0 -689
- package/static/i18n-messages/es.json +0 -688
- package/static/i18n-messages/fr.json +0 -688
- package/static/i18n-messages/it.json +0 -688
- package/static/i18n-messages/pl.json +0 -688
- package/static/i18n-messages/pt_BR.json +0 -688
- package/static/i18n-messages/pt_PT.json +0 -688
- package/static/i18n-messages/ru.json +0 -688
- package/static/i18n-messages/uk.json +0 -688
- package/static/i18n-messages/zh_Hans.json +0 -688
- package/static/i18n-messages/zh_Hant.json +0 -688
- package/static/styles/global/_forms.scss +0 -146
- package/static/styles/global/_overrides.scss +0 -72
- package/static/styles/global/_utilities.scss +0 -127
- package/static/theme.min.css +0 -8
- package/system/vendure-admin-ui-system.metadata.json +0 -1
|
@@ -1,3994 +0,0 @@
|
|
|
1
|
-
import * as i0 from '@angular/core';
|
|
2
|
-
import { Component, ChangeDetectionStrategy, ChangeDetectorRef, ViewChild, Injectable, EventEmitter, Input, HostBinding, Output, ContentChild, TemplateRef, SkipSelf, Optional, ViewChildren, ElementRef, forwardRef, NgModule } from '@angular/core';
|
|
3
|
-
import * as i1 from '@angular/router';
|
|
4
|
-
import { Router, ActivatedRoute, RouterModule } from '@angular/router';
|
|
5
|
-
import * as i2 from '@vendure/admin-ui/core';
|
|
6
|
-
import { BaseDetailComponent, ServerConfigService, NotificationService, DataService, BaseListComponent, SortOrder, LogicalOperator, DeletionResult, ModalService, Permission, unicodePatternValidator, findTranslation, getConfigArgValue, createUpdatedTranslatable, encodeConfigArgValue, LocalStorageService, FacetValueSelectorComponent, flattenFacetValues, JobState, JobQueueService, getDefaultUiLanguage, BaseEntityResolver, AssetType, createResolveData, CanDeactivateDetailGuard, detailBreadcrumb, AssetPickerDialogComponent, AssetPreviewDialogComponent, GlobalFlag, SharedModule } from '@vendure/admin-ui/core';
|
|
7
|
-
import { marker } from '@biesbjerg/ngx-translate-extract-marker';
|
|
8
|
-
import { map, debounceTime, takeUntil, finalize, switchMap, filter, take, mergeMap, shareReplay, distinctUntilChanged, tap, mapTo, startWith, skipUntil, skip, withLatestFrom, delay, defaultIfEmpty, catchError } from 'rxjs/operators';
|
|
9
|
-
import { FormGroup, FormControl, FormBuilder, Validators, FormArray, NG_VALUE_ACCESSOR } from '@angular/forms';
|
|
10
|
-
import { BehaviorSubject, combineLatest, EMPTY, Subject, merge, of, forkJoin, throwError, from } from 'rxjs';
|
|
11
|
-
import { normalizeString } from '@vendure/common/lib/normalize-string';
|
|
12
|
-
import { notNullOrUndefined, generateAllCombinations } from '@vendure/common/lib/shared-utils';
|
|
13
|
-
import { SortOrder as SortOrder$1 } from '@vendure/common/lib/generated-shop-types';
|
|
14
|
-
import { Location } from '@angular/common';
|
|
15
|
-
import { DEFAULT_CHANNEL_CODE } from '@vendure/common/lib/shared-constants';
|
|
16
|
-
import { unique } from '@vendure/common/lib/unique';
|
|
17
|
-
import { __awaiter } from 'tslib';
|
|
18
|
-
import { pick } from '@vendure/common/lib/pick';
|
|
19
|
-
import { moveItemInArray } from '@angular/cdk/drag-drop';
|
|
20
|
-
|
|
21
|
-
class AssetDetailComponent extends BaseDetailComponent {
|
|
22
|
-
constructor(router, route, serverConfigService, notificationService, dataService, formBuilder) {
|
|
23
|
-
super(route, router, serverConfigService, dataService);
|
|
24
|
-
this.notificationService = notificationService;
|
|
25
|
-
this.dataService = dataService;
|
|
26
|
-
this.formBuilder = formBuilder;
|
|
27
|
-
this.detailForm = new FormGroup({});
|
|
28
|
-
this.customFields = this.getCustomFieldConfig('Asset');
|
|
29
|
-
}
|
|
30
|
-
ngOnInit() {
|
|
31
|
-
this.detailForm = new FormGroup({
|
|
32
|
-
name: new FormControl(''),
|
|
33
|
-
tags: new FormControl([]),
|
|
34
|
-
customFields: this.formBuilder.group(this.customFields.reduce((hash, field) => (Object.assign(Object.assign({}, hash), { [field.name]: '' })), {})),
|
|
35
|
-
});
|
|
36
|
-
this.init();
|
|
37
|
-
}
|
|
38
|
-
ngOnDestroy() {
|
|
39
|
-
this.destroy();
|
|
40
|
-
}
|
|
41
|
-
onAssetChange(event) {
|
|
42
|
-
var _a, _b;
|
|
43
|
-
(_a = this.detailForm.get('name')) === null || _a === void 0 ? void 0 : _a.setValue(event.name);
|
|
44
|
-
(_b = this.detailForm.get('tags')) === null || _b === void 0 ? void 0 : _b.setValue(event.tags);
|
|
45
|
-
this.detailForm.markAsDirty();
|
|
46
|
-
}
|
|
47
|
-
save() {
|
|
48
|
-
this.dataService.product
|
|
49
|
-
.updateAsset({
|
|
50
|
-
id: this.id,
|
|
51
|
-
name: this.detailForm.value.name,
|
|
52
|
-
tags: this.detailForm.value.tags,
|
|
53
|
-
customFields: this.detailForm.value.customFields,
|
|
54
|
-
})
|
|
55
|
-
.subscribe(() => {
|
|
56
|
-
this.notificationService.success(marker('common.notify-update-success'), { entity: 'Asset' });
|
|
57
|
-
}, err => {
|
|
58
|
-
this.notificationService.error(marker('common.notify-update-error'), {
|
|
59
|
-
entity: 'Asset',
|
|
60
|
-
});
|
|
61
|
-
});
|
|
62
|
-
}
|
|
63
|
-
setFormValues(entity, languageCode) {
|
|
64
|
-
var _a, _b;
|
|
65
|
-
(_a = this.detailForm.get('name')) === null || _a === void 0 ? void 0 : _a.setValue(entity.name);
|
|
66
|
-
(_b = this.detailForm.get('tags')) === null || _b === void 0 ? void 0 : _b.setValue(entity.tags);
|
|
67
|
-
if (this.customFields.length) {
|
|
68
|
-
this.setCustomFieldFormValues(this.customFields, this.detailForm.get(['customFields']), entity);
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
AssetDetailComponent.decorators = [
|
|
73
|
-
{ type: Component, args: [{
|
|
74
|
-
selector: 'vdr-asset-detail',
|
|
75
|
-
template: "<vdr-action-bar>\r\n <vdr-ab-left>\r\n <vdr-entity-info [entity]=\"entity$ | async\"></vdr-entity-info>\r\n </vdr-ab-left>\r\n\r\n <vdr-ab-right>\r\n <vdr-action-bar-items locationId=\"asset-detail\"></vdr-action-bar-items>\r\n <button\r\n *vdrIfPermissions=\"['UpdateCatalog', 'UpdateAsset']\"\r\n class=\"btn btn-primary\"\r\n (click)=\"save()\"\r\n [disabled]=\"detailForm.invalid || detailForm.pristine\"\r\n >\r\n {{ 'common.update' | translate }}\r\n </button>\r\n </vdr-ab-right>\r\n</vdr-action-bar>\r\n<vdr-asset-preview\r\n [asset]=\"entity$ | async\"\r\n [editable]=\"true\"\r\n [customFields]=\"customFields\"\r\n [customFieldsForm]=\"detailForm.get('customFields')\"\r\n (assetChange)=\"onAssetChange($event)\"\r\n></vdr-asset-preview>\r\n",
|
|
76
|
-
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
77
|
-
styles: [":host{display:flex;flex-direction:column;height:100%}\n"]
|
|
78
|
-
},] }
|
|
79
|
-
];
|
|
80
|
-
AssetDetailComponent.ctorParameters = () => [
|
|
81
|
-
{ type: Router },
|
|
82
|
-
{ type: ActivatedRoute },
|
|
83
|
-
{ type: ServerConfigService },
|
|
84
|
-
{ type: NotificationService },
|
|
85
|
-
{ type: DataService },
|
|
86
|
-
{ type: FormBuilder }
|
|
87
|
-
];
|
|
88
|
-
|
|
89
|
-
class AssetListComponent extends BaseListComponent {
|
|
90
|
-
constructor(notificationService, modalService, dataService, router, route) {
|
|
91
|
-
super(router, route);
|
|
92
|
-
this.notificationService = notificationService;
|
|
93
|
-
this.modalService = modalService;
|
|
94
|
-
this.dataService = dataService;
|
|
95
|
-
this.searchTerm$ = new BehaviorSubject(undefined);
|
|
96
|
-
this.filterByTags$ = new BehaviorSubject(undefined);
|
|
97
|
-
this.uploading = false;
|
|
98
|
-
super.setQueryFn((...args) => this.dataService.product.getAssetList(...args), data => data.assets, (skip, take) => {
|
|
99
|
-
var _a;
|
|
100
|
-
const searchTerm = this.searchTerm$.value;
|
|
101
|
-
const tags = (_a = this.filterByTags$.value) === null || _a === void 0 ? void 0 : _a.map(t => t.value);
|
|
102
|
-
return {
|
|
103
|
-
options: Object.assign(Object.assign({ skip,
|
|
104
|
-
take }, (searchTerm
|
|
105
|
-
? {
|
|
106
|
-
filter: {
|
|
107
|
-
name: { contains: searchTerm },
|
|
108
|
-
},
|
|
109
|
-
}
|
|
110
|
-
: {})), { sort: {
|
|
111
|
-
createdAt: SortOrder.DESC,
|
|
112
|
-
}, tags, tagsOperator: LogicalOperator.AND }),
|
|
113
|
-
};
|
|
114
|
-
}, { take: 25, skip: 0 });
|
|
115
|
-
}
|
|
116
|
-
ngOnInit() {
|
|
117
|
-
super.ngOnInit();
|
|
118
|
-
this.paginationConfig$ = combineLatest(this.itemsPerPage$, this.currentPage$, this.totalItems$).pipe(map(([itemsPerPage, currentPage, totalItems]) => ({ itemsPerPage, currentPage, totalItems })));
|
|
119
|
-
this.searchTerm$.pipe(debounceTime(250), takeUntil(this.destroy$)).subscribe(() => this.refresh());
|
|
120
|
-
this.filterByTags$.pipe(takeUntil(this.destroy$)).subscribe(() => this.refresh());
|
|
121
|
-
this.allTags$ = this.dataService.product.getTagList().mapStream(data => data.tags.items);
|
|
122
|
-
}
|
|
123
|
-
filesSelected(files) {
|
|
124
|
-
if (files.length) {
|
|
125
|
-
this.uploading = true;
|
|
126
|
-
this.dataService.product
|
|
127
|
-
.createAssets(files)
|
|
128
|
-
.pipe(finalize(() => (this.uploading = false)))
|
|
129
|
-
.subscribe(({ createAssets }) => {
|
|
130
|
-
let successCount = 0;
|
|
131
|
-
for (const result of createAssets) {
|
|
132
|
-
switch (result.__typename) {
|
|
133
|
-
case 'Asset':
|
|
134
|
-
successCount++;
|
|
135
|
-
break;
|
|
136
|
-
case 'MimeTypeError':
|
|
137
|
-
this.notificationService.error(result.message);
|
|
138
|
-
break;
|
|
139
|
-
}
|
|
140
|
-
}
|
|
141
|
-
if (0 < successCount) {
|
|
142
|
-
super.refresh();
|
|
143
|
-
this.notificationService.success(marker('asset.notify-create-assets-success'), {
|
|
144
|
-
count: successCount,
|
|
145
|
-
});
|
|
146
|
-
}
|
|
147
|
-
});
|
|
148
|
-
}
|
|
149
|
-
}
|
|
150
|
-
deleteAssets(assets) {
|
|
151
|
-
this.showModalAndDelete(assets.map(a => a.id))
|
|
152
|
-
.pipe(switchMap(response => {
|
|
153
|
-
if (response.result === DeletionResult.DELETED) {
|
|
154
|
-
return [true];
|
|
155
|
-
}
|
|
156
|
-
else {
|
|
157
|
-
return this.showModalAndDelete(assets.map(a => a.id), response.message || '').pipe(map(r => r.result === DeletionResult.DELETED));
|
|
158
|
-
}
|
|
159
|
-
}))
|
|
160
|
-
.subscribe(() => {
|
|
161
|
-
this.notificationService.success(marker('common.notify-delete-success'), {
|
|
162
|
-
entity: 'Assets',
|
|
163
|
-
});
|
|
164
|
-
this.refresh();
|
|
165
|
-
}, err => {
|
|
166
|
-
this.notificationService.error(marker('common.notify-delete-error'), {
|
|
167
|
-
entity: 'Assets',
|
|
168
|
-
});
|
|
169
|
-
});
|
|
170
|
-
}
|
|
171
|
-
showModalAndDelete(assetIds, message) {
|
|
172
|
-
return this.modalService
|
|
173
|
-
.dialog({
|
|
174
|
-
title: marker('catalog.confirm-delete-assets'),
|
|
175
|
-
translationVars: {
|
|
176
|
-
count: assetIds.length,
|
|
177
|
-
},
|
|
178
|
-
body: message,
|
|
179
|
-
buttons: [
|
|
180
|
-
{ type: 'secondary', label: marker('common.cancel') },
|
|
181
|
-
{ type: 'danger', label: marker('common.delete'), returnValue: true },
|
|
182
|
-
],
|
|
183
|
-
})
|
|
184
|
-
.pipe(switchMap(res => (res ? this.dataService.product.deleteAssets(assetIds, !!message) : EMPTY)), map(res => res.deleteAssets));
|
|
185
|
-
}
|
|
186
|
-
}
|
|
187
|
-
AssetListComponent.decorators = [
|
|
188
|
-
{ type: Component, args: [{
|
|
189
|
-
selector: 'vdr-asset-list',
|
|
190
|
-
template: "<vdr-action-bar>\r\n <vdr-ab-left [grow]=\"true\">\r\n <vdr-asset-search-input\r\n class=\"pr4 mt1\"\r\n [tags]=\"allTags$ | async\"\r\n (searchTermChange)=\"searchTerm$.next($event)\"\r\n (tagsChange)=\"filterByTags$.next($event)\"\r\n ></vdr-asset-search-input>\r\n </vdr-ab-left>\r\n <vdr-ab-right>\r\n <vdr-action-bar-items locationId=\"asset-list\"></vdr-action-bar-items>\r\n <vdr-asset-file-input\r\n (selectFiles)=\"filesSelected($event)\"\r\n [uploading]=\"uploading\"\r\n dropZoneTarget=\".content-area\"\r\n ></vdr-asset-file-input>\r\n </vdr-ab-right>\r\n</vdr-action-bar>\r\n\r\n<vdr-asset-gallery\r\n [assets]=\"(items$ | async)! | paginate: (paginationConfig$ | async) || {}\"\r\n [multiSelect]=\"true\"\r\n [canDelete]=\"['DeleteCatalog', 'DeleteAsset'] | hasPermission\"\r\n (deleteAssets)=\"deleteAssets($event)\"\r\n></vdr-asset-gallery>\r\n\r\n<div class=\"paging-controls\">\r\n <vdr-items-per-page-controls\r\n [itemsPerPage]=\"itemsPerPage$ | async\"\r\n (itemsPerPageChange)=\"setItemsPerPage($event)\"\r\n ></vdr-items-per-page-controls>\r\n\r\n <vdr-pagination-controls\r\n [currentPage]=\"currentPage$ | async\"\r\n [itemsPerPage]=\"itemsPerPage$ | async\"\r\n [totalItems]=\"totalItems$ | async\"\r\n (pageChange)=\"setPageNumber($event)\"\r\n ></vdr-pagination-controls>\r\n</div>\r\n",
|
|
191
|
-
styles: [":host{display:flex;flex-direction:column;height:100%}vdr-asset-gallery{flex:1}.paging-controls{padding-top:6px;border-top:1px solid var(--color-component-border-100);display:flex;justify-content:space-between}.search-input{margin-top:6px;min-width:300px}\n"]
|
|
192
|
-
},] }
|
|
193
|
-
];
|
|
194
|
-
AssetListComponent.ctorParameters = () => [
|
|
195
|
-
{ type: NotificationService },
|
|
196
|
-
{ type: ModalService },
|
|
197
|
-
{ type: DataService },
|
|
198
|
-
{ type: Router },
|
|
199
|
-
{ type: ActivatedRoute }
|
|
200
|
-
];
|
|
201
|
-
|
|
202
|
-
class CollectionDetailComponent extends BaseDetailComponent {
|
|
203
|
-
constructor(router, route, serverConfigService, changeDetector, dataService, formBuilder, notificationService, modalService, localStorageService) {
|
|
204
|
-
var _a;
|
|
205
|
-
super(route, router, serverConfigService, dataService);
|
|
206
|
-
this.changeDetector = changeDetector;
|
|
207
|
-
this.dataService = dataService;
|
|
208
|
-
this.formBuilder = formBuilder;
|
|
209
|
-
this.notificationService = notificationService;
|
|
210
|
-
this.modalService = modalService;
|
|
211
|
-
this.localStorageService = localStorageService;
|
|
212
|
-
this.assetChanges = {};
|
|
213
|
-
this.filters = [];
|
|
214
|
-
this.allFilters = [];
|
|
215
|
-
this.livePreview = false;
|
|
216
|
-
this.updatePermission = [Permission.UpdateCatalog, Permission.UpdateCollection];
|
|
217
|
-
this.filterRemoved$ = new Subject();
|
|
218
|
-
this.customFields = this.getCustomFieldConfig('Collection');
|
|
219
|
-
this.detailForm = this.formBuilder.group({
|
|
220
|
-
name: ['', Validators.required],
|
|
221
|
-
slug: ['', unicodePatternValidator(/^[\p{Letter}0-9_-]+$/)],
|
|
222
|
-
description: '',
|
|
223
|
-
visible: false,
|
|
224
|
-
filters: this.formBuilder.array([]),
|
|
225
|
-
customFields: this.formBuilder.group(this.customFields.reduce((hash, field) => (Object.assign(Object.assign({}, hash), { [field.name]: '' })), {})),
|
|
226
|
-
});
|
|
227
|
-
this.livePreview = (_a = this.localStorageService.get('livePreviewCollectionContents')) !== null && _a !== void 0 ? _a : false;
|
|
228
|
-
}
|
|
229
|
-
ngOnInit() {
|
|
230
|
-
this.init();
|
|
231
|
-
this.dataService.collection.getCollectionFilters().single$.subscribe(res => {
|
|
232
|
-
this.allFilters = res.collectionFilters;
|
|
233
|
-
});
|
|
234
|
-
const filtersFormArray = this.detailForm.get('filters');
|
|
235
|
-
this.updatedFilters$ = merge(filtersFormArray.statusChanges, this.filterRemoved$).pipe(debounceTime(200), filter(() => filtersFormArray.touched), map(() => this.mapOperationsToInputs(this.filters, filtersFormArray.value).filter(_filter => {
|
|
236
|
-
// ensure all the arguments have valid values. E.g. a newly-added
|
|
237
|
-
// filter will not yet have valid values
|
|
238
|
-
for (const arg of _filter.arguments) {
|
|
239
|
-
if (arg.value === '') {
|
|
240
|
-
return false;
|
|
241
|
-
}
|
|
242
|
-
}
|
|
243
|
-
return true;
|
|
244
|
-
})));
|
|
245
|
-
this.parentId$ = this.route.paramMap.pipe(map(pm => pm.get('parentId') || undefined), switchMap(parentId => {
|
|
246
|
-
if (parentId) {
|
|
247
|
-
return of(parentId);
|
|
248
|
-
}
|
|
249
|
-
else {
|
|
250
|
-
return this.entity$.pipe(map(collection => { var _a; return (_a = collection.parent) === null || _a === void 0 ? void 0 : _a.id; }));
|
|
251
|
-
}
|
|
252
|
-
}));
|
|
253
|
-
}
|
|
254
|
-
ngOnDestroy() {
|
|
255
|
-
this.destroy();
|
|
256
|
-
}
|
|
257
|
-
getFilterDefinition(_filter) {
|
|
258
|
-
return this.allFilters.find(f => f.code === _filter.code);
|
|
259
|
-
}
|
|
260
|
-
assetsChanged() {
|
|
261
|
-
return !!Object.values(this.assetChanges).length;
|
|
262
|
-
}
|
|
263
|
-
/**
|
|
264
|
-
* If creating a new Collection, automatically generate the slug based on the collection name.
|
|
265
|
-
*/
|
|
266
|
-
updateSlug(nameValue) {
|
|
267
|
-
combineLatest(this.entity$, this.languageCode$)
|
|
268
|
-
.pipe(take(1))
|
|
269
|
-
.subscribe(([entity, languageCode]) => {
|
|
270
|
-
const slugControl = this.detailForm.get(['slug']);
|
|
271
|
-
const currentTranslation = findTranslation(entity, languageCode);
|
|
272
|
-
const currentSlugIsEmpty = !currentTranslation || !currentTranslation.slug;
|
|
273
|
-
if (slugControl && slugControl.pristine && currentSlugIsEmpty) {
|
|
274
|
-
slugControl.setValue(normalizeString(`${nameValue}`, '-'));
|
|
275
|
-
}
|
|
276
|
-
});
|
|
277
|
-
}
|
|
278
|
-
addFilter(collectionFilter) {
|
|
279
|
-
const filtersArray = this.detailForm.get('filters');
|
|
280
|
-
const argsHash = collectionFilter.args.reduce((output, arg) => (Object.assign(Object.assign({}, output), { [arg.name]: getConfigArgValue(arg.value) })), {});
|
|
281
|
-
filtersArray.push(this.formBuilder.control({
|
|
282
|
-
code: collectionFilter.code,
|
|
283
|
-
args: argsHash,
|
|
284
|
-
}));
|
|
285
|
-
this.filters.push({
|
|
286
|
-
code: collectionFilter.code,
|
|
287
|
-
args: collectionFilter.args.map(a => ({ name: a.name, value: getConfigArgValue(a.value) })),
|
|
288
|
-
});
|
|
289
|
-
}
|
|
290
|
-
removeFilter(index) {
|
|
291
|
-
const filtersArray = this.detailForm.get('filters');
|
|
292
|
-
if (index !== -1) {
|
|
293
|
-
filtersArray.removeAt(index);
|
|
294
|
-
filtersArray.markAsDirty();
|
|
295
|
-
filtersArray.markAsTouched();
|
|
296
|
-
this.filters.splice(index, 1);
|
|
297
|
-
this.filterRemoved$.next();
|
|
298
|
-
}
|
|
299
|
-
}
|
|
300
|
-
create() {
|
|
301
|
-
if (!this.detailForm.dirty) {
|
|
302
|
-
return;
|
|
303
|
-
}
|
|
304
|
-
combineLatest(this.entity$, this.languageCode$)
|
|
305
|
-
.pipe(take(1), mergeMap(([category, languageCode]) => {
|
|
306
|
-
const input = this.getUpdatedCollection(category, this.detailForm, languageCode);
|
|
307
|
-
const parentId = this.route.snapshot.paramMap.get('parentId');
|
|
308
|
-
if (parentId) {
|
|
309
|
-
input.parentId = parentId;
|
|
310
|
-
}
|
|
311
|
-
return this.dataService.collection.createCollection(input);
|
|
312
|
-
}))
|
|
313
|
-
.subscribe(data => {
|
|
314
|
-
this.notificationService.success(marker('common.notify-create-success'), {
|
|
315
|
-
entity: 'Collection',
|
|
316
|
-
});
|
|
317
|
-
this.assetChanges = {};
|
|
318
|
-
this.detailForm.markAsPristine();
|
|
319
|
-
this.changeDetector.markForCheck();
|
|
320
|
-
this.router.navigate(['../', data.createCollection.id], { relativeTo: this.route });
|
|
321
|
-
}, err => {
|
|
322
|
-
this.notificationService.error(marker('common.notify-create-error'), {
|
|
323
|
-
entity: 'Collection',
|
|
324
|
-
});
|
|
325
|
-
});
|
|
326
|
-
}
|
|
327
|
-
save() {
|
|
328
|
-
combineLatest(this.entity$, this.languageCode$)
|
|
329
|
-
.pipe(take(1), mergeMap(([category, languageCode]) => {
|
|
330
|
-
const input = this.getUpdatedCollection(category, this.detailForm, languageCode);
|
|
331
|
-
return this.dataService.collection.updateCollection(input);
|
|
332
|
-
}))
|
|
333
|
-
.subscribe(() => {
|
|
334
|
-
this.assetChanges = {};
|
|
335
|
-
this.detailForm.markAsPristine();
|
|
336
|
-
this.changeDetector.markForCheck();
|
|
337
|
-
this.notificationService.success(marker('common.notify-update-success'), {
|
|
338
|
-
entity: 'Collection',
|
|
339
|
-
});
|
|
340
|
-
this.contentsComponent.refresh();
|
|
341
|
-
}, err => {
|
|
342
|
-
this.notificationService.error(marker('common.notify-update-error'), {
|
|
343
|
-
entity: 'Collection',
|
|
344
|
-
});
|
|
345
|
-
});
|
|
346
|
-
}
|
|
347
|
-
canDeactivate() {
|
|
348
|
-
return super.canDeactivate() && !this.assetChanges.assets && !this.assetChanges.featuredAsset;
|
|
349
|
-
}
|
|
350
|
-
toggleLivePreview() {
|
|
351
|
-
this.livePreview = !this.livePreview;
|
|
352
|
-
this.localStorageService.set('livePreviewCollectionContents', this.livePreview);
|
|
353
|
-
}
|
|
354
|
-
trackByFn(index, item) {
|
|
355
|
-
return JSON.stringify(item);
|
|
356
|
-
}
|
|
357
|
-
/**
|
|
358
|
-
* Sets the values of the form on changes to the category or current language.
|
|
359
|
-
*/
|
|
360
|
-
setFormValues(entity, languageCode) {
|
|
361
|
-
const currentTranslation = findTranslation(entity, languageCode);
|
|
362
|
-
this.detailForm.patchValue({
|
|
363
|
-
name: currentTranslation ? currentTranslation.name : '',
|
|
364
|
-
slug: currentTranslation ? currentTranslation.slug : '',
|
|
365
|
-
description: currentTranslation ? currentTranslation.description : '',
|
|
366
|
-
visible: !entity.isPrivate,
|
|
367
|
-
});
|
|
368
|
-
const formArray = this.detailForm.get('filters');
|
|
369
|
-
if (formArray.length !== entity.filters.length) {
|
|
370
|
-
formArray.clear();
|
|
371
|
-
this.filters = [];
|
|
372
|
-
entity.filters.forEach(f => this.addFilter(f));
|
|
373
|
-
}
|
|
374
|
-
if (this.customFields.length) {
|
|
375
|
-
this.setCustomFieldFormValues(this.customFields, this.detailForm.get(['customFields']), entity, currentTranslation);
|
|
376
|
-
}
|
|
377
|
-
}
|
|
378
|
-
/**
|
|
379
|
-
* Given a category and the value of the form, this method creates an updated copy of the category which
|
|
380
|
-
* can then be persisted to the API.
|
|
381
|
-
*/
|
|
382
|
-
getUpdatedCollection(category, form, languageCode) {
|
|
383
|
-
var _a, _b;
|
|
384
|
-
const updatedCategory = createUpdatedTranslatable({
|
|
385
|
-
translatable: category,
|
|
386
|
-
updatedFields: form.value,
|
|
387
|
-
customFieldConfig: this.customFields,
|
|
388
|
-
languageCode,
|
|
389
|
-
defaultTranslation: {
|
|
390
|
-
languageCode,
|
|
391
|
-
name: category.name || '',
|
|
392
|
-
slug: category.slug || '',
|
|
393
|
-
description: category.description || '',
|
|
394
|
-
},
|
|
395
|
-
});
|
|
396
|
-
return Object.assign(Object.assign({}, updatedCategory), { assetIds: (_a = this.assetChanges.assets) === null || _a === void 0 ? void 0 : _a.map(a => a.id), featuredAssetId: (_b = this.assetChanges.featuredAsset) === null || _b === void 0 ? void 0 : _b.id, isPrivate: !form.value.visible, filters: this.mapOperationsToInputs(this.filters, this.detailForm.value.filters) });
|
|
397
|
-
}
|
|
398
|
-
/**
|
|
399
|
-
* Maps an array of conditions or actions to the input format expected by the GraphQL API.
|
|
400
|
-
*/
|
|
401
|
-
mapOperationsToInputs(operations, formValueOperations) {
|
|
402
|
-
return operations.map((o, i) => {
|
|
403
|
-
return {
|
|
404
|
-
code: o.code,
|
|
405
|
-
arguments: Object.entries(formValueOperations[i].args).map(([name, value], j) => {
|
|
406
|
-
return {
|
|
407
|
-
name,
|
|
408
|
-
value: encodeConfigArgValue(value),
|
|
409
|
-
};
|
|
410
|
-
}),
|
|
411
|
-
};
|
|
412
|
-
});
|
|
413
|
-
}
|
|
414
|
-
}
|
|
415
|
-
CollectionDetailComponent.decorators = [
|
|
416
|
-
{ type: Component, args: [{
|
|
417
|
-
selector: 'vdr-collection-detail',
|
|
418
|
-
template: "<vdr-action-bar>\r\n <vdr-ab-left>\r\n <vdr-entity-info [entity]=\"entity$ | async\"></vdr-entity-info>\r\n <vdr-language-selector\r\n [disabled]=\"isNew$ | async\"\r\n [availableLanguageCodes]=\"availableLanguages$ | async\"\r\n [currentLanguageCode]=\"languageCode$ | async\"\r\n (languageCodeChange)=\"setLanguage($event)\"\r\n ></vdr-language-selector>\r\n </vdr-ab-left>\r\n\r\n <vdr-ab-right>\r\n <vdr-action-bar-items locationId=\"collection-detail\"></vdr-action-bar-items>\r\n <button\r\n class=\"btn btn-primary\"\r\n *ngIf=\"isNew$ | async; else updateButton\"\r\n (click)=\"create()\"\r\n [disabled]=\"detailForm.invalid || detailForm.pristine\"\r\n >\r\n {{ 'common.create' | translate }}\r\n </button>\r\n <ng-template #updateButton>\r\n <button\r\n *vdrIfPermissions=\"updatePermission\"\r\n class=\"btn btn-primary\"\r\n (click)=\"save()\"\r\n [disabled]=\"(detailForm.invalid || detailForm.pristine) && !assetsChanged()\"\r\n >\r\n {{ 'common.update' | translate }}\r\n </button>\r\n </ng-template>\r\n </vdr-ab-right>\r\n</vdr-action-bar>\r\n\r\n<form class=\"form\" [formGroup]=\"detailForm\" *ngIf=\"entity$ | async as category\">\r\n <div class=\"clr-row\">\r\n <div class=\"clr-col\">\r\n <vdr-form-field [label]=\"'catalog.visibility' | translate\" for=\"visibility\">\r\n <clr-toggle-wrapper>\r\n <input\r\n type=\"checkbox\"\r\n clrToggle\r\n formControlName=\"visible\"\r\n id=\"visibility\"\r\n [vdrDisabled]=\"!(updatePermission | hasPermission)\"\r\n />\r\n <label class=\"visible-toggle\">\r\n <ng-container *ngIf=\"detailForm.value.visible; else private\">{{\r\n 'catalog.public' | translate\r\n }}</ng-container>\r\n <ng-template #private>{{ 'catalog.private' | translate }}</ng-template>\r\n </label>\r\n </clr-toggle-wrapper>\r\n </vdr-form-field>\r\n <vdr-form-field [label]=\"'common.name' | translate\" for=\"name\">\r\n <input\r\n id=\"name\"\r\n type=\"text\"\r\n formControlName=\"name\"\r\n [readonly]=\"!(updatePermission | hasPermission)\"\r\n (input)=\"updateSlug($event.target.value)\"\r\n />\r\n </vdr-form-field>\r\n <vdr-form-field\r\n [label]=\"'catalog.slug' | translate\"\r\n for=\"slug\"\r\n [errors]=\"{ pattern: ('catalog.slug-pattern-error' | translate) }\"\r\n >\r\n <input\r\n id=\"slug\"\r\n type=\"text\"\r\n formControlName=\"slug\"\r\n [readonly]=\"!(updatePermission | hasPermission)\"\r\n />\r\n </vdr-form-field>\r\n <vdr-rich-text-editor\r\n formControlName=\"description\"\r\n [readonly]=\"!(updatePermission | hasPermission)\"\r\n [label]=\"'common.description' | translate\"\r\n ></vdr-rich-text-editor>\r\n\r\n <section formGroupName=\"customFields\" *ngIf=\"customFields.length\">\r\n <label>{{ 'common.custom-fields' | translate }}</label>\r\n <vdr-tabbed-custom-fields\r\n entityName=\"Collection\"\r\n [customFields]=\"customFields\"\r\n [customFieldsFormGroup]=\"detailForm.get(['customFields'])\"\r\n [readonly]=\"!(updatePermission | hasPermission)\"\r\n ></vdr-tabbed-custom-fields>\r\n </section>\r\n <vdr-custom-detail-component-host\r\n locationId=\"collection-detail\"\r\n [entity$]=\"entity$\"\r\n [detailForm]=\"detailForm\"\r\n ></vdr-custom-detail-component-host>\r\n </div>\r\n <div class=\"clr-col-md-auto\">\r\n <vdr-assets\r\n [assets]=\"category.assets\"\r\n [featuredAsset]=\"category.featuredAsset\"\r\n [updatePermissions]=\"updatePermission\"\r\n (change)=\"assetChanges = $event\"\r\n ></vdr-assets>\r\n </div>\r\n </div>\r\n <div class=\"clr-row\" formArrayName=\"filters\">\r\n <div class=\"clr-col\">\r\n <label>{{ 'catalog.filters' | translate }}</label>\r\n <ng-container *ngFor=\"let filter of filters; index as i; trackBy:trackByFn\">\r\n <vdr-configurable-input\r\n (remove)=\"removeFilter(i)\"\r\n [position]=\"i\"\r\n [operation]=\"filter\"\r\n [operationDefinition]=\"getFilterDefinition(filter)\"\r\n [formControlName]=\"i\"\r\n [readonly]=\"!(updatePermission | hasPermission)\"\r\n ></vdr-configurable-input>\r\n </ng-container>\r\n\r\n <div *vdrIfPermissions=\"updatePermission\">\r\n <vdr-dropdown>\r\n <button class=\"btn btn-outline\" vdrDropdownTrigger>\r\n <clr-icon shape=\"plus\"></clr-icon>\r\n {{ 'marketing.add-condition' | translate }}\r\n </button>\r\n <vdr-dropdown-menu vdrPosition=\"bottom-left\">\r\n <button\r\n *ngFor=\"let filter of allFilters\"\r\n type=\"button\"\r\n vdrDropdownItem\r\n (click)=\"addFilter(filter)\"\r\n >\r\n {{ filter.description }}\r\n </button>\r\n </vdr-dropdown-menu>\r\n </vdr-dropdown>\r\n </div>\r\n </div>\r\n <div class=\"clr-col\">\r\n <vdr-collection-contents\r\n [collectionId]=\"id\"\r\n [parentId]=\"parentId$ | async\"\r\n [updatedFilters]=\"updatedFilters$ | async\"\r\n [previewUpdatedFilters]=\"livePreview\"\r\n #collectionContents\r\n >\r\n <ng-template let-count>\r\n <div class=\"contents-title\">\r\n {{ 'catalog.collection-contents' | translate }} ({{\r\n 'common.results-count' | translate: { count: count }\r\n }})\r\n </div>\r\n <clr-checkbox-wrapper [class.disabled]=\"detailForm.get('filters')?.pristine\">\r\n <input\r\n type=\"checkbox\"\r\n clrCheckbox\r\n [ngModelOptions]=\"{ standalone: true }\"\r\n [disabled]=\"detailForm.get('filters')?.pristine\"\r\n [ngModel]=\"livePreview\"\r\n (ngModelChange)=\"toggleLivePreview()\"\r\n />\r\n <label>{{ 'catalog.live-preview-contents' | translate }}</label>\r\n </clr-checkbox-wrapper>\r\n </ng-template>\r\n </vdr-collection-contents>\r\n </div>\r\n </div>\r\n</form>\r\n",
|
|
419
|
-
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
420
|
-
styles: [".visible-toggle{margin-top:-3px!important}clr-checkbox-wrapper{transition:opacity .3s}clr-checkbox-wrapper.disabled{opacity:.5}\n"]
|
|
421
|
-
},] }
|
|
422
|
-
];
|
|
423
|
-
CollectionDetailComponent.ctorParameters = () => [
|
|
424
|
-
{ type: Router },
|
|
425
|
-
{ type: ActivatedRoute },
|
|
426
|
-
{ type: ServerConfigService },
|
|
427
|
-
{ type: ChangeDetectorRef },
|
|
428
|
-
{ type: DataService },
|
|
429
|
-
{ type: FormBuilder },
|
|
430
|
-
{ type: NotificationService },
|
|
431
|
-
{ type: ModalService },
|
|
432
|
-
{ type: LocalStorageService }
|
|
433
|
-
];
|
|
434
|
-
CollectionDetailComponent.propDecorators = {
|
|
435
|
-
contentsComponent: [{ type: ViewChild, args: ['collectionContents',] }]
|
|
436
|
-
};
|
|
437
|
-
|
|
438
|
-
class CollectionListComponent {
|
|
439
|
-
constructor(dataService, notificationService, modalService, router, route, serverConfigService) {
|
|
440
|
-
this.dataService = dataService;
|
|
441
|
-
this.notificationService = notificationService;
|
|
442
|
-
this.modalService = modalService;
|
|
443
|
-
this.router = router;
|
|
444
|
-
this.route = route;
|
|
445
|
-
this.serverConfigService = serverConfigService;
|
|
446
|
-
this.filterTermControl = new FormControl('');
|
|
447
|
-
this.expandAll = false;
|
|
448
|
-
this.expandedIds = [];
|
|
449
|
-
this.destroy$ = new Subject();
|
|
450
|
-
}
|
|
451
|
-
ngOnInit() {
|
|
452
|
-
var _a, _b;
|
|
453
|
-
this.queryResult = this.dataService.collection.getCollections(1000, 0).refetchOnChannelChange();
|
|
454
|
-
this.items$ = this.queryResult.mapStream(data => data.collections.items).pipe(shareReplay(1));
|
|
455
|
-
this.activeCollectionId$ = this.route.paramMap.pipe(map(pm => pm.get('contents')), distinctUntilChanged());
|
|
456
|
-
this.expandedIds = (_b = (_a = this.route.snapshot.queryParamMap.get('expanded')) === null || _a === void 0 ? void 0 : _a.split(',')) !== null && _b !== void 0 ? _b : [];
|
|
457
|
-
this.expandAll = this.route.snapshot.queryParamMap.get('expanded') === 'all';
|
|
458
|
-
this.activeCollectionTitle$ = combineLatest(this.activeCollectionId$, this.items$).pipe(map(([id, collections]) => {
|
|
459
|
-
if (id) {
|
|
460
|
-
const match = collections.find(c => c.id === id);
|
|
461
|
-
return match ? match.name : '';
|
|
462
|
-
}
|
|
463
|
-
return '';
|
|
464
|
-
}));
|
|
465
|
-
this.availableLanguages$ = this.serverConfigService.getAvailableLanguages();
|
|
466
|
-
this.contentLanguage$ = this.dataService.client
|
|
467
|
-
.uiState()
|
|
468
|
-
.mapStream(({ uiState }) => uiState.contentLanguage)
|
|
469
|
-
.pipe(tap(() => this.refresh()));
|
|
470
|
-
this.filterTermControl.valueChanges
|
|
471
|
-
.pipe(debounceTime(250), takeUntil(this.destroy$))
|
|
472
|
-
.subscribe(term => {
|
|
473
|
-
this.router.navigate(['./'], {
|
|
474
|
-
queryParams: {
|
|
475
|
-
q: term || undefined,
|
|
476
|
-
},
|
|
477
|
-
queryParamsHandling: 'merge',
|
|
478
|
-
relativeTo: this.route,
|
|
479
|
-
});
|
|
480
|
-
});
|
|
481
|
-
this.route.queryParamMap
|
|
482
|
-
.pipe(map(qpm => qpm.get('q')), distinctUntilChanged(), takeUntil(this.destroy$))
|
|
483
|
-
.subscribe(() => this.refresh());
|
|
484
|
-
this.filterTermControl.patchValue(this.route.snapshot.queryParamMap.get('q'));
|
|
485
|
-
}
|
|
486
|
-
ngOnDestroy() {
|
|
487
|
-
this.queryResult.completed$.next();
|
|
488
|
-
this.destroy$.next(undefined);
|
|
489
|
-
this.destroy$.complete();
|
|
490
|
-
}
|
|
491
|
-
toggleExpandAll() {
|
|
492
|
-
this.router.navigate(['./'], {
|
|
493
|
-
queryParams: {
|
|
494
|
-
expanded: this.expandAll ? 'all' : undefined,
|
|
495
|
-
},
|
|
496
|
-
queryParamsHandling: 'merge',
|
|
497
|
-
relativeTo: this.route,
|
|
498
|
-
});
|
|
499
|
-
}
|
|
500
|
-
onRearrange(event) {
|
|
501
|
-
this.dataService.collection.moveCollection([event]).subscribe({
|
|
502
|
-
next: () => {
|
|
503
|
-
this.notificationService.success(marker('common.notify-saved-changes'));
|
|
504
|
-
this.refresh();
|
|
505
|
-
},
|
|
506
|
-
error: err => {
|
|
507
|
-
this.notificationService.error(marker('common.notify-save-changes-error'));
|
|
508
|
-
},
|
|
509
|
-
});
|
|
510
|
-
}
|
|
511
|
-
deleteCollection(id) {
|
|
512
|
-
this.items$
|
|
513
|
-
.pipe(take(1), map(items => -1 < items.findIndex(i => i.parent && i.parent.id === id)), switchMap(hasChildren => {
|
|
514
|
-
return this.modalService.dialog({
|
|
515
|
-
title: marker('catalog.confirm-delete-collection'),
|
|
516
|
-
body: hasChildren
|
|
517
|
-
? marker('catalog.confirm-delete-collection-and-children-body')
|
|
518
|
-
: undefined,
|
|
519
|
-
buttons: [
|
|
520
|
-
{ type: 'secondary', label: marker('common.cancel') },
|
|
521
|
-
{ type: 'danger', label: marker('common.delete'), returnValue: true },
|
|
522
|
-
],
|
|
523
|
-
});
|
|
524
|
-
}), switchMap(response => (response ? this.dataService.collection.deleteCollection(id) : EMPTY)))
|
|
525
|
-
.subscribe(() => {
|
|
526
|
-
this.notificationService.success(marker('common.notify-delete-success'), {
|
|
527
|
-
entity: 'Collection',
|
|
528
|
-
});
|
|
529
|
-
this.refresh();
|
|
530
|
-
}, err => {
|
|
531
|
-
this.notificationService.error(marker('common.notify-delete-error'), {
|
|
532
|
-
entity: 'Collection',
|
|
533
|
-
});
|
|
534
|
-
});
|
|
535
|
-
}
|
|
536
|
-
closeContents() {
|
|
537
|
-
const params = Object.assign({}, this.route.snapshot.params);
|
|
538
|
-
delete params.contents;
|
|
539
|
-
this.router.navigate(['./', params], { relativeTo: this.route, queryParamsHandling: 'preserve' });
|
|
540
|
-
}
|
|
541
|
-
setLanguage(code) {
|
|
542
|
-
this.dataService.client.setContentLanguage(code).subscribe();
|
|
543
|
-
}
|
|
544
|
-
refresh() {
|
|
545
|
-
const filterTerm = this.route.snapshot.queryParamMap.get('q');
|
|
546
|
-
this.queryResult.ref.refetch({
|
|
547
|
-
options: Object.assign({ skip: 0, take: 1000 }, (filterTerm
|
|
548
|
-
? {
|
|
549
|
-
filter: {
|
|
550
|
-
name: {
|
|
551
|
-
contains: filterTerm,
|
|
552
|
-
},
|
|
553
|
-
},
|
|
554
|
-
}
|
|
555
|
-
: {})),
|
|
556
|
-
});
|
|
557
|
-
}
|
|
558
|
-
}
|
|
559
|
-
CollectionListComponent.decorators = [
|
|
560
|
-
{ type: Component, args: [{
|
|
561
|
-
selector: 'vdr-collection-list',
|
|
562
|
-
template: "<vdr-action-bar>\r\n <vdr-ab-left>\r\n <div class=\"flex center wrap\">\r\n <vdr-language-selector\r\n class=\"mt2\"\r\n [availableLanguageCodes]=\"availableLanguages$ | async\"\r\n [currentLanguageCode]=\"contentLanguage$ | async\"\r\n (languageCodeChange)=\"setLanguage($event)\"\r\n ></vdr-language-selector>\r\n <clr-checkbox-wrapper\r\n class=\"expand-all-toggle ml3\"\r\n [ngClass]=\"(availableLanguages$ | async)?.length === 1 ? 'mt3' : 'mt1'\"\r\n >\r\n <input type=\"checkbox\" clrCheckbox [(ngModel)]=\"expandAll\" (change)=\"toggleExpandAll()\"/>\r\n <label>{{ 'catalog.expand-all-collections' | translate }}</label>\r\n </clr-checkbox-wrapper>\r\n <input\r\n type='text'\r\n name='searchTerm'\r\n [formControl]='filterTermControl'\r\n [placeholder]=\"'catalog.filter-by-name' | translate\"\r\n class='clr-input search-input ml4'\r\n />\r\n </div>\r\n </vdr-ab-left>\r\n <vdr-ab-right>\r\n <vdr-action-bar-items locationId=\"collection-list\"></vdr-action-bar-items>\r\n <a\r\n class=\"btn btn-primary\"\r\n *vdrIfPermissions=\"['CreateCatalog', 'CreateCollection']\"\r\n [routerLink]=\"['./create']\"\r\n >\r\n <clr-icon shape=\"plus\"></clr-icon>\r\n {{ 'catalog.create-new-collection' | translate }}\r\n </a>\r\n </vdr-ab-right>\r\n</vdr-action-bar>\r\n<div class=\"collection-wrapper\">\r\n <vdr-collection-tree\r\n [collections]=\"items$ | async\"\r\n [activeCollectionId]=\"activeCollectionId$ | async\"\r\n [expandAll]=\"expandAll\"\r\n [expandedIds]=\"expandedIds\"\r\n (rearrange)=\"onRearrange($event)\"\r\n (deleteCollection)=\"deleteCollection($event)\"\r\n ></vdr-collection-tree>\r\n\r\n <div class=\"collection-contents\" [class.expanded]=\"activeCollectionId$ | async\">\r\n <vdr-collection-contents [collectionId]=\"activeCollectionId$ | async\">\r\n <ng-template let-count>\r\n <div class=\"collection-title\">\r\n {{ activeCollectionTitle$ | async }} ({{\r\n 'common.results-count' | translate: { count: count }\r\n }})\r\n </div>\r\n <button type=\"button\" class=\"close-button\" (click)=\"closeContents()\">\r\n <clr-icon shape=\"close\"></clr-icon>\r\n </button>\r\n </ng-template>\r\n </vdr-collection-contents>\r\n </div>\r\n</div>\r\n",
|
|
563
|
-
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
564
|
-
styles: [":host{height:100%;display:flex;flex-direction:column}.expand-all-toggle{display:block}.collection-wrapper{display:flex;height:calc(100% - 50px)}.collection-wrapper vdr-collection-tree{flex:1;height:100%;overflow:auto}.collection-wrapper .collection-contents{height:100%;width:0;opacity:0;visibility:hidden;overflow:auto;transition:width .3s,opacity .2s .3s,visibility 0s .3s}.collection-wrapper .collection-contents.expanded{width:30vw;visibility:visible;opacity:1;padding-left:12px}.collection-wrapper .collection-contents .close-button{margin:0;background:none;border:none;cursor:pointer}.paging-controls{padding-top:6px;border-top:1px solid var(--color-component-border-100);display:flex;justify-content:space-between}\n"]
|
|
565
|
-
},] }
|
|
566
|
-
];
|
|
567
|
-
CollectionListComponent.ctorParameters = () => [
|
|
568
|
-
{ type: DataService },
|
|
569
|
-
{ type: NotificationService },
|
|
570
|
-
{ type: ModalService },
|
|
571
|
-
{ type: Router },
|
|
572
|
-
{ type: ActivatedRoute },
|
|
573
|
-
{ type: ServerConfigService }
|
|
574
|
-
];
|
|
575
|
-
|
|
576
|
-
class FacetDetailComponent extends BaseDetailComponent {
|
|
577
|
-
constructor(router, route, serverConfigService, changeDetector, dataService, formBuilder, notificationService, modalService) {
|
|
578
|
-
super(route, router, serverConfigService, dataService);
|
|
579
|
-
this.changeDetector = changeDetector;
|
|
580
|
-
this.dataService = dataService;
|
|
581
|
-
this.formBuilder = formBuilder;
|
|
582
|
-
this.notificationService = notificationService;
|
|
583
|
-
this.modalService = modalService;
|
|
584
|
-
this.updatePermission = [Permission.UpdateCatalog, Permission.UpdateFacet];
|
|
585
|
-
this.customFields = this.getCustomFieldConfig('Facet');
|
|
586
|
-
this.customValueFields = this.getCustomFieldConfig('FacetValue');
|
|
587
|
-
this.detailForm = this.formBuilder.group({
|
|
588
|
-
facet: this.formBuilder.group({
|
|
589
|
-
code: ['', Validators.required],
|
|
590
|
-
name: '',
|
|
591
|
-
visible: true,
|
|
592
|
-
customFields: this.formBuilder.group(this.customFields.reduce((hash, field) => (Object.assign(Object.assign({}, hash), { [field.name]: '' })), {})),
|
|
593
|
-
}),
|
|
594
|
-
values: this.formBuilder.array([]),
|
|
595
|
-
});
|
|
596
|
-
}
|
|
597
|
-
ngOnInit() {
|
|
598
|
-
this.init();
|
|
599
|
-
}
|
|
600
|
-
ngOnDestroy() {
|
|
601
|
-
this.destroy();
|
|
602
|
-
}
|
|
603
|
-
updateCode(currentCode, nameValue) {
|
|
604
|
-
if (!currentCode) {
|
|
605
|
-
const codeControl = this.detailForm.get(['facet', 'code']);
|
|
606
|
-
if (codeControl && codeControl.pristine) {
|
|
607
|
-
codeControl.setValue(normalizeString(nameValue, '-'));
|
|
608
|
-
}
|
|
609
|
-
}
|
|
610
|
-
}
|
|
611
|
-
updateValueCode(currentCode, nameValue, index) {
|
|
612
|
-
if (!currentCode) {
|
|
613
|
-
const codeControl = this.detailForm.get(['values', index, 'code']);
|
|
614
|
-
if (codeControl && codeControl.pristine) {
|
|
615
|
-
codeControl.setValue(normalizeString(nameValue, '-'));
|
|
616
|
-
}
|
|
617
|
-
}
|
|
618
|
-
}
|
|
619
|
-
customValueFieldIsSet(index, name) {
|
|
620
|
-
return !!this.detailForm.get(['values', index, 'customFields', name]);
|
|
621
|
-
}
|
|
622
|
-
getValuesFormArray() {
|
|
623
|
-
return this.detailForm.get('values');
|
|
624
|
-
}
|
|
625
|
-
addFacetValue() {
|
|
626
|
-
const valuesFormArray = this.detailForm.get('values');
|
|
627
|
-
if (valuesFormArray) {
|
|
628
|
-
const valueGroup = this.formBuilder.group({
|
|
629
|
-
id: '',
|
|
630
|
-
name: ['', Validators.required],
|
|
631
|
-
code: '',
|
|
632
|
-
});
|
|
633
|
-
const newValue = { name: '', code: '' };
|
|
634
|
-
if (this.customValueFields.length) {
|
|
635
|
-
const customValueFieldsGroup = new FormGroup({});
|
|
636
|
-
newValue.customFields = {};
|
|
637
|
-
for (const fieldDef of this.customValueFields) {
|
|
638
|
-
const key = fieldDef.name;
|
|
639
|
-
customValueFieldsGroup.addControl(key, new FormControl());
|
|
640
|
-
}
|
|
641
|
-
valueGroup.addControl('customFields', customValueFieldsGroup);
|
|
642
|
-
}
|
|
643
|
-
valuesFormArray.insert(valuesFormArray.length, valueGroup);
|
|
644
|
-
this.values.push(newValue);
|
|
645
|
-
}
|
|
646
|
-
}
|
|
647
|
-
create() {
|
|
648
|
-
const facetForm = this.detailForm.get('facet');
|
|
649
|
-
if (!facetForm || !facetForm.dirty) {
|
|
650
|
-
return;
|
|
651
|
-
}
|
|
652
|
-
combineLatest(this.entity$, this.languageCode$)
|
|
653
|
-
.pipe(take(1), mergeMap(([facet, languageCode]) => {
|
|
654
|
-
const newFacet = this.getUpdatedFacet(facet, facetForm, languageCode);
|
|
655
|
-
return this.dataService.facet.createFacet(newFacet);
|
|
656
|
-
}), switchMap(data => this.dataService.facet.getAllFacets().single$.pipe(mapTo(data))))
|
|
657
|
-
.subscribe(data => {
|
|
658
|
-
this.notificationService.success(marker('common.notify-create-success'), { entity: 'Facet' });
|
|
659
|
-
this.detailForm.markAsPristine();
|
|
660
|
-
this.changeDetector.markForCheck();
|
|
661
|
-
this.router.navigate(['../', data.createFacet.id], { relativeTo: this.route });
|
|
662
|
-
}, err => {
|
|
663
|
-
this.notificationService.error(marker('common.notify-create-error'), {
|
|
664
|
-
entity: 'Facet',
|
|
665
|
-
});
|
|
666
|
-
});
|
|
667
|
-
}
|
|
668
|
-
save() {
|
|
669
|
-
combineLatest(this.entity$, this.languageCode$)
|
|
670
|
-
.pipe(take(1), mergeMap(([facet, languageCode]) => {
|
|
671
|
-
const facetGroup = this.detailForm.get('facet');
|
|
672
|
-
const updateOperations = [];
|
|
673
|
-
if (facetGroup && facetGroup.dirty) {
|
|
674
|
-
const newFacet = this.getUpdatedFacet(facet, facetGroup, languageCode);
|
|
675
|
-
if (newFacet) {
|
|
676
|
-
updateOperations.push(this.dataService.facet.updateFacet(newFacet));
|
|
677
|
-
}
|
|
678
|
-
}
|
|
679
|
-
const valuesArray = this.detailForm.get('values');
|
|
680
|
-
if (valuesArray && valuesArray.dirty) {
|
|
681
|
-
const createdValues = this.getCreatedFacetValues(facet, valuesArray, languageCode);
|
|
682
|
-
if (createdValues.length) {
|
|
683
|
-
updateOperations.push(this.dataService.facet
|
|
684
|
-
.createFacetValues(createdValues)
|
|
685
|
-
.pipe(switchMap(() => this.dataService.facet.getFacet(this.id).single$)));
|
|
686
|
-
}
|
|
687
|
-
const updatedValues = this.getUpdatedFacetValues(facet, valuesArray, languageCode);
|
|
688
|
-
if (updatedValues.length) {
|
|
689
|
-
updateOperations.push(this.dataService.facet.updateFacetValues(updatedValues));
|
|
690
|
-
}
|
|
691
|
-
}
|
|
692
|
-
return forkJoin(updateOperations);
|
|
693
|
-
}), switchMap(() => this.dataService.facet.getAllFacets().single$))
|
|
694
|
-
.subscribe(() => {
|
|
695
|
-
this.detailForm.markAsPristine();
|
|
696
|
-
this.changeDetector.markForCheck();
|
|
697
|
-
this.notificationService.success(marker('common.notify-update-success'), { entity: 'Facet' });
|
|
698
|
-
}, err => {
|
|
699
|
-
this.notificationService.error(marker('common.notify-update-error'), {
|
|
700
|
-
entity: 'Facet',
|
|
701
|
-
});
|
|
702
|
-
});
|
|
703
|
-
}
|
|
704
|
-
deleteFacetValue(facetValueId, index) {
|
|
705
|
-
if (!facetValueId) {
|
|
706
|
-
// deleting a newly-added (not persisted) FacetValue
|
|
707
|
-
const valuesFormArray = this.detailForm.get('values');
|
|
708
|
-
if (valuesFormArray) {
|
|
709
|
-
valuesFormArray.removeAt(index);
|
|
710
|
-
}
|
|
711
|
-
this.values.splice(index, 1);
|
|
712
|
-
return;
|
|
713
|
-
}
|
|
714
|
-
this.showModalAndDelete(facetValueId)
|
|
715
|
-
.pipe(switchMap(response => {
|
|
716
|
-
if (response.result === DeletionResult.DELETED) {
|
|
717
|
-
return [true];
|
|
718
|
-
}
|
|
719
|
-
else {
|
|
720
|
-
return this.showModalAndDelete(facetValueId, response.message || '').pipe(map(r => r.result === DeletionResult.DELETED));
|
|
721
|
-
}
|
|
722
|
-
}), switchMap(deleted => (deleted ? this.dataService.facet.getFacet(this.id).single$ : [])))
|
|
723
|
-
.subscribe(() => {
|
|
724
|
-
this.notificationService.success(marker('common.notify-delete-success'), {
|
|
725
|
-
entity: 'FacetValue',
|
|
726
|
-
});
|
|
727
|
-
}, err => {
|
|
728
|
-
this.notificationService.error(marker('common.notify-delete-error'), {
|
|
729
|
-
entity: 'FacetValue',
|
|
730
|
-
});
|
|
731
|
-
});
|
|
732
|
-
}
|
|
733
|
-
showModalAndDelete(facetValueId, message) {
|
|
734
|
-
return this.modalService
|
|
735
|
-
.dialog({
|
|
736
|
-
title: marker('catalog.confirm-delete-facet-value'),
|
|
737
|
-
body: message,
|
|
738
|
-
buttons: [
|
|
739
|
-
{ type: 'secondary', label: marker('common.cancel') },
|
|
740
|
-
{ type: 'danger', label: marker('common.delete'), returnValue: true },
|
|
741
|
-
],
|
|
742
|
-
})
|
|
743
|
-
.pipe(switchMap(result => result ? this.dataService.facet.deleteFacetValues([facetValueId], !!message) : EMPTY), map(result => result.deleteFacetValues[0]));
|
|
744
|
-
}
|
|
745
|
-
/**
|
|
746
|
-
* Sets the values of the form on changes to the facet or current language.
|
|
747
|
-
*/
|
|
748
|
-
setFormValues(facet, languageCode) {
|
|
749
|
-
var _a;
|
|
750
|
-
const currentTranslation = findTranslation(facet, languageCode);
|
|
751
|
-
this.detailForm.patchValue({
|
|
752
|
-
facet: {
|
|
753
|
-
code: facet.code,
|
|
754
|
-
visible: !facet.isPrivate,
|
|
755
|
-
name: (_a = currentTranslation === null || currentTranslation === void 0 ? void 0 : currentTranslation.name) !== null && _a !== void 0 ? _a : '',
|
|
756
|
-
},
|
|
757
|
-
});
|
|
758
|
-
if (this.customFields.length) {
|
|
759
|
-
const customFieldsGroup = this.detailForm.get(['facet', 'customFields']);
|
|
760
|
-
this.setCustomFieldFormValues(this.customFields, this.detailForm.get(['facet', 'customFields']), facet, currentTranslation);
|
|
761
|
-
}
|
|
762
|
-
const currentValuesFormArray = this.detailForm.get('values');
|
|
763
|
-
this.values = [...facet.values];
|
|
764
|
-
facet.values.forEach((value, i) => {
|
|
765
|
-
var _a, _b, _c, _d, _e;
|
|
766
|
-
const valueTranslation = findTranslation(value, languageCode);
|
|
767
|
-
const group = {
|
|
768
|
-
id: value.id,
|
|
769
|
-
code: value.code,
|
|
770
|
-
name: valueTranslation ? valueTranslation.name : '',
|
|
771
|
-
};
|
|
772
|
-
const valueControl = currentValuesFormArray.at(i);
|
|
773
|
-
if (valueControl) {
|
|
774
|
-
(_a = valueControl.get('id')) === null || _a === void 0 ? void 0 : _a.setValue(group.id);
|
|
775
|
-
(_b = valueControl.get('code')) === null || _b === void 0 ? void 0 : _b.setValue(group.code);
|
|
776
|
-
(_c = valueControl.get('name')) === null || _c === void 0 ? void 0 : _c.setValue(group.name);
|
|
777
|
-
}
|
|
778
|
-
else {
|
|
779
|
-
currentValuesFormArray.insert(i, this.formBuilder.group(group));
|
|
780
|
-
}
|
|
781
|
-
if (this.customValueFields.length) {
|
|
782
|
-
let customValueFieldsGroup = this.detailForm.get(['values', i, 'customFields']);
|
|
783
|
-
if (!customValueFieldsGroup) {
|
|
784
|
-
customValueFieldsGroup = new FormGroup({});
|
|
785
|
-
this.detailForm.get(['values', i]).addControl('customFields', customValueFieldsGroup);
|
|
786
|
-
}
|
|
787
|
-
if (customValueFieldsGroup) {
|
|
788
|
-
for (const fieldDef of this.customValueFields) {
|
|
789
|
-
const key = fieldDef.name;
|
|
790
|
-
const fieldValue = fieldDef.type === 'localeString'
|
|
791
|
-
? (_e = (_d = valueTranslation) === null || _d === void 0 ? void 0 : _d.customFields) === null || _e === void 0 ? void 0 : _e[key]
|
|
792
|
-
: value.customFields[key];
|
|
793
|
-
const control = customValueFieldsGroup.get(key);
|
|
794
|
-
if (control) {
|
|
795
|
-
control.setValue(fieldValue);
|
|
796
|
-
}
|
|
797
|
-
else {
|
|
798
|
-
customValueFieldsGroup.addControl(key, new FormControl(fieldValue));
|
|
799
|
-
}
|
|
800
|
-
}
|
|
801
|
-
}
|
|
802
|
-
}
|
|
803
|
-
});
|
|
804
|
-
}
|
|
805
|
-
/**
|
|
806
|
-
* Given a facet and the value of the detailForm, this method creates an updated copy of the facet which
|
|
807
|
-
* can then be persisted to the API.
|
|
808
|
-
*/
|
|
809
|
-
getUpdatedFacet(facet, facetFormGroup, languageCode) {
|
|
810
|
-
const input = createUpdatedTranslatable({
|
|
811
|
-
translatable: facet,
|
|
812
|
-
updatedFields: facetFormGroup.value,
|
|
813
|
-
customFieldConfig: this.customFields,
|
|
814
|
-
languageCode,
|
|
815
|
-
defaultTranslation: {
|
|
816
|
-
languageCode,
|
|
817
|
-
name: facet.name || '',
|
|
818
|
-
},
|
|
819
|
-
});
|
|
820
|
-
input.isPrivate = !facetFormGroup.value.visible;
|
|
821
|
-
return input;
|
|
822
|
-
}
|
|
823
|
-
/**
|
|
824
|
-
* Given an array of facet values and the values from the detailForm, this method creates a new array
|
|
825
|
-
* which can be persisted to the API via a createFacetValues mutation.
|
|
826
|
-
*/
|
|
827
|
-
getCreatedFacetValues(facet, valuesFormArray, languageCode) {
|
|
828
|
-
return valuesFormArray.controls
|
|
829
|
-
.filter(c => !c.value.id)
|
|
830
|
-
.map(c => c.value)
|
|
831
|
-
.map(value => createUpdatedTranslatable({
|
|
832
|
-
translatable: Object.assign(Object.assign({}, value), { translations: [] }),
|
|
833
|
-
updatedFields: value,
|
|
834
|
-
customFieldConfig: this.customValueFields,
|
|
835
|
-
languageCode,
|
|
836
|
-
defaultTranslation: {
|
|
837
|
-
languageCode,
|
|
838
|
-
name: '',
|
|
839
|
-
},
|
|
840
|
-
}))
|
|
841
|
-
.map(input => (Object.assign({ facetId: facet.id }, input)));
|
|
842
|
-
}
|
|
843
|
-
/**
|
|
844
|
-
* Given an array of facet values and the values from the detailForm, this method creates a new array
|
|
845
|
-
* which can be persisted to the API via an updateFacetValues mutation.
|
|
846
|
-
*/
|
|
847
|
-
getUpdatedFacetValues(facet, valuesFormArray, languageCode) {
|
|
848
|
-
const dirtyValues = facet.values.filter((v, i) => {
|
|
849
|
-
const formRow = valuesFormArray.get(i.toString());
|
|
850
|
-
return formRow && formRow.dirty && formRow.value.id;
|
|
851
|
-
});
|
|
852
|
-
const dirtyValueValues = valuesFormArray.controls
|
|
853
|
-
.filter(c => c.dirty && c.value.id)
|
|
854
|
-
.map(c => c.value);
|
|
855
|
-
if (dirtyValues.length !== dirtyValueValues.length) {
|
|
856
|
-
throw new Error(marker(`error.facet-value-form-values-do-not-match`));
|
|
857
|
-
}
|
|
858
|
-
return dirtyValues
|
|
859
|
-
.map((value, i) => {
|
|
860
|
-
return createUpdatedTranslatable({
|
|
861
|
-
translatable: value,
|
|
862
|
-
updatedFields: dirtyValueValues[i],
|
|
863
|
-
customFieldConfig: this.customValueFields,
|
|
864
|
-
languageCode,
|
|
865
|
-
defaultTranslation: {
|
|
866
|
-
languageCode,
|
|
867
|
-
name: '',
|
|
868
|
-
},
|
|
869
|
-
});
|
|
870
|
-
})
|
|
871
|
-
.filter(notNullOrUndefined);
|
|
872
|
-
}
|
|
873
|
-
}
|
|
874
|
-
FacetDetailComponent.decorators = [
|
|
875
|
-
{ type: Component, args: [{
|
|
876
|
-
selector: 'vdr-facet-detail',
|
|
877
|
-
template: "<vdr-action-bar>\r\n <vdr-ab-left>\r\n <vdr-entity-info [entity]=\"entity$ | async\"></vdr-entity-info>\r\n <vdr-language-selector\r\n [disabled]=\"isNew$ | async\"\r\n [availableLanguageCodes]=\"availableLanguages$ | async\"\r\n [currentLanguageCode]=\"languageCode$ | async\"\r\n (languageCodeChange)=\"setLanguage($event)\"\r\n ></vdr-language-selector>\r\n </vdr-ab-left>\r\n\r\n <vdr-ab-right>\r\n <vdr-action-bar-items locationId=\"facet-detail\"></vdr-action-bar-items>\r\n <button\r\n class=\"btn btn-primary\"\r\n *ngIf=\"isNew$ | async; else updateButton\"\r\n (click)=\"create()\"\r\n [disabled]=\"detailForm.invalid || detailForm.pristine\"\r\n >\r\n {{ 'common.create' | translate }}\r\n </button>\r\n <ng-template #updateButton>\r\n <button\r\n *vdrIfPermissions=\"updatePermission\"\r\n class=\"btn btn-primary\"\r\n (click)=\"save()\"\r\n [disabled]=\"detailForm.invalid || detailForm.pristine\"\r\n >\r\n {{ 'common.update' | translate }}\r\n </button>\r\n </ng-template>\r\n </vdr-ab-right>\r\n</vdr-action-bar>\r\n\r\n<form class=\"form\" [formGroup]=\"detailForm\" *ngIf=\"entity$ | async as facet\">\r\n <section class=\"form-block\" formGroupName=\"facet\">\r\n <vdr-form-field [label]=\"'catalog.visibility' | translate\" for=\"visibility\">\r\n <clr-toggle-wrapper>\r\n <input\r\n type=\"checkbox\"\r\n clrToggle\r\n [vdrDisabled]=\"!(updatePermission | hasPermission)\"\r\n formControlName=\"visible\"\r\n id=\"visibility\"\r\n />\r\n <label class=\"visible-toggle\">\r\n <ng-container *ngIf=\"detailForm.value.facet.visible; else private\">{{\r\n 'catalog.public' | translate\r\n }}</ng-container>\r\n <ng-template #private>{{ 'catalog.private' | translate }}</ng-template>\r\n </label>\r\n </clr-toggle-wrapper>\r\n </vdr-form-field>\r\n <vdr-form-field [label]=\"'common.name' | translate\" for=\"name\">\r\n <input\r\n id=\"name\"\r\n type=\"text\"\r\n formControlName=\"name\"\r\n [readonly]=\"!(updatePermission | hasPermission)\"\r\n (input)=\"updateCode(facet.code, $event.target.value)\"\r\n />\r\n </vdr-form-field>\r\n <vdr-form-field\r\n [label]=\"'common.code' | translate\"\r\n for=\"code\"\r\n [readOnlyToggle]=\"updatePermission | hasPermission\"\r\n >\r\n <input\r\n id=\"code\"\r\n type=\"text\"\r\n [readonly]=\"!(updatePermission | hasPermission)\"\r\n formControlName=\"code\"\r\n />\r\n </vdr-form-field>\r\n\r\n <section formGroupName=\"customFields\" *ngIf=\"customFields.length\">\r\n <label>{{ 'common.custom-fields' | translate }}</label>\r\n <vdr-tabbed-custom-fields\r\n entityName=\"Facet\"\r\n [customFields]=\"customFields\"\r\n [customFieldsFormGroup]=\"detailForm.get(['facet', 'customFields'])\"\r\n [readonly]=\"!(updatePermission | hasPermission)\"\r\n ></vdr-tabbed-custom-fields>\r\n </section>\r\n <vdr-custom-detail-component-host\r\n locationId=\"facet-detail\"\r\n [entity$]=\"entity$\"\r\n [detailForm]=\"detailForm\"\r\n ></vdr-custom-detail-component-host>\r\n </section>\r\n\r\n <section class=\"form-block\" *ngIf=\"!(isNew$ | async)\">\r\n <label>{{ 'catalog.facet-values' | translate }}</label>\r\n\r\n <table class=\"facet-values-list table\" formArrayName=\"values\" *ngIf=\"0 < getValuesFormArray().length\">\r\n <thead>\r\n <tr>\r\n <th></th>\r\n <th>{{ 'common.name' | translate }}</th>\r\n <th>{{ 'common.code' | translate }}</th>\r\n <ng-container *ngIf=\"customValueFields.length\">\r\n <th>{{ 'common.custom-fields' | translate }}</th>\r\n </ng-container>\r\n <th></th>\r\n </tr>\r\n </thead>\r\n <tbody>\r\n <tr class=\"facet-value\" *ngFor=\"let value of values; let i = index\" [formGroupName]=\"i\">\r\n <td class=\"align-middle\">\r\n <vdr-entity-info [entity]=\"value\"></vdr-entity-info>\r\n </td>\r\n <td class=\"align-middle\">\r\n <input\r\n type=\"text\"\r\n formControlName=\"name\"\r\n [readonly]=\"!(updatePermission | hasPermission)\"\r\n (input)=\"updateValueCode(facet.values[i]?.code, $event.target.value, i)\"\r\n />\r\n </td>\r\n <td class=\"align-middle\"><input type=\"text\" formControlName=\"code\" readonly /></td>\r\n <td class=\"\" *ngIf=\"customValueFields.length\">\r\n <vdr-tabbed-custom-fields\r\n entityName=\"FacetValue\"\r\n [customFields]=\"customValueFields\"\r\n [compact]=\"true\"\r\n [customFieldsFormGroup]=\"detailForm.get(['values', i, 'customFields'])\"\r\n [readonly]=\"!(updatePermission | hasPermission)\"\r\n ></vdr-tabbed-custom-fields>\r\n </td>\r\n <td class=\"align-middle\">\r\n <vdr-dropdown>\r\n <button type=\"button\" class=\"btn btn-link btn-sm\" vdrDropdownTrigger>\r\n {{ 'common.actions' | translate }}\r\n <clr-icon shape=\"caret down\"></clr-icon>\r\n </button>\r\n <vdr-dropdown-menu vdrPosition=\"bottom-right\">\r\n <button\r\n type=\"button\"\r\n class=\"delete-button\"\r\n (click)=\"deleteFacetValue(facet.values[i]?.id, i)\"\r\n [disabled]=\"!(updatePermission | hasPermission)\"\r\n vdrDropdownItem\r\n >\r\n <clr-icon shape=\"trash\" class=\"is-danger\"></clr-icon>\r\n {{ 'common.delete' | translate }}\r\n </button>\r\n </vdr-dropdown-menu>\r\n </vdr-dropdown>\r\n </td>\r\n </tr>\r\n </tbody>\r\n </table>\r\n\r\n <div>\r\n <button\r\n type=\"button\"\r\n class=\"btn btn-secondary\"\r\n *vdrIfPermissions=\"['CreateCatalog', 'CreateFacet']\"\r\n (click)=\"addFacetValue()\"\r\n >\r\n <clr-icon shape=\"add\"></clr-icon>\r\n {{ 'catalog.add-facet-value' | translate }}\r\n </button>\r\n </div>\r\n </section>\r\n</form>\r\n",
|
|
878
|
-
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
879
|
-
styles: [".visible-toggle{margin-top:-3px!important}\n"]
|
|
880
|
-
},] }
|
|
881
|
-
];
|
|
882
|
-
FacetDetailComponent.ctorParameters = () => [
|
|
883
|
-
{ type: Router },
|
|
884
|
-
{ type: ActivatedRoute },
|
|
885
|
-
{ type: ServerConfigService },
|
|
886
|
-
{ type: ChangeDetectorRef },
|
|
887
|
-
{ type: DataService },
|
|
888
|
-
{ type: FormBuilder },
|
|
889
|
-
{ type: NotificationService },
|
|
890
|
-
{ type: ModalService }
|
|
891
|
-
];
|
|
892
|
-
|
|
893
|
-
class FacetListComponent extends BaseListComponent {
|
|
894
|
-
constructor(dataService, modalService, notificationService, serverConfigService, router, route) {
|
|
895
|
-
super(router, route);
|
|
896
|
-
this.dataService = dataService;
|
|
897
|
-
this.modalService = modalService;
|
|
898
|
-
this.notificationService = notificationService;
|
|
899
|
-
this.serverConfigService = serverConfigService;
|
|
900
|
-
this.filterTermControl = new FormControl('');
|
|
901
|
-
this.initialLimit = 3;
|
|
902
|
-
this.displayLimit = {};
|
|
903
|
-
super.setQueryFn((...args) => this.dataService.facet.getFacets(...args).refetchOnChannelChange(), data => data.facets, (skip, take) => ({
|
|
904
|
-
options: {
|
|
905
|
-
skip,
|
|
906
|
-
take,
|
|
907
|
-
filter: {
|
|
908
|
-
name: {
|
|
909
|
-
contains: this.filterTermControl.value,
|
|
910
|
-
},
|
|
911
|
-
},
|
|
912
|
-
sort: {
|
|
913
|
-
createdAt: SortOrder$1.DESC,
|
|
914
|
-
},
|
|
915
|
-
},
|
|
916
|
-
}));
|
|
917
|
-
}
|
|
918
|
-
ngOnInit() {
|
|
919
|
-
super.ngOnInit();
|
|
920
|
-
this.availableLanguages$ = this.serverConfigService.getAvailableLanguages();
|
|
921
|
-
this.contentLanguage$ = this.dataService.client
|
|
922
|
-
.uiState()
|
|
923
|
-
.mapStream(({ uiState }) => uiState.contentLanguage)
|
|
924
|
-
.pipe(tap(() => this.refresh()));
|
|
925
|
-
this.filterTermControl.valueChanges
|
|
926
|
-
.pipe(filter(value => 2 <= value.length || value.length === 0), debounceTime(250), takeUntil(this.destroy$))
|
|
927
|
-
.subscribe(() => this.refresh());
|
|
928
|
-
}
|
|
929
|
-
toggleDisplayLimit(facet) {
|
|
930
|
-
if (this.displayLimit[facet.id] === facet.values.length) {
|
|
931
|
-
this.displayLimit[facet.id] = this.initialLimit;
|
|
932
|
-
}
|
|
933
|
-
else {
|
|
934
|
-
this.displayLimit[facet.id] = facet.values.length;
|
|
935
|
-
}
|
|
936
|
-
}
|
|
937
|
-
deleteFacet(facetValueId) {
|
|
938
|
-
this.showModalAndDelete(facetValueId)
|
|
939
|
-
.pipe(switchMap(response => {
|
|
940
|
-
if (response.result === DeletionResult.DELETED) {
|
|
941
|
-
return [true];
|
|
942
|
-
}
|
|
943
|
-
else {
|
|
944
|
-
return this.showModalAndDelete(facetValueId, response.message || '').pipe(map(r => r.result === DeletionResult.DELETED));
|
|
945
|
-
}
|
|
946
|
-
}),
|
|
947
|
-
// Refresh the cached facets to reflect the changes
|
|
948
|
-
switchMap(() => this.dataService.facet.getAllFacets().single$))
|
|
949
|
-
.subscribe(() => {
|
|
950
|
-
this.notificationService.success(marker('common.notify-delete-success'), {
|
|
951
|
-
entity: 'FacetValue',
|
|
952
|
-
});
|
|
953
|
-
this.refresh();
|
|
954
|
-
}, err => {
|
|
955
|
-
this.notificationService.error(marker('common.notify-delete-error'), {
|
|
956
|
-
entity: 'FacetValue',
|
|
957
|
-
});
|
|
958
|
-
});
|
|
959
|
-
}
|
|
960
|
-
setLanguage(code) {
|
|
961
|
-
this.dataService.client.setContentLanguage(code).subscribe();
|
|
962
|
-
}
|
|
963
|
-
showModalAndDelete(facetId, message) {
|
|
964
|
-
return this.modalService
|
|
965
|
-
.dialog({
|
|
966
|
-
title: marker('catalog.confirm-delete-facet'),
|
|
967
|
-
body: message,
|
|
968
|
-
buttons: [
|
|
969
|
-
{ type: 'secondary', label: marker('common.cancel') },
|
|
970
|
-
{ type: 'danger', label: marker('common.delete'), returnValue: true },
|
|
971
|
-
],
|
|
972
|
-
})
|
|
973
|
-
.pipe(switchMap(res => (res ? this.dataService.facet.deleteFacet(facetId, !!message) : EMPTY)), map(res => res.deleteFacet));
|
|
974
|
-
}
|
|
975
|
-
}
|
|
976
|
-
FacetListComponent.decorators = [
|
|
977
|
-
{ type: Component, args: [{
|
|
978
|
-
selector: 'vdr-facet-list',
|
|
979
|
-
template: "<vdr-action-bar>\r\n <vdr-ab-left>\r\n <div class=\"flex center wrap\">\r\n <vdr-language-selector\r\n [availableLanguageCodes]=\"availableLanguages$ | async\"\r\n [currentLanguageCode]=\"contentLanguage$ | async\"\r\n (languageCodeChange)=\"setLanguage($event)\"\r\n ></vdr-language-selector>\r\n <input\r\n type=\"text\"\r\n name=\"searchTerm\"\r\n [formControl]=\"filterTermControl\"\r\n [placeholder]=\"'catalog.filter-by-name' | translate\"\r\n class=\"clr-input search-input ml4\"\r\n />\r\n </div>\r\n </vdr-ab-left>\r\n <vdr-ab-right>\r\n <vdr-action-bar-items locationId=\"facet-list\"></vdr-action-bar-items>\r\n <a\r\n class=\"btn btn-primary\"\r\n *vdrIfPermissions=\"['CreateCatalog', 'CreateFacet']\"\r\n [routerLink]=\"['./create']\"\r\n >\r\n <clr-icon shape=\"plus\"></clr-icon>\r\n {{ 'catalog.create-new-facet' | translate }}\r\n </a>\r\n </vdr-ab-right>\r\n</vdr-action-bar>\r\n\r\n<vdr-data-table\r\n [items]=\"items$ | async\"\r\n [itemsPerPage]=\"itemsPerPage$ | async\"\r\n [totalItems]=\"totalItems$ | async\"\r\n [currentPage]=\"currentPage$ | async\"\r\n (pageChange)=\"setPageNumber($event)\"\r\n (itemsPerPageChange)=\"setItemsPerPage($event)\"\r\n>\r\n <vdr-dt-column>{{ 'common.code' | translate }}</vdr-dt-column>\r\n <vdr-dt-column>{{ 'common.name' | translate }}</vdr-dt-column>\r\n <vdr-dt-column [expand]=\"true\">{{ 'catalog.values' | translate }}</vdr-dt-column>\r\n <vdr-dt-column>{{ 'catalog.visibility' | translate }}</vdr-dt-column>\r\n <vdr-dt-column></vdr-dt-column>\r\n <vdr-dt-column></vdr-dt-column>\r\n <ng-template let-facet=\"item\">\r\n <td class=\"left align-middle\" [class.private]=\"facet.isPrivate\">{{ facet.code }}</td>\r\n <td class=\"left align-middle\" [class.private]=\"facet.isPrivate\">{{ facet.name }}</td>\r\n <td class=\"left align-middle\" [class.private]=\"facet.isPrivate\">\r\n <vdr-facet-value-chip\r\n *ngFor=\"let value of facet.values | slice: 0:displayLimit[facet.id] || 3\"\r\n [facetValue]=\"value\"\r\n [removable]=\"false\"\r\n [displayFacetName]=\"false\"\r\n ></vdr-facet-value-chip>\r\n <button\r\n class=\"btn btn-sm btn-secondary btn-icon\"\r\n *ngIf=\"facet.values.length > initialLimit\"\r\n (click)=\"toggleDisplayLimit(facet)\"\r\n >\r\n <ng-container *ngIf=\"(displayLimit[facet.id] || 0) < facet.values.length; else collapse\">\r\n <clr-icon shape=\"plus\"></clr-icon>\r\n {{ facet.values.length - initialLimit }}\r\n </ng-container>\r\n <ng-template #collapse>\r\n <clr-icon shape=\"minus\"></clr-icon>\r\n </ng-template>\r\n </button>\r\n </td>\r\n <td class=\"left align-middle\" [class.private]=\"facet.isPrivate\">\r\n <vdr-chip>\r\n <ng-container *ngIf=\"!facet.isPrivate; else private\">{{\r\n 'catalog.public' | translate\r\n }}</ng-container>\r\n <ng-template #private>{{ 'catalog.private' | translate }}</ng-template>\r\n </vdr-chip>\r\n </td>\r\n <td class=\"right align-middle\" [class.private]=\"facet.isPrivate\">\r\n <vdr-table-row-action\r\n iconShape=\"edit\"\r\n [label]=\"'common.edit' | translate\"\r\n [linkTo]=\"['./', facet.id]\"\r\n ></vdr-table-row-action>\r\n </td>\r\n <td class=\"right align-middle\" [class.private]=\"facet.isPrivate\">\r\n <vdr-dropdown>\r\n <button type=\"button\" class=\"btn btn-link btn-sm\" vdrDropdownTrigger>\r\n {{ 'common.actions' | translate }}\r\n <clr-icon shape=\"caret down\"></clr-icon>\r\n </button>\r\n <vdr-dropdown-menu vdrPosition=\"bottom-right\">\r\n <button\r\n type=\"button\"\r\n class=\"delete-button\"\r\n (click)=\"deleteFacet(facet.id)\"\r\n [disabled]=\"!(['DeleteCatalog', 'DeleteFacet'] | hasPermission)\"\r\n vdrDropdownItem\r\n >\r\n <clr-icon shape=\"trash\" class=\"is-danger\"></clr-icon>\r\n {{ 'common.delete' | translate }}\r\n </button>\r\n </vdr-dropdown-menu>\r\n </vdr-dropdown>\r\n </td>\r\n </ng-template>\r\n</vdr-data-table>\r\n",
|
|
980
|
-
styles: ["td.private{background-color:var(--color-component-bg-200)}\n"]
|
|
981
|
-
},] }
|
|
982
|
-
];
|
|
983
|
-
FacetListComponent.ctorParameters = () => [
|
|
984
|
-
{ type: DataService },
|
|
985
|
-
{ type: ModalService },
|
|
986
|
-
{ type: NotificationService },
|
|
987
|
-
{ type: ServerConfigService },
|
|
988
|
-
{ type: Router },
|
|
989
|
-
{ type: ActivatedRoute }
|
|
990
|
-
];
|
|
991
|
-
|
|
992
|
-
/**
|
|
993
|
-
* @description
|
|
994
|
-
* Like String.prototype.replace(), but replaces the last instance
|
|
995
|
-
* rather than the first.
|
|
996
|
-
*/
|
|
997
|
-
function replaceLast(target, search, replace) {
|
|
998
|
-
if (!target) {
|
|
999
|
-
return '';
|
|
1000
|
-
}
|
|
1001
|
-
const lastIndex = target.lastIndexOf(search);
|
|
1002
|
-
if (lastIndex === -1) {
|
|
1003
|
-
return target;
|
|
1004
|
-
}
|
|
1005
|
-
const head = target.substr(0, lastIndex);
|
|
1006
|
-
const tail = target.substr(lastIndex).replace(search, replace);
|
|
1007
|
-
return head + tail;
|
|
1008
|
-
}
|
|
1009
|
-
|
|
1010
|
-
/**
|
|
1011
|
-
* Handles the logic for making the API calls to perform CRUD operations on a Product and its related
|
|
1012
|
-
* entities. This logic was extracted out of the component because it became too large and hard to follow.
|
|
1013
|
-
*/
|
|
1014
|
-
class ProductDetailService {
|
|
1015
|
-
constructor(dataService) {
|
|
1016
|
-
this.dataService = dataService;
|
|
1017
|
-
}
|
|
1018
|
-
getFacets() {
|
|
1019
|
-
return this.dataService.facet.getAllFacets().mapSingle(data => data.facets.items);
|
|
1020
|
-
}
|
|
1021
|
-
getTaxCategories() {
|
|
1022
|
-
return this.dataService.settings
|
|
1023
|
-
.getTaxCategories()
|
|
1024
|
-
.mapSingle(data => data.taxCategories)
|
|
1025
|
-
.pipe(shareReplay(1));
|
|
1026
|
-
}
|
|
1027
|
-
createProductWithVariants(input, createVariantsConfig, languageCode) {
|
|
1028
|
-
const createProduct$ = this.dataService.product.createProduct(input);
|
|
1029
|
-
const nonEmptyOptionGroups = createVariantsConfig.groups.filter(g => 0 < g.values.length);
|
|
1030
|
-
const createOptionGroups$ = this.createProductOptionGroups(nonEmptyOptionGroups, languageCode);
|
|
1031
|
-
return forkJoin(createProduct$, createOptionGroups$).pipe(mergeMap(([{ createProduct }, optionGroups]) => {
|
|
1032
|
-
const addOptionsToProduct$ = optionGroups.length
|
|
1033
|
-
? forkJoin(optionGroups.map(optionGroup => {
|
|
1034
|
-
return this.dataService.product.addOptionGroupToProduct({
|
|
1035
|
-
productId: createProduct.id,
|
|
1036
|
-
optionGroupId: optionGroup.id,
|
|
1037
|
-
});
|
|
1038
|
-
}))
|
|
1039
|
-
: of([]);
|
|
1040
|
-
return addOptionsToProduct$.pipe(map(() => {
|
|
1041
|
-
return { createProduct, optionGroups };
|
|
1042
|
-
}));
|
|
1043
|
-
}), mergeMap(({ createProduct, optionGroups }) => {
|
|
1044
|
-
const variants = createVariantsConfig.variants.map(v => {
|
|
1045
|
-
const optionIds = optionGroups.length
|
|
1046
|
-
? v.optionValues.map((optionName, index) => {
|
|
1047
|
-
const option = optionGroups[index].options.find(o => o.name === optionName);
|
|
1048
|
-
if (!option) {
|
|
1049
|
-
throw new Error(`Could not find a matching ProductOption "${optionName}" when creating variant`);
|
|
1050
|
-
}
|
|
1051
|
-
return option.id;
|
|
1052
|
-
})
|
|
1053
|
-
: [];
|
|
1054
|
-
return Object.assign(Object.assign({}, v), { optionIds });
|
|
1055
|
-
});
|
|
1056
|
-
const options = optionGroups.map(og => og.options).reduce((flat, o) => [...flat, ...o], []);
|
|
1057
|
-
return this.createProductVariants(createProduct, variants, options, languageCode);
|
|
1058
|
-
}));
|
|
1059
|
-
}
|
|
1060
|
-
createProductOptionGroups(groups, languageCode) {
|
|
1061
|
-
return groups.length
|
|
1062
|
-
? forkJoin(groups.map(c => {
|
|
1063
|
-
return this.dataService.product
|
|
1064
|
-
.createProductOptionGroups({
|
|
1065
|
-
code: normalizeString(c.name, '-'),
|
|
1066
|
-
translations: [{ languageCode, name: c.name }],
|
|
1067
|
-
options: c.values.map(v => ({
|
|
1068
|
-
code: normalizeString(v, '-'),
|
|
1069
|
-
translations: [{ languageCode, name: v }],
|
|
1070
|
-
})),
|
|
1071
|
-
})
|
|
1072
|
-
.pipe(map(data => data.createProductOptionGroup));
|
|
1073
|
-
}))
|
|
1074
|
-
: of([]);
|
|
1075
|
-
}
|
|
1076
|
-
createProductVariants(product, variantData, options, languageCode) {
|
|
1077
|
-
const variants = variantData.map(v => {
|
|
1078
|
-
const name = options.length
|
|
1079
|
-
? `${product.name} ${v.optionIds
|
|
1080
|
-
.map(id => options.find(o => o.id === id))
|
|
1081
|
-
.filter(notNullOrUndefined)
|
|
1082
|
-
.map(o => o.name)
|
|
1083
|
-
.join(' ')}`
|
|
1084
|
-
: product.name;
|
|
1085
|
-
return {
|
|
1086
|
-
productId: product.id,
|
|
1087
|
-
price: v.price,
|
|
1088
|
-
sku: v.sku,
|
|
1089
|
-
stockOnHand: v.stock,
|
|
1090
|
-
translations: [
|
|
1091
|
-
{
|
|
1092
|
-
languageCode,
|
|
1093
|
-
name,
|
|
1094
|
-
},
|
|
1095
|
-
],
|
|
1096
|
-
optionIds: v.optionIds,
|
|
1097
|
-
};
|
|
1098
|
-
});
|
|
1099
|
-
return this.dataService.product.createProductVariants(variants).pipe(map(({ createProductVariants }) => ({
|
|
1100
|
-
createProductVariants,
|
|
1101
|
-
productId: product.id,
|
|
1102
|
-
})));
|
|
1103
|
-
}
|
|
1104
|
-
updateProduct(updateOptions) {
|
|
1105
|
-
const { product, languageCode, autoUpdate, productInput, variantsInput } = updateOptions;
|
|
1106
|
-
const updateOperations = [];
|
|
1107
|
-
const updateVariantsInput = variantsInput || [];
|
|
1108
|
-
const variants$ = autoUpdate
|
|
1109
|
-
? this.dataService.product
|
|
1110
|
-
.getProductVariants({}, product.id)
|
|
1111
|
-
.mapSingle(({ productVariants }) => productVariants.items)
|
|
1112
|
-
: of([]);
|
|
1113
|
-
return variants$.pipe(mergeMap(variants => {
|
|
1114
|
-
var _a, _b, _c, _d;
|
|
1115
|
-
if (productInput) {
|
|
1116
|
-
updateOperations.push(this.dataService.product.updateProduct(productInput));
|
|
1117
|
-
const productOldName = (_b = (_a = findTranslation(product, languageCode)) === null || _a === void 0 ? void 0 : _a.name) !== null && _b !== void 0 ? _b : '';
|
|
1118
|
-
const productNewName = (_c = findTranslation(productInput, languageCode)) === null || _c === void 0 ? void 0 : _c.name;
|
|
1119
|
-
if (productNewName && productOldName !== productNewName && autoUpdate) {
|
|
1120
|
-
for (const variant of variants) {
|
|
1121
|
-
const currentVariantName = ((_d = findTranslation(variant, languageCode)) === null || _d === void 0 ? void 0 : _d.name) || '';
|
|
1122
|
-
let variantInput;
|
|
1123
|
-
const existingVariantInput = updateVariantsInput.find(i => i.id === variant.id);
|
|
1124
|
-
if (existingVariantInput) {
|
|
1125
|
-
variantInput = existingVariantInput;
|
|
1126
|
-
}
|
|
1127
|
-
else {
|
|
1128
|
-
variantInput = {
|
|
1129
|
-
id: variant.id,
|
|
1130
|
-
translations: [{ languageCode, name: currentVariantName }],
|
|
1131
|
-
};
|
|
1132
|
-
updateVariantsInput.push(variantInput);
|
|
1133
|
-
}
|
|
1134
|
-
const variantTranslation = findTranslation(variantInput, languageCode);
|
|
1135
|
-
if (variantTranslation) {
|
|
1136
|
-
if (variantTranslation.name) {
|
|
1137
|
-
variantTranslation.name = replaceLast(variantTranslation.name, productOldName, productNewName);
|
|
1138
|
-
}
|
|
1139
|
-
else {
|
|
1140
|
-
// The variant translation was falsy, which occurs
|
|
1141
|
-
// when defining the product name for a new translation
|
|
1142
|
-
// language that had not yet been defined.
|
|
1143
|
-
variantTranslation.name = [
|
|
1144
|
-
productNewName,
|
|
1145
|
-
...variant.options.map(o => o.name),
|
|
1146
|
-
].join(' ');
|
|
1147
|
-
}
|
|
1148
|
-
}
|
|
1149
|
-
}
|
|
1150
|
-
}
|
|
1151
|
-
}
|
|
1152
|
-
if (updateVariantsInput.length) {
|
|
1153
|
-
updateOperations.push(this.dataService.product.updateProductVariants(updateVariantsInput));
|
|
1154
|
-
}
|
|
1155
|
-
return forkJoin(updateOperations);
|
|
1156
|
-
}));
|
|
1157
|
-
}
|
|
1158
|
-
updateProductOption(input, product, languageCode) {
|
|
1159
|
-
const variants$ = input.autoUpdate
|
|
1160
|
-
? this.dataService.product
|
|
1161
|
-
.getProductVariants({}, product.id)
|
|
1162
|
-
.mapSingle(({ productVariants }) => productVariants.items)
|
|
1163
|
-
: of([]);
|
|
1164
|
-
return variants$.pipe(mergeMap(variants => {
|
|
1165
|
-
var _a, _b, _c;
|
|
1166
|
-
let updateProductVariantNames$ = of([]);
|
|
1167
|
-
if (input.autoUpdate) {
|
|
1168
|
-
// Update any ProductVariants' names which include the option name
|
|
1169
|
-
let oldOptionName;
|
|
1170
|
-
const newOptionName = (_a = findTranslation(input, languageCode)) === null || _a === void 0 ? void 0 : _a.name;
|
|
1171
|
-
if (!newOptionName) {
|
|
1172
|
-
updateProductVariantNames$ = of([]);
|
|
1173
|
-
}
|
|
1174
|
-
const variantsToUpdate = [];
|
|
1175
|
-
for (const variant of variants) {
|
|
1176
|
-
if (variant.options.map(o => o.id).includes(input.id)) {
|
|
1177
|
-
if (!oldOptionName) {
|
|
1178
|
-
oldOptionName = (_b = findTranslation(variant.options.find(o => o.id === input.id), languageCode)) === null || _b === void 0 ? void 0 : _b.name;
|
|
1179
|
-
}
|
|
1180
|
-
const variantName = ((_c = findTranslation(variant, languageCode)) === null || _c === void 0 ? void 0 : _c.name) || '';
|
|
1181
|
-
if (oldOptionName && newOptionName && variantName.includes(oldOptionName)) {
|
|
1182
|
-
variantsToUpdate.push({
|
|
1183
|
-
id: variant.id,
|
|
1184
|
-
translations: [
|
|
1185
|
-
{
|
|
1186
|
-
languageCode,
|
|
1187
|
-
name: replaceLast(variantName, oldOptionName, newOptionName),
|
|
1188
|
-
},
|
|
1189
|
-
],
|
|
1190
|
-
});
|
|
1191
|
-
}
|
|
1192
|
-
}
|
|
1193
|
-
}
|
|
1194
|
-
if (variantsToUpdate.length) {
|
|
1195
|
-
updateProductVariantNames$ =
|
|
1196
|
-
this.dataService.product.updateProductVariants(variantsToUpdate);
|
|
1197
|
-
}
|
|
1198
|
-
}
|
|
1199
|
-
return this.dataService.product
|
|
1200
|
-
.updateProductOption(input)
|
|
1201
|
-
.pipe(mergeMap(() => updateProductVariantNames$));
|
|
1202
|
-
}));
|
|
1203
|
-
}
|
|
1204
|
-
deleteProductVariant(id, productId) {
|
|
1205
|
-
return this.dataService.product.deleteProductVariant(id).pipe(switchMap(result => {
|
|
1206
|
-
if (result.deleteProductVariant.result === DeletionResult.DELETED) {
|
|
1207
|
-
return this.dataService.product.getProduct(productId).single$;
|
|
1208
|
-
}
|
|
1209
|
-
else {
|
|
1210
|
-
return throwError(result.deleteProductVariant.message);
|
|
1211
|
-
}
|
|
1212
|
-
}));
|
|
1213
|
-
}
|
|
1214
|
-
}
|
|
1215
|
-
ProductDetailService.ɵprov = i0.ɵɵdefineInjectable({ factory: function ProductDetailService_Factory() { return new ProductDetailService(i0.ɵɵinject(i2.DataService)); }, token: ProductDetailService, providedIn: "root" });
|
|
1216
|
-
ProductDetailService.decorators = [
|
|
1217
|
-
{ type: Injectable, args: [{
|
|
1218
|
-
providedIn: 'root',
|
|
1219
|
-
},] }
|
|
1220
|
-
];
|
|
1221
|
-
ProductDetailService.ctorParameters = () => [
|
|
1222
|
-
{ type: DataService }
|
|
1223
|
-
];
|
|
1224
|
-
|
|
1225
|
-
class ApplyFacetDialogComponent {
|
|
1226
|
-
constructor(changeDetector) {
|
|
1227
|
-
this.changeDetector = changeDetector;
|
|
1228
|
-
this.selectedValues = [];
|
|
1229
|
-
}
|
|
1230
|
-
ngAfterViewInit() {
|
|
1231
|
-
setTimeout(() => this.selector.focus(), 0);
|
|
1232
|
-
}
|
|
1233
|
-
selectValues() {
|
|
1234
|
-
this.resolveWith(this.selectedValues);
|
|
1235
|
-
}
|
|
1236
|
-
cancel() {
|
|
1237
|
-
this.resolveWith();
|
|
1238
|
-
}
|
|
1239
|
-
}
|
|
1240
|
-
ApplyFacetDialogComponent.decorators = [
|
|
1241
|
-
{ type: Component, args: [{
|
|
1242
|
-
selector: 'vdr-apply-facet-dialog',
|
|
1243
|
-
template: "<ng-template vdrDialogTitle>{{ 'catalog.add-facets' | translate }}</ng-template>\r\n\r\n<vdr-facet-value-selector\r\n [facets]=\"facets\"\r\n (selectedValuesChange)=\"selectedValues = $event\"\r\n></vdr-facet-value-selector>\r\n\r\n<ng-template vdrDialogButtons>\r\n <button type=\"button\" class=\"btn\" (click)=\"cancel()\">{{ 'common.cancel' | translate }}</button>\r\n <button\r\n type=\"submit\"\r\n (click)=\"selectValues()\"\r\n [disabled]=\"selectedValues.length === 0\"\r\n class=\"btn btn-primary\"\r\n >\r\n {{ 'catalog.add-facets' | translate }}\r\n </button>\r\n</ng-template>\r\n",
|
|
1244
|
-
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
1245
|
-
styles: [""]
|
|
1246
|
-
},] }
|
|
1247
|
-
];
|
|
1248
|
-
ApplyFacetDialogComponent.ctorParameters = () => [
|
|
1249
|
-
{ type: ChangeDetectorRef }
|
|
1250
|
-
];
|
|
1251
|
-
ApplyFacetDialogComponent.propDecorators = {
|
|
1252
|
-
selector: [{ type: ViewChild, args: [FacetValueSelectorComponent,] }]
|
|
1253
|
-
};
|
|
1254
|
-
|
|
1255
|
-
class AssignProductsToChannelDialogComponent {
|
|
1256
|
-
constructor(dataService, notificationService) {
|
|
1257
|
-
this.dataService = dataService;
|
|
1258
|
-
this.notificationService = notificationService;
|
|
1259
|
-
this.priceFactorControl = new FormControl(1);
|
|
1260
|
-
this.selectedChannelIdControl = new FormControl();
|
|
1261
|
-
}
|
|
1262
|
-
get isProductVariantMode() {
|
|
1263
|
-
return this.productVariantIds != null;
|
|
1264
|
-
}
|
|
1265
|
-
ngOnInit() {
|
|
1266
|
-
const activeChannelId$ = this.dataService.client
|
|
1267
|
-
.userStatus()
|
|
1268
|
-
.mapSingle(({ userStatus }) => userStatus.activeChannelId);
|
|
1269
|
-
const allChannels$ = this.dataService.settings.getChannels().mapSingle(data => data.channels);
|
|
1270
|
-
combineLatest(activeChannelId$, allChannels$).subscribe(([activeChannelId, channels]) => {
|
|
1271
|
-
// tslint:disable-next-line:no-non-null-assertion
|
|
1272
|
-
this.currentChannel = channels.find(c => c.id === activeChannelId);
|
|
1273
|
-
this.availableChannels = channels;
|
|
1274
|
-
});
|
|
1275
|
-
this.selectedChannelIdControl.valueChanges.subscribe(ids => {
|
|
1276
|
-
this.selectChannel(ids);
|
|
1277
|
-
});
|
|
1278
|
-
this.variantsPreview$ = combineLatest(from(this.getTopVariants(10)), this.priceFactorControl.valueChanges.pipe(startWith(1))).pipe(map(([variants, factor]) => {
|
|
1279
|
-
return variants.map(v => ({
|
|
1280
|
-
id: v.id,
|
|
1281
|
-
name: v.name,
|
|
1282
|
-
price: v.price,
|
|
1283
|
-
pricePreview: v.price * +factor,
|
|
1284
|
-
}));
|
|
1285
|
-
}));
|
|
1286
|
-
}
|
|
1287
|
-
selectChannel(channelIds) {
|
|
1288
|
-
this.selectedChannel = this.availableChannels.find(c => c.id === channelIds[0]);
|
|
1289
|
-
}
|
|
1290
|
-
assign() {
|
|
1291
|
-
const selectedChannel = this.selectedChannel;
|
|
1292
|
-
if (selectedChannel) {
|
|
1293
|
-
if (!this.isProductVariantMode) {
|
|
1294
|
-
this.dataService.product
|
|
1295
|
-
.assignProductsToChannel({
|
|
1296
|
-
channelId: selectedChannel.id,
|
|
1297
|
-
productIds: this.productIds,
|
|
1298
|
-
priceFactor: +this.priceFactorControl.value,
|
|
1299
|
-
})
|
|
1300
|
-
.subscribe(() => {
|
|
1301
|
-
this.notificationService.success(marker('catalog.assign-product-to-channel-success'), {
|
|
1302
|
-
channel: selectedChannel.code,
|
|
1303
|
-
});
|
|
1304
|
-
this.resolveWith(true);
|
|
1305
|
-
});
|
|
1306
|
-
}
|
|
1307
|
-
else if (this.productVariantIds) {
|
|
1308
|
-
this.dataService.product
|
|
1309
|
-
.assignVariantsToChannel({
|
|
1310
|
-
channelId: selectedChannel.id,
|
|
1311
|
-
productVariantIds: this.productVariantIds,
|
|
1312
|
-
priceFactor: +this.priceFactorControl.value,
|
|
1313
|
-
})
|
|
1314
|
-
.subscribe(() => {
|
|
1315
|
-
this.notificationService.success(marker('catalog.assign-variant-to-channel-success'), {
|
|
1316
|
-
channel: selectedChannel.code,
|
|
1317
|
-
});
|
|
1318
|
-
this.resolveWith(true);
|
|
1319
|
-
});
|
|
1320
|
-
}
|
|
1321
|
-
}
|
|
1322
|
-
}
|
|
1323
|
-
cancel() {
|
|
1324
|
-
this.resolveWith();
|
|
1325
|
-
}
|
|
1326
|
-
getTopVariants(take) {
|
|
1327
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
1328
|
-
const variants = [];
|
|
1329
|
-
for (let i = 0; i < this.productIds.length && variants.length < take; i++) {
|
|
1330
|
-
const productVariants = yield this.dataService.product
|
|
1331
|
-
.getProduct(this.productIds[i], { take: this.isProductVariantMode ? undefined : take })
|
|
1332
|
-
.mapSingle(({ product }) => {
|
|
1333
|
-
const _variants = product ? product.variantList.items : [];
|
|
1334
|
-
return _variants.filter(v => { var _a; return this.isProductVariantMode ? (_a = this.productVariantIds) === null || _a === void 0 ? void 0 : _a.includes(v.id) : true; });
|
|
1335
|
-
})
|
|
1336
|
-
.toPromise();
|
|
1337
|
-
variants.push(...(productVariants || []));
|
|
1338
|
-
}
|
|
1339
|
-
return variants.slice(0, take);
|
|
1340
|
-
});
|
|
1341
|
-
}
|
|
1342
|
-
}
|
|
1343
|
-
AssignProductsToChannelDialogComponent.decorators = [
|
|
1344
|
-
{ type: Component, args: [{
|
|
1345
|
-
selector: 'vdr-assign-products-to-channel-dialog',
|
|
1346
|
-
template: "<ng-template vdrDialogTitle>\r\n <ng-container *ngIf=\"isProductVariantMode; else productModeTitle\">{{\r\n 'catalog.assign-variants-to-channel' | translate\r\n }}</ng-container>\r\n <ng-template #productModeTitle>{{ 'catalog.assign-products-to-channel' | translate }}</ng-template>\r\n</ng-template>\r\n\r\n<div class=\"flex\">\r\n <clr-input-container>\r\n <label>{{ 'common.channel' | translate }}</label>\r\n <vdr-channel-assignment-control\r\n clrInput\r\n [multiple]=\"false\"\r\n [includeDefaultChannel]=\"false\"\r\n [disableChannelIds]=\"currentChannelIds\"\r\n [formControl]=\"selectedChannelIdControl\"\r\n ></vdr-channel-assignment-control>\r\n </clr-input-container>\r\n <div class=\"flex-spacer\"></div>\r\n <clr-input-container>\r\n <label>{{ 'catalog.price-conversion-factor' | translate }}</label>\r\n <input clrInput type=\"number\" min=\"0\" max=\"99999\" [formControl]=\"priceFactorControl\" />\r\n </clr-input-container>\r\n</div>\r\n\r\n<div class=\"channel-price-preview\">\r\n <label class=\"clr-control-label\">{{ 'catalog.channel-price-preview' | translate }}</label>\r\n <table class=\"table\">\r\n <thead>\r\n <tr>\r\n <th>{{ 'common.name' | translate }}</th>\r\n <th>\r\n {{\r\n 'catalog.price-in-channel'\r\n | translate: { channel: currentChannel?.code | channelCodeToLabel | translate }\r\n }}\r\n </th>\r\n <th>\r\n <ng-template [ngIf]=\"selectedChannel\" [ngIfElse]=\"noSelection\">\r\n {{ 'catalog.price-in-channel' | translate: { channel: selectedChannel?.code } }}\r\n </ng-template>\r\n <ng-template #noSelection>\r\n {{ 'catalog.no-channel-selected' | translate }}\r\n </ng-template>\r\n </th>\r\n </tr>\r\n </thead>\r\n <tbody>\r\n <tr *ngFor=\"let row of variantsPreview$ | async\">\r\n <td>{{ row.name }}</td>\r\n <td>{{ row.price | localeCurrency: currentChannel?.currencyCode }}</td>\r\n <td>\r\n <ng-template [ngIf]=\"selectedChannel\" [ngIfElse]=\"noChannelSelected\">\r\n {{ row.pricePreview | localeCurrency: selectedChannel?.currencyCode }}\r\n </ng-template>\r\n <ng-template #noChannelSelected> - </ng-template>\r\n </td>\r\n </tr>\r\n </tbody>\r\n </table>\r\n</div>\r\n\r\n<ng-template vdrDialogButtons>\r\n <button type=\"button\" class=\"btn\" (click)=\"cancel()\">{{ 'common.cancel' | translate }}</button>\r\n <button type=\"submit\" (click)=\"assign()\" [disabled]=\"!selectedChannel\" class=\"btn btn-primary\">\r\n <ng-template [ngIf]=\"selectedChannel\" [ngIfElse]=\"noSelection\">\r\n {{ 'catalog.assign-to-named-channel' | translate: { channelCode: selectedChannel?.code } }}\r\n </ng-template>\r\n <ng-template #noSelection>\r\n {{ 'catalog.no-channel-selected' | translate }}\r\n </ng-template>\r\n </button>\r\n</ng-template>\r\n",
|
|
1347
|
-
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
1348
|
-
styles: ["vdr-channel-assignment-control{min-width:200px}.channel-price-preview{margin-top:24px}.channel-price-preview table.table{margin-top:6px}\n"]
|
|
1349
|
-
},] }
|
|
1350
|
-
];
|
|
1351
|
-
AssignProductsToChannelDialogComponent.ctorParameters = () => [
|
|
1352
|
-
{ type: DataService },
|
|
1353
|
-
{ type: NotificationService }
|
|
1354
|
-
];
|
|
1355
|
-
|
|
1356
|
-
class ProductDetailComponent extends BaseDetailComponent {
|
|
1357
|
-
constructor(route, router, serverConfigService, productDetailService, formBuilder, modalService, notificationService, dataService, location, changeDetector) {
|
|
1358
|
-
super(route, router, serverConfigService, dataService);
|
|
1359
|
-
this.productDetailService = productDetailService;
|
|
1360
|
-
this.formBuilder = formBuilder;
|
|
1361
|
-
this.modalService = modalService;
|
|
1362
|
-
this.notificationService = notificationService;
|
|
1363
|
-
this.dataService = dataService;
|
|
1364
|
-
this.location = location;
|
|
1365
|
-
this.changeDetector = changeDetector;
|
|
1366
|
-
this.filterInput = new FormControl('');
|
|
1367
|
-
this.assetChanges = {};
|
|
1368
|
-
this.variantAssetChanges = {};
|
|
1369
|
-
this.variantFacetValueChanges = {};
|
|
1370
|
-
this.currentPage$ = new BehaviorSubject(1);
|
|
1371
|
-
this.itemsPerPage$ = new BehaviorSubject(10);
|
|
1372
|
-
this.selectedVariantIds = [];
|
|
1373
|
-
this.variantDisplayMode = 'card';
|
|
1374
|
-
this.createVariantsConfig = { groups: [], variants: [] };
|
|
1375
|
-
// Used to store all ProductVariants which have been loaded.
|
|
1376
|
-
// It is needed when saving changes to variants.
|
|
1377
|
-
this.productVariantMap = new Map();
|
|
1378
|
-
this.updatePermissions = [Permission.UpdateCatalog, Permission.UpdateProduct];
|
|
1379
|
-
this.customFields = this.getCustomFieldConfig('Product');
|
|
1380
|
-
this.customVariantFields = this.getCustomFieldConfig('ProductVariant');
|
|
1381
|
-
this.customOptionGroupFields = this.getCustomFieldConfig('ProductOptionGroup');
|
|
1382
|
-
this.customOptionFields = this.getCustomFieldConfig('ProductOption');
|
|
1383
|
-
this.detailForm = this.formBuilder.group({
|
|
1384
|
-
product: this.formBuilder.group({
|
|
1385
|
-
enabled: true,
|
|
1386
|
-
name: ['', Validators.required],
|
|
1387
|
-
autoUpdateVariantNames: true,
|
|
1388
|
-
slug: ['', unicodePatternValidator(/^[\p{Letter}0-9_-]+$/)],
|
|
1389
|
-
description: '',
|
|
1390
|
-
facetValueIds: [[]],
|
|
1391
|
-
customFields: this.formBuilder.group(this.customFields.reduce((hash, field) => (Object.assign(Object.assign({}, hash), { [field.name]: '' })), {})),
|
|
1392
|
-
}),
|
|
1393
|
-
variants: this.formBuilder.array([]),
|
|
1394
|
-
});
|
|
1395
|
-
}
|
|
1396
|
-
ngOnInit() {
|
|
1397
|
-
this.init();
|
|
1398
|
-
this.product$ = this.entity$;
|
|
1399
|
-
this.totalItems$ = this.product$.pipe(map(product => product.variantList.totalItems));
|
|
1400
|
-
this.paginationConfig$ = combineLatest(this.totalItems$, this.itemsPerPage$, this.currentPage$).pipe(map(([totalItems, itemsPerPage, currentPage]) => ({
|
|
1401
|
-
totalItems,
|
|
1402
|
-
itemsPerPage,
|
|
1403
|
-
currentPage,
|
|
1404
|
-
})));
|
|
1405
|
-
const variants$ = this.product$.pipe(map(product => product.variantList.items));
|
|
1406
|
-
const filterTerm$ = this.filterInput.valueChanges.pipe(startWith(''), debounceTime(200), shareReplay());
|
|
1407
|
-
const initialVariants$ = this.product$.pipe(map(p => p.variantList.items));
|
|
1408
|
-
const updatedVariants$ = combineLatest(filterTerm$, this.currentPage$, this.itemsPerPage$).pipe(skipUntil(initialVariants$), skip(1), switchMap(([term, currentPage, itemsPerPage]) => {
|
|
1409
|
-
return this.dataService.product
|
|
1410
|
-
.getProductVariants(Object.assign(Object.assign({ skip: (currentPage - 1) * itemsPerPage, take: itemsPerPage }, (term
|
|
1411
|
-
? { filter: { name: { contains: term }, sku: { contains: term } } }
|
|
1412
|
-
: {})), { filterOperator: LogicalOperator.OR }), this.id)
|
|
1413
|
-
.mapStream(({ productVariants }) => productVariants.items);
|
|
1414
|
-
}), shareReplay({ bufferSize: 1, refCount: true }));
|
|
1415
|
-
this.variants$ = merge(initialVariants$, updatedVariants$).pipe(tap(variants => {
|
|
1416
|
-
for (const variant of variants) {
|
|
1417
|
-
this.productVariantMap.set(variant.id, variant);
|
|
1418
|
-
}
|
|
1419
|
-
}));
|
|
1420
|
-
this.taxCategories$ = this.productDetailService.getTaxCategories().pipe(takeUntil(this.destroy$));
|
|
1421
|
-
this.activeTab$ = this.route.paramMap.pipe(map(qpm => qpm.get('tab')));
|
|
1422
|
-
combineLatest(updatedVariants$, this.languageCode$)
|
|
1423
|
-
.pipe(takeUntil(this.destroy$))
|
|
1424
|
-
.subscribe(([variants, languageCode]) => {
|
|
1425
|
-
this.buildVariantFormArray(variants, languageCode);
|
|
1426
|
-
});
|
|
1427
|
-
// FacetValues are provided initially by the nested array of the
|
|
1428
|
-
// Product entity, but once a fetch to get all Facets is made (as when
|
|
1429
|
-
// opening the FacetValue selector modal), then these additional values
|
|
1430
|
-
// are concatenated onto the initial array.
|
|
1431
|
-
this.facets$ = this.productDetailService.getFacets();
|
|
1432
|
-
const productFacetValues$ = this.product$.pipe(map(product => product.facetValues));
|
|
1433
|
-
const allFacetValues$ = this.facets$.pipe(map(flattenFacetValues));
|
|
1434
|
-
const productGroup = this.getProductFormGroup();
|
|
1435
|
-
const formFacetValueIdChanges$ = productGroup.valueChanges.pipe(map(val => val.facetValueIds), distinctUntilChanged());
|
|
1436
|
-
const formChangeFacetValues$ = combineLatest(formFacetValueIdChanges$, productFacetValues$, allFacetValues$).pipe(map(([ids, productFacetValues, allFacetValues]) => {
|
|
1437
|
-
const combined = [...productFacetValues, ...allFacetValues];
|
|
1438
|
-
return ids.map(id => combined.find(fv => fv.id === id)).filter(notNullOrUndefined);
|
|
1439
|
-
}));
|
|
1440
|
-
this.facetValues$ = merge(productFacetValues$, formChangeFacetValues$);
|
|
1441
|
-
this.productChannels$ = this.product$.pipe(map(p => p.channels));
|
|
1442
|
-
this.channelPriceIncludesTax$ = this.dataService.settings
|
|
1443
|
-
.getActiveChannel('cache-first')
|
|
1444
|
-
.refetchOnChannelChange()
|
|
1445
|
-
.mapStream(data => data.activeChannel.pricesIncludeTax)
|
|
1446
|
-
.pipe(shareReplay(1));
|
|
1447
|
-
}
|
|
1448
|
-
ngOnDestroy() {
|
|
1449
|
-
this.destroy();
|
|
1450
|
-
}
|
|
1451
|
-
navigateToTab(tabName) {
|
|
1452
|
-
this.location.replaceState(this.router
|
|
1453
|
-
.createUrlTree(['./', Object.assign(Object.assign({}, this.route.snapshot.params), { tab: tabName })], {
|
|
1454
|
-
queryParamsHandling: 'merge',
|
|
1455
|
-
relativeTo: this.route,
|
|
1456
|
-
})
|
|
1457
|
-
.toString());
|
|
1458
|
-
}
|
|
1459
|
-
isDefaultChannel(channelCode) {
|
|
1460
|
-
return channelCode === DEFAULT_CHANNEL_CODE;
|
|
1461
|
-
}
|
|
1462
|
-
setPage(page) {
|
|
1463
|
-
this.currentPage$.next(page);
|
|
1464
|
-
}
|
|
1465
|
-
setItemsPerPage(value) {
|
|
1466
|
-
this.itemsPerPage$.next(+value);
|
|
1467
|
-
this.currentPage$.next(1);
|
|
1468
|
-
}
|
|
1469
|
-
assignToChannel() {
|
|
1470
|
-
this.productChannels$
|
|
1471
|
-
.pipe(take(1), switchMap(channels => {
|
|
1472
|
-
return this.modalService.fromComponent(AssignProductsToChannelDialogComponent, {
|
|
1473
|
-
size: 'lg',
|
|
1474
|
-
locals: {
|
|
1475
|
-
productIds: [this.id],
|
|
1476
|
-
currentChannelIds: channels.map(c => c.id),
|
|
1477
|
-
},
|
|
1478
|
-
});
|
|
1479
|
-
}))
|
|
1480
|
-
.subscribe();
|
|
1481
|
-
}
|
|
1482
|
-
removeFromChannel(channelId) {
|
|
1483
|
-
this.modalService
|
|
1484
|
-
.dialog({
|
|
1485
|
-
title: marker('catalog.remove-product-from-channel'),
|
|
1486
|
-
buttons: [
|
|
1487
|
-
{ type: 'secondary', label: marker('common.cancel') },
|
|
1488
|
-
{ type: 'danger', label: marker('catalog.remove-from-channel'), returnValue: true },
|
|
1489
|
-
],
|
|
1490
|
-
})
|
|
1491
|
-
.pipe(switchMap(response => response
|
|
1492
|
-
? this.dataService.product.removeProductsFromChannel({
|
|
1493
|
-
channelId,
|
|
1494
|
-
productIds: [this.id],
|
|
1495
|
-
})
|
|
1496
|
-
: EMPTY))
|
|
1497
|
-
.subscribe(() => {
|
|
1498
|
-
this.notificationService.success(marker('catalog.notify-remove-product-from-channel-success'));
|
|
1499
|
-
}, err => {
|
|
1500
|
-
this.notificationService.error(marker('catalog.notify-remove-product-from-channel-error'));
|
|
1501
|
-
});
|
|
1502
|
-
}
|
|
1503
|
-
assignVariantToChannel(variant) {
|
|
1504
|
-
return this.modalService
|
|
1505
|
-
.fromComponent(AssignProductsToChannelDialogComponent, {
|
|
1506
|
-
size: 'lg',
|
|
1507
|
-
locals: {
|
|
1508
|
-
productIds: [this.id],
|
|
1509
|
-
productVariantIds: [variant.id],
|
|
1510
|
-
currentChannelIds: variant.channels.map(c => c.id),
|
|
1511
|
-
},
|
|
1512
|
-
})
|
|
1513
|
-
.subscribe();
|
|
1514
|
-
}
|
|
1515
|
-
removeVariantFromChannel({ channelId, variant, }) {
|
|
1516
|
-
this.modalService
|
|
1517
|
-
.dialog({
|
|
1518
|
-
title: marker('catalog.remove-product-variant-from-channel'),
|
|
1519
|
-
buttons: [
|
|
1520
|
-
{ type: 'secondary', label: marker('common.cancel') },
|
|
1521
|
-
{ type: 'danger', label: marker('catalog.remove-from-channel'), returnValue: true },
|
|
1522
|
-
],
|
|
1523
|
-
})
|
|
1524
|
-
.pipe(switchMap(response => response
|
|
1525
|
-
? this.dataService.product.removeVariantsFromChannel({
|
|
1526
|
-
channelId,
|
|
1527
|
-
productVariantIds: [variant.id],
|
|
1528
|
-
})
|
|
1529
|
-
: EMPTY))
|
|
1530
|
-
.subscribe(() => {
|
|
1531
|
-
this.notificationService.success(marker('catalog.notify-remove-variant-from-channel-success'));
|
|
1532
|
-
}, err => {
|
|
1533
|
-
this.notificationService.error(marker('catalog.notify-remove-variant-from-channel-error'));
|
|
1534
|
-
});
|
|
1535
|
-
}
|
|
1536
|
-
assetsChanged() {
|
|
1537
|
-
return !!Object.values(this.assetChanges).length;
|
|
1538
|
-
}
|
|
1539
|
-
variantAssetsChanged() {
|
|
1540
|
-
return !!Object.keys(this.variantAssetChanges).length;
|
|
1541
|
-
}
|
|
1542
|
-
variantAssetChange(event) {
|
|
1543
|
-
this.variantAssetChanges[event.variantId] = event;
|
|
1544
|
-
}
|
|
1545
|
-
/**
|
|
1546
|
-
* If creating a new product, automatically generate the slug based on the product name.
|
|
1547
|
-
*/
|
|
1548
|
-
updateSlug(nameValue) {
|
|
1549
|
-
combineLatest(this.entity$, this.languageCode$)
|
|
1550
|
-
.pipe(take(1))
|
|
1551
|
-
.subscribe(([entity, languageCode]) => {
|
|
1552
|
-
const slugControl = this.detailForm.get(['product', 'slug']);
|
|
1553
|
-
const currentTranslation = findTranslation(entity, languageCode);
|
|
1554
|
-
const currentSlugIsEmpty = !currentTranslation || !currentTranslation.slug;
|
|
1555
|
-
if (slugControl && slugControl.pristine && currentSlugIsEmpty) {
|
|
1556
|
-
slugControl.setValue(normalizeString(`${nameValue}`, '-'));
|
|
1557
|
-
}
|
|
1558
|
-
});
|
|
1559
|
-
}
|
|
1560
|
-
selectProductFacetValue() {
|
|
1561
|
-
this.displayFacetValueModal().subscribe(facetValueIds => {
|
|
1562
|
-
if (facetValueIds) {
|
|
1563
|
-
const productGroup = this.getProductFormGroup();
|
|
1564
|
-
const currentFacetValueIds = productGroup.value.facetValueIds;
|
|
1565
|
-
productGroup.patchValue({
|
|
1566
|
-
facetValueIds: unique([...currentFacetValueIds, ...facetValueIds]),
|
|
1567
|
-
});
|
|
1568
|
-
productGroup.markAsDirty();
|
|
1569
|
-
}
|
|
1570
|
-
});
|
|
1571
|
-
}
|
|
1572
|
-
updateProductOption(input) {
|
|
1573
|
-
combineLatest(this.product$, this.languageCode$)
|
|
1574
|
-
.pipe(take(1), mergeMap(([product, languageCode]) => this.productDetailService.updateProductOption(input, product, languageCode)))
|
|
1575
|
-
.subscribe(() => {
|
|
1576
|
-
this.notificationService.success(marker('common.notify-update-success'), {
|
|
1577
|
-
entity: 'ProductOption',
|
|
1578
|
-
});
|
|
1579
|
-
}, err => {
|
|
1580
|
-
this.notificationService.error(marker('common.notify-update-error'), {
|
|
1581
|
-
entity: 'ProductOption',
|
|
1582
|
-
});
|
|
1583
|
-
});
|
|
1584
|
-
}
|
|
1585
|
-
removeProductFacetValue(facetValueId) {
|
|
1586
|
-
const productGroup = this.getProductFormGroup();
|
|
1587
|
-
const currentFacetValueIds = productGroup.value.facetValueIds;
|
|
1588
|
-
productGroup.patchValue({
|
|
1589
|
-
facetValueIds: currentFacetValueIds.filter(id => id !== facetValueId),
|
|
1590
|
-
});
|
|
1591
|
-
productGroup.markAsDirty();
|
|
1592
|
-
}
|
|
1593
|
-
/**
|
|
1594
|
-
* Opens a dialog to select FacetValues to apply to the select ProductVariants.
|
|
1595
|
-
*/
|
|
1596
|
-
selectVariantFacetValue(selectedVariantIds) {
|
|
1597
|
-
this.displayFacetValueModal()
|
|
1598
|
-
.pipe(withLatestFrom(this.variants$))
|
|
1599
|
-
.subscribe(([facetValueIds, variants]) => {
|
|
1600
|
-
if (facetValueIds) {
|
|
1601
|
-
for (const variantId of selectedVariantIds) {
|
|
1602
|
-
const index = variants.findIndex(v => v.id === variantId);
|
|
1603
|
-
const variant = variants[index];
|
|
1604
|
-
const existingFacetValueIds = variant ? variant.facetValues.map(fv => fv.id) : [];
|
|
1605
|
-
const variantFormGroup = this.detailForm.get('variants').controls.find(c => c.value.id === variantId);
|
|
1606
|
-
if (variantFormGroup) {
|
|
1607
|
-
const uniqueFacetValueIds = unique([...existingFacetValueIds, ...facetValueIds]);
|
|
1608
|
-
variantFormGroup.patchValue({
|
|
1609
|
-
facetValueIds: uniqueFacetValueIds,
|
|
1610
|
-
});
|
|
1611
|
-
variantFormGroup.markAsDirty();
|
|
1612
|
-
this.variantFacetValueChanges[variantId] = uniqueFacetValueIds;
|
|
1613
|
-
}
|
|
1614
|
-
}
|
|
1615
|
-
this.changeDetector.markForCheck();
|
|
1616
|
-
}
|
|
1617
|
-
});
|
|
1618
|
-
}
|
|
1619
|
-
variantsToCreateAreValid() {
|
|
1620
|
-
return (0 < this.createVariantsConfig.variants.length &&
|
|
1621
|
-
this.createVariantsConfig.variants.every(v => {
|
|
1622
|
-
return v.sku !== '';
|
|
1623
|
-
}));
|
|
1624
|
-
}
|
|
1625
|
-
displayFacetValueModal() {
|
|
1626
|
-
return this.productDetailService.getFacets().pipe(mergeMap(facets => this.modalService.fromComponent(ApplyFacetDialogComponent, {
|
|
1627
|
-
size: 'md',
|
|
1628
|
-
closable: true,
|
|
1629
|
-
locals: { facets },
|
|
1630
|
-
})), map(facetValues => facetValues && facetValues.map(v => v.id)));
|
|
1631
|
-
}
|
|
1632
|
-
create() {
|
|
1633
|
-
const productGroup = this.getProductFormGroup();
|
|
1634
|
-
if (!productGroup.dirty) {
|
|
1635
|
-
return;
|
|
1636
|
-
}
|
|
1637
|
-
combineLatest(this.product$, this.languageCode$)
|
|
1638
|
-
.pipe(take(1), mergeMap(([product, languageCode]) => {
|
|
1639
|
-
const newProduct = this.getUpdatedProduct(product, productGroup, languageCode);
|
|
1640
|
-
return this.productDetailService.createProductWithVariants(newProduct, this.createVariantsConfig, languageCode);
|
|
1641
|
-
}))
|
|
1642
|
-
.subscribe(({ createProductVariants, productId }) => {
|
|
1643
|
-
this.notificationService.success(marker('common.notify-create-success'), {
|
|
1644
|
-
entity: 'Product',
|
|
1645
|
-
});
|
|
1646
|
-
this.assetChanges = {};
|
|
1647
|
-
this.variantAssetChanges = {};
|
|
1648
|
-
this.detailForm.markAsPristine();
|
|
1649
|
-
this.router.navigate(['../', productId], { relativeTo: this.route });
|
|
1650
|
-
}, err => {
|
|
1651
|
-
// tslint:disable-next-line:no-console
|
|
1652
|
-
console.error(err);
|
|
1653
|
-
this.notificationService.error(marker('common.notify-create-error'), {
|
|
1654
|
-
entity: 'Product',
|
|
1655
|
-
});
|
|
1656
|
-
});
|
|
1657
|
-
}
|
|
1658
|
-
save() {
|
|
1659
|
-
combineLatest(this.product$, this.languageCode$, this.channelPriceIncludesTax$)
|
|
1660
|
-
.pipe(take(1), mergeMap(([product, languageCode, priceIncludesTax]) => {
|
|
1661
|
-
var _a, _b;
|
|
1662
|
-
const productGroup = this.getProductFormGroup();
|
|
1663
|
-
let productInput;
|
|
1664
|
-
let variantsInput;
|
|
1665
|
-
if (productGroup.dirty || this.assetsChanged()) {
|
|
1666
|
-
productInput = this.getUpdatedProduct(product, productGroup, languageCode);
|
|
1667
|
-
}
|
|
1668
|
-
const variantsArray = this.detailForm.get('variants');
|
|
1669
|
-
if ((variantsArray && variantsArray.dirty) || this.variantAssetsChanged()) {
|
|
1670
|
-
variantsInput = this.getUpdatedProductVariants(product, variantsArray, languageCode, priceIncludesTax);
|
|
1671
|
-
}
|
|
1672
|
-
return this.productDetailService.updateProduct({
|
|
1673
|
-
product,
|
|
1674
|
-
languageCode,
|
|
1675
|
-
autoUpdate: (_b = (_a = this.detailForm.get(['product', 'autoUpdateVariantNames'])) === null || _a === void 0 ? void 0 : _a.value) !== null && _b !== void 0 ? _b : false,
|
|
1676
|
-
productInput,
|
|
1677
|
-
variantsInput,
|
|
1678
|
-
});
|
|
1679
|
-
}))
|
|
1680
|
-
.subscribe(result => {
|
|
1681
|
-
this.updateSlugAfterSave(result);
|
|
1682
|
-
this.detailForm.markAsPristine();
|
|
1683
|
-
this.assetChanges = {};
|
|
1684
|
-
this.variantAssetChanges = {};
|
|
1685
|
-
this.notificationService.success(marker('common.notify-update-success'), {
|
|
1686
|
-
entity: 'Product',
|
|
1687
|
-
});
|
|
1688
|
-
this.changeDetector.markForCheck();
|
|
1689
|
-
}, err => {
|
|
1690
|
-
this.notificationService.error(marker('common.notify-update-error'), {
|
|
1691
|
-
entity: 'Product',
|
|
1692
|
-
});
|
|
1693
|
-
});
|
|
1694
|
-
}
|
|
1695
|
-
canDeactivate() {
|
|
1696
|
-
return super.canDeactivate() && !this.assetChanges.assets && !this.assetChanges.featuredAsset;
|
|
1697
|
-
}
|
|
1698
|
-
/**
|
|
1699
|
-
* Sets the values of the form on changes to the product or current language.
|
|
1700
|
-
*/
|
|
1701
|
-
setFormValues(product, languageCode) {
|
|
1702
|
-
const currentTranslation = findTranslation(product, languageCode);
|
|
1703
|
-
this.detailForm.patchValue({
|
|
1704
|
-
product: {
|
|
1705
|
-
enabled: product.enabled,
|
|
1706
|
-
name: currentTranslation ? currentTranslation.name : '',
|
|
1707
|
-
slug: currentTranslation ? currentTranslation.slug : '',
|
|
1708
|
-
description: currentTranslation ? currentTranslation.description : '',
|
|
1709
|
-
facetValueIds: product.facetValues.map(fv => fv.id),
|
|
1710
|
-
},
|
|
1711
|
-
});
|
|
1712
|
-
if (this.customFields.length) {
|
|
1713
|
-
this.setCustomFieldFormValues(this.customFields, this.detailForm.get(['product', 'customFields']), product, currentTranslation);
|
|
1714
|
-
}
|
|
1715
|
-
this.buildVariantFormArray(product.variantList.items, languageCode);
|
|
1716
|
-
}
|
|
1717
|
-
buildVariantFormArray(variants, languageCode) {
|
|
1718
|
-
const variantsFormArray = this.detailForm.get('variants');
|
|
1719
|
-
variants.forEach((variant, i) => {
|
|
1720
|
-
const variantTranslation = findTranslation(variant, languageCode);
|
|
1721
|
-
const pendingFacetValueChanges = this.variantFacetValueChanges[variant.id];
|
|
1722
|
-
const facetValueIds = pendingFacetValueChanges
|
|
1723
|
-
? pendingFacetValueChanges
|
|
1724
|
-
: variant.facetValues.map(fv => fv.id);
|
|
1725
|
-
const group = {
|
|
1726
|
-
id: variant.id,
|
|
1727
|
-
enabled: variant.enabled,
|
|
1728
|
-
sku: variant.sku,
|
|
1729
|
-
name: variantTranslation ? variantTranslation.name : '',
|
|
1730
|
-
price: variant.price,
|
|
1731
|
-
priceWithTax: variant.priceWithTax,
|
|
1732
|
-
taxCategoryId: variant.taxCategory.id,
|
|
1733
|
-
stockOnHand: variant.stockOnHand,
|
|
1734
|
-
useGlobalOutOfStockThreshold: variant.useGlobalOutOfStockThreshold,
|
|
1735
|
-
outOfStockThreshold: variant.outOfStockThreshold,
|
|
1736
|
-
trackInventory: variant.trackInventory,
|
|
1737
|
-
facetValueIds,
|
|
1738
|
-
};
|
|
1739
|
-
let variantFormGroup = variantsFormArray.controls.find(c => c.value.id === variant.id);
|
|
1740
|
-
if (variantFormGroup) {
|
|
1741
|
-
if (variantFormGroup.pristine) {
|
|
1742
|
-
variantFormGroup.patchValue(group);
|
|
1743
|
-
}
|
|
1744
|
-
}
|
|
1745
|
-
else {
|
|
1746
|
-
variantFormGroup = this.formBuilder.group(Object.assign(Object.assign({}, group), { facetValueIds: this.formBuilder.control(facetValueIds) }));
|
|
1747
|
-
variantsFormArray.insert(i, variantFormGroup);
|
|
1748
|
-
}
|
|
1749
|
-
if (this.customVariantFields.length) {
|
|
1750
|
-
let customFieldsGroup = variantFormGroup.get(['customFields']);
|
|
1751
|
-
if (!customFieldsGroup) {
|
|
1752
|
-
customFieldsGroup = this.formBuilder.group(this.customVariantFields.reduce((hash, field) => (Object.assign(Object.assign({}, hash), { [field.name]: '' })), {}));
|
|
1753
|
-
variantFormGroup.addControl('customFields', customFieldsGroup);
|
|
1754
|
-
}
|
|
1755
|
-
this.setCustomFieldFormValues(this.customVariantFields, customFieldsGroup, variant, variantTranslation);
|
|
1756
|
-
}
|
|
1757
|
-
});
|
|
1758
|
-
}
|
|
1759
|
-
/**
|
|
1760
|
-
* Given a product and the value of the detailForm, this method creates an updated copy of the product which
|
|
1761
|
-
* can then be persisted to the API.
|
|
1762
|
-
*/
|
|
1763
|
-
getUpdatedProduct(product, productFormGroup, languageCode) {
|
|
1764
|
-
var _a, _b;
|
|
1765
|
-
const updatedProduct = createUpdatedTranslatable({
|
|
1766
|
-
translatable: product,
|
|
1767
|
-
updatedFields: productFormGroup.value,
|
|
1768
|
-
customFieldConfig: this.customFields,
|
|
1769
|
-
languageCode,
|
|
1770
|
-
defaultTranslation: {
|
|
1771
|
-
languageCode,
|
|
1772
|
-
name: product.name || '',
|
|
1773
|
-
slug: product.slug || '',
|
|
1774
|
-
description: product.description || '',
|
|
1775
|
-
},
|
|
1776
|
-
});
|
|
1777
|
-
return Object.assign(Object.assign({}, updatedProduct), { assetIds: (_a = this.assetChanges.assets) === null || _a === void 0 ? void 0 : _a.map(a => a.id), featuredAssetId: (_b = this.assetChanges.featuredAsset) === null || _b === void 0 ? void 0 : _b.id, facetValueIds: productFormGroup.value.facetValueIds });
|
|
1778
|
-
}
|
|
1779
|
-
/**
|
|
1780
|
-
* Given an array of product variants and the values from the detailForm, this method creates an new array
|
|
1781
|
-
* which can be persisted to the API.
|
|
1782
|
-
*/
|
|
1783
|
-
getUpdatedProductVariants(product, variantsFormArray, languageCode, priceIncludesTax) {
|
|
1784
|
-
const dirtyFormControls = variantsFormArray.controls.filter(c => c.dirty);
|
|
1785
|
-
const dirtyVariants = dirtyFormControls
|
|
1786
|
-
.map(c => this.productVariantMap.get(c.value.id))
|
|
1787
|
-
.filter(notNullOrUndefined);
|
|
1788
|
-
const dirtyVariantValues = dirtyFormControls.map(c => c.value);
|
|
1789
|
-
if (dirtyVariants.length !== dirtyVariantValues.length) {
|
|
1790
|
-
throw new Error(marker(`error.product-variant-form-values-do-not-match`));
|
|
1791
|
-
}
|
|
1792
|
-
return dirtyVariants
|
|
1793
|
-
.map((variant, i) => {
|
|
1794
|
-
var _a, _b;
|
|
1795
|
-
const formValue = dirtyVariantValues.find(value => value.id === variant.id);
|
|
1796
|
-
const result = createUpdatedTranslatable({
|
|
1797
|
-
translatable: variant,
|
|
1798
|
-
updatedFields: formValue,
|
|
1799
|
-
customFieldConfig: this.customVariantFields,
|
|
1800
|
-
languageCode,
|
|
1801
|
-
defaultTranslation: {
|
|
1802
|
-
languageCode,
|
|
1803
|
-
name: '',
|
|
1804
|
-
},
|
|
1805
|
-
});
|
|
1806
|
-
result.taxCategoryId = formValue.taxCategoryId;
|
|
1807
|
-
result.facetValueIds = formValue.facetValueIds;
|
|
1808
|
-
result.price = priceIncludesTax ? formValue.priceWithTax : formValue.price;
|
|
1809
|
-
const assetChanges = this.variantAssetChanges[variant.id];
|
|
1810
|
-
if (assetChanges) {
|
|
1811
|
-
result.featuredAssetId = (_a = assetChanges.featuredAsset) === null || _a === void 0 ? void 0 : _a.id;
|
|
1812
|
-
result.assetIds = (_b = assetChanges.assets) === null || _b === void 0 ? void 0 : _b.map(a => a.id);
|
|
1813
|
-
}
|
|
1814
|
-
return result;
|
|
1815
|
-
})
|
|
1816
|
-
.filter(notNullOrUndefined);
|
|
1817
|
-
}
|
|
1818
|
-
getProductFormGroup() {
|
|
1819
|
-
return this.detailForm.get('product');
|
|
1820
|
-
}
|
|
1821
|
-
/**
|
|
1822
|
-
* The server may alter the slug value in order to normalize and ensure uniqueness upon saving.
|
|
1823
|
-
*/
|
|
1824
|
-
updateSlugAfterSave(results) {
|
|
1825
|
-
const firstResult = results[0];
|
|
1826
|
-
const slugControl = this.detailForm.get(['product', 'slug']);
|
|
1827
|
-
function isUpdateMutation(input) {
|
|
1828
|
-
return input.hasOwnProperty('updateProduct');
|
|
1829
|
-
}
|
|
1830
|
-
if (slugControl && isUpdateMutation(firstResult)) {
|
|
1831
|
-
slugControl.setValue(firstResult.updateProduct.slug, { emitEvent: false });
|
|
1832
|
-
}
|
|
1833
|
-
}
|
|
1834
|
-
}
|
|
1835
|
-
ProductDetailComponent.decorators = [
|
|
1836
|
-
{ type: Component, args: [{
|
|
1837
|
-
selector: 'vdr-product-detail',
|
|
1838
|
-
template: "<vdr-action-bar>\r\n <vdr-ab-left>\r\n <div class=\"flex clr-flex-row\">\r\n <vdr-entity-info [entity]=\"entity$ | async\"></vdr-entity-info>\r\n <clr-toggle-wrapper *vdrIfPermissions=\"['UpdateCatalog', 'UpdateProduct']\">\r\n <input\r\n type=\"checkbox\"\r\n clrToggle\r\n name=\"enabled\"\r\n [formControl]=\"detailForm.get(['product', 'enabled'])\"\r\n />\r\n <label>{{ 'common.enabled' | translate }}</label>\r\n </clr-toggle-wrapper>\r\n </div>\r\n <vdr-language-selector\r\n [disabled]=\"isNew$ | async\"\r\n [availableLanguageCodes]=\"availableLanguages$ | async\"\r\n [currentLanguageCode]=\"languageCode$ | async\"\r\n (languageCodeChange)=\"setLanguage($event)\"\r\n ></vdr-language-selector>\r\n </vdr-ab-left>\r\n\r\n <vdr-ab-right>\r\n <vdr-action-bar-items locationId=\"product-detail\"></vdr-action-bar-items>\r\n <button\r\n class=\"btn btn-primary\"\r\n *ngIf=\"isNew$ | async; else updateButton\"\r\n (click)=\"create()\"\r\n [disabled]=\"detailForm.invalid || detailForm.pristine || !variantsToCreateAreValid()\"\r\n >\r\n {{ 'common.create' | translate }}\r\n </button>\r\n <ng-template #updateButton>\r\n <button\r\n *vdrIfPermissions=\"['UpdateCatalog', 'UpdateProduct']\"\r\n class=\"btn btn-primary\"\r\n (click)=\"save()\"\r\n [disabled]=\"\r\n (detailForm.invalid || detailForm.pristine) && !assetsChanged() && !variantAssetsChanged()\r\n \"\r\n >\r\n {{ 'common.update' | translate }}\r\n </button>\r\n </ng-template>\r\n </vdr-ab-right>\r\n</vdr-action-bar>\r\n\r\n<form class=\"form\" [formGroup]=\"detailForm\" *ngIf=\"product$ | async as product\">\r\n <button type=\"submit\" hidden x-data=\"prevents enter key from triggering other buttons\"></button>\r\n <clr-tabs>\r\n <clr-tab>\r\n <button clrTabLink (click)=\"navigateToTab('details')\">\r\n {{ 'catalog.product-details' | translate }}\r\n </button>\r\n <clr-tab-content *clrIfActive=\"(activeTab$ | async) === 'details'\">\r\n <div class=\"clr-row\">\r\n <div class=\"clr-col\">\r\n <section class=\"form-block\" formGroupName=\"product\">\r\n <ng-container *ngIf=\"!(isNew$ | async)\">\r\n <ng-container *vdrIfMultichannel>\r\n <vdr-form-item\r\n [label]=\"'common.channels' | translate\"\r\n *vdrIfDefaultChannelActive\r\n >\r\n <div class=\"flex channel-assignment\">\r\n <ng-container *ngFor=\"let channel of productChannels$ | async\">\r\n <vdr-chip\r\n *ngIf=\"!isDefaultChannel(channel.code)\"\r\n icon=\"times-circle\"\r\n (iconClick)=\"removeFromChannel(channel.id)\"\r\n >\r\n <vdr-channel-badge\r\n [channelCode]=\"channel.code\"\r\n ></vdr-channel-badge>\r\n {{ channel.code | channelCodeToLabel }}\r\n </vdr-chip>\r\n </ng-container>\r\n <button class=\"btn btn-sm\" (click)=\"assignToChannel()\">\r\n <clr-icon shape=\"layers\"></clr-icon>\r\n {{ 'catalog.assign-to-channel' | translate }}\r\n </button>\r\n </div>\r\n </vdr-form-item>\r\n </ng-container>\r\n </ng-container>\r\n <vdr-form-field [label]=\"'catalog.product-name' | translate\" for=\"name\">\r\n <input\r\n id=\"name\"\r\n type=\"text\"\r\n formControlName=\"name\"\r\n [readonly]=\"!(['UpdateCatalog', 'UpdateProduct'] | hasPermission)\"\r\n (input)=\"updateSlug($event.target.value)\"\r\n />\r\n </vdr-form-field>\r\n <div\r\n class=\"auto-rename-wrapper\"\r\n [class.visible]=\"\r\n (isNew$ | async) === false && detailForm.get(['product', 'name'])?.dirty\r\n \"\r\n >\r\n <clr-checkbox-wrapper>\r\n <input\r\n clrCheckbox\r\n type=\"checkbox\"\r\n id=\"auto-update\"\r\n formControlName=\"autoUpdateVariantNames\"\r\n />\r\n <label>{{\r\n 'catalog.auto-update-product-variant-name' | translate\r\n }}</label>\r\n </clr-checkbox-wrapper>\r\n </div>\r\n <vdr-form-field\r\n [label]=\"'catalog.slug' | translate\"\r\n for=\"slug\"\r\n [errors]=\"{ pattern: 'catalog.slug-pattern-error' | translate }\"\r\n >\r\n <input\r\n id=\"slug\"\r\n type=\"text\"\r\n formControlName=\"slug\"\r\n [readonly]=\"!(['UpdateCatalog', 'UpdateProduct'] | hasPermission)\"\r\n />\r\n </vdr-form-field>\r\n <vdr-rich-text-editor\r\n formControlName=\"description\"\r\n [readonly]=\"!(['UpdateCatalog', 'UpdateProduct'] | hasPermission)\"\r\n [label]=\"'common.description' | translate\"\r\n ></vdr-rich-text-editor>\r\n\r\n <section formGroupName=\"customFields\" *ngIf=\"customFields.length\">\r\n <label>{{ 'common.custom-fields' | translate }}</label>\r\n <vdr-tabbed-custom-fields\r\n entityName=\"Product\"\r\n [customFields]=\"customFields\"\r\n [customFieldsFormGroup]=\"detailForm.get(['product', 'customFields'])\"\r\n [readonly]=\"!(['UpdateCatalog', 'UpdateProduct'] | hasPermission)\"\r\n ></vdr-tabbed-custom-fields>\r\n </section>\r\n <vdr-custom-detail-component-host\r\n locationId=\"product-detail\"\r\n [entity$]=\"entity$\"\r\n [detailForm]=\"detailForm\"\r\n ></vdr-custom-detail-component-host>\r\n </section>\r\n </div>\r\n <div class=\"clr-col-md-auto\">\r\n <vdr-assets\r\n [assets]=\"assetChanges.assets || product.assets\"\r\n [featuredAsset]=\"assetChanges.featuredAsset || product.featuredAsset\"\r\n [updatePermissions]=\"updatePermissions\"\r\n (change)=\"assetChanges = $event\"\r\n ></vdr-assets>\r\n <div class=\"facets\">\r\n <vdr-facet-value-chip\r\n *ngFor=\"let facetValue of facetValues$ | async\"\r\n [facetValue]=\"facetValue\"\r\n [removable]=\"['UpdateCatalog', 'UpdateProduct'] | hasPermission\"\r\n (remove)=\"removeProductFacetValue(facetValue.id)\"\r\n ></vdr-facet-value-chip>\r\n <button\r\n class=\"btn btn-sm btn-secondary\"\r\n *vdrIfPermissions=\"['UpdateCatalog', 'UpdateProduct']\"\r\n (click)=\"selectProductFacetValue()\"\r\n >\r\n <clr-icon shape=\"plus\"></clr-icon>\r\n {{ 'catalog.add-facets' | translate }}\r\n </button>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n <div *ngIf=\"isNew$ | async\">\r\n <h4>{{ 'catalog.product-variants' | translate }}</h4>\r\n <vdr-generate-product-variants\r\n (variantsChange)=\"createVariantsConfig = $event\"\r\n ></vdr-generate-product-variants>\r\n </div>\r\n </clr-tab-content>\r\n </clr-tab>\r\n <clr-tab *ngIf=\"!(isNew$ | async)\">\r\n <button clrTabLink (click)=\"navigateToTab('variants')\">\r\n {{ 'catalog.product-variants' | translate }}\r\n </button>\r\n <clr-tab-content *clrIfActive=\"(activeTab$ | async) === 'variants'\">\r\n <section class=\"form-block\">\r\n <div class=\"view-mode\">\r\n <div class=\"btn-group\">\r\n <button\r\n class=\"btn btn-secondary-outline\"\r\n (click)=\"variantDisplayMode = 'card'\"\r\n [class.btn-primary]=\"variantDisplayMode === 'card'\"\r\n >\r\n <clr-icon shape=\"list\"></clr-icon>\r\n {{ 'catalog.display-variant-cards' | translate }}\r\n </button>\r\n <button\r\n class=\"btn\"\r\n (click)=\"variantDisplayMode = 'table'\"\r\n [class.btn-primary]=\"variantDisplayMode === 'table'\"\r\n >\r\n <clr-icon shape=\"table\"></clr-icon>\r\n {{ 'catalog.display-variant-table' | translate }}\r\n </button>\r\n </div>\r\n <div class=\"variant-filter\">\r\n <input\r\n [formControl]=\"filterInput\"\r\n [placeholder]=\"'catalog.filter-by-name-or-sku' | translate\"\r\n />\r\n <button class=\"icon-button\" (click)=\"filterInput.setValue('')\">\r\n <clr-icon shape=\"times\"></clr-icon>\r\n </button>\r\n </div>\r\n <div class=\"flex-spacer\"></div>\r\n <a\r\n *vdrIfPermissions=\"['UpdateCatalog', 'UpdateProduct']\"\r\n [routerLink]=\"['./', 'manage-variants']\"\r\n class=\"btn btn-secondary edit-variants-btn\"\r\n >\r\n <clr-icon shape=\"add-text\"></clr-icon>\r\n {{ 'catalog.manage-variants' | translate }}\r\n </a>\r\n </div>\r\n\r\n <div class=\"pagination-row mt4\" *ngIf=\"10 < (paginationConfig$ | async)?.totalItems\">\r\n <vdr-items-per-page-controls\r\n [itemsPerPage]=\"itemsPerPage$ | async\"\r\n (itemsPerPageChange)=\"setItemsPerPage($event)\"\r\n ></vdr-items-per-page-controls>\r\n\r\n <vdr-pagination-controls\r\n [id]=\"(paginationConfig$ | async)?.id\"\r\n [currentPage]=\"currentPage$ | async\"\r\n [itemsPerPage]=\"itemsPerPage$ | async\"\r\n (pageChange)=\"setPage($event)\"\r\n ></vdr-pagination-controls>\r\n </div>\r\n\r\n <vdr-product-variants-table\r\n *ngIf=\"variantDisplayMode === 'table'\"\r\n [variants]=\"variants$ | async\"\r\n [paginationConfig]=\"paginationConfig$ | async\"\r\n [optionGroups]=\"product.optionGroups\"\r\n [channelPriceIncludesTax]=\"channelPriceIncludesTax$ | async\"\r\n [productVariantsFormArray]=\"detailForm.get('variants')\"\r\n [pendingAssetChanges]=\"variantAssetChanges\"\r\n ></vdr-product-variants-table>\r\n <vdr-product-variants-list\r\n *ngIf=\"variantDisplayMode === 'card'\"\r\n [variants]=\"variants$ | async\"\r\n [paginationConfig]=\"paginationConfig$ | async\"\r\n [channelPriceIncludesTax]=\"channelPriceIncludesTax$ | async\"\r\n [facets]=\"facets$ | async\"\r\n [optionGroups]=\"product.optionGroups\"\r\n [productVariantsFormArray]=\"detailForm.get('variants')\"\r\n [taxCategories]=\"taxCategories$ | async\"\r\n [customFields]=\"customVariantFields\"\r\n [customOptionFields]=\"customOptionFields\"\r\n [activeLanguage]=\"languageCode$ | async\"\r\n [pendingAssetChanges]=\"variantAssetChanges\"\r\n (assignToChannel)=\"assignVariantToChannel($event)\"\r\n (removeFromChannel)=\"removeVariantFromChannel($event)\"\r\n (assetChange)=\"variantAssetChange($event)\"\r\n (updateProductOption)=\"updateProductOption($event)\"\r\n (selectionChange)=\"selectedVariantIds = $event\"\r\n (selectFacetValueClick)=\"selectVariantFacetValue($event)\"\r\n ></vdr-product-variants-list>\r\n </section>\r\n <div class=\"pagination-row mt4\" *ngIf=\"10 < (paginationConfig$ | async)?.totalItems\">\r\n <vdr-items-per-page-controls\r\n [itemsPerPage]=\"itemsPerPage$ | async\"\r\n (itemsPerPageChange)=\"setItemsPerPage($event)\"\r\n ></vdr-items-per-page-controls>\r\n\r\n <vdr-pagination-controls\r\n [id]=\"(paginationConfig$ | async)?.id\"\r\n [currentPage]=\"currentPage$ | async\"\r\n [itemsPerPage]=\"itemsPerPage$ | async\"\r\n (pageChange)=\"setPage($event)\"\r\n ></vdr-pagination-controls>\r\n </div>\r\n </clr-tab-content>\r\n </clr-tab>\r\n </clr-tabs>\r\n</form>\r\n",
|
|
1839
|
-
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
1840
|
-
styles: [":host ::ng-deep trix-toolbar{top:24px}.facets{margin-top:12px;display:flex;flex-wrap:wrap;align-items:center}@media screen and (min-width: 768px){.facets{max-width:340px}}vdr-action-bar clr-toggle-wrapper{margin-top:12px}.variant-filter{flex:1;display:flex}.variant-filter input{flex:1;max-width:initial;border-radius:3px 0 0 3px!important}.variant-filter .icon-button{border:1px solid var(--color-component-border-300);background-color:var(--color-component-bg-100);border-radius:0 3px 3px 0;border-left:none}.group-name{padding-right:6px}.view-mode{display:flex;justify-content:flex-end;align-items:center}.edit-variants-btn{margin-top:0}.channel-assignment{flex-wrap:wrap;max-height:144px;overflow-y:auto}.auto-rename-wrapper{overflow:hidden;max-height:0;padding-left:9.5rem;margin-bottom:0;transition:max-height .2s,margin-bottom .2s}.auto-rename-wrapper.visible{max-height:24px;margin-bottom:12px}.pagination-row{display:flex;align-items:baseline;justify-content:space-between}\n"]
|
|
1841
|
-
},] }
|
|
1842
|
-
];
|
|
1843
|
-
ProductDetailComponent.ctorParameters = () => [
|
|
1844
|
-
{ type: ActivatedRoute },
|
|
1845
|
-
{ type: Router },
|
|
1846
|
-
{ type: ServerConfigService },
|
|
1847
|
-
{ type: ProductDetailService },
|
|
1848
|
-
{ type: FormBuilder },
|
|
1849
|
-
{ type: ModalService },
|
|
1850
|
-
{ type: NotificationService },
|
|
1851
|
-
{ type: DataService },
|
|
1852
|
-
{ type: Location },
|
|
1853
|
-
{ type: ChangeDetectorRef }
|
|
1854
|
-
];
|
|
1855
|
-
|
|
1856
|
-
class ProductListComponent extends BaseListComponent {
|
|
1857
|
-
constructor(dataService, modalService, notificationService, jobQueueService, serverConfigService, router, route) {
|
|
1858
|
-
super(router, route);
|
|
1859
|
-
this.dataService = dataService;
|
|
1860
|
-
this.modalService = modalService;
|
|
1861
|
-
this.notificationService = notificationService;
|
|
1862
|
-
this.jobQueueService = jobQueueService;
|
|
1863
|
-
this.serverConfigService = serverConfigService;
|
|
1864
|
-
this.searchTerm = '';
|
|
1865
|
-
this.facetValueIds = [];
|
|
1866
|
-
this.groupByProduct = true;
|
|
1867
|
-
this.pendingSearchIndexUpdates = 0;
|
|
1868
|
-
this.route.queryParamMap
|
|
1869
|
-
.pipe(map(qpm => qpm.get('q')), takeUntil(this.destroy$))
|
|
1870
|
-
.subscribe(term => {
|
|
1871
|
-
this.searchTerm = term || '';
|
|
1872
|
-
if (this.productSearchInput) {
|
|
1873
|
-
this.productSearchInput.setSearchTerm(term);
|
|
1874
|
-
}
|
|
1875
|
-
});
|
|
1876
|
-
this.selectedFacetValueIds$ = this.route.queryParamMap.pipe(map(qpm => qpm.getAll('fvids')));
|
|
1877
|
-
this.selectedFacetValueIds$.pipe(takeUntil(this.destroy$)).subscribe(ids => {
|
|
1878
|
-
this.facetValueIds = ids;
|
|
1879
|
-
if (this.productSearchInput) {
|
|
1880
|
-
this.productSearchInput.setFacetValues(ids);
|
|
1881
|
-
}
|
|
1882
|
-
});
|
|
1883
|
-
super.setQueryFn((...args) => this.dataService.product.searchProducts(this.searchTerm, ...args).refetchOnChannelChange(), data => data.search,
|
|
1884
|
-
// tslint:disable-next-line:no-shadowed-variable
|
|
1885
|
-
(skip, take) => ({
|
|
1886
|
-
input: {
|
|
1887
|
-
skip,
|
|
1888
|
-
take,
|
|
1889
|
-
term: this.searchTerm,
|
|
1890
|
-
facetValueIds: this.facetValueIds,
|
|
1891
|
-
facetValueOperator: LogicalOperator.AND,
|
|
1892
|
-
groupByProduct: this.groupByProduct,
|
|
1893
|
-
},
|
|
1894
|
-
}));
|
|
1895
|
-
}
|
|
1896
|
-
ngOnInit() {
|
|
1897
|
-
super.ngOnInit();
|
|
1898
|
-
this.facetValues$ = this.result$.pipe(map(data => data.search.facetValues));
|
|
1899
|
-
this.facetValues$
|
|
1900
|
-
.pipe(take(1), delay(100), withLatestFrom(this.selectedFacetValueIds$))
|
|
1901
|
-
.subscribe(([__, ids]) => {
|
|
1902
|
-
this.productSearchInput.setFacetValues(ids);
|
|
1903
|
-
});
|
|
1904
|
-
this.availableLanguages$ = this.serverConfigService.getAvailableLanguages();
|
|
1905
|
-
this.contentLanguage$ = this.dataService.client
|
|
1906
|
-
.uiState()
|
|
1907
|
-
.mapStream(({ uiState }) => uiState.contentLanguage)
|
|
1908
|
-
.pipe(tap(() => this.refresh()));
|
|
1909
|
-
this.dataService.product
|
|
1910
|
-
.getPendingSearchIndexUpdates()
|
|
1911
|
-
.mapSingle(({ pendingSearchIndexUpdates }) => pendingSearchIndexUpdates)
|
|
1912
|
-
.subscribe(value => (this.pendingSearchIndexUpdates = value));
|
|
1913
|
-
}
|
|
1914
|
-
ngAfterViewInit() {
|
|
1915
|
-
if (this.productSearchInput && this.searchTerm) {
|
|
1916
|
-
setTimeout(() => this.productSearchInput.setSearchTerm(this.searchTerm));
|
|
1917
|
-
}
|
|
1918
|
-
}
|
|
1919
|
-
setSearchTerm(term) {
|
|
1920
|
-
this.searchTerm = term;
|
|
1921
|
-
this.setQueryParam({ q: term || null, page: 1 });
|
|
1922
|
-
this.refresh();
|
|
1923
|
-
}
|
|
1924
|
-
setFacetValueIds(ids) {
|
|
1925
|
-
this.facetValueIds = ids;
|
|
1926
|
-
this.setQueryParam({ fvids: ids, page: 1 });
|
|
1927
|
-
this.refresh();
|
|
1928
|
-
}
|
|
1929
|
-
rebuildSearchIndex() {
|
|
1930
|
-
this.dataService.product.reindex().subscribe(({ reindex }) => {
|
|
1931
|
-
this.notificationService.info(marker('catalog.reindexing'));
|
|
1932
|
-
this.jobQueueService.addJob(reindex.id, job => {
|
|
1933
|
-
if (job.state === JobState.COMPLETED) {
|
|
1934
|
-
const time = new Intl.NumberFormat().format(job.duration || 0);
|
|
1935
|
-
this.notificationService.success(marker('catalog.reindex-successful'), {
|
|
1936
|
-
count: job.result.indexedItemCount,
|
|
1937
|
-
time,
|
|
1938
|
-
});
|
|
1939
|
-
this.refresh();
|
|
1940
|
-
}
|
|
1941
|
-
else {
|
|
1942
|
-
this.notificationService.error(marker('catalog.reindex-error'));
|
|
1943
|
-
}
|
|
1944
|
-
});
|
|
1945
|
-
});
|
|
1946
|
-
}
|
|
1947
|
-
runPendingSearchIndexUpdates() {
|
|
1948
|
-
this.dataService.product.runPendingSearchIndexUpdates().subscribe(value => {
|
|
1949
|
-
this.notificationService.info(marker('catalog.running-search-index-updates'), {
|
|
1950
|
-
count: this.pendingSearchIndexUpdates,
|
|
1951
|
-
});
|
|
1952
|
-
this.pendingSearchIndexUpdates = 0;
|
|
1953
|
-
});
|
|
1954
|
-
}
|
|
1955
|
-
deleteProduct(productId) {
|
|
1956
|
-
this.modalService
|
|
1957
|
-
.dialog({
|
|
1958
|
-
title: marker('catalog.confirm-delete-product'),
|
|
1959
|
-
buttons: [
|
|
1960
|
-
{ type: 'secondary', label: marker('common.cancel') },
|
|
1961
|
-
{ type: 'danger', label: marker('common.delete'), returnValue: true },
|
|
1962
|
-
],
|
|
1963
|
-
})
|
|
1964
|
-
.pipe(switchMap(response => (response ? this.dataService.product.deleteProduct(productId) : EMPTY)),
|
|
1965
|
-
// Short delay to allow the product to be removed from the search index before
|
|
1966
|
-
// refreshing.
|
|
1967
|
-
delay(500))
|
|
1968
|
-
.subscribe(() => {
|
|
1969
|
-
this.notificationService.success(marker('common.notify-delete-success'), {
|
|
1970
|
-
entity: 'Product',
|
|
1971
|
-
});
|
|
1972
|
-
this.refresh();
|
|
1973
|
-
}, err => {
|
|
1974
|
-
this.notificationService.error(marker('common.notify-delete-error'), {
|
|
1975
|
-
entity: 'Product',
|
|
1976
|
-
});
|
|
1977
|
-
});
|
|
1978
|
-
}
|
|
1979
|
-
setLanguage(code) {
|
|
1980
|
-
this.dataService.client.setContentLanguage(code).subscribe();
|
|
1981
|
-
}
|
|
1982
|
-
}
|
|
1983
|
-
ProductListComponent.decorators = [
|
|
1984
|
-
{ type: Component, args: [{
|
|
1985
|
-
selector: 'vdr-products-list',
|
|
1986
|
-
template: "<vdr-action-bar>\r\n <vdr-ab-left [grow]=\"true\">\r\n <div class=\"search-form\">\r\n <vdr-product-search-input\r\n #productSearchInputComponent\r\n [facetValueResults]=\"facetValues$ | async\"\r\n (searchTermChange)=\"setSearchTerm($event)\"\r\n (facetValueChange)=\"setFacetValueIds($event)\"\r\n ></vdr-product-search-input>\r\n <vdr-dropdown class=\"search-settings-menu mr3\">\r\n <button\r\n type=\"button\"\r\n class=\"icon-button search-index-button\"\r\n [title]=\"\r\n (pendingSearchIndexUpdates\r\n ? 'catalog.pending-search-index-updates'\r\n : 'catalog.search-index-controls'\r\n ) | translate\r\n \"\r\n vdrDropdownTrigger\r\n >\r\n <clr-icon shape=\"cog\"></clr-icon>\r\n <vdr-status-badge *ngIf=\"pendingSearchIndexUpdates\" type=\"warning\"></vdr-status-badge>\r\n </button>\r\n <vdr-dropdown-menu vdrPosition=\"bottom-right\">\r\n <h4 class=\"dropdown-header\">{{ 'catalog.search-index-controls' | translate }}</h4>\r\n <ng-container *ngIf=\"pendingSearchIndexUpdates\">\r\n <button\r\n type=\"button\"\r\n class=\"run-updates-button\"\r\n vdrDropdownItem\r\n (click)=\"runPendingSearchIndexUpdates()\"\r\n [disabled]=\"!(['UpdateCatalog', 'UpdateProduct'] | hasPermission)\"\r\n >\r\n <vdr-status-badge type=\"warning\"></vdr-status-badge>\r\n {{\r\n 'catalog.run-pending-search-index-updates'\r\n | translate: {count: pendingSearchIndexUpdates}\r\n }}\r\n </button>\r\n <div class=\"dropdown-divider\"></div>\r\n </ng-container>\r\n <button\r\n type=\"button\"\r\n vdrDropdownItem\r\n (click)=\"rebuildSearchIndex()\"\r\n [disabled]=\"!(['UpdateCatalog', 'UpdateProduct'] | hasPermission)\"\r\n >\r\n {{ 'catalog.rebuild-search-index' | translate }}\r\n </button>\r\n </vdr-dropdown-menu>\r\n </vdr-dropdown>\r\n </div>\r\n <div class=\"flex wrap\">\r\n <clr-checkbox-wrapper class=\"mt2\">\r\n <input type=\"checkbox\" clrCheckbox [(ngModel)]=\"groupByProduct\" (ngModelChange)=\"refresh()\"/>\r\n <label>{{ 'catalog.group-by-product' | translate }}</label>\r\n </clr-checkbox-wrapper>\r\n <vdr-language-selector\r\n [availableLanguageCodes]=\"availableLanguages$ | async\"\r\n [currentLanguageCode]=\"contentLanguage$ | async\"\r\n (languageCodeChange)=\"setLanguage($event)\"\r\n ></vdr-language-selector>\r\n </div>\r\n </vdr-ab-left>\r\n <vdr-ab-right>\r\n <vdr-action-bar-items locationId=\"product-list\"></vdr-action-bar-items>\r\n <a\r\n class=\"btn btn-primary\"\r\n [routerLink]=\"['./create']\"\r\n *vdrIfPermissions=\"['CreateCatalog', 'CreateProduct']\"\r\n >\r\n <clr-icon shape=\"plus\"></clr-icon>\r\n <span class=\"full-label\">{{ 'catalog.create-new-product' | translate }}</span>\r\n </a>\r\n </vdr-ab-right>\r\n</vdr-action-bar>\r\n\r\n<vdr-data-table\r\n [items]=\"items$ | async\"\r\n [itemsPerPage]=\"itemsPerPage$ | async\"\r\n [totalItems]=\"totalItems$ | async\"\r\n [currentPage]=\"currentPage$ | async\"\r\n (pageChange)=\"setPageNumber($event)\"\r\n (itemsPerPageChange)=\"setItemsPerPage($event)\"\r\n>\r\n <ng-template let-result=\"item\">\r\n <td class=\"left align-middle image-col\" [class.disabled]=\"!result.enabled\">\r\n <div class=\"image-placeholder\">\r\n <img\r\n *ngIf=\"\r\n groupByProduct\r\n ? result.productAsset\r\n : result.productVariantAsset || result.productAsset as asset;\r\n else imagePlaceholder\r\n \"\r\n [src]=\"asset | assetPreview: 'tiny'\"\r\n />\r\n <ng-template #imagePlaceholder>\r\n <div class=\"placeholder\">\r\n <clr-icon shape=\"image\" size=\"48\"></clr-icon>\r\n </div>\r\n </ng-template>\r\n </div>\r\n </td>\r\n <td class=\"left align-middle\" [class.disabled]=\"!result.enabled\">\r\n {{ groupByProduct ? result.productName : result.productVariantName }}\r\n </td>\r\n <td class=\"align-middle\" [class.disabled]=\"!result.enabled\">\r\n <vdr-chip *ngIf=\"!result.enabled\">{{ 'common.disabled' | translate }}</vdr-chip>\r\n </td>\r\n <td class=\"right align-middle\" [class.disabled]=\"!result.enabled\">\r\n <vdr-table-row-action\r\n class=\"edit-button\"\r\n iconShape=\"edit\"\r\n [label]=\"'common.edit' | translate\"\r\n [linkTo]=\"['./', result.productId]\"\r\n ></vdr-table-row-action>\r\n <vdr-dropdown>\r\n <button type=\"button\" class=\"btn btn-link btn-sm\" vdrDropdownTrigger>\r\n {{ 'common.actions' | translate }}\r\n <clr-icon shape=\"caret down\"></clr-icon>\r\n </button>\r\n <vdr-dropdown-menu vdrPosition=\"bottom-right\">\r\n <button\r\n type=\"button\"\r\n class=\"delete-button\"\r\n (click)=\"deleteProduct(result.productId)\"\r\n [disabled]=\"!(['DeleteCatalog', 'DeleteProduct'] | hasPermission)\"\r\n vdrDropdownItem\r\n >\r\n <clr-icon shape=\"trash\" class=\"is-danger\"></clr-icon>\r\n {{ 'common.delete' | translate }}\r\n </button>\r\n </vdr-dropdown-menu>\r\n </vdr-dropdown>\r\n </td>\r\n </ng-template>\r\n</vdr-data-table>\r\n",
|
|
1987
|
-
styles: [".image-col{width:70px}.image-placeholder{width:50px;height:50px;background-color:var(--color-component-bg-200)}.image-placeholder img{border-radius:var(--border-radius-img)}.image-placeholder .placeholder{text-align:center;color:var(--color-grey-300)}.search-form{display:flex;align-items:center;width:100%;margin-bottom:6px}.search-input{min-width:300px}@media screen and (max-width: 768px){.search-input{min-width:100px}}.search-settings-menu{margin:0 12px}td.disabled{background-color:var(--color-component-bg-200)}.search-index-button{position:relative}.search-index-button vdr-status-badge{right:0;top:0}.run-updates-button{position:relative}.run-updates-button vdr-status-badge{left:10px;top:10px}.edit-button{margin-right:24px}\n"]
|
|
1988
|
-
},] }
|
|
1989
|
-
];
|
|
1990
|
-
ProductListComponent.ctorParameters = () => [
|
|
1991
|
-
{ type: DataService },
|
|
1992
|
-
{ type: ModalService },
|
|
1993
|
-
{ type: NotificationService },
|
|
1994
|
-
{ type: JobQueueService },
|
|
1995
|
-
{ type: ServerConfigService },
|
|
1996
|
-
{ type: Router },
|
|
1997
|
-
{ type: ActivatedRoute }
|
|
1998
|
-
];
|
|
1999
|
-
ProductListComponent.propDecorators = {
|
|
2000
|
-
productSearchInput: [{ type: ViewChild, args: ['productSearchInputComponent', { static: true },] }]
|
|
2001
|
-
};
|
|
2002
|
-
|
|
2003
|
-
class ProductOptionsEditorComponent extends BaseDetailComponent {
|
|
2004
|
-
constructor(route, router, serverConfigService, dataService, productDetailService, formBuilder, changeDetector, notificationService) {
|
|
2005
|
-
super(route, router, serverConfigService, dataService);
|
|
2006
|
-
this.route = route;
|
|
2007
|
-
this.router = router;
|
|
2008
|
-
this.serverConfigService = serverConfigService;
|
|
2009
|
-
this.dataService = dataService;
|
|
2010
|
-
this.productDetailService = productDetailService;
|
|
2011
|
-
this.formBuilder = formBuilder;
|
|
2012
|
-
this.changeDetector = changeDetector;
|
|
2013
|
-
this.notificationService = notificationService;
|
|
2014
|
-
this.autoUpdateVariantNames = true;
|
|
2015
|
-
this.updatePermission = [Permission.UpdateCatalog, Permission.UpdateProduct];
|
|
2016
|
-
this.optionGroupCustomFields = this.getCustomFieldConfig('ProductOptionGroup');
|
|
2017
|
-
this.optionCustomFields = this.getCustomFieldConfig('ProductOption');
|
|
2018
|
-
}
|
|
2019
|
-
ngOnInit() {
|
|
2020
|
-
this.optionGroups$ = this.route.snapshot.data.entity.pipe(map((product) => product.optionGroups));
|
|
2021
|
-
this.detailForm = new FormGroup({
|
|
2022
|
-
optionGroups: new FormArray([]),
|
|
2023
|
-
});
|
|
2024
|
-
super.init();
|
|
2025
|
-
}
|
|
2026
|
-
getOptionGroups() {
|
|
2027
|
-
const optionGroups = this.detailForm.get('optionGroups');
|
|
2028
|
-
return optionGroups.controls;
|
|
2029
|
-
}
|
|
2030
|
-
getOptions(optionGroup) {
|
|
2031
|
-
const options = optionGroup.get('options');
|
|
2032
|
-
return options.controls;
|
|
2033
|
-
}
|
|
2034
|
-
save() {
|
|
2035
|
-
if (this.detailForm.invalid || this.detailForm.pristine) {
|
|
2036
|
-
return;
|
|
2037
|
-
}
|
|
2038
|
-
// tslint:disable-next-line:no-non-null-assertion
|
|
2039
|
-
const $product = this.dataService.product.getProduct(this.id).mapSingle(data => data.product);
|
|
2040
|
-
combineLatest(this.entity$, this.languageCode$, $product)
|
|
2041
|
-
.pipe(take(1), mergeMap(([{ optionGroups }, languageCode, product]) => {
|
|
2042
|
-
var _a, _b, _c, _d, _e;
|
|
2043
|
-
const updateOperations = [];
|
|
2044
|
-
for (const optionGroupForm of this.getOptionGroups()) {
|
|
2045
|
-
if (((_a = optionGroupForm.get('name')) === null || _a === void 0 ? void 0 : _a.dirty) || ((_b = optionGroupForm.get('code')) === null || _b === void 0 ? void 0 : _b.dirty)) {
|
|
2046
|
-
const optionGroupEntity = optionGroups.find(og => og.id === optionGroupForm.value.id);
|
|
2047
|
-
if (optionGroupEntity) {
|
|
2048
|
-
const input = this.getUpdatedOptionGroup(optionGroupEntity, optionGroupForm, languageCode);
|
|
2049
|
-
updateOperations.push(this.dataService.product.updateProductOptionGroup(input));
|
|
2050
|
-
}
|
|
2051
|
-
}
|
|
2052
|
-
for (const optionForm of this.getOptions(optionGroupForm)) {
|
|
2053
|
-
if (((_c = optionForm.get('name')) === null || _c === void 0 ? void 0 : _c.dirty) || ((_d = optionForm.get('code')) === null || _d === void 0 ? void 0 : _d.dirty)) {
|
|
2054
|
-
const optionGroup = (_e = optionGroups
|
|
2055
|
-
.find(og => og.id === optionGroupForm.value.id)) === null || _e === void 0 ? void 0 : _e.options.find(o => o.id === optionForm.value.id);
|
|
2056
|
-
if (optionGroup) {
|
|
2057
|
-
const input = this.getUpdatedOption(optionGroup, optionForm, languageCode);
|
|
2058
|
-
updateOperations.push(this.productDetailService.updateProductOption(Object.assign(Object.assign({}, input), { autoUpdate: this.autoUpdateVariantNames }), product, languageCode));
|
|
2059
|
-
}
|
|
2060
|
-
}
|
|
2061
|
-
}
|
|
2062
|
-
}
|
|
2063
|
-
return forkJoin(updateOperations);
|
|
2064
|
-
}))
|
|
2065
|
-
.subscribe(() => {
|
|
2066
|
-
this.detailForm.markAsPristine();
|
|
2067
|
-
this.changeDetector.markForCheck();
|
|
2068
|
-
this.notificationService.success(marker('common.notify-update-success'), {
|
|
2069
|
-
entity: 'ProductOptionGroup',
|
|
2070
|
-
});
|
|
2071
|
-
}, err => {
|
|
2072
|
-
this.notificationService.error(marker('common.notify-update-error'), {
|
|
2073
|
-
entity: 'ProductOptionGroup',
|
|
2074
|
-
});
|
|
2075
|
-
});
|
|
2076
|
-
}
|
|
2077
|
-
getUpdatedOptionGroup(optionGroup, optionGroupFormGroup, languageCode) {
|
|
2078
|
-
const input = createUpdatedTranslatable({
|
|
2079
|
-
translatable: optionGroup,
|
|
2080
|
-
updatedFields: optionGroupFormGroup.value,
|
|
2081
|
-
customFieldConfig: this.optionGroupCustomFields,
|
|
2082
|
-
languageCode,
|
|
2083
|
-
defaultTranslation: {
|
|
2084
|
-
languageCode,
|
|
2085
|
-
name: optionGroup.name || '',
|
|
2086
|
-
},
|
|
2087
|
-
});
|
|
2088
|
-
return input;
|
|
2089
|
-
}
|
|
2090
|
-
getUpdatedOption(option, optionFormGroup, languageCode) {
|
|
2091
|
-
const input = createUpdatedTranslatable({
|
|
2092
|
-
translatable: option,
|
|
2093
|
-
updatedFields: optionFormGroup.value,
|
|
2094
|
-
customFieldConfig: this.optionGroupCustomFields,
|
|
2095
|
-
languageCode,
|
|
2096
|
-
defaultTranslation: {
|
|
2097
|
-
languageCode,
|
|
2098
|
-
name: option.name || '',
|
|
2099
|
-
},
|
|
2100
|
-
});
|
|
2101
|
-
return input;
|
|
2102
|
-
}
|
|
2103
|
-
setFormValues(entity, languageCode) {
|
|
2104
|
-
const groupsFormArray = new FormArray([]);
|
|
2105
|
-
for (const optionGroup of entity.optionGroups) {
|
|
2106
|
-
const groupTranslation = findTranslation(optionGroup, languageCode);
|
|
2107
|
-
const group = {
|
|
2108
|
-
id: optionGroup.id,
|
|
2109
|
-
createdAt: optionGroup.createdAt,
|
|
2110
|
-
updatedAt: optionGroup.updatedAt,
|
|
2111
|
-
code: optionGroup.code,
|
|
2112
|
-
name: groupTranslation ? groupTranslation.name : '',
|
|
2113
|
-
};
|
|
2114
|
-
const optionsFormArray = new FormArray([]);
|
|
2115
|
-
for (const option of optionGroup.options) {
|
|
2116
|
-
const optionTranslation = findTranslation(option, languageCode);
|
|
2117
|
-
const optionControl = this.formBuilder.group({
|
|
2118
|
-
id: option.id,
|
|
2119
|
-
createdAt: option.createdAt,
|
|
2120
|
-
updatedAt: option.updatedAt,
|
|
2121
|
-
code: option.code,
|
|
2122
|
-
name: optionTranslation ? optionTranslation.name : '',
|
|
2123
|
-
});
|
|
2124
|
-
optionsFormArray.push(optionControl);
|
|
2125
|
-
}
|
|
2126
|
-
const groupControl = this.formBuilder.group(group);
|
|
2127
|
-
groupControl.addControl('options', optionsFormArray);
|
|
2128
|
-
groupsFormArray.push(groupControl);
|
|
2129
|
-
}
|
|
2130
|
-
this.detailForm.setControl('optionGroups', groupsFormArray);
|
|
2131
|
-
}
|
|
2132
|
-
}
|
|
2133
|
-
ProductOptionsEditorComponent.decorators = [
|
|
2134
|
-
{ type: Component, args: [{
|
|
2135
|
-
selector: 'vdr-product-options-editor',
|
|
2136
|
-
template: "<vdr-action-bar>\r\n <vdr-ab-left>\r\n <vdr-language-selector\r\n [availableLanguageCodes]=\"availableLanguages$ | async\"\r\n [currentLanguageCode]=\"languageCode$ | async\"\r\n (languageCodeChange)=\"setLanguage($event)\"\r\n ></vdr-language-selector>\r\n </vdr-ab-left>\r\n\r\n <vdr-ab-right>\r\n <div class=\"flex center\">\r\n <div class=\"mr2\">\r\n <clr-checkbox-wrapper>\r\n <input\r\n clrCheckbox\r\n type=\"checkbox\"\r\n id=\"auto-update\"\r\n [(ngModel)]=\"autoUpdateVariantNames\"\r\n />\r\n <label>{{ 'catalog.auto-update-product-variant-name' | translate }}</label>\r\n </clr-checkbox-wrapper>\r\n </div>\r\n <button\r\n *vdrIfPermissions=\"updatePermission\"\r\n class=\"btn btn-primary\"\r\n (click)=\"save()\"\r\n [disabled]=\"detailForm.pristine || detailForm.invalid\"\r\n >\r\n {{ 'common.update' | translate }}\r\n </button>\r\n </div>\r\n </vdr-ab-right>\r\n</vdr-action-bar>\r\n<form class=\"form\" [formGroup]=\"detailForm\" *ngIf=\"optionGroups$ | async as optionGroups\">\r\n <div formGroupName=\"optionGroups\" class=\"clr-row\">\r\n <div class=\"clr-col-12 clr-col-xl-6\" *ngFor=\"let optionGroup of getOptionGroups(); index as i\">\r\n <section class=\"card\" [formArrayName]=\"i\">\r\n <div class=\"card-header option-group-header\">\r\n <vdr-entity-info [entity]=\"optionGroup.value\"></vdr-entity-info>\r\n <div class=\"ml2\">{{ optionGroup.value.code }}</div>\r\n </div>\r\n <div class=\"card-block\">\r\n <vdr-form-field [label]=\"'common.name' | translate\" for=\"name\">\r\n <input\r\n [id]=\"'name-' + i\"\r\n type=\"text\"\r\n formControlName=\"name\"\r\n [readonly]=\"!(updatePermission | hasPermission)\"\r\n />\r\n </vdr-form-field>\r\n <vdr-form-field [label]=\"'common.code' | translate\" for=\"code\">\r\n <input\r\n [id]=\"'code-' + i\"\r\n type=\"text\"\r\n [readonly]=\"!(updatePermission | hasPermission)\"\r\n formControlName=\"code\"\r\n />\r\n </vdr-form-field>\r\n </div>\r\n <section class=\"card-block\">\r\n <table class=\"facet-values-list table mt2 mb4\" formGroupName=\"options\">\r\n <thead>\r\n <tr>\r\n <th></th>\r\n <th>{{ 'common.name' | translate }}</th>\r\n <th>{{ 'common.code' | translate }}</th>\r\n </tr>\r\n </thead>\r\n <tbody>\r\n <tr\r\n class=\"facet-value\"\r\n *ngFor=\"let option of getOptions(optionGroup); let i = index\"\r\n [formGroupName]=\"i\"\r\n >\r\n <td class=\"align-middle\">\r\n <vdr-entity-info [entity]=\"option.value\"></vdr-entity-info>\r\n </td>\r\n <td class=\"align-middle\">\r\n <input\r\n type=\"text\"\r\n formControlName=\"name\"\r\n [readonly]=\"!(updatePermission | hasPermission)\"\r\n />\r\n </td>\r\n <td class=\"align-middle\"><input type=\"text\" formControlName=\"code\" /></td>\r\n </tr>\r\n </tbody>\r\n </table>\r\n </section>\r\n </section>\r\n </div>\r\n </div>\r\n</form>\r\n",
|
|
2137
|
-
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
2138
|
-
styles: [".option-group-header{display:flex;align-items:baseline}\n"]
|
|
2139
|
-
},] }
|
|
2140
|
-
];
|
|
2141
|
-
ProductOptionsEditorComponent.ctorParameters = () => [
|
|
2142
|
-
{ type: ActivatedRoute },
|
|
2143
|
-
{ type: Router },
|
|
2144
|
-
{ type: ServerConfigService },
|
|
2145
|
-
{ type: DataService },
|
|
2146
|
-
{ type: ProductDetailService },
|
|
2147
|
-
{ type: FormBuilder },
|
|
2148
|
-
{ type: ChangeDetectorRef },
|
|
2149
|
-
{ type: NotificationService }
|
|
2150
|
-
];
|
|
2151
|
-
|
|
2152
|
-
class ConfirmVariantDeletionDialogComponent {
|
|
2153
|
-
constructor() {
|
|
2154
|
-
this.variants = [];
|
|
2155
|
-
}
|
|
2156
|
-
confirm() {
|
|
2157
|
-
this.resolveWith(true);
|
|
2158
|
-
}
|
|
2159
|
-
cancel() {
|
|
2160
|
-
this.resolveWith();
|
|
2161
|
-
}
|
|
2162
|
-
}
|
|
2163
|
-
ConfirmVariantDeletionDialogComponent.decorators = [
|
|
2164
|
-
{ type: Component, args: [{
|
|
2165
|
-
selector: 'vdr-confirm-variant-deletion-dialog',
|
|
2166
|
-
template: "<ng-template vdrDialogTitle>\r\n {{ 'catalog.confirm-deletion-of-unused-variants-title' | translate }}\r\n</ng-template>\r\n{{ 'catalog.confirm-deletion-of-unused-variants-body' | translate }}\r\n<ul>\r\n <li *ngFor=\"let variant of variants\">{{ variant.name }} ({{ variant.sku }})</li>\r\n</ul>\r\n<ng-template vdrDialogButtons>\r\n <button type=\"button\" class=\"btn\" (click)=\"cancel()\">{{ 'common.cancel' | translate }}</button>\r\n <button type=\"submit\" (click)=\"confirm()\" class=\"btn btn-primary\">\r\n {{ 'common.confirm' | translate }}\r\n </button>\r\n</ng-template>\r\n",
|
|
2167
|
-
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
2168
|
-
styles: [""]
|
|
2169
|
-
},] }
|
|
2170
|
-
];
|
|
2171
|
-
|
|
2172
|
-
class GeneratedVariant {
|
|
2173
|
-
constructor(config) {
|
|
2174
|
-
for (const key of Object.keys(config)) {
|
|
2175
|
-
this[key] = config[key];
|
|
2176
|
-
}
|
|
2177
|
-
}
|
|
2178
|
-
}
|
|
2179
|
-
class ProductVariantsEditorComponent {
|
|
2180
|
-
constructor(route, dataService, productDetailService, notificationService, modalService) {
|
|
2181
|
-
this.route = route;
|
|
2182
|
-
this.dataService = dataService;
|
|
2183
|
-
this.productDetailService = productDetailService;
|
|
2184
|
-
this.notificationService = notificationService;
|
|
2185
|
-
this.modalService = modalService;
|
|
2186
|
-
this.formValueChanged = false;
|
|
2187
|
-
this.optionsChanged = false;
|
|
2188
|
-
this.generatedVariants = [];
|
|
2189
|
-
}
|
|
2190
|
-
ngOnInit() {
|
|
2191
|
-
this.initOptionsAndVariants();
|
|
2192
|
-
this.languageCode =
|
|
2193
|
-
this.route.snapshot.paramMap.get('lang') || getDefaultUiLanguage();
|
|
2194
|
-
this.dataService.settings.getActiveChannel().single$.subscribe(data => {
|
|
2195
|
-
this.currencyCode = data.activeChannel.currencyCode;
|
|
2196
|
-
});
|
|
2197
|
-
}
|
|
2198
|
-
onFormChanged(variantInfo) {
|
|
2199
|
-
this.formValueChanged = true;
|
|
2200
|
-
variantInfo.enabled = true;
|
|
2201
|
-
}
|
|
2202
|
-
canDeactivate() {
|
|
2203
|
-
return !this.formValueChanged;
|
|
2204
|
-
}
|
|
2205
|
-
getVariantsToAdd() {
|
|
2206
|
-
return this.generatedVariants.filter(v => !v.existing && v.enabled);
|
|
2207
|
-
}
|
|
2208
|
-
getVariantName(variant) {
|
|
2209
|
-
return variant.options.length === 0
|
|
2210
|
-
? marker('catalog.default-variant')
|
|
2211
|
-
: variant.options.map(o => o.name).join(' ');
|
|
2212
|
-
}
|
|
2213
|
-
addOptionGroup() {
|
|
2214
|
-
this.optionGroups.push({
|
|
2215
|
-
isNew: true,
|
|
2216
|
-
locked: false,
|
|
2217
|
-
name: '',
|
|
2218
|
-
values: [],
|
|
2219
|
-
});
|
|
2220
|
-
this.optionsChanged = true;
|
|
2221
|
-
}
|
|
2222
|
-
removeOptionGroup(optionGroup) {
|
|
2223
|
-
const id = optionGroup.id;
|
|
2224
|
-
if (optionGroup.isNew) {
|
|
2225
|
-
this.optionGroups = this.optionGroups.filter(og => og !== optionGroup);
|
|
2226
|
-
this.generateVariants();
|
|
2227
|
-
this.optionsChanged = true;
|
|
2228
|
-
}
|
|
2229
|
-
else if (id) {
|
|
2230
|
-
this.modalService
|
|
2231
|
-
.dialog({
|
|
2232
|
-
title: marker('catalog.confirm-delete-product-option-group'),
|
|
2233
|
-
translationVars: { name: optionGroup.name },
|
|
2234
|
-
buttons: [
|
|
2235
|
-
{ type: 'secondary', label: marker('common.cancel') },
|
|
2236
|
-
{ type: 'danger', label: marker('common.delete'), returnValue: true },
|
|
2237
|
-
],
|
|
2238
|
-
})
|
|
2239
|
-
.pipe(switchMap(val => {
|
|
2240
|
-
if (val) {
|
|
2241
|
-
return this.dataService.product.removeOptionGroupFromProduct({
|
|
2242
|
-
optionGroupId: id,
|
|
2243
|
-
productId: this.product.id,
|
|
2244
|
-
});
|
|
2245
|
-
}
|
|
2246
|
-
else {
|
|
2247
|
-
return EMPTY;
|
|
2248
|
-
}
|
|
2249
|
-
}))
|
|
2250
|
-
.subscribe(({ removeOptionGroupFromProduct }) => {
|
|
2251
|
-
var _a;
|
|
2252
|
-
if (removeOptionGroupFromProduct.__typename === 'Product') {
|
|
2253
|
-
this.notificationService.success(marker('common.notify-delete-success'), {
|
|
2254
|
-
entity: 'ProductOptionGroup',
|
|
2255
|
-
});
|
|
2256
|
-
this.initOptionsAndVariants();
|
|
2257
|
-
this.optionsChanged = true;
|
|
2258
|
-
}
|
|
2259
|
-
else if (removeOptionGroupFromProduct.__typename === 'ProductOptionInUseError') {
|
|
2260
|
-
this.notificationService.error((_a = removeOptionGroupFromProduct.message) !== null && _a !== void 0 ? _a : '');
|
|
2261
|
-
}
|
|
2262
|
-
});
|
|
2263
|
-
}
|
|
2264
|
-
}
|
|
2265
|
-
addOption(index, optionName) {
|
|
2266
|
-
const group = this.optionGroups[index];
|
|
2267
|
-
if (group) {
|
|
2268
|
-
group.values.push({ name: optionName, locked: false });
|
|
2269
|
-
this.generateVariants();
|
|
2270
|
-
this.optionsChanged = true;
|
|
2271
|
-
}
|
|
2272
|
-
}
|
|
2273
|
-
removeOption(index, { id, name }) {
|
|
2274
|
-
const optionGroup = this.optionGroups[index];
|
|
2275
|
-
if (optionGroup) {
|
|
2276
|
-
if (!id) {
|
|
2277
|
-
optionGroup.values = optionGroup.values.filter(v => v.name !== name);
|
|
2278
|
-
this.generateVariants();
|
|
2279
|
-
}
|
|
2280
|
-
else {
|
|
2281
|
-
this.modalService
|
|
2282
|
-
.dialog({
|
|
2283
|
-
title: marker('catalog.confirm-delete-product-option'),
|
|
2284
|
-
translationVars: { name },
|
|
2285
|
-
buttons: [
|
|
2286
|
-
{ type: 'secondary', label: marker('common.cancel') },
|
|
2287
|
-
{ type: 'danger', label: marker('common.delete'), returnValue: true },
|
|
2288
|
-
],
|
|
2289
|
-
})
|
|
2290
|
-
.pipe(switchMap(val => {
|
|
2291
|
-
if (val) {
|
|
2292
|
-
return this.dataService.product.deleteProductOption(id);
|
|
2293
|
-
}
|
|
2294
|
-
else {
|
|
2295
|
-
return EMPTY;
|
|
2296
|
-
}
|
|
2297
|
-
}))
|
|
2298
|
-
.subscribe(({ deleteProductOption }) => {
|
|
2299
|
-
var _a;
|
|
2300
|
-
if (deleteProductOption.result === DeletionResult.DELETED) {
|
|
2301
|
-
this.notificationService.success(marker('common.notify-delete-success'), {
|
|
2302
|
-
entity: 'ProductOption',
|
|
2303
|
-
});
|
|
2304
|
-
optionGroup.values = optionGroup.values.filter(v => v.id !== id);
|
|
2305
|
-
this.generateVariants();
|
|
2306
|
-
this.optionsChanged = true;
|
|
2307
|
-
}
|
|
2308
|
-
else {
|
|
2309
|
-
this.notificationService.error((_a = deleteProductOption.message) !== null && _a !== void 0 ? _a : '');
|
|
2310
|
-
}
|
|
2311
|
-
});
|
|
2312
|
-
}
|
|
2313
|
-
}
|
|
2314
|
-
}
|
|
2315
|
-
generateVariants() {
|
|
2316
|
-
const groups = this.optionGroups.map(g => g.values);
|
|
2317
|
-
const previousVariants = this.generatedVariants;
|
|
2318
|
-
const generatedVariantFactory = (isDefault, options, existingVariant, prototypeVariant) => {
|
|
2319
|
-
var _a, _b, _c, _d, _e, _f;
|
|
2320
|
-
const prototype = this.getVariantPrototype(options, previousVariants);
|
|
2321
|
-
return new GeneratedVariant({
|
|
2322
|
-
enabled: true,
|
|
2323
|
-
existing: !!existingVariant,
|
|
2324
|
-
productVariantId: existingVariant === null || existingVariant === void 0 ? void 0 : existingVariant.id,
|
|
2325
|
-
isDefault,
|
|
2326
|
-
options,
|
|
2327
|
-
price: (_b = (_a = existingVariant === null || existingVariant === void 0 ? void 0 : existingVariant.price) !== null && _a !== void 0 ? _a : prototypeVariant === null || prototypeVariant === void 0 ? void 0 : prototypeVariant.price) !== null && _b !== void 0 ? _b : prototype.price,
|
|
2328
|
-
sku: (_d = (_c = existingVariant === null || existingVariant === void 0 ? void 0 : existingVariant.sku) !== null && _c !== void 0 ? _c : prototypeVariant === null || prototypeVariant === void 0 ? void 0 : prototypeVariant.sku) !== null && _d !== void 0 ? _d : prototype.sku,
|
|
2329
|
-
stock: (_f = (_e = existingVariant === null || existingVariant === void 0 ? void 0 : existingVariant.stockOnHand) !== null && _e !== void 0 ? _e : prototypeVariant === null || prototypeVariant === void 0 ? void 0 : prototypeVariant.stockOnHand) !== null && _f !== void 0 ? _f : prototype.stock,
|
|
2330
|
-
});
|
|
2331
|
-
};
|
|
2332
|
-
this.generatedVariants = groups.length
|
|
2333
|
-
? generateAllCombinations(groups).map(options => {
|
|
2334
|
-
const existingVariant = this.product.variants.find(v => this.optionsAreEqual(v.options, options));
|
|
2335
|
-
const prototypeVariant = this.product.variants.find(v => this.optionsAreSubset(v.options, options));
|
|
2336
|
-
return generatedVariantFactory(false, options, existingVariant, prototypeVariant);
|
|
2337
|
-
})
|
|
2338
|
-
: [generatedVariantFactory(true, [], this.product.variants[0])];
|
|
2339
|
-
}
|
|
2340
|
-
/**
|
|
2341
|
-
* Returns one of the existing variants to base the newly-generated variant's
|
|
2342
|
-
* details off.
|
|
2343
|
-
*/
|
|
2344
|
-
getVariantPrototype(options, previousVariants) {
|
|
2345
|
-
const variantsWithSimilarOptions = previousVariants.filter(v => options.map(o => o.name).filter(name => v.options.map(o => o.name).includes(name)));
|
|
2346
|
-
if (variantsWithSimilarOptions.length) {
|
|
2347
|
-
return pick(previousVariants[0], ['sku', 'price', 'stock']);
|
|
2348
|
-
}
|
|
2349
|
-
return {
|
|
2350
|
-
sku: '',
|
|
2351
|
-
price: 0,
|
|
2352
|
-
stock: 0,
|
|
2353
|
-
};
|
|
2354
|
-
}
|
|
2355
|
-
deleteVariant(id, options) {
|
|
2356
|
-
this.modalService
|
|
2357
|
-
.dialog({
|
|
2358
|
-
title: marker('catalog.confirm-delete-product-variant'),
|
|
2359
|
-
translationVars: { name: options.map(o => o.name).join(' ') },
|
|
2360
|
-
buttons: [
|
|
2361
|
-
{ type: 'secondary', label: marker('common.cancel') },
|
|
2362
|
-
{ type: 'danger', label: marker('common.delete'), returnValue: true },
|
|
2363
|
-
],
|
|
2364
|
-
})
|
|
2365
|
-
.pipe(switchMap(response => response ? this.productDetailService.deleteProductVariant(id, this.product.id) : EMPTY), switchMap(() => this.reFetchProduct(null)))
|
|
2366
|
-
.subscribe(() => {
|
|
2367
|
-
this.notificationService.success(marker('common.notify-delete-success'), {
|
|
2368
|
-
entity: 'ProductVariant',
|
|
2369
|
-
});
|
|
2370
|
-
this.initOptionsAndVariants();
|
|
2371
|
-
}, err => {
|
|
2372
|
-
this.notificationService.error(marker('common.notify-delete-error'), {
|
|
2373
|
-
entity: 'ProductVariant',
|
|
2374
|
-
});
|
|
2375
|
-
});
|
|
2376
|
-
}
|
|
2377
|
-
save() {
|
|
2378
|
-
this.optionGroups = this.optionGroups.filter(g => g.values.length);
|
|
2379
|
-
const newOptionGroups = this.optionGroups
|
|
2380
|
-
.filter(og => og.isNew)
|
|
2381
|
-
.map(og => ({
|
|
2382
|
-
name: og.name,
|
|
2383
|
-
values: [],
|
|
2384
|
-
}));
|
|
2385
|
-
this.checkUniqueSkus()
|
|
2386
|
-
.pipe(mergeMap(() => this.confirmDeletionOfObsoleteVariants()), mergeMap(() => this.productDetailService.createProductOptionGroups(newOptionGroups, this.languageCode)), mergeMap(createdOptionGroups => this.addOptionGroupsToProduct(createdOptionGroups)), mergeMap(createdOptionGroups => this.addNewOptionsToGroups(createdOptionGroups)), mergeMap(groupsIds => this.fetchOptionGroups(groupsIds)), mergeMap(groups => this.createNewProductVariants(groups)), mergeMap(res => this.deleteObsoleteVariants(res.createProductVariants)), mergeMap(variants => this.reFetchProduct(variants)))
|
|
2387
|
-
.subscribe({
|
|
2388
|
-
next: variants => {
|
|
2389
|
-
this.formValueChanged = false;
|
|
2390
|
-
this.notificationService.success(marker('catalog.created-new-variants-success'), {
|
|
2391
|
-
count: variants.length,
|
|
2392
|
-
});
|
|
2393
|
-
this.initOptionsAndVariants();
|
|
2394
|
-
this.optionsChanged = false;
|
|
2395
|
-
},
|
|
2396
|
-
});
|
|
2397
|
-
}
|
|
2398
|
-
checkUniqueSkus() {
|
|
2399
|
-
const withDuplicateSkus = this.generatedVariants.filter((variant, index) => {
|
|
2400
|
-
return (variant.enabled &&
|
|
2401
|
-
this.generatedVariants.find(gv => gv.sku.trim() === variant.sku.trim() && gv !== variant));
|
|
2402
|
-
});
|
|
2403
|
-
if (withDuplicateSkus.length) {
|
|
2404
|
-
return this.modalService
|
|
2405
|
-
.dialog({
|
|
2406
|
-
title: marker('catalog.duplicate-sku-warning'),
|
|
2407
|
-
body: unique(withDuplicateSkus.map(v => `${v.sku}`)).join(', '),
|
|
2408
|
-
buttons: [{ label: marker('common.close'), returnValue: false, type: 'primary' }],
|
|
2409
|
-
})
|
|
2410
|
-
.pipe(mergeMap(res => EMPTY));
|
|
2411
|
-
}
|
|
2412
|
-
else {
|
|
2413
|
-
return of(true);
|
|
2414
|
-
}
|
|
2415
|
-
}
|
|
2416
|
-
confirmDeletionOfObsoleteVariants() {
|
|
2417
|
-
const obsoleteVariants = this.getObsoleteVariants();
|
|
2418
|
-
if (obsoleteVariants.length) {
|
|
2419
|
-
return this.modalService
|
|
2420
|
-
.fromComponent(ConfirmVariantDeletionDialogComponent, {
|
|
2421
|
-
locals: {
|
|
2422
|
-
variants: obsoleteVariants,
|
|
2423
|
-
},
|
|
2424
|
-
})
|
|
2425
|
-
.pipe(mergeMap(res => {
|
|
2426
|
-
return res === true ? of(true) : EMPTY;
|
|
2427
|
-
}));
|
|
2428
|
-
}
|
|
2429
|
-
else {
|
|
2430
|
-
return of(true);
|
|
2431
|
-
}
|
|
2432
|
-
}
|
|
2433
|
-
getObsoleteVariants() {
|
|
2434
|
-
return this.product.variants.filter(variant => !this.generatedVariants.find(gv => gv.productVariantId === variant.id));
|
|
2435
|
-
}
|
|
2436
|
-
hasOnlyDefaultVariant(product) {
|
|
2437
|
-
return product.variants.length === 1 && product.optionGroups.length === 0;
|
|
2438
|
-
}
|
|
2439
|
-
addOptionGroupsToProduct(createdOptionGroups) {
|
|
2440
|
-
if (createdOptionGroups.length) {
|
|
2441
|
-
return forkJoin(createdOptionGroups.map(optionGroup => {
|
|
2442
|
-
return this.dataService.product.addOptionGroupToProduct({
|
|
2443
|
-
productId: this.product.id,
|
|
2444
|
-
optionGroupId: optionGroup.id,
|
|
2445
|
-
});
|
|
2446
|
-
})).pipe(map(() => createdOptionGroups));
|
|
2447
|
-
}
|
|
2448
|
-
else {
|
|
2449
|
-
return of([]);
|
|
2450
|
-
}
|
|
2451
|
-
}
|
|
2452
|
-
addNewOptionsToGroups(createdOptionGroups) {
|
|
2453
|
-
const newOptions = this.optionGroups
|
|
2454
|
-
.map(og => {
|
|
2455
|
-
const createdGroup = createdOptionGroups.find(cog => cog.name === og.name);
|
|
2456
|
-
const productOptionGroupId = createdGroup ? createdGroup.id : og.id;
|
|
2457
|
-
if (!productOptionGroupId) {
|
|
2458
|
-
throw new Error('Could not get a productOptionGroupId');
|
|
2459
|
-
}
|
|
2460
|
-
return og.values
|
|
2461
|
-
.filter(v => !v.locked)
|
|
2462
|
-
.map(v => ({
|
|
2463
|
-
productOptionGroupId,
|
|
2464
|
-
code: normalizeString(v.name, '-'),
|
|
2465
|
-
translations: [{ name: v.name, languageCode: this.languageCode }],
|
|
2466
|
-
}));
|
|
2467
|
-
})
|
|
2468
|
-
.reduce((flat, options) => [...flat, ...options], []);
|
|
2469
|
-
const allGroupIds = [
|
|
2470
|
-
...createdOptionGroups.map(g => g.id),
|
|
2471
|
-
...this.optionGroups.map(g => g.id).filter(notNullOrUndefined),
|
|
2472
|
-
];
|
|
2473
|
-
if (newOptions.length) {
|
|
2474
|
-
return forkJoin(newOptions.map(input => this.dataService.product.addOptionToGroup(input))).pipe(map(() => allGroupIds));
|
|
2475
|
-
}
|
|
2476
|
-
else {
|
|
2477
|
-
return of(allGroupIds);
|
|
2478
|
-
}
|
|
2479
|
-
}
|
|
2480
|
-
fetchOptionGroups(groupsIds) {
|
|
2481
|
-
return forkJoin(groupsIds.map(id => this.dataService.product
|
|
2482
|
-
.getProductOptionGroup(id)
|
|
2483
|
-
.mapSingle(data => data.productOptionGroup)
|
|
2484
|
-
.pipe(filter(notNullOrUndefined)))).pipe(defaultIfEmpty([]));
|
|
2485
|
-
}
|
|
2486
|
-
createNewProductVariants(groups) {
|
|
2487
|
-
const options = groups
|
|
2488
|
-
.filter(notNullOrUndefined)
|
|
2489
|
-
.map(og => og.options)
|
|
2490
|
-
.reduce((flat, o) => [...flat, ...o], []);
|
|
2491
|
-
const variants = this.generatedVariants
|
|
2492
|
-
.filter(v => v.enabled && !v.existing)
|
|
2493
|
-
.map(v => {
|
|
2494
|
-
const optionIds = groups.map((group, index) => {
|
|
2495
|
-
const option = group.options.find(o => o.name === v.options[index].name);
|
|
2496
|
-
if (option) {
|
|
2497
|
-
return option.id;
|
|
2498
|
-
}
|
|
2499
|
-
else {
|
|
2500
|
-
throw new Error(`Could not find a matching option for group ${group.name}`);
|
|
2501
|
-
}
|
|
2502
|
-
});
|
|
2503
|
-
return {
|
|
2504
|
-
price: v.price,
|
|
2505
|
-
sku: v.sku,
|
|
2506
|
-
stock: v.stock,
|
|
2507
|
-
optionIds,
|
|
2508
|
-
};
|
|
2509
|
-
});
|
|
2510
|
-
return this.productDetailService.createProductVariants(this.product, variants, options, this.languageCode);
|
|
2511
|
-
}
|
|
2512
|
-
deleteObsoleteVariants(input) {
|
|
2513
|
-
const obsoleteVariants = this.getObsoleteVariants();
|
|
2514
|
-
if (obsoleteVariants.length) {
|
|
2515
|
-
const deleteOperations = obsoleteVariants.map(v => this.dataService.product.deleteProductVariant(v.id).pipe(map(() => input)));
|
|
2516
|
-
return forkJoin(...deleteOperations);
|
|
2517
|
-
}
|
|
2518
|
-
else {
|
|
2519
|
-
return of(input);
|
|
2520
|
-
}
|
|
2521
|
-
}
|
|
2522
|
-
reFetchProduct(input) {
|
|
2523
|
-
// Re-fetch the Product to force an update to the view.
|
|
2524
|
-
const id = this.route.snapshot.paramMap.get('id');
|
|
2525
|
-
if (id) {
|
|
2526
|
-
return this.dataService.product.getProduct(id).single$.pipe(map(() => input));
|
|
2527
|
-
}
|
|
2528
|
-
else {
|
|
2529
|
-
return of(input);
|
|
2530
|
-
}
|
|
2531
|
-
}
|
|
2532
|
-
initOptionsAndVariants() {
|
|
2533
|
-
this.dataService.product
|
|
2534
|
-
// tslint:disable-next-line:no-non-null-assertion
|
|
2535
|
-
.getProductVariantsOptions(this.route.snapshot.paramMap.get('id'))
|
|
2536
|
-
// tslint:disable-next-line:no-non-null-assertion
|
|
2537
|
-
.mapSingle(({ product }) => product)
|
|
2538
|
-
.subscribe(p => {
|
|
2539
|
-
this.product = p;
|
|
2540
|
-
const allUsedOptionIds = p.variants.map(v => v.options.map(option => option.id)).flat();
|
|
2541
|
-
const allUsedOptionGroupIds = p.variants
|
|
2542
|
-
.map(v => v.options.map(option => option.groupId))
|
|
2543
|
-
.flat();
|
|
2544
|
-
this.optionGroups = p.optionGroups.map(og => {
|
|
2545
|
-
return {
|
|
2546
|
-
id: og.id,
|
|
2547
|
-
isNew: false,
|
|
2548
|
-
name: og.name,
|
|
2549
|
-
locked: allUsedOptionGroupIds.includes(og.id),
|
|
2550
|
-
values: og.options.map(o => ({
|
|
2551
|
-
id: o.id,
|
|
2552
|
-
name: o.name,
|
|
2553
|
-
locked: allUsedOptionIds.includes(o.id),
|
|
2554
|
-
})),
|
|
2555
|
-
};
|
|
2556
|
-
});
|
|
2557
|
-
this.generateVariants();
|
|
2558
|
-
});
|
|
2559
|
-
}
|
|
2560
|
-
optionsAreEqual(a, b) {
|
|
2561
|
-
return this.toOptionString(a) === this.toOptionString(b);
|
|
2562
|
-
}
|
|
2563
|
-
optionsAreSubset(a, b) {
|
|
2564
|
-
return this.toOptionString(b).includes(this.toOptionString(a));
|
|
2565
|
-
}
|
|
2566
|
-
toOptionString(o) {
|
|
2567
|
-
return o
|
|
2568
|
-
.map(x => x.name)
|
|
2569
|
-
.sort()
|
|
2570
|
-
.join('|');
|
|
2571
|
-
}
|
|
2572
|
-
}
|
|
2573
|
-
ProductVariantsEditorComponent.decorators = [
|
|
2574
|
-
{ type: Component, args: [{
|
|
2575
|
-
selector: 'vdr-product-variants-editor',
|
|
2576
|
-
template: "<vdr-action-bar>\r\n <vdr-ab-right>\r\n <button\r\n class=\"btn btn-primary\"\r\n (click)=\"save()\"\r\n [disabled]=\"(!formValueChanged && !optionsChanged) || getVariantsToAdd().length === 0\"\r\n >\r\n {{ 'common.add-new-variants' | translate: { count: getVariantsToAdd().length } }}\r\n </button>\r\n </vdr-ab-right>\r\n</vdr-action-bar>\r\n\r\n<div *ngFor=\"let group of optionGroups; index as i\" class=\"option-groups\">\r\n <div class=\"name\">\r\n <label>{{ 'catalog.option' | translate }}</label>\r\n <input clrInput [(ngModel)]=\"group.name\" name=\"name\" [readonly]=\"!group.isNew\" />\r\n </div>\r\n <div class=\"values\">\r\n <label>{{ 'catalog.option-values' | translate }}</label>\r\n <vdr-option-value-input\r\n #optionValueInputComponent\r\n [options]=\"group.values\"\r\n [groupName]=\"group.name\"\r\n [disabled]=\"group.name === ''\"\r\n (add)=\"addOption(i, $event.name)\"\r\n (remove)=\"removeOption(i, $event)\"\r\n ></vdr-option-value-input>\r\n </div>\r\n <div>\r\n <button\r\n [disabled]=\"group.locked\"\r\n class=\"btn btn-icon btn-danger-outline mt5\" (click)=\"removeOptionGroup(group)\">\r\n <clr-icon shape=\"trash\"></clr-icon>\r\n </button>\r\n </div>\r\n</div>\r\n<button class=\"btn btn-primary-outline btn-sm\" (click)=\"addOptionGroup()\">\r\n <clr-icon shape=\"plus\"></clr-icon>\r\n {{ 'catalog.add-option' | translate }}\r\n</button>\r\n\r\n<div class=\"variants-preview\">\r\n <table class=\"table\">\r\n <thead>\r\n <tr>\r\n <th></th>\r\n <th>{{ 'catalog.variant' | translate }}</th>\r\n <th>{{ 'catalog.sku' | translate }}</th>\r\n <th>{{ 'catalog.price' | translate }}</th>\r\n <th>{{ 'catalog.stock-on-hand' | translate }}</th>\r\n <th></th>\r\n </tr>\r\n </thead>\r\n <tr *ngFor=\"let variant of generatedVariants\" [class.disabled]=\"!variant.enabled || variant.existing\">\r\n <td class=\"left\">\r\n <clr-checkbox-wrapper *ngIf=\"!variant.existing\">\r\n <input\r\n type=\"checkbox\"\r\n [(ngModel)]=\"variant.enabled\"\r\n name=\"enabled\"\r\n clrCheckbox\r\n (ngModelChange)=\"formValueChanged = true\"\r\n />\r\n <label>{{ 'common.create' | translate }}</label>\r\n </clr-checkbox-wrapper>\r\n </td>\r\n <td>\r\n {{ getVariantName(variant) | translate }}\r\n </td>\r\n <td>\r\n <div class=\"flex center\">\r\n <clr-input-container *ngIf=\"!variant.existing\">\r\n <input\r\n clrInput\r\n type=\"text\"\r\n [(ngModel)]=\"variant.sku\"\r\n [placeholder]=\"'catalog.sku' | translate\"\r\n name=\"sku\"\r\n required\r\n (ngModelChange)=\"onFormChanged(variant)\"\r\n />\r\n </clr-input-container>\r\n <span *ngIf=\"variant.existing\">{{ variant.sku }}</span>\r\n </div>\r\n </td>\r\n <td>\r\n <div class=\"flex center\">\r\n <clr-input-container *ngIf=\"!variant.existing\">\r\n <vdr-currency-input\r\n clrInput\r\n [(ngModel)]=\"variant.price\"\r\n name=\"price\"\r\n [currencyCode]=\"currencyCode\"\r\n (ngModelChange)=\"onFormChanged(variant)\"\r\n ></vdr-currency-input>\r\n </clr-input-container>\r\n <span *ngIf=\"variant.existing\">{{ variant.price | localeCurrency: currencyCode }}</span>\r\n </div>\r\n </td>\r\n <td>\r\n <div class=\"flex center\">\r\n <clr-input-container *ngIf=\"!variant.existing\">\r\n <input\r\n clrInput\r\n type=\"number\"\r\n [(ngModel)]=\"variant.stock\"\r\n name=\"stock\"\r\n min=\"0\"\r\n step=\"1\"\r\n (ngModelChange)=\"onFormChanged(variant)\"\r\n />\r\n </clr-input-container>\r\n <span *ngIf=\"variant.existing\">{{ variant.stock }}</span>\r\n </div>\r\n </td>\r\n <td>\r\n <vdr-dropdown *ngIf=\"variant.productVariantId as productVariantId\">\r\n <button class=\"icon-button\" vdrDropdownTrigger>\r\n <clr-icon shape=\"ellipsis-vertical\"></clr-icon>\r\n </button>\r\n <vdr-dropdown-menu vdrPosition=\"bottom-right\">\r\n <button\r\n type=\"button\"\r\n class=\"delete-button\"\r\n (click)=\"deleteVariant(productVariantId, variant.options)\"\r\n vdrDropdownItem\r\n >\r\n <clr-icon shape=\"trash\" class=\"is-danger\"></clr-icon>\r\n {{ 'common.delete' | translate }}\r\n </button>\r\n </vdr-dropdown-menu>\r\n </vdr-dropdown>\r\n </td>\r\n </tr>\r\n </table>\r\n</div>\r\n",
|
|
2577
|
-
changeDetection: ChangeDetectionStrategy.Default,
|
|
2578
|
-
styles: [".option-groups{display:flex}.option-groups:first-of-type{margin-top:24px}.values{flex:1;margin:0 6px}.variants-preview tr.disabled td{background-color:var(--color-component-bg-100);color:var(--color-grey-400)}\n"]
|
|
2579
|
-
},] }
|
|
2580
|
-
];
|
|
2581
|
-
ProductVariantsEditorComponent.ctorParameters = () => [
|
|
2582
|
-
{ type: ActivatedRoute },
|
|
2583
|
-
{ type: DataService },
|
|
2584
|
-
{ type: ProductDetailService },
|
|
2585
|
-
{ type: NotificationService },
|
|
2586
|
-
{ type: ModalService }
|
|
2587
|
-
];
|
|
2588
|
-
|
|
2589
|
-
class AssetResolver extends BaseEntityResolver {
|
|
2590
|
-
constructor(router, dataService) {
|
|
2591
|
-
super(router, {
|
|
2592
|
-
__typename: 'Asset',
|
|
2593
|
-
id: '',
|
|
2594
|
-
createdAt: '',
|
|
2595
|
-
updatedAt: '',
|
|
2596
|
-
name: '',
|
|
2597
|
-
type: AssetType.IMAGE,
|
|
2598
|
-
fileSize: 0,
|
|
2599
|
-
mimeType: '',
|
|
2600
|
-
width: 0,
|
|
2601
|
-
height: 0,
|
|
2602
|
-
source: '',
|
|
2603
|
-
preview: '',
|
|
2604
|
-
focalPoint: null,
|
|
2605
|
-
}, id => dataService.product.getAsset(id).mapStream(data => data.asset));
|
|
2606
|
-
}
|
|
2607
|
-
}
|
|
2608
|
-
AssetResolver.ɵprov = i0.ɵɵdefineInjectable({ factory: function AssetResolver_Factory() { return new AssetResolver(i0.ɵɵinject(i1.Router), i0.ɵɵinject(i2.DataService)); }, token: AssetResolver, providedIn: "root" });
|
|
2609
|
-
AssetResolver.decorators = [
|
|
2610
|
-
{ type: Injectable, args: [{
|
|
2611
|
-
providedIn: 'root',
|
|
2612
|
-
},] }
|
|
2613
|
-
];
|
|
2614
|
-
AssetResolver.ctorParameters = () => [
|
|
2615
|
-
{ type: Router },
|
|
2616
|
-
{ type: DataService }
|
|
2617
|
-
];
|
|
2618
|
-
|
|
2619
|
-
class CollectionResolver extends BaseEntityResolver {
|
|
2620
|
-
constructor(router, dataService) {
|
|
2621
|
-
super(router, {
|
|
2622
|
-
__typename: 'Collection',
|
|
2623
|
-
id: '',
|
|
2624
|
-
createdAt: '',
|
|
2625
|
-
updatedAt: '',
|
|
2626
|
-
languageCode: getDefaultUiLanguage(),
|
|
2627
|
-
name: '',
|
|
2628
|
-
slug: '',
|
|
2629
|
-
isPrivate: false,
|
|
2630
|
-
description: '',
|
|
2631
|
-
featuredAsset: null,
|
|
2632
|
-
assets: [],
|
|
2633
|
-
translations: [],
|
|
2634
|
-
filters: [],
|
|
2635
|
-
parent: {},
|
|
2636
|
-
children: null,
|
|
2637
|
-
}, id => dataService.collection.getCollection(id).mapStream(data => data.collection));
|
|
2638
|
-
}
|
|
2639
|
-
}
|
|
2640
|
-
CollectionResolver.ɵprov = i0.ɵɵdefineInjectable({ factory: function CollectionResolver_Factory() { return new CollectionResolver(i0.ɵɵinject(i1.Router), i0.ɵɵinject(i2.DataService)); }, token: CollectionResolver, providedIn: "root" });
|
|
2641
|
-
CollectionResolver.decorators = [
|
|
2642
|
-
{ type: Injectable, args: [{
|
|
2643
|
-
providedIn: 'root',
|
|
2644
|
-
},] }
|
|
2645
|
-
];
|
|
2646
|
-
CollectionResolver.ctorParameters = () => [
|
|
2647
|
-
{ type: Router },
|
|
2648
|
-
{ type: DataService }
|
|
2649
|
-
];
|
|
2650
|
-
|
|
2651
|
-
class FacetResolver extends BaseEntityResolver {
|
|
2652
|
-
constructor(router, dataService) {
|
|
2653
|
-
super(router, {
|
|
2654
|
-
__typename: 'Facet',
|
|
2655
|
-
id: '',
|
|
2656
|
-
createdAt: '',
|
|
2657
|
-
updatedAt: '',
|
|
2658
|
-
isPrivate: false,
|
|
2659
|
-
languageCode: getDefaultUiLanguage(),
|
|
2660
|
-
name: '',
|
|
2661
|
-
code: '',
|
|
2662
|
-
translations: [],
|
|
2663
|
-
values: [],
|
|
2664
|
-
}, (id) => dataService.facet.getFacet(id).mapStream((data) => data.facet));
|
|
2665
|
-
}
|
|
2666
|
-
}
|
|
2667
|
-
FacetResolver.ɵprov = i0.ɵɵdefineInjectable({ factory: function FacetResolver_Factory() { return new FacetResolver(i0.ɵɵinject(i1.Router), i0.ɵɵinject(i2.DataService)); }, token: FacetResolver, providedIn: "root" });
|
|
2668
|
-
FacetResolver.decorators = [
|
|
2669
|
-
{ type: Injectable, args: [{
|
|
2670
|
-
providedIn: 'root',
|
|
2671
|
-
},] }
|
|
2672
|
-
];
|
|
2673
|
-
FacetResolver.ctorParameters = () => [
|
|
2674
|
-
{ type: Router },
|
|
2675
|
-
{ type: DataService }
|
|
2676
|
-
];
|
|
2677
|
-
|
|
2678
|
-
class ProductResolver extends BaseEntityResolver {
|
|
2679
|
-
constructor(dataService, router) {
|
|
2680
|
-
super(router, {
|
|
2681
|
-
__typename: 'Product',
|
|
2682
|
-
id: '',
|
|
2683
|
-
createdAt: '',
|
|
2684
|
-
updatedAt: '',
|
|
2685
|
-
enabled: true,
|
|
2686
|
-
languageCode: getDefaultUiLanguage(),
|
|
2687
|
-
name: '',
|
|
2688
|
-
slug: '',
|
|
2689
|
-
featuredAsset: null,
|
|
2690
|
-
assets: [],
|
|
2691
|
-
description: '',
|
|
2692
|
-
translations: [],
|
|
2693
|
-
optionGroups: [],
|
|
2694
|
-
facetValues: [],
|
|
2695
|
-
variantList: { items: [], totalItems: 0 },
|
|
2696
|
-
channels: [],
|
|
2697
|
-
}, id => dataService.product
|
|
2698
|
-
.getProduct(id, { take: 10 })
|
|
2699
|
-
.refetchOnChannelChange()
|
|
2700
|
-
.mapStream(data => data.product));
|
|
2701
|
-
}
|
|
2702
|
-
}
|
|
2703
|
-
ProductResolver.ɵprov = i0.ɵɵdefineInjectable({ factory: function ProductResolver_Factory() { return new ProductResolver(i0.ɵɵinject(i2.DataService), i0.ɵɵinject(i1.Router)); }, token: ProductResolver, providedIn: "root" });
|
|
2704
|
-
ProductResolver.decorators = [
|
|
2705
|
-
{ type: Injectable, args: [{
|
|
2706
|
-
providedIn: 'root',
|
|
2707
|
-
},] }
|
|
2708
|
-
];
|
|
2709
|
-
ProductResolver.ctorParameters = () => [
|
|
2710
|
-
{ type: DataService },
|
|
2711
|
-
{ type: Router }
|
|
2712
|
-
];
|
|
2713
|
-
|
|
2714
|
-
class ProductVariantsResolver extends BaseEntityResolver {
|
|
2715
|
-
constructor(router, dataService) {
|
|
2716
|
-
super(router, {
|
|
2717
|
-
__typename: 'Product',
|
|
2718
|
-
id: '',
|
|
2719
|
-
createdAt: '',
|
|
2720
|
-
updatedAt: '',
|
|
2721
|
-
name: '',
|
|
2722
|
-
optionGroups: [],
|
|
2723
|
-
variants: [],
|
|
2724
|
-
}, id => dataService.product.getProductVariantsOptions(id).mapStream(data => data.product));
|
|
2725
|
-
}
|
|
2726
|
-
}
|
|
2727
|
-
ProductVariantsResolver.ɵprov = i0.ɵɵdefineInjectable({ factory: function ProductVariantsResolver_Factory() { return new ProductVariantsResolver(i0.ɵɵinject(i1.Router), i0.ɵɵinject(i2.DataService)); }, token: ProductVariantsResolver, providedIn: "root" });
|
|
2728
|
-
ProductVariantsResolver.decorators = [
|
|
2729
|
-
{ type: Injectable, args: [{
|
|
2730
|
-
providedIn: 'root',
|
|
2731
|
-
},] }
|
|
2732
|
-
];
|
|
2733
|
-
ProductVariantsResolver.ctorParameters = () => [
|
|
2734
|
-
{ type: Router },
|
|
2735
|
-
{ type: DataService }
|
|
2736
|
-
];
|
|
2737
|
-
|
|
2738
|
-
const ɵ0 = {
|
|
2739
|
-
breadcrumb: marker('breadcrumb.products'),
|
|
2740
|
-
}, ɵ1 = {
|
|
2741
|
-
breadcrumb: productBreadcrumb,
|
|
2742
|
-
}, ɵ2 = {
|
|
2743
|
-
breadcrumb: productVariantEditorBreadcrumb,
|
|
2744
|
-
}, ɵ3 = {
|
|
2745
|
-
breadcrumb: productOptionsEditorBreadcrumb,
|
|
2746
|
-
}, ɵ4 = {
|
|
2747
|
-
breadcrumb: marker('breadcrumb.facets'),
|
|
2748
|
-
}, ɵ5 = {
|
|
2749
|
-
breadcrumb: facetBreadcrumb,
|
|
2750
|
-
}, ɵ6 = {
|
|
2751
|
-
breadcrumb: marker('breadcrumb.collections'),
|
|
2752
|
-
}, ɵ7 = {
|
|
2753
|
-
breadcrumb: collectionBreadcrumb,
|
|
2754
|
-
}, ɵ8 = {
|
|
2755
|
-
breadcrumb: marker('breadcrumb.assets'),
|
|
2756
|
-
}, ɵ9 = {
|
|
2757
|
-
breadcrumb: assetBreadcrumb,
|
|
2758
|
-
};
|
|
2759
|
-
const catalogRoutes = [
|
|
2760
|
-
{
|
|
2761
|
-
path: 'products',
|
|
2762
|
-
component: ProductListComponent,
|
|
2763
|
-
data: ɵ0,
|
|
2764
|
-
},
|
|
2765
|
-
{
|
|
2766
|
-
path: 'products/:id',
|
|
2767
|
-
component: ProductDetailComponent,
|
|
2768
|
-
resolve: createResolveData(ProductResolver),
|
|
2769
|
-
canDeactivate: [CanDeactivateDetailGuard],
|
|
2770
|
-
data: ɵ1,
|
|
2771
|
-
},
|
|
2772
|
-
{
|
|
2773
|
-
path: 'products/:id/manage-variants',
|
|
2774
|
-
component: ProductVariantsEditorComponent,
|
|
2775
|
-
resolve: createResolveData(ProductVariantsResolver),
|
|
2776
|
-
canDeactivate: [CanDeactivateDetailGuard],
|
|
2777
|
-
data: ɵ2,
|
|
2778
|
-
},
|
|
2779
|
-
{
|
|
2780
|
-
path: 'products/:id/options',
|
|
2781
|
-
component: ProductOptionsEditorComponent,
|
|
2782
|
-
resolve: createResolveData(ProductVariantsResolver),
|
|
2783
|
-
canDeactivate: [CanDeactivateDetailGuard],
|
|
2784
|
-
data: ɵ3,
|
|
2785
|
-
},
|
|
2786
|
-
{
|
|
2787
|
-
path: 'facets',
|
|
2788
|
-
component: FacetListComponent,
|
|
2789
|
-
data: ɵ4,
|
|
2790
|
-
},
|
|
2791
|
-
{
|
|
2792
|
-
path: 'facets/:id',
|
|
2793
|
-
component: FacetDetailComponent,
|
|
2794
|
-
resolve: createResolveData(FacetResolver),
|
|
2795
|
-
canDeactivate: [CanDeactivateDetailGuard],
|
|
2796
|
-
data: ɵ5,
|
|
2797
|
-
},
|
|
2798
|
-
{
|
|
2799
|
-
path: 'collections',
|
|
2800
|
-
component: CollectionListComponent,
|
|
2801
|
-
data: ɵ6,
|
|
2802
|
-
},
|
|
2803
|
-
{
|
|
2804
|
-
path: 'collections/:id',
|
|
2805
|
-
component: CollectionDetailComponent,
|
|
2806
|
-
resolve: createResolveData(CollectionResolver),
|
|
2807
|
-
canDeactivate: [CanDeactivateDetailGuard],
|
|
2808
|
-
data: ɵ7,
|
|
2809
|
-
},
|
|
2810
|
-
{
|
|
2811
|
-
path: 'assets',
|
|
2812
|
-
component: AssetListComponent,
|
|
2813
|
-
data: ɵ8,
|
|
2814
|
-
},
|
|
2815
|
-
{
|
|
2816
|
-
path: 'assets/:id',
|
|
2817
|
-
component: AssetDetailComponent,
|
|
2818
|
-
resolve: createResolveData(AssetResolver),
|
|
2819
|
-
data: ɵ9,
|
|
2820
|
-
},
|
|
2821
|
-
];
|
|
2822
|
-
function productBreadcrumb(data, params) {
|
|
2823
|
-
return detailBreadcrumb({
|
|
2824
|
-
entity: data.entity,
|
|
2825
|
-
id: params.id,
|
|
2826
|
-
breadcrumbKey: 'breadcrumb.products',
|
|
2827
|
-
getName: product => product.name,
|
|
2828
|
-
route: 'products',
|
|
2829
|
-
});
|
|
2830
|
-
}
|
|
2831
|
-
function productVariantEditorBreadcrumb(data, params) {
|
|
2832
|
-
return data.entity.pipe(map((entity) => {
|
|
2833
|
-
return [
|
|
2834
|
-
{
|
|
2835
|
-
label: marker('breadcrumb.products'),
|
|
2836
|
-
link: ['../', 'products'],
|
|
2837
|
-
},
|
|
2838
|
-
{
|
|
2839
|
-
label: `${entity.name}`,
|
|
2840
|
-
link: ['../', 'products', params.id, { tab: 'variants' }],
|
|
2841
|
-
},
|
|
2842
|
-
{
|
|
2843
|
-
label: marker('breadcrumb.manage-variants'),
|
|
2844
|
-
link: ['manage-variants'],
|
|
2845
|
-
},
|
|
2846
|
-
];
|
|
2847
|
-
}));
|
|
2848
|
-
}
|
|
2849
|
-
function productOptionsEditorBreadcrumb(data, params) {
|
|
2850
|
-
return data.entity.pipe(map((entity) => {
|
|
2851
|
-
return [
|
|
2852
|
-
{
|
|
2853
|
-
label: marker('breadcrumb.products'),
|
|
2854
|
-
link: ['../', 'products'],
|
|
2855
|
-
},
|
|
2856
|
-
{
|
|
2857
|
-
label: `${entity.name}`,
|
|
2858
|
-
link: ['../', 'products', params.id, { tab: 'variants' }],
|
|
2859
|
-
},
|
|
2860
|
-
{
|
|
2861
|
-
label: marker('breadcrumb.product-options'),
|
|
2862
|
-
link: ['options'],
|
|
2863
|
-
},
|
|
2864
|
-
];
|
|
2865
|
-
}));
|
|
2866
|
-
}
|
|
2867
|
-
function facetBreadcrumb(data, params) {
|
|
2868
|
-
return detailBreadcrumb({
|
|
2869
|
-
entity: data.entity,
|
|
2870
|
-
id: params.id,
|
|
2871
|
-
breadcrumbKey: 'breadcrumb.facets',
|
|
2872
|
-
getName: facet => facet.name,
|
|
2873
|
-
route: 'facets',
|
|
2874
|
-
});
|
|
2875
|
-
}
|
|
2876
|
-
function collectionBreadcrumb(data, params) {
|
|
2877
|
-
return detailBreadcrumb({
|
|
2878
|
-
entity: data.entity,
|
|
2879
|
-
id: params.id,
|
|
2880
|
-
breadcrumbKey: 'breadcrumb.collections',
|
|
2881
|
-
getName: collection => collection.name,
|
|
2882
|
-
route: 'collections',
|
|
2883
|
-
});
|
|
2884
|
-
}
|
|
2885
|
-
function assetBreadcrumb(data, params) {
|
|
2886
|
-
return detailBreadcrumb({
|
|
2887
|
-
entity: data.entity,
|
|
2888
|
-
id: params.id,
|
|
2889
|
-
breadcrumbKey: 'breadcrumb.assets',
|
|
2890
|
-
getName: asset => asset.name,
|
|
2891
|
-
route: 'assets',
|
|
2892
|
-
});
|
|
2893
|
-
}
|
|
2894
|
-
|
|
2895
|
-
/**
|
|
2896
|
-
* A component which displays the Assets, and allows assets to be removed and
|
|
2897
|
-
* added, and for the featured asset to be set.
|
|
2898
|
-
*
|
|
2899
|
-
* Note: rather complex code for drag drop is due to a limitation of the default CDK implementation
|
|
2900
|
-
* which is addressed by a work-around from here: https://github.com/angular/components/issues/13372#issuecomment-483998378
|
|
2901
|
-
*/
|
|
2902
|
-
class AssetsComponent {
|
|
2903
|
-
constructor(modalService, changeDetector) {
|
|
2904
|
-
this.modalService = modalService;
|
|
2905
|
-
this.changeDetector = changeDetector;
|
|
2906
|
-
this.compact = false;
|
|
2907
|
-
this.change = new EventEmitter();
|
|
2908
|
-
this.assets = [];
|
|
2909
|
-
}
|
|
2910
|
-
set assetsSetter(val) {
|
|
2911
|
-
// create a new non-readonly array of assets
|
|
2912
|
-
this.assets = (val || []).slice();
|
|
2913
|
-
}
|
|
2914
|
-
selectAssets() {
|
|
2915
|
-
this.modalService
|
|
2916
|
-
.fromComponent(AssetPickerDialogComponent, {
|
|
2917
|
-
size: 'xl',
|
|
2918
|
-
})
|
|
2919
|
-
.subscribe(result => {
|
|
2920
|
-
if (result && result.length) {
|
|
2921
|
-
this.assets = unique(this.assets.concat(result), 'id');
|
|
2922
|
-
if (!this.featuredAsset) {
|
|
2923
|
-
this.featuredAsset = result[0];
|
|
2924
|
-
}
|
|
2925
|
-
this.emitChangeEvent(this.assets, this.featuredAsset);
|
|
2926
|
-
this.changeDetector.markForCheck();
|
|
2927
|
-
}
|
|
2928
|
-
});
|
|
2929
|
-
}
|
|
2930
|
-
setAsFeatured(asset) {
|
|
2931
|
-
this.featuredAsset = asset;
|
|
2932
|
-
this.emitChangeEvent(this.assets, asset);
|
|
2933
|
-
}
|
|
2934
|
-
isFeatured(asset) {
|
|
2935
|
-
return !!this.featuredAsset && this.featuredAsset.id === asset.id;
|
|
2936
|
-
}
|
|
2937
|
-
previewAsset(asset) {
|
|
2938
|
-
this.modalService
|
|
2939
|
-
.fromComponent(AssetPreviewDialogComponent, {
|
|
2940
|
-
size: 'xl',
|
|
2941
|
-
closable: true,
|
|
2942
|
-
locals: { asset },
|
|
2943
|
-
})
|
|
2944
|
-
.subscribe();
|
|
2945
|
-
}
|
|
2946
|
-
removeAsset(asset) {
|
|
2947
|
-
this.assets = this.assets.filter(a => a.id !== asset.id);
|
|
2948
|
-
if (this.featuredAsset && this.featuredAsset.id === asset.id) {
|
|
2949
|
-
this.featuredAsset = this.assets.length > 0 ? this.assets[0] : undefined;
|
|
2950
|
-
}
|
|
2951
|
-
this.emitChangeEvent(this.assets, this.featuredAsset);
|
|
2952
|
-
}
|
|
2953
|
-
emitChangeEvent(assets, featuredAsset) {
|
|
2954
|
-
this.change.emit({
|
|
2955
|
-
assets,
|
|
2956
|
-
featuredAsset,
|
|
2957
|
-
});
|
|
2958
|
-
}
|
|
2959
|
-
dropListDropped(event) {
|
|
2960
|
-
moveItemInArray(this.assets, event.previousContainer.data, event.container.data);
|
|
2961
|
-
this.emitChangeEvent(this.assets, this.featuredAsset);
|
|
2962
|
-
}
|
|
2963
|
-
}
|
|
2964
|
-
AssetsComponent.decorators = [
|
|
2965
|
-
{ type: Component, args: [{
|
|
2966
|
-
selector: 'vdr-assets',
|
|
2967
|
-
template: "<div class=\"card\" *ngIf=\"!compact; else compactView\">\r\n <div class=\"card-img\">\r\n <div class=\"featured-asset\">\r\n <img\r\n *ngIf=\"featuredAsset\"\r\n [src]=\"featuredAsset | assetPreview:'small'\"\r\n (click)=\"previewAsset(featuredAsset)\"\r\n />\r\n <div class=\"placeholder\" *ngIf=\"!featuredAsset\" (click)=\"selectAssets()\">\r\n <clr-icon shape=\"image\" size=\"128\"></clr-icon>\r\n <div>{{ 'catalog.no-featured-asset' | translate }}</div>\r\n </div>\r\n </div>\r\n </div>\r\n <div class=\"card-block\"><ng-container *ngTemplateOutlet=\"assetList\"></ng-container></div>\r\n <div class=\"card-footer\" *vdrIfPermissions=\"updatePermissions\">\r\n <button class=\"btn\" (click)=\"selectAssets()\">\r\n <clr-icon shape=\"attachment\"></clr-icon>\r\n {{ 'asset.add-asset' | translate }}\r\n </button>\r\n </div>\r\n</div>\r\n\r\n<ng-template #compactView>\r\n <div class=\"featured-asset compact\">\r\n <img\r\n *ngIf=\"featuredAsset\"\r\n [src]=\"featuredAsset | assetPreview:'thumb'\"\r\n (click)=\"previewAsset(featuredAsset)\"\r\n />\r\n\r\n <div class=\"placeholder\" *ngIf=\"!featuredAsset\" (click)=\"selectAssets()\"><clr-icon shape=\"image\" size=\"150\"></clr-icon></div>\r\n </div>\r\n <ng-container *ngTemplateOutlet=\"assetList\"></ng-container>\r\n <button\r\n *vdrIfPermissions=\"updatePermissions\"\r\n class=\"compact-select btn btn-icon btn-sm btn-block\"\r\n [title]=\"'asset.add-asset' | translate\"\r\n (click)=\"selectAssets()\"\r\n >\r\n <clr-icon shape=\"attachment\"></clr-icon>\r\n {{ 'asset.add-asset' | translate }}\r\n </button>\r\n</ng-template>\r\n\r\n<ng-template #assetList>\r\n <div class=\"all-assets\" [class.compact]=\"compact\" cdkDropListGroup>\r\n <div\r\n *ngFor=\"let asset of assets; let index = index\"\r\n class=\"drop-list\"\r\n cdkDropList\r\n cdkDropListOrientation=\"horizontal\"\r\n [cdkDropListData]=\"index\"\r\n [cdkDropListDisabled]=\"!(updatePermissions | hasPermission)\"\r\n (cdkDropListDropped)=\"dropListDropped($event)\"\r\n >\r\n <vdr-dropdown cdkDrag>\r\n <div\r\n class=\"asset-thumb\"\r\n vdrDropdownTrigger\r\n [class.featured]=\"isFeatured(asset)\"\r\n [title]=\"\"\r\n tabindex=\"0\"\r\n >\r\n <img [src]=\"asset | assetPreview:'tiny'\" />\r\n </div>\r\n <vdr-dropdown-menu vdrPosition=\"bottom-right\">\r\n <button type=\"button\" vdrDropdownItem (click)=\"previewAsset(asset)\">\r\n {{ 'asset.preview' | translate }}\r\n </button>\r\n <button\r\n type=\"button\"\r\n [disabled]=\"isFeatured(asset) || !(updatePermissions | hasPermission)\"\r\n vdrDropdownItem\r\n (click)=\"setAsFeatured(asset)\"\r\n >\r\n {{ 'asset.set-as-featured-asset' | translate }}\r\n </button>\r\n <div class=\"dropdown-divider\"></div>\r\n <button\r\n type=\"button\"\r\n class=\"remove-asset\"\r\n vdrDropdownItem\r\n [disabled]=\"!(updatePermissions | hasPermission)\"\r\n (click)=\"removeAsset(asset)\"\r\n >\r\n {{ 'asset.remove-asset' | translate }}\r\n </button>\r\n </vdr-dropdown-menu>\r\n </vdr-dropdown>\r\n </div>\r\n </div>\r\n</ng-template>\r\n",
|
|
2968
|
-
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
2969
|
-
styles: [":host{width:340px;display:block}:host.compact{width:162px}.placeholder{text-align:center;color:var(--color-grey-300)}.featured-asset{text-align:center;background:var(--color-component-bg-200);padding:6px;cursor:pointer;border-radius:var(--border-radius-img)}.featured-asset img{border-radius:var(--border-radius-img)}.featured-asset.compact{width:100%;min-height:40px;position:relative;padding:6px}.featured-asset .compact-select{position:absolute;bottom:6px;right:6px;margin:0}.all-assets{display:flex;flex-wrap:wrap}.all-assets .drop-list{min-width:60px}.all-assets .asset-thumb{margin:3px;padding:0;border:2px solid var(--color-component-border-100);border-radius:var(--border-radius-img);cursor:pointer}.all-assets .asset-thumb img{width:50px;height:50px;border-radius:var(--border-radius-img)}.all-assets .asset-thumb.featured{border-color:var(--color-primary-500);border-radius:calc(var(--border-radius-img) + 2px)}.all-assets .remove-asset{color:var(--color-warning-500)}.all-assets.compact .drop-list{min-width:54px}.all-assets.compact .asset-thumb{margin:1px;border-width:1px}.all-assets.compact .cdk-drag-placeholder{width:50px}.all-assets.compact .cdk-drag-placeholder .asset-thumb{width:50px}.cdk-drag-animating{transition:transform .25s cubic-bezier(0,0,.2,1)}.example-box:last-child{border:none}.all-assets.cdk-drop-list-dragging vdr-dropdown:not(.cdk-drag-placeholder){transition:transform .25s cubic-bezier(0,0,.2,1)}.cdk-drop-list-dragging>*:not(.cdk-drag-placeholder){display:none}\n"]
|
|
2970
|
-
},] }
|
|
2971
|
-
];
|
|
2972
|
-
AssetsComponent.ctorParameters = () => [
|
|
2973
|
-
{ type: ModalService },
|
|
2974
|
-
{ type: ChangeDetectorRef }
|
|
2975
|
-
];
|
|
2976
|
-
AssetsComponent.propDecorators = {
|
|
2977
|
-
assetsSetter: [{ type: Input, args: ['assets',] }],
|
|
2978
|
-
featuredAsset: [{ type: Input }],
|
|
2979
|
-
compact: [{ type: HostBinding, args: ['class.compact',] }, { type: Input }],
|
|
2980
|
-
change: [{ type: Output }],
|
|
2981
|
-
updatePermissions: [{ type: Input }]
|
|
2982
|
-
};
|
|
2983
|
-
|
|
2984
|
-
class CollectionContentsComponent {
|
|
2985
|
-
constructor(route, router, dataService) {
|
|
2986
|
-
this.route = route;
|
|
2987
|
-
this.router = router;
|
|
2988
|
-
this.dataService = dataService;
|
|
2989
|
-
this.previewUpdatedFilters = false;
|
|
2990
|
-
this.filterTermControl = new FormControl('');
|
|
2991
|
-
this.isLoading = false;
|
|
2992
|
-
this.collectionIdChange$ = new BehaviorSubject('');
|
|
2993
|
-
this.parentIdChange$ = new BehaviorSubject('');
|
|
2994
|
-
this.filterChanges$ = new BehaviorSubject([]);
|
|
2995
|
-
this.refresh$ = new BehaviorSubject(true);
|
|
2996
|
-
this.destroy$ = new Subject();
|
|
2997
|
-
}
|
|
2998
|
-
ngOnInit() {
|
|
2999
|
-
this.contentsCurrentPage$ = this.route.queryParamMap.pipe(map(qpm => qpm.get('contentsPage')), map(page => (!page ? 1 : +page)), startWith(1), distinctUntilChanged());
|
|
3000
|
-
this.contentsItemsPerPage$ = this.route.queryParamMap.pipe(map(qpm => qpm.get('contentsPerPage')), map(perPage => (!perPage ? 10 : +perPage)), startWith(10), distinctUntilChanged());
|
|
3001
|
-
const filterTerm$ = this.filterTermControl.valueChanges.pipe(debounceTime(250), tap(() => this.setContentsPageNumber(1)), startWith(''));
|
|
3002
|
-
const filterChanges$ = this.filterChanges$.asObservable().pipe(filter(() => this.previewUpdatedFilters), tap(() => this.setContentsPageNumber(1)), startWith([]));
|
|
3003
|
-
const fetchUpdate$ = combineLatest(this.collectionIdChange$, this.parentIdChange$, this.contentsCurrentPage$, this.contentsItemsPerPage$, filterTerm$, filterChanges$, this.refresh$);
|
|
3004
|
-
const collection$ = fetchUpdate$.pipe(takeUntil(this.destroy$), tap(() => (this.isLoading = true)), debounceTime(50), switchMap(([id, parentId, currentPage, itemsPerPage, filterTerm, filters]) => {
|
|
3005
|
-
const take = itemsPerPage;
|
|
3006
|
-
const skip = (currentPage - 1) * itemsPerPage;
|
|
3007
|
-
if (filters.length && this.previewUpdatedFilters) {
|
|
3008
|
-
const filterClause = filterTerm
|
|
3009
|
-
? { name: { contains: filterTerm } }
|
|
3010
|
-
: undefined;
|
|
3011
|
-
return this.dataService.collection
|
|
3012
|
-
.previewCollectionVariants({
|
|
3013
|
-
parentId,
|
|
3014
|
-
filters,
|
|
3015
|
-
}, {
|
|
3016
|
-
take,
|
|
3017
|
-
skip,
|
|
3018
|
-
filter: filterClause,
|
|
3019
|
-
})
|
|
3020
|
-
.mapSingle(data => data.previewCollectionVariants)
|
|
3021
|
-
.pipe(catchError(() => of({ items: [], totalItems: 0 })));
|
|
3022
|
-
}
|
|
3023
|
-
else if (id) {
|
|
3024
|
-
return this.dataService.collection
|
|
3025
|
-
.getCollectionContents(id, take, skip, filterTerm)
|
|
3026
|
-
.mapSingle(data => { var _a; return (_a = data.collection) === null || _a === void 0 ? void 0 : _a.productVariants; });
|
|
3027
|
-
}
|
|
3028
|
-
else {
|
|
3029
|
-
return of(null);
|
|
3030
|
-
}
|
|
3031
|
-
}), tap(() => (this.isLoading = false)), finalize(() => (this.isLoading = false)));
|
|
3032
|
-
this.contents$ = collection$.pipe(map(result => (result ? result.items : [])));
|
|
3033
|
-
this.contentsTotalItems$ = collection$.pipe(map(result => (result ? result.totalItems : 0)));
|
|
3034
|
-
}
|
|
3035
|
-
ngOnChanges(changes) {
|
|
3036
|
-
if ('collectionId' in changes) {
|
|
3037
|
-
this.collectionIdChange$.next(changes.collectionId.currentValue);
|
|
3038
|
-
}
|
|
3039
|
-
if ('parentId' in changes) {
|
|
3040
|
-
this.parentIdChange$.next(changes.parentId.currentValue);
|
|
3041
|
-
}
|
|
3042
|
-
if ('updatedFilters' in changes) {
|
|
3043
|
-
if (this.updatedFilters) {
|
|
3044
|
-
this.filterChanges$.next(this.updatedFilters);
|
|
3045
|
-
}
|
|
3046
|
-
}
|
|
3047
|
-
}
|
|
3048
|
-
ngOnDestroy() {
|
|
3049
|
-
this.destroy$.next();
|
|
3050
|
-
this.destroy$.complete();
|
|
3051
|
-
}
|
|
3052
|
-
setContentsPageNumber(page) {
|
|
3053
|
-
this.setParam('contentsPage', page);
|
|
3054
|
-
}
|
|
3055
|
-
setContentsItemsPerPage(perPage) {
|
|
3056
|
-
this.setParam('contentsPerPage', perPage);
|
|
3057
|
-
}
|
|
3058
|
-
refresh() {
|
|
3059
|
-
this.refresh$.next(true);
|
|
3060
|
-
}
|
|
3061
|
-
setParam(key, value) {
|
|
3062
|
-
this.router.navigate(['./'], {
|
|
3063
|
-
relativeTo: this.route,
|
|
3064
|
-
queryParams: {
|
|
3065
|
-
[key]: value,
|
|
3066
|
-
},
|
|
3067
|
-
queryParamsHandling: 'merge',
|
|
3068
|
-
replaceUrl: true,
|
|
3069
|
-
});
|
|
3070
|
-
}
|
|
3071
|
-
}
|
|
3072
|
-
CollectionContentsComponent.decorators = [
|
|
3073
|
-
{ type: Component, args: [{
|
|
3074
|
-
selector: 'vdr-collection-contents',
|
|
3075
|
-
template: "<div class=\"contents-header\">\r\n <div class=\"header-title-row\">\r\n <ng-container\r\n *ngTemplateOutlet=\"headerTemplate; context: { $implicit: contentsTotalItems$ | async }\"\r\n ></ng-container>\r\n </div>\r\n <input\r\n type=\"text\"\r\n [placeholder]=\"'catalog.filter-by-name' | translate\"\r\n [formControl]=\"filterTermControl\"\r\n />\r\n</div>\r\n<div class=\"table-wrapper\">\r\n <div class=\"progress loop\" [class.visible]=\"isLoading\"></div>\r\n <vdr-data-table\r\n [class.loading]=\"isLoading\"\r\n [items]=\"contents$ | async\"\r\n [itemsPerPage]=\"contentsItemsPerPage$ | async\"\r\n [totalItems]=\"contentsTotalItems$ | async\"\r\n [currentPage]=\"contentsCurrentPage$ | async\"\r\n (pageChange)=\"setContentsPageNumber($event)\"\r\n (itemsPerPageChange)=\"setContentsItemsPerPage($event)\"\r\n >\r\n <ng-template let-variant=\"item\">\r\n <td class=\"left align-middle\">{{ variant.name }}</td>\r\n <td class=\"left align-middle\"><small class=\"sku\">{{ variant.sku }}</small></td>\r\n <td class=\"right align-middle\">\r\n <vdr-table-row-action\r\n iconShape=\"edit\"\r\n [label]=\"'common.edit' | translate\"\r\n [linkTo]=\"['/catalog/products', variant.productId, { tab: 'variants' }]\"\r\n ></vdr-table-row-action>\r\n </td>\r\n </ng-template>\r\n </vdr-data-table>\r\n</div>\r\n",
|
|
3076
|
-
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
3077
|
-
styles: [".contents-header{background-color:var(--color-component-bg-100);position:sticky;top:0;padding:6px;z-index:1;border-bottom:1px solid var(--color-component-border-200)}.contents-header .header-title-row{display:flex;justify-content:space-between;align-items:center}.contents-header .clr-input{width:100%}:host{display:block}:host ::ng-deep table{margin-top:-1px}vdr-data-table{opacity:1;transition:opacity .3s}vdr-data-table.loading{opacity:.5}.table-wrapper{position:relative}.progress{position:absolute;top:0;left:0;overflow:hidden;height:6px;opacity:0;transition:opacity .1s}.progress.visible{opacity:1}.sku{color:var(--color-text-200)}\n"]
|
|
3078
|
-
},] }
|
|
3079
|
-
];
|
|
3080
|
-
CollectionContentsComponent.ctorParameters = () => [
|
|
3081
|
-
{ type: ActivatedRoute },
|
|
3082
|
-
{ type: Router },
|
|
3083
|
-
{ type: DataService }
|
|
3084
|
-
];
|
|
3085
|
-
CollectionContentsComponent.propDecorators = {
|
|
3086
|
-
collectionId: [{ type: Input }],
|
|
3087
|
-
parentId: [{ type: Input }],
|
|
3088
|
-
updatedFilters: [{ type: Input }],
|
|
3089
|
-
previewUpdatedFilters: [{ type: Input }],
|
|
3090
|
-
headerTemplate: [{ type: ContentChild, args: [TemplateRef, { static: true },] }]
|
|
3091
|
-
};
|
|
3092
|
-
|
|
3093
|
-
/**
|
|
3094
|
-
* Builds a tree from an array of nodes which have a parent.
|
|
3095
|
-
* Based on https://stackoverflow.com/a/31247960/772859, modified to preserve ordering.
|
|
3096
|
-
*/
|
|
3097
|
-
function arrayToTree(nodes, currentState, expandedIds = []) {
|
|
3098
|
-
var _a, _b;
|
|
3099
|
-
const topLevelNodes = [];
|
|
3100
|
-
const mappedArr = {};
|
|
3101
|
-
const currentStateMap = treeToMap(currentState);
|
|
3102
|
-
// First map the nodes of the array to an object -> create a hash table.
|
|
3103
|
-
for (const node of nodes) {
|
|
3104
|
-
mappedArr[node.id] = Object.assign(Object.assign({}, node), { children: [] });
|
|
3105
|
-
}
|
|
3106
|
-
for (const id of nodes.map(n => n.id)) {
|
|
3107
|
-
if (mappedArr.hasOwnProperty(id)) {
|
|
3108
|
-
const mappedElem = mappedArr[id];
|
|
3109
|
-
mappedElem.expanded = (_b = (_a = currentStateMap.get(id)) === null || _a === void 0 ? void 0 : _a.expanded) !== null && _b !== void 0 ? _b : expandedIds.includes(id);
|
|
3110
|
-
const parent = mappedElem.parent;
|
|
3111
|
-
if (!parent) {
|
|
3112
|
-
continue;
|
|
3113
|
-
}
|
|
3114
|
-
// If the element is not at the root level, add it to its parent array of children.
|
|
3115
|
-
const parentIsRoot = !mappedArr[parent.id];
|
|
3116
|
-
if (!parentIsRoot) {
|
|
3117
|
-
if (mappedArr[parent.id]) {
|
|
3118
|
-
mappedArr[parent.id].children.push(mappedElem);
|
|
3119
|
-
}
|
|
3120
|
-
else {
|
|
3121
|
-
mappedArr[parent.id] = { children: [mappedElem] };
|
|
3122
|
-
}
|
|
3123
|
-
}
|
|
3124
|
-
else {
|
|
3125
|
-
topLevelNodes.push(mappedElem);
|
|
3126
|
-
}
|
|
3127
|
-
}
|
|
3128
|
-
}
|
|
3129
|
-
// tslint:disable-next-line:no-non-null-assertion
|
|
3130
|
-
const rootId = topLevelNodes.length ? topLevelNodes[0].parent.id : undefined;
|
|
3131
|
-
return { id: rootId, children: topLevelNodes };
|
|
3132
|
-
}
|
|
3133
|
-
/**
|
|
3134
|
-
* Converts an existing tree (as generated by the arrayToTree function) into a flat
|
|
3135
|
-
* Map. This is used to persist certain states (e.g. `expanded`) when re-building the
|
|
3136
|
-
* tree.
|
|
3137
|
-
*/
|
|
3138
|
-
function treeToMap(tree) {
|
|
3139
|
-
const nodeMap = new Map();
|
|
3140
|
-
function visit(node) {
|
|
3141
|
-
nodeMap.set(node.id, node);
|
|
3142
|
-
node.children.forEach(visit);
|
|
3143
|
-
}
|
|
3144
|
-
if (tree) {
|
|
3145
|
-
visit(tree);
|
|
3146
|
-
}
|
|
3147
|
-
return nodeMap;
|
|
3148
|
-
}
|
|
3149
|
-
|
|
3150
|
-
class CollectionTreeComponent {
|
|
3151
|
-
constructor() {
|
|
3152
|
-
this.expandAll = false;
|
|
3153
|
-
this.expandedIds = [];
|
|
3154
|
-
this.rearrange = new EventEmitter();
|
|
3155
|
-
this.deleteCollection = new EventEmitter();
|
|
3156
|
-
this.allMoveListItems = [];
|
|
3157
|
-
}
|
|
3158
|
-
ngOnChanges(changes) {
|
|
3159
|
-
if ('collections' in changes && this.collections) {
|
|
3160
|
-
this.collectionTree = arrayToTree(this.collections, this.collectionTree, this.expandedIds);
|
|
3161
|
-
this.allMoveListItems = [];
|
|
3162
|
-
}
|
|
3163
|
-
}
|
|
3164
|
-
onDrop(event) {
|
|
3165
|
-
const item = event.item.data;
|
|
3166
|
-
const newParent = event.container.data;
|
|
3167
|
-
const newParentId = newParent.id;
|
|
3168
|
-
if (newParentId == null) {
|
|
3169
|
-
throw new Error(`Could not determine the ID of the root Collection`);
|
|
3170
|
-
}
|
|
3171
|
-
this.rearrange.emit({
|
|
3172
|
-
collectionId: item.id,
|
|
3173
|
-
parentId: newParentId,
|
|
3174
|
-
index: event.currentIndex,
|
|
3175
|
-
});
|
|
3176
|
-
}
|
|
3177
|
-
onMove(event) {
|
|
3178
|
-
this.rearrange.emit(event);
|
|
3179
|
-
}
|
|
3180
|
-
onDelete(id) {
|
|
3181
|
-
this.deleteCollection.emit(id);
|
|
3182
|
-
}
|
|
3183
|
-
getMoveListItems(collection) {
|
|
3184
|
-
if (this.allMoveListItems.length === 0) {
|
|
3185
|
-
this.allMoveListItems = this.calculateAllMoveListItems();
|
|
3186
|
-
}
|
|
3187
|
-
return this.allMoveListItems.filter(item => {
|
|
3188
|
-
var _a;
|
|
3189
|
-
return item.id !== collection.id &&
|
|
3190
|
-
!item.ancestorIdPath.has(collection.id) &&
|
|
3191
|
-
item.id !== ((_a = collection.parent) === null || _a === void 0 ? void 0 : _a.id);
|
|
3192
|
-
});
|
|
3193
|
-
}
|
|
3194
|
-
calculateAllMoveListItems() {
|
|
3195
|
-
const visit = (node, parentPath, ancestorIdPath, output) => {
|
|
3196
|
-
const path = parentPath.concat(node.name);
|
|
3197
|
-
output.push({ path: path.slice(1).join(' / ') || 'root', id: node.id, ancestorIdPath });
|
|
3198
|
-
node.children.forEach(child => visit(child, path, new Set([...ancestorIdPath, node.id]), output));
|
|
3199
|
-
return output;
|
|
3200
|
-
};
|
|
3201
|
-
return visit(this.collectionTree, [], new Set(), []);
|
|
3202
|
-
}
|
|
3203
|
-
isRootNode(node) {
|
|
3204
|
-
return !node.hasOwnProperty('parent');
|
|
3205
|
-
}
|
|
3206
|
-
}
|
|
3207
|
-
CollectionTreeComponent.decorators = [
|
|
3208
|
-
{ type: Component, args: [{
|
|
3209
|
-
selector: 'vdr-collection-tree',
|
|
3210
|
-
template: "<vdr-collection-tree-node\r\n *ngIf=\"collectionTree\"\r\n cdkDropListGroup\r\n [expandAll]=\"expandAll\"\r\n [collectionTree]=\"collectionTree\"\r\n [activeCollectionId]=\"activeCollectionId\"\r\n></vdr-collection-tree-node>\r\n",
|
|
3211
|
-
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
3212
|
-
styles: [""]
|
|
3213
|
-
},] }
|
|
3214
|
-
];
|
|
3215
|
-
CollectionTreeComponent.propDecorators = {
|
|
3216
|
-
collections: [{ type: Input }],
|
|
3217
|
-
activeCollectionId: [{ type: Input }],
|
|
3218
|
-
expandAll: [{ type: Input }],
|
|
3219
|
-
expandedIds: [{ type: Input }],
|
|
3220
|
-
rearrange: [{ type: Output }],
|
|
3221
|
-
deleteCollection: [{ type: Output }]
|
|
3222
|
-
};
|
|
3223
|
-
|
|
3224
|
-
class CollectionTreeNodeComponent {
|
|
3225
|
-
constructor(parent, root, dataService, router, route) {
|
|
3226
|
-
this.parent = parent;
|
|
3227
|
-
this.root = root;
|
|
3228
|
-
this.dataService = dataService;
|
|
3229
|
-
this.router = router;
|
|
3230
|
-
this.route = route;
|
|
3231
|
-
this.depth = 0;
|
|
3232
|
-
this.expandAll = false;
|
|
3233
|
-
this.moveListItems = [];
|
|
3234
|
-
if (parent) {
|
|
3235
|
-
this.depth = parent.depth + 1;
|
|
3236
|
-
}
|
|
3237
|
-
}
|
|
3238
|
-
ngOnInit() {
|
|
3239
|
-
this.parentName = this.collectionTree.name || '<root>';
|
|
3240
|
-
const permissions$ = this.dataService.client
|
|
3241
|
-
.userStatus()
|
|
3242
|
-
.mapStream(data => data.userStatus.permissions)
|
|
3243
|
-
.pipe(shareReplay(1));
|
|
3244
|
-
this.hasUpdatePermission$ = permissions$.pipe(map(perms => perms.includes(Permission.UpdateCatalog) || perms.includes(Permission.UpdateCollection)));
|
|
3245
|
-
this.hasDeletePermission$ = permissions$.pipe(map(perms => perms.includes(Permission.DeleteCatalog) || perms.includes(Permission.DeleteCollection)));
|
|
3246
|
-
}
|
|
3247
|
-
ngOnChanges(changes) {
|
|
3248
|
-
const expandAllChange = changes['expandAll'];
|
|
3249
|
-
if (expandAllChange) {
|
|
3250
|
-
if (expandAllChange.previousValue === true && expandAllChange.currentValue === false) {
|
|
3251
|
-
this.collectionTree.children.forEach(c => (c.expanded = false));
|
|
3252
|
-
}
|
|
3253
|
-
}
|
|
3254
|
-
}
|
|
3255
|
-
trackByFn(index, item) {
|
|
3256
|
-
return item.id;
|
|
3257
|
-
}
|
|
3258
|
-
toggleExpanded(collection) {
|
|
3259
|
-
var _a, _b;
|
|
3260
|
-
collection.expanded = !collection.expanded;
|
|
3261
|
-
let expandedIds = (_b = (_a = this.route.snapshot.queryParamMap.get('expanded')) === null || _a === void 0 ? void 0 : _a.split(',')) !== null && _b !== void 0 ? _b : [];
|
|
3262
|
-
if (collection.expanded) {
|
|
3263
|
-
expandedIds.push(collection.id);
|
|
3264
|
-
}
|
|
3265
|
-
else {
|
|
3266
|
-
expandedIds = expandedIds.filter(id => id !== collection.id);
|
|
3267
|
-
}
|
|
3268
|
-
this.router.navigate(['./'], {
|
|
3269
|
-
queryParams: {
|
|
3270
|
-
expanded: expandedIds.filter(id => !!id).join(','),
|
|
3271
|
-
},
|
|
3272
|
-
queryParamsHandling: 'merge',
|
|
3273
|
-
relativeTo: this.route,
|
|
3274
|
-
});
|
|
3275
|
-
}
|
|
3276
|
-
getMoveListItems(collection) {
|
|
3277
|
-
this.moveListItems = this.root.getMoveListItems(collection);
|
|
3278
|
-
}
|
|
3279
|
-
move(collection, parentId) {
|
|
3280
|
-
this.root.onMove({
|
|
3281
|
-
index: 0,
|
|
3282
|
-
parentId,
|
|
3283
|
-
collectionId: collection.id,
|
|
3284
|
-
});
|
|
3285
|
-
}
|
|
3286
|
-
moveUp(collection, currentIndex) {
|
|
3287
|
-
if (!collection.parent) {
|
|
3288
|
-
return;
|
|
3289
|
-
}
|
|
3290
|
-
this.root.onMove({
|
|
3291
|
-
index: currentIndex - 1,
|
|
3292
|
-
parentId: collection.parent.id,
|
|
3293
|
-
collectionId: collection.id,
|
|
3294
|
-
});
|
|
3295
|
-
}
|
|
3296
|
-
moveDown(collection, currentIndex) {
|
|
3297
|
-
if (!collection.parent) {
|
|
3298
|
-
return;
|
|
3299
|
-
}
|
|
3300
|
-
this.root.onMove({
|
|
3301
|
-
index: currentIndex + 1,
|
|
3302
|
-
parentId: collection.parent.id,
|
|
3303
|
-
collectionId: collection.id,
|
|
3304
|
-
});
|
|
3305
|
-
}
|
|
3306
|
-
drop(event) {
|
|
3307
|
-
moveItemInArray(this.collectionTree.children, event.previousIndex, event.currentIndex);
|
|
3308
|
-
this.root.onDrop(event);
|
|
3309
|
-
}
|
|
3310
|
-
delete(id) {
|
|
3311
|
-
this.root.onDelete(id);
|
|
3312
|
-
}
|
|
3313
|
-
}
|
|
3314
|
-
CollectionTreeNodeComponent.decorators = [
|
|
3315
|
-
{ type: Component, args: [{
|
|
3316
|
-
selector: 'vdr-collection-tree-node',
|
|
3317
|
-
template: "<div\r\n cdkDropList\r\n class=\"tree-node\"\r\n #dropList\r\n [cdkDropListData]=\"collectionTree\"\r\n [cdkDropListDisabled]=\"!(hasUpdatePermission$ | async)\"\r\n (cdkDropListDropped)=\"drop($event)\"\r\n>\r\n <div\r\n class=\"collection\"\r\n [class.private]=\"collection.isPrivate\"\r\n *ngFor=\"let collection of collectionTree.children; index as i; trackBy: trackByFn\"\r\n cdkDrag\r\n [cdkDragData]=\"collection\"\r\n >\r\n <div\r\n class=\"collection-detail\"\r\n [ngClass]=\"'depth-' + depth\"\r\n [class.active]=\"collection.id === activeCollectionId\"\r\n >\r\n <div class=\"name\">\r\n <button\r\n class=\"icon-button folder-button\"\r\n [disabled]=\"expandAll\"\r\n *ngIf=\"collection.children?.length; else folderSpacer\"\r\n (click)=\"toggleExpanded(collection)\"\r\n >\r\n <clr-icon shape=\"folder\" *ngIf=\"!collection.expanded && !expandAll\"></clr-icon>\r\n <clr-icon shape=\"folder-open\" *ngIf=\"collection.expanded || expandAll\"></clr-icon>\r\n </button>\r\n <ng-template #folderSpacer>\r\n <div class=\"folder-button-spacer\"></div>\r\n </ng-template>\r\n {{ collection.name }}\r\n </div>\r\n <div class=\"flex-spacer\"></div>\r\n <vdr-chip *ngIf=\"collection.isPrivate\">{{ 'catalog.private' | translate }}</vdr-chip>\r\n <a\r\n class=\"btn btn-link btn-sm\"\r\n [routerLink]=\"['./', { contents: collection.id }]\"\r\n queryParamsHandling=\"preserve\"\r\n >\r\n <clr-icon shape=\"view-list\"></clr-icon>\r\n {{ 'catalog.view-contents' | translate }}\r\n </a>\r\n <a class=\"btn btn-link btn-sm\" [routerLink]=\"['/catalog/collections/', collection.id]\">\r\n <clr-icon shape=\"edit\"></clr-icon>\r\n {{ 'common.edit' | translate }}\r\n </a>\r\n <div class=\"drag-handle\" cdkDragHandle *vdrIfPermissions=\"['UpdateCatalog', 'UpdateCollection']\">\r\n <clr-icon shape=\"drag-handle\" size=\"24\"></clr-icon>\r\n </div>\r\n <vdr-dropdown>\r\n <button class=\"icon-button\" vdrDropdownTrigger (click)=\"getMoveListItems(collection)\">\r\n <clr-icon shape=\"ellipsis-vertical\"></clr-icon>\r\n </button>\r\n <vdr-dropdown-menu vdrPosition=\"bottom-right\">\r\n <a\r\n class=\"dropdown-item\"\r\n [routerLink]=\"['./', 'create', { parentId: collection.id }]\"\r\n *vdrIfPermissions=\"['CreateCatalog', 'CreateCollection']\"\r\n >\r\n <clr-icon shape=\"plus\"></clr-icon>\r\n {{ 'catalog.create-new-collection' | translate }}\r\n </a>\r\n <div class=\"dropdown-divider\"></div>\r\n <button\r\n type=\"button\"\r\n vdrDropdownItem\r\n [disabled]=\"i === 0 || !(hasUpdatePermission$ | async)\"\r\n (click)=\"moveUp(collection, i)\"\r\n >\r\n <clr-icon shape=\"caret up\"></clr-icon>\r\n {{ 'catalog.move-up' | translate }}\r\n </button>\r\n <button\r\n type=\"button\"\r\n vdrDropdownItem\r\n [disabled]=\"\r\n i === collectionTree.children.length - 1 || !(hasUpdatePermission$ | async)\r\n \"\r\n (click)=\"moveDown(collection, i)\"\r\n >\r\n <clr-icon shape=\"caret down\"></clr-icon>\r\n {{ 'catalog.move-down' | translate }}\r\n </button>\r\n <h4 class=\"dropdown-header\">{{ 'catalog.move-to' | translate }}</h4>\r\n <button\r\n type=\"button\"\r\n vdrDropdownItem\r\n *ngFor=\"let item of moveListItems\"\r\n (click)=\"move(collection, item.id)\"\r\n [disabled]=\"!(hasUpdatePermission$ | async)\"\r\n >\r\n <div class=\"move-to-item\">\r\n <div class=\"move-icon\">\r\n <clr-icon shape=\"child-arrow\"></clr-icon>\r\n </div>\r\n <div class=\"path\">\r\n {{ item.path }}\r\n </div>\r\n </div>\r\n </button>\r\n <div class=\"dropdown-divider\"></div>\r\n <button\r\n class=\"button\"\r\n vdrDropdownItem\r\n (click)=\"delete(collection.id)\"\r\n [disabled]=\"!(hasDeletePermission$ | async)\"\r\n >\r\n <clr-icon shape=\"trash\" class=\"is-danger\"></clr-icon>\r\n {{ 'common.delete' | translate }}\r\n </button>\r\n </vdr-dropdown-menu>\r\n </vdr-dropdown>\r\n </div>\r\n <vdr-collection-tree-node\r\n *ngIf=\"collection.expanded || expandAll\"\r\n [expandAll]=\"expandAll\"\r\n [collectionTree]=\"collection\"\r\n [activeCollectionId]=\"activeCollectionId\"\r\n ></vdr-collection-tree-node>\r\n </div>\r\n</div>\r\n",
|
|
3318
|
-
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
3319
|
-
styles: [":host{display:block}.collection{background-color:var(--color-component-bg-100);font-size:.65rem;transition:transform .25s cubic-bezier(0,0,.2,1);margin-bottom:2px;border-left:2px solid transparent;transition:border-left-color .2s}.collection.private{background-color:var(--color-component-bg-200)}.collection .collection-detail{padding:6px 12px;display:flex;align-items:center;justify-content:space-between;border-bottom:1px solid var(--color-component-border-100)}.collection .collection-detail.active{background-color:var(--clr-global-selection-color)}.collection .collection-detail.depth-1{padding-left:36px}.collection .collection-detail.depth-2{padding-left:60px}.collection .collection-detail.depth-3{padding-left:84px}.collection .collection-detail.depth-4{padding-left:108px}.collection .collection-detail .folder-button-spacer{display:inline-block;width:28px}.tree-node{display:block;background:var(--color-component-bg-100);overflow:hidden}.tree-node.cdk-drop-list-dragging>.collection{border-left-color:var(--color-primary-300)}.drag-placeholder{min-height:120px;background-color:var(--color-component-bg-300);transition:transform .25s cubic-bezier(0,0,.2,1)}.cdk-drag-preview{box-sizing:border-box;border-radius:4px;box-shadow:0 5px 5px -3px #0003,0 8px 10px 1px #00000024,0 3px 14px 2px #0000001f}.cdk-drag-placeholder{opacity:0}.cdk-drag-animating{transition:transform .25s cubic-bezier(0,0,.2,1)}.example-list.cdk-drop-list-dragging .tree-node:not(.cdk-drag-placeholder){transition:transform .25s cubic-bezier(0,0,.2,1)}.move-to-item{display:flex;white-space:normal;align-items:baseline}.move-to-item .move-icon{flex:none;margin-right:3px}.move-to-item .path{line-height:18px}\n"]
|
|
3320
|
-
},] }
|
|
3321
|
-
];
|
|
3322
|
-
CollectionTreeNodeComponent.ctorParameters = () => [
|
|
3323
|
-
{ type: CollectionTreeNodeComponent, decorators: [{ type: SkipSelf }, { type: Optional }] },
|
|
3324
|
-
{ type: CollectionTreeComponent },
|
|
3325
|
-
{ type: DataService },
|
|
3326
|
-
{ type: Router },
|
|
3327
|
-
{ type: ActivatedRoute }
|
|
3328
|
-
];
|
|
3329
|
-
CollectionTreeNodeComponent.propDecorators = {
|
|
3330
|
-
collectionTree: [{ type: Input }],
|
|
3331
|
-
activeCollectionId: [{ type: Input }],
|
|
3332
|
-
expandAll: [{ type: Input }]
|
|
3333
|
-
};
|
|
3334
|
-
|
|
3335
|
-
const DEFAULT_VARIANT_CODE = '__DEFAULT_VARIANT__';
|
|
3336
|
-
class GenerateProductVariantsComponent {
|
|
3337
|
-
constructor(dataService) {
|
|
3338
|
-
this.dataService = dataService;
|
|
3339
|
-
this.variantsChange = new EventEmitter();
|
|
3340
|
-
this.optionGroups = [];
|
|
3341
|
-
this.variantFormValues = {};
|
|
3342
|
-
}
|
|
3343
|
-
ngOnInit() {
|
|
3344
|
-
this.dataService.settings.getActiveChannel().single$.subscribe(data => {
|
|
3345
|
-
this.currencyCode = data.activeChannel.currencyCode;
|
|
3346
|
-
});
|
|
3347
|
-
this.generateVariants();
|
|
3348
|
-
}
|
|
3349
|
-
addOption() {
|
|
3350
|
-
this.optionGroups.push({ name: '', values: [] });
|
|
3351
|
-
const index = this.optionGroups.length - 1;
|
|
3352
|
-
setTimeout(() => {
|
|
3353
|
-
var _a;
|
|
3354
|
-
const input = (_a = this.groupNameInputs.get(index)) === null || _a === void 0 ? void 0 : _a.nativeElement;
|
|
3355
|
-
input === null || input === void 0 ? void 0 : input.focus();
|
|
3356
|
-
});
|
|
3357
|
-
}
|
|
3358
|
-
removeOption(name) {
|
|
3359
|
-
this.optionGroups = this.optionGroups.filter(g => g.name !== name);
|
|
3360
|
-
this.generateVariants();
|
|
3361
|
-
}
|
|
3362
|
-
generateVariants() {
|
|
3363
|
-
const totalValuesCount = this.optionGroups.reduce((sum, group) => sum + group.values.length, 0);
|
|
3364
|
-
const groups = totalValuesCount
|
|
3365
|
-
? this.optionGroups.map(g => g.values.map(v => v.name))
|
|
3366
|
-
: [[DEFAULT_VARIANT_CODE]];
|
|
3367
|
-
this.variants = generateAllCombinations(groups).map(values => ({ id: values.join('|'), values }));
|
|
3368
|
-
this.variants.forEach(variant => {
|
|
3369
|
-
if (!this.variantFormValues[variant.id]) {
|
|
3370
|
-
this.variantFormValues[variant.id] = {
|
|
3371
|
-
optionValues: variant.values,
|
|
3372
|
-
enabled: true,
|
|
3373
|
-
price: this.copyFromDefault(variant.id, 'price', 0),
|
|
3374
|
-
sku: this.copyFromDefault(variant.id, 'sku', ''),
|
|
3375
|
-
stock: this.copyFromDefault(variant.id, 'stock', 0),
|
|
3376
|
-
};
|
|
3377
|
-
}
|
|
3378
|
-
});
|
|
3379
|
-
this.onFormChange();
|
|
3380
|
-
}
|
|
3381
|
-
trackByFn(index, variant) {
|
|
3382
|
-
return variant.values.join('|');
|
|
3383
|
-
}
|
|
3384
|
-
handleEnter(event, optionValueInputComponent) {
|
|
3385
|
-
event.preventDefault();
|
|
3386
|
-
event.stopPropagation();
|
|
3387
|
-
optionValueInputComponent.focus();
|
|
3388
|
-
}
|
|
3389
|
-
onFormChange() {
|
|
3390
|
-
const variantsToCreate = this.variants.map(v => this.variantFormValues[v.id]).filter(v => v.enabled);
|
|
3391
|
-
this.variantsChange.emit({
|
|
3392
|
-
groups: this.optionGroups.map(og => ({ name: og.name, values: og.values.map(v => v.name) })),
|
|
3393
|
-
variants: variantsToCreate,
|
|
3394
|
-
});
|
|
3395
|
-
}
|
|
3396
|
-
copyFromDefault(variantId, prop, value) {
|
|
3397
|
-
return variantId !== DEFAULT_VARIANT_CODE
|
|
3398
|
-
? this.variantFormValues[DEFAULT_VARIANT_CODE][prop]
|
|
3399
|
-
: value;
|
|
3400
|
-
}
|
|
3401
|
-
}
|
|
3402
|
-
GenerateProductVariantsComponent.decorators = [
|
|
3403
|
-
{ type: Component, args: [{
|
|
3404
|
-
selector: 'vdr-generate-product-variants',
|
|
3405
|
-
template: "<div *ngFor=\"let group of optionGroups\" class=\"option-groups\">\r\n <div class=\"name\">\r\n <label>{{ 'catalog.option' | translate }}</label>\r\n <input\r\n #optionGroupName\r\n placeholder=\"e.g. Size\"\r\n clrInput\r\n [(ngModel)]=\"group.name\"\r\n name=\"name\"\r\n required\r\n (keydown.enter)=\"handleEnter($event, optionValueInputComponent)\"\r\n />\r\n </div>\r\n <div class=\"values\">\r\n <label>{{ 'catalog.option-values' | translate }}</label>\r\n <vdr-option-value-input\r\n #optionValueInputComponent\r\n [(ngModel)]=\"group.values\"\r\n (ngModelChange)=\"generateVariants()\"\r\n (edit)=\"generateVariants()\"\r\n [groupName]=\"group.name\"\r\n [disabled]=\"group.name === ''\"\r\n ></vdr-option-value-input>\r\n </div>\r\n <div class=\"remove-group\">\r\n <button\r\n class=\"btn btn-icon btn-warning-outline\"\r\n [title]=\"'catalog.remove-option' | translate\"\r\n (click)=\"removeOption(group.name)\"\r\n >\r\n <clr-icon shape=\"trash\"></clr-icon>\r\n </button>\r\n </div>\r\n</div>\r\n<button class=\"btn btn-primary-outline btn-sm\" (click)=\"addOption()\">\r\n <clr-icon shape=\"plus\"></clr-icon>\r\n {{ 'catalog.add-option' | translate }}\r\n</button>\r\n\r\n<div class=\"variants-preview\">\r\n <table class=\"table\">\r\n <thead>\r\n <tr>\r\n <th *ngIf=\"1 < variants.length\">{{ 'common.create' | translate }}</th>\r\n <th *ngIf=\"1 < variants.length\">{{ 'catalog.variant' | translate }}</th>\r\n <th>{{ 'catalog.sku' | translate }}</th>\r\n <th>{{ 'catalog.price' | translate }}</th>\r\n <th>{{ 'catalog.stock-on-hand' | translate }}</th>\r\n </tr>\r\n </thead>\r\n <tr\r\n *ngFor=\"let variant of variants; trackBy: trackByFn\"\r\n [class.disabled]=\"!variantFormValues[variant.id].enabled\"\r\n >\r\n <td *ngIf=\"1 < variants.length\">\r\n <input\r\n type=\"checkbox\"\r\n (change)=\"onFormChange()\"\r\n [(ngModel)]=\"variantFormValues[variant.id].enabled\"\r\n clrCheckbox\r\n />\r\n </td>\r\n <td *ngIf=\"1 < variants.length\">\r\n {{ variant.values.join(' ') }}\r\n </td>\r\n <td>\r\n <clr-input-container>\r\n <input\r\n clrInput\r\n type=\"text\"\r\n (change)=\"onFormChange()\"\r\n [(ngModel)]=\"variantFormValues[variant.id].sku\"\r\n [placeholder]=\"'catalog.sku' | translate\"\r\n />\r\n </clr-input-container>\r\n </td>\r\n <td>\r\n <clr-input-container>\r\n <vdr-currency-input\r\n clrInput\r\n [(ngModel)]=\"variantFormValues[variant.id].price\"\r\n (ngModelChange)=\"onFormChange()\"\r\n [currencyCode]=\"currencyCode\"\r\n ></vdr-currency-input>\r\n </clr-input-container>\r\n </td>\r\n <td>\r\n <clr-input-container>\r\n <input\r\n clrInput\r\n type=\"number\"\r\n [(ngModel)]=\"variantFormValues[variant.id].stock\"\r\n (change)=\"onFormChange()\"\r\n min=\"0\"\r\n step=\"1\"\r\n />\r\n </clr-input-container>\r\n </td>\r\n </tr>\r\n </table>\r\n</div>\r\n",
|
|
3406
|
-
styles: [":host{display:block;margin-bottom:120px}.option-groups{display:flex}.values{flex:1;margin:0 6px}.remove-group{padding-top:18px}.variants-preview tr.disabled td{background-color:var(--color-component-bg-100);color:var(--color-grey-400)}\n"]
|
|
3407
|
-
},] }
|
|
3408
|
-
];
|
|
3409
|
-
GenerateProductVariantsComponent.ctorParameters = () => [
|
|
3410
|
-
{ type: DataService }
|
|
3411
|
-
];
|
|
3412
|
-
GenerateProductVariantsComponent.propDecorators = {
|
|
3413
|
-
variantsChange: [{ type: Output }],
|
|
3414
|
-
groupNameInputs: [{ type: ViewChildren, args: ['optionGroupName', { read: ElementRef },] }]
|
|
3415
|
-
};
|
|
3416
|
-
|
|
3417
|
-
const OPTION_VALUE_INPUT_VALUE_ACCESSOR = {
|
|
3418
|
-
provide: NG_VALUE_ACCESSOR,
|
|
3419
|
-
useExisting: forwardRef(() => OptionValueInputComponent),
|
|
3420
|
-
multi: true,
|
|
3421
|
-
};
|
|
3422
|
-
class OptionValueInputComponent {
|
|
3423
|
-
constructor(changeDetector) {
|
|
3424
|
-
this.changeDetector = changeDetector;
|
|
3425
|
-
this.groupName = '';
|
|
3426
|
-
this.add = new EventEmitter();
|
|
3427
|
-
this.remove = new EventEmitter();
|
|
3428
|
-
this.edit = new EventEmitter();
|
|
3429
|
-
this.disabled = false;
|
|
3430
|
-
this.input = '';
|
|
3431
|
-
this.isFocussed = false;
|
|
3432
|
-
this.lastSelected = false;
|
|
3433
|
-
this.editingIndex = -1;
|
|
3434
|
-
}
|
|
3435
|
-
get optionValues() {
|
|
3436
|
-
var _a, _b;
|
|
3437
|
-
return (_b = (_a = this.formValue) !== null && _a !== void 0 ? _a : this.options) !== null && _b !== void 0 ? _b : [];
|
|
3438
|
-
}
|
|
3439
|
-
registerOnChange(fn) {
|
|
3440
|
-
this.onChangeFn = fn;
|
|
3441
|
-
}
|
|
3442
|
-
registerOnTouched(fn) {
|
|
3443
|
-
this.onTouchFn = fn;
|
|
3444
|
-
}
|
|
3445
|
-
setDisabledState(isDisabled) {
|
|
3446
|
-
this.disabled = isDisabled;
|
|
3447
|
-
this.changeDetector.markForCheck();
|
|
3448
|
-
}
|
|
3449
|
-
writeValue(obj) {
|
|
3450
|
-
this.formValue = obj || [];
|
|
3451
|
-
}
|
|
3452
|
-
focus() {
|
|
3453
|
-
this.textArea.nativeElement.focus();
|
|
3454
|
-
}
|
|
3455
|
-
editName(index, event) {
|
|
3456
|
-
var _a;
|
|
3457
|
-
const optionValue = this.optionValues[index];
|
|
3458
|
-
if (!optionValue.locked && !optionValue.id) {
|
|
3459
|
-
event.cancelBubble = true;
|
|
3460
|
-
this.editingIndex = index;
|
|
3461
|
-
const input = (_a = this.nameInputs.get(index)) === null || _a === void 0 ? void 0 : _a.nativeElement;
|
|
3462
|
-
setTimeout(() => input === null || input === void 0 ? void 0 : input.focus());
|
|
3463
|
-
}
|
|
3464
|
-
}
|
|
3465
|
-
updateOption(index, event) {
|
|
3466
|
-
const optionValue = this.optionValues[index];
|
|
3467
|
-
const newName = event.target.value;
|
|
3468
|
-
if (optionValue) {
|
|
3469
|
-
if (newName) {
|
|
3470
|
-
optionValue.name = newName;
|
|
3471
|
-
this.edit.emit({ index, option: optionValue });
|
|
3472
|
-
}
|
|
3473
|
-
this.editingIndex = -1;
|
|
3474
|
-
}
|
|
3475
|
-
}
|
|
3476
|
-
removeOption(option) {
|
|
3477
|
-
var _a;
|
|
3478
|
-
if (!option.locked) {
|
|
3479
|
-
if (this.formValue) {
|
|
3480
|
-
this.formValue = (_a = this.formValue) === null || _a === void 0 ? void 0 : _a.filter(o => o.name !== option.name);
|
|
3481
|
-
this.onChangeFn(this.formValue);
|
|
3482
|
-
}
|
|
3483
|
-
else {
|
|
3484
|
-
this.remove.emit(option);
|
|
3485
|
-
}
|
|
3486
|
-
}
|
|
3487
|
-
}
|
|
3488
|
-
handleKey(event) {
|
|
3489
|
-
switch (event.key) {
|
|
3490
|
-
case ',':
|
|
3491
|
-
case 'Enter':
|
|
3492
|
-
this.addOptionValue();
|
|
3493
|
-
event.preventDefault();
|
|
3494
|
-
break;
|
|
3495
|
-
case 'Backspace':
|
|
3496
|
-
if (this.lastSelected) {
|
|
3497
|
-
this.removeLastOption();
|
|
3498
|
-
this.lastSelected = false;
|
|
3499
|
-
}
|
|
3500
|
-
else if (this.input === '') {
|
|
3501
|
-
this.lastSelected = true;
|
|
3502
|
-
}
|
|
3503
|
-
break;
|
|
3504
|
-
default:
|
|
3505
|
-
this.lastSelected = false;
|
|
3506
|
-
}
|
|
3507
|
-
}
|
|
3508
|
-
handleBlur() {
|
|
3509
|
-
this.isFocussed = false;
|
|
3510
|
-
this.addOptionValue();
|
|
3511
|
-
}
|
|
3512
|
-
addOptionValue() {
|
|
3513
|
-
const options = this.parseInputIntoOptions(this.input).filter(option => {
|
|
3514
|
-
var _a;
|
|
3515
|
-
// do not add an option with the same name
|
|
3516
|
-
// as an existing option
|
|
3517
|
-
const existing = (_a = this.options) !== null && _a !== void 0 ? _a : this.formValue;
|
|
3518
|
-
return !(existing === null || existing === void 0 ? void 0 : existing.find(o => (o === null || o === void 0 ? void 0 : o.name) === option.name));
|
|
3519
|
-
});
|
|
3520
|
-
if (!this.formValue && this.options) {
|
|
3521
|
-
for (const option of options) {
|
|
3522
|
-
this.add.emit(option);
|
|
3523
|
-
}
|
|
3524
|
-
}
|
|
3525
|
-
else {
|
|
3526
|
-
this.formValue = unique([...this.formValue, ...options]);
|
|
3527
|
-
this.onChangeFn(this.formValue);
|
|
3528
|
-
}
|
|
3529
|
-
this.input = '';
|
|
3530
|
-
}
|
|
3531
|
-
parseInputIntoOptions(input) {
|
|
3532
|
-
return input
|
|
3533
|
-
.split(/[,\n]/)
|
|
3534
|
-
.map(s => s.trim())
|
|
3535
|
-
.filter(s => s !== '')
|
|
3536
|
-
.map(s => ({ name: s, locked: false }));
|
|
3537
|
-
}
|
|
3538
|
-
removeLastOption() {
|
|
3539
|
-
if (this.optionValues.length) {
|
|
3540
|
-
const option = this.optionValues[this.optionValues.length - 1];
|
|
3541
|
-
this.removeOption(option);
|
|
3542
|
-
}
|
|
3543
|
-
}
|
|
3544
|
-
}
|
|
3545
|
-
OptionValueInputComponent.decorators = [
|
|
3546
|
-
{ type: Component, args: [{
|
|
3547
|
-
selector: 'vdr-option-value-input',
|
|
3548
|
-
template: "<div class=\"input-wrapper\" [class.focus]=\"isFocussed\" (click)=\"textArea.focus()\">\r\n <div class=\"chips\" *ngIf=\"0 < optionValues.length\">\r\n <vdr-chip\r\n *ngFor=\"let option of optionValues; last as isLast; index as i\"\r\n [icon]=\"option.locked ? 'lock' : 'times'\"\r\n [class.selected]=\"isLast && lastSelected\"\r\n [class.locked]=\"option.locked\"\r\n [colorFrom]=\"groupName\"\r\n (iconClick)=\"removeOption(option)\"\r\n >\r\n <span [hidden]=\"editingIndex !== i\">\r\n <input\r\n #editNameInput\r\n type=\"text\"\r\n [ngModel]=\"option.name\"\r\n (blur)=\"updateOption(i, $event)\"\r\n (click)=\"$event.cancelBubble = true\"\r\n />\r\n </span>\r\n <span\r\n class=\"option-name\"\r\n [class.editable]=\"!option.locked && !option.id\"\r\n (click)=\"editName(i, $event)\" [hidden]=\"editingIndex === i\">{{ option.name }}</span>\r\n </vdr-chip>\r\n </div>\r\n <textarea\r\n #textArea\r\n (keyup)=\"handleKey($event)\"\r\n (focus)=\"isFocussed = true\"\r\n (blur)=\"handleBlur()\"\r\n [(ngModel)]=\"input\"\r\n [disabled]=\"disabled\"\r\n ></textarea>\r\n</div>\r\n",
|
|
3549
|
-
changeDetection: ChangeDetectionStrategy.Default,
|
|
3550
|
-
providers: [OPTION_VALUE_INPUT_VALUE_ACCESSOR],
|
|
3551
|
-
styles: [".input-wrapper{background-color:#fff;border-radius:3px!important;border:1px solid var(--color-grey-300)!important;cursor:text}.input-wrapper.focus{border-color:var(--color-primary-500)!important;box-shadow:0 0 1px 1px var(--color-primary-100)}.input-wrapper .chips{padding:5px}.input-wrapper textarea{border:none;width:100%;height:24px;margin-top:3px;padding:0 6px}.input-wrapper textarea:focus{outline:none}.input-wrapper textarea:disabled{background-color:var(--color-component-bg-100)}vdr-chip ::ng-deep .wrapper{margin:0 3px}vdr-chip.locked{opacity:.8}vdr-chip.selected ::ng-deep .wrapper{border-color:var(--color-warning-500)!important;box-shadow:0 0 1px 1px var(--color-warning-400);opacity:.6}vdr-chip .option-name.editable:hover{outline:1px solid var(--color-component-bg-300);outline-offset:1px;border-radius:1px}vdr-chip input{padding:0!important;margin-top:-2px;margin-bottom:-2px}\n"]
|
|
3552
|
-
},] }
|
|
3553
|
-
];
|
|
3554
|
-
OptionValueInputComponent.ctorParameters = () => [
|
|
3555
|
-
{ type: ChangeDetectorRef }
|
|
3556
|
-
];
|
|
3557
|
-
OptionValueInputComponent.propDecorators = {
|
|
3558
|
-
groupName: [{ type: Input }],
|
|
3559
|
-
textArea: [{ type: ViewChild, args: ['textArea', { static: true },] }],
|
|
3560
|
-
nameInputs: [{ type: ViewChildren, args: ['editNameInput', { read: ElementRef },] }],
|
|
3561
|
-
options: [{ type: Input }],
|
|
3562
|
-
add: [{ type: Output }],
|
|
3563
|
-
remove: [{ type: Output }],
|
|
3564
|
-
edit: [{ type: Output }],
|
|
3565
|
-
disabled: [{ type: Input }]
|
|
3566
|
-
};
|
|
3567
|
-
|
|
3568
|
-
class UpdateProductOptionDialogComponent {
|
|
3569
|
-
constructor() {
|
|
3570
|
-
this.updateVariantName = true;
|
|
3571
|
-
this.codeInputTouched = false;
|
|
3572
|
-
}
|
|
3573
|
-
ngOnInit() {
|
|
3574
|
-
var _a;
|
|
3575
|
-
const currentTranslation = this.productOption.translations.find(t => t.languageCode === this.activeLanguage);
|
|
3576
|
-
this.name = (_a = currentTranslation === null || currentTranslation === void 0 ? void 0 : currentTranslation.name) !== null && _a !== void 0 ? _a : '';
|
|
3577
|
-
this.code = this.productOption.code;
|
|
3578
|
-
this.customFieldsForm = new FormGroup({});
|
|
3579
|
-
if (this.customFields) {
|
|
3580
|
-
const cfCurrentTranslation = (currentTranslation && currentTranslation.customFields) || {};
|
|
3581
|
-
for (const fieldDef of this.customFields) {
|
|
3582
|
-
const key = fieldDef.name;
|
|
3583
|
-
const value = fieldDef.type === 'localeString'
|
|
3584
|
-
? cfCurrentTranslation[key]
|
|
3585
|
-
: this.productOption.customFields[key];
|
|
3586
|
-
this.customFieldsForm.addControl(fieldDef.name, new FormControl(value));
|
|
3587
|
-
}
|
|
3588
|
-
}
|
|
3589
|
-
}
|
|
3590
|
-
update() {
|
|
3591
|
-
const result = createUpdatedTranslatable({
|
|
3592
|
-
translatable: this.productOption,
|
|
3593
|
-
languageCode: this.activeLanguage,
|
|
3594
|
-
updatedFields: {
|
|
3595
|
-
code: this.code,
|
|
3596
|
-
name: this.name,
|
|
3597
|
-
customFields: this.customFieldsForm.value,
|
|
3598
|
-
},
|
|
3599
|
-
customFieldConfig: this.customFields,
|
|
3600
|
-
defaultTranslation: {
|
|
3601
|
-
languageCode: this.activeLanguage,
|
|
3602
|
-
name: '',
|
|
3603
|
-
},
|
|
3604
|
-
});
|
|
3605
|
-
this.resolveWith(Object.assign(Object.assign({}, result), { autoUpdate: this.updateVariantName }));
|
|
3606
|
-
}
|
|
3607
|
-
cancel() {
|
|
3608
|
-
this.resolveWith();
|
|
3609
|
-
}
|
|
3610
|
-
updateCode(nameValue) {
|
|
3611
|
-
if (!this.codeInputTouched && !this.productOption.code) {
|
|
3612
|
-
this.code = normalizeString(nameValue, '-');
|
|
3613
|
-
}
|
|
3614
|
-
}
|
|
3615
|
-
}
|
|
3616
|
-
UpdateProductOptionDialogComponent.decorators = [
|
|
3617
|
-
{ type: Component, args: [{
|
|
3618
|
-
selector: 'vdr-update-product-option-dialog',
|
|
3619
|
-
template: "<ng-template vdrDialogTitle>{{ 'catalog.update-product-option' | translate }}</ng-template>\r\n<vdr-form-field [label]=\"'catalog.option-name' | translate\" for=\"name\">\r\n <input\r\n id=\"name\"\r\n type=\"text\"\r\n #nameInput=\"ngModel\"\r\n [(ngModel)]=\"name\"\r\n required\r\n (input)=\"updateCode($event.target.value)\"\r\n />\r\n</vdr-form-field>\r\n<vdr-form-field [label]=\"'common.code' | translate\" for=\"code\">\r\n <input id=\"code\" type=\"text\" #codeInput=\"ngModel\" required [(ngModel)]=\"code\" pattern=\"[a-z0-9_-]+\" />\r\n</vdr-form-field>\r\n<clr-checkbox-wrapper>\r\n <input type=\"checkbox\" clrCheckbox [(ngModel)]=\"updateVariantName\" />\r\n <label>{{ 'catalog.auto-update-option-variant-name' | translate }}</label>\r\n</clr-checkbox-wrapper>\r\n<section *ngIf=\"customFields.length\">\r\n <label>{{ 'common.custom-fields' | translate }}</label>\r\n <vdr-tabbed-custom-fields\r\n entityName=\"ProductOption\"\r\n [customFields]=\"customFields\"\r\n [customFieldsFormGroup]=\"customFieldsForm\"\r\n [readonly]=\"!(['UpdateCatalog', 'UpdateProduct'] | hasPermission)\"\r\n ></vdr-tabbed-custom-fields>\r\n</section>\r\n\r\n<ng-template vdrDialogButtons>\r\n <button type=\"button\" class=\"btn\" (click)=\"cancel()\">{{ 'common.cancel' | translate }}</button>\r\n <button\r\n type=\"submit\"\r\n (click)=\"update()\"\r\n [disabled]=\"\r\n nameInput.invalid ||\r\n codeInput.invalid ||\r\n (nameInput.pristine && codeInput.pristine && customFieldsForm.pristine)\r\n \"\r\n class=\"btn btn-primary\"\r\n >\r\n {{ 'catalog.update-product-option' | translate }}\r\n </button>\r\n</ng-template>\r\n",
|
|
3620
|
-
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
3621
|
-
styles: [""]
|
|
3622
|
-
},] }
|
|
3623
|
-
];
|
|
3624
|
-
|
|
3625
|
-
class ProductVariantsListComponent {
|
|
3626
|
-
constructor(changeDetector, modalService, dataService) {
|
|
3627
|
-
this.changeDetector = changeDetector;
|
|
3628
|
-
this.modalService = modalService;
|
|
3629
|
-
this.dataService = dataService;
|
|
3630
|
-
this.assignToChannel = new EventEmitter();
|
|
3631
|
-
this.removeFromChannel = new EventEmitter();
|
|
3632
|
-
this.assetChange = new EventEmitter();
|
|
3633
|
-
this.selectionChange = new EventEmitter();
|
|
3634
|
-
this.selectFacetValueClick = new EventEmitter();
|
|
3635
|
-
this.updateProductOption = new EventEmitter();
|
|
3636
|
-
this.selectedVariantIds = [];
|
|
3637
|
-
this.formGroupMap = new Map();
|
|
3638
|
-
this.GlobalFlag = GlobalFlag;
|
|
3639
|
-
this.updatePermission = [Permission.UpdateCatalog, Permission.UpdateProduct];
|
|
3640
|
-
}
|
|
3641
|
-
ngOnInit() {
|
|
3642
|
-
this.dataService.settings.getGlobalSettings('cache-first').single$.subscribe(({ globalSettings }) => {
|
|
3643
|
-
this.globalTrackInventory = globalSettings.trackInventory;
|
|
3644
|
-
this.globalOutOfStockThreshold = globalSettings.outOfStockThreshold;
|
|
3645
|
-
this.changeDetector.markForCheck();
|
|
3646
|
-
});
|
|
3647
|
-
this.subscription = this.formArray.valueChanges.subscribe(() => this.changeDetector.markForCheck());
|
|
3648
|
-
this.subscription.add(this.formArray.valueChanges
|
|
3649
|
-
.pipe(map(value => value.length), debounceTime(1), distinctUntilChanged())
|
|
3650
|
-
.subscribe(() => {
|
|
3651
|
-
this.buildFormGroupMap();
|
|
3652
|
-
}));
|
|
3653
|
-
this.buildFormGroupMap();
|
|
3654
|
-
}
|
|
3655
|
-
ngOnChanges(changes) {
|
|
3656
|
-
if ('facets' in changes && !!changes['facets'].currentValue) {
|
|
3657
|
-
this.facetValues = flattenFacetValues(this.facets);
|
|
3658
|
-
}
|
|
3659
|
-
}
|
|
3660
|
-
ngOnDestroy() {
|
|
3661
|
-
if (this.subscription) {
|
|
3662
|
-
this.subscription.unsubscribe();
|
|
3663
|
-
}
|
|
3664
|
-
}
|
|
3665
|
-
isDefaultChannel(channelCode) {
|
|
3666
|
-
return channelCode === DEFAULT_CHANNEL_CODE;
|
|
3667
|
-
}
|
|
3668
|
-
trackById(index, item) {
|
|
3669
|
-
return item.id;
|
|
3670
|
-
}
|
|
3671
|
-
inventoryIsNotTracked(formGroup) {
|
|
3672
|
-
var _a;
|
|
3673
|
-
const trackInventory = (_a = formGroup.get('trackInventory')) === null || _a === void 0 ? void 0 : _a.value;
|
|
3674
|
-
return (trackInventory === GlobalFlag.FALSE ||
|
|
3675
|
-
(trackInventory === GlobalFlag.INHERIT && this.globalTrackInventory === false));
|
|
3676
|
-
}
|
|
3677
|
-
getTaxCategoryName(group) {
|
|
3678
|
-
const control = group.get(['taxCategoryId']);
|
|
3679
|
-
if (control && this.taxCategories) {
|
|
3680
|
-
const match = this.taxCategories.find(t => t.id === control.value);
|
|
3681
|
-
return match ? match.name : '';
|
|
3682
|
-
}
|
|
3683
|
-
return '';
|
|
3684
|
-
}
|
|
3685
|
-
getStockOnHandMinValue(variant) {
|
|
3686
|
-
var _a, _b;
|
|
3687
|
-
const effectiveOutOfStockThreshold = ((_a = variant.get('useGlobalOutOfStockThreshold')) === null || _a === void 0 ? void 0 : _a.value)
|
|
3688
|
-
? this.globalOutOfStockThreshold
|
|
3689
|
-
: (_b = variant.get('outOfStockThreshold')) === null || _b === void 0 ? void 0 : _b.value;
|
|
3690
|
-
return effectiveOutOfStockThreshold;
|
|
3691
|
-
}
|
|
3692
|
-
getSaleableStockLevel(variant) {
|
|
3693
|
-
const effectiveOutOfStockThreshold = variant.useGlobalOutOfStockThreshold
|
|
3694
|
-
? this.globalOutOfStockThreshold
|
|
3695
|
-
: variant.outOfStockThreshold;
|
|
3696
|
-
return variant.stockOnHand - variant.stockAllocated - effectiveOutOfStockThreshold;
|
|
3697
|
-
}
|
|
3698
|
-
areAllSelected() {
|
|
3699
|
-
return !!this.variants && this.selectedVariantIds.length === this.variants.length;
|
|
3700
|
-
}
|
|
3701
|
-
onAssetChange(variantId, event) {
|
|
3702
|
-
this.assetChange.emit(Object.assign({ variantId }, event));
|
|
3703
|
-
const index = this.variants.findIndex(v => v.id === variantId);
|
|
3704
|
-
this.formArray.at(index).markAsDirty();
|
|
3705
|
-
}
|
|
3706
|
-
toggleSelectAll() {
|
|
3707
|
-
if (this.areAllSelected()) {
|
|
3708
|
-
this.selectedVariantIds = [];
|
|
3709
|
-
}
|
|
3710
|
-
else {
|
|
3711
|
-
this.selectedVariantIds = this.variants.map(v => v.id);
|
|
3712
|
-
}
|
|
3713
|
-
this.selectionChange.emit(this.selectedVariantIds);
|
|
3714
|
-
}
|
|
3715
|
-
toggleSelectVariant(variantId) {
|
|
3716
|
-
const index = this.selectedVariantIds.indexOf(variantId);
|
|
3717
|
-
if (-1 < index) {
|
|
3718
|
-
this.selectedVariantIds.splice(index, 1);
|
|
3719
|
-
}
|
|
3720
|
-
else {
|
|
3721
|
-
this.selectedVariantIds.push(variantId);
|
|
3722
|
-
}
|
|
3723
|
-
this.selectionChange.emit(this.selectedVariantIds);
|
|
3724
|
-
}
|
|
3725
|
-
optionGroupName(optionGroupId) {
|
|
3726
|
-
var _a;
|
|
3727
|
-
const group = this.optionGroups.find(g => g.id === optionGroupId);
|
|
3728
|
-
if (group) {
|
|
3729
|
-
const translation = (_a = group === null || group === void 0 ? void 0 : group.translations.find(t => t.languageCode === this.activeLanguage)) !== null && _a !== void 0 ? _a : group.translations[0];
|
|
3730
|
-
return translation.name;
|
|
3731
|
-
}
|
|
3732
|
-
}
|
|
3733
|
-
optionName(option) {
|
|
3734
|
-
var _a;
|
|
3735
|
-
const translation = (_a = option.translations.find(t => t.languageCode === this.activeLanguage)) !== null && _a !== void 0 ? _a : option.translations[0];
|
|
3736
|
-
return translation.name;
|
|
3737
|
-
}
|
|
3738
|
-
pendingFacetValues(variant) {
|
|
3739
|
-
if (this.facets) {
|
|
3740
|
-
const formFacetValueIds = this.getFacetValueIds(variant.id);
|
|
3741
|
-
const variantFacetValueIds = variant.facetValues.map(fv => fv.id);
|
|
3742
|
-
return formFacetValueIds
|
|
3743
|
-
.filter(x => !variantFacetValueIds.includes(x))
|
|
3744
|
-
.map(id => this.facetValues.find(fv => fv.id === id))
|
|
3745
|
-
.filter(notNullOrUndefined);
|
|
3746
|
-
}
|
|
3747
|
-
else {
|
|
3748
|
-
return [];
|
|
3749
|
-
}
|
|
3750
|
-
}
|
|
3751
|
-
existingFacetValues(variant) {
|
|
3752
|
-
const formFacetValueIds = this.getFacetValueIds(variant.id);
|
|
3753
|
-
const intersection = [...formFacetValueIds].filter(x => variant.facetValues.map(fv => fv.id).includes(x));
|
|
3754
|
-
return intersection
|
|
3755
|
-
.map(id => variant.facetValues.find(fv => fv.id === id))
|
|
3756
|
-
.filter(notNullOrUndefined);
|
|
3757
|
-
}
|
|
3758
|
-
removeFacetValue(variant, facetValueId) {
|
|
3759
|
-
const formGroup = this.formGroupMap.get(variant.id);
|
|
3760
|
-
if (formGroup) {
|
|
3761
|
-
const newValue = formGroup.value.facetValueIds.filter(id => id !== facetValueId);
|
|
3762
|
-
formGroup.patchValue({
|
|
3763
|
-
facetValueIds: newValue,
|
|
3764
|
-
});
|
|
3765
|
-
formGroup.markAsDirty();
|
|
3766
|
-
}
|
|
3767
|
-
}
|
|
3768
|
-
isVariantSelected(variantId) {
|
|
3769
|
-
return -1 < this.selectedVariantIds.indexOf(variantId);
|
|
3770
|
-
}
|
|
3771
|
-
editOption(option) {
|
|
3772
|
-
this.modalService
|
|
3773
|
-
.fromComponent(UpdateProductOptionDialogComponent, {
|
|
3774
|
-
size: 'md',
|
|
3775
|
-
locals: {
|
|
3776
|
-
productOption: option,
|
|
3777
|
-
activeLanguage: this.activeLanguage,
|
|
3778
|
-
customFields: this.customOptionFields,
|
|
3779
|
-
},
|
|
3780
|
-
})
|
|
3781
|
-
.subscribe(result => {
|
|
3782
|
-
if (result) {
|
|
3783
|
-
this.updateProductOption.emit(result);
|
|
3784
|
-
}
|
|
3785
|
-
});
|
|
3786
|
-
}
|
|
3787
|
-
buildFormGroupMap() {
|
|
3788
|
-
this.formGroupMap.clear();
|
|
3789
|
-
for (const controlGroup of this.formArray.controls) {
|
|
3790
|
-
this.formGroupMap.set(controlGroup.value.id, controlGroup);
|
|
3791
|
-
}
|
|
3792
|
-
this.changeDetector.markForCheck();
|
|
3793
|
-
}
|
|
3794
|
-
getFacetValueIds(id) {
|
|
3795
|
-
var _a;
|
|
3796
|
-
const formValue = (_a = this.formGroupMap.get(id)) === null || _a === void 0 ? void 0 : _a.value;
|
|
3797
|
-
return formValue.facetValueIds;
|
|
3798
|
-
}
|
|
3799
|
-
}
|
|
3800
|
-
ProductVariantsListComponent.decorators = [
|
|
3801
|
-
{ type: Component, args: [{
|
|
3802
|
-
selector: 'vdr-product-variants-list',
|
|
3803
|
-
template: "<div class=\"variants-list\">\r\n <div\r\n class=\"variant-container card\"\r\n *ngFor=\"\r\n let variant of variants | paginate: paginationConfig || { itemsPerPage: 10, currentPage: 1 };\r\n trackBy: trackById;\r\n let i = index\r\n \"\r\n [class.disabled]=\"!formGroupMap.get(variant.id)?.get('enabled')?.value\"\r\n >\r\n <ng-container *ngIf=\"formGroupMap.get(variant.id) as formGroup\" [formGroup]=\"formGroup\">\r\n <div class=\"card-block header-row\">\r\n <div class=\"details\">\r\n <vdr-title-input class=\"sku\" [readonly]=\"!(updatePermission | hasPermission)\">\r\n <clr-input-container>\r\n <input\r\n clrInput\r\n type=\"text\"\r\n formControlName=\"sku\"\r\n [readonly]=\"!(updatePermission | hasPermission)\"\r\n [placeholder]=\"'catalog.sku' | translate\"\r\n />\r\n </clr-input-container>\r\n </vdr-title-input>\r\n <vdr-title-input class=\"name\" [readonly]=\"!(updatePermission | hasPermission)\">\r\n <clr-input-container>\r\n <input\r\n clrInput\r\n type=\"text\"\r\n formControlName=\"name\"\r\n [readonly]=\"!(updatePermission | hasPermission)\"\r\n [placeholder]=\"'common.name' | translate\"\r\n />\r\n </clr-input-container>\r\n </vdr-title-input>\r\n </div>\r\n <div class=\"right-controls\">\r\n <clr-toggle-wrapper *vdrIfPermissions=\"updatePermission\">\r\n <input type=\"checkbox\" clrToggle name=\"enabled\" formControlName=\"enabled\" />\r\n <label>{{ 'common.enabled' | translate }}</label>\r\n </clr-toggle-wrapper>\r\n </div>\r\n </div>\r\n <div class=\"card-block\">\r\n <div class=\"variant-body\">\r\n <div class=\"assets\">\r\n <vdr-assets\r\n [compact]=\"true\"\r\n [assets]=\"pendingAssetChanges[variant.id]?.assets || variant.assets\"\r\n [featuredAsset]=\"\r\n pendingAssetChanges[variant.id]?.featuredAsset || variant.featuredAsset\r\n \"\r\n [updatePermissions]=\"updatePermission\"\r\n (change)=\"onAssetChange(variant.id, $event)\"\r\n ></vdr-assets>\r\n </div>\r\n <div class=\"variant-form-inputs\">\r\n <div class=\"standard-fields\">\r\n <div class=\"variant-form-input-row\">\r\n <div class=\"tax-category\">\r\n <clr-select-container\r\n *vdrIfPermissions=\"updatePermission; else taxCategoryLabel\"\r\n >\r\n <label>{{ 'catalog.tax-category' | translate }}</label>\r\n <select clrSelect name=\"options\" formControlName=\"taxCategoryId\">\r\n <option\r\n *ngFor=\"let taxCategory of taxCategories\"\r\n [value]=\"taxCategory.id\"\r\n >\r\n {{ taxCategory.name }}\r\n </option>\r\n </select>\r\n </clr-select-container>\r\n <ng-template #taxCategoryLabel>\r\n <label class=\"clr-control-label\">{{\r\n 'catalog.tax-category' | translate\r\n }}</label>\r\n <div class=\"tax-category-label\">\r\n {{ getTaxCategoryName(formGroup) }}\r\n </div>\r\n </ng-template>\r\n </div>\r\n <div class=\"price\">\r\n <clr-input-container>\r\n <label>{{ 'catalog.price' | translate }}</label>\r\n <vdr-currency-input\r\n *ngIf=\"!channelPriceIncludesTax\"\r\n clrInput\r\n [currencyCode]=\"variant.currencyCode\"\r\n [readonly]=\"!(updatePermission | hasPermission)\"\r\n formControlName=\"price\"\r\n ></vdr-currency-input>\r\n <vdr-currency-input\r\n *ngIf=\"channelPriceIncludesTax\"\r\n clrInput\r\n [currencyCode]=\"variant.currencyCode\"\r\n [readonly]=\"!(updatePermission | hasPermission)\"\r\n formControlName=\"priceWithTax\"\r\n ></vdr-currency-input>\r\n </clr-input-container>\r\n </div>\r\n <vdr-variant-price-detail\r\n [price]=\"formGroup.get('price')!.value\"\r\n [currencyCode]=\"variant.currencyCode\"\r\n [priceIncludesTax]=\"channelPriceIncludesTax\"\r\n [taxCategoryId]=\"formGroup.get('taxCategoryId')!.value\"\r\n ></vdr-variant-price-detail>\r\n </div>\r\n <div class=\"variant-form-input-row\">\r\n <clr-select-container *vdrIfPermissions=\"updatePermission\">\r\n <label\r\n >{{ 'catalog.track-inventory' | translate }}\r\n <vdr-help-tooltip\r\n [content]=\"'catalog.track-inventory-tooltip' | translate\"\r\n ></vdr-help-tooltip>\r\n </label>\r\n <select clrSelect name=\"options\" formControlName=\"trackInventory\">\r\n <option [value]=\"GlobalFlag.TRUE\">\r\n {{ 'catalog.track-inventory-true' | translate }}\r\n </option>\r\n <option [value]=\"GlobalFlag.FALSE\">\r\n {{ 'catalog.track-inventory-false' | translate }}\r\n </option>\r\n <option [value]=\"GlobalFlag.INHERIT\">\r\n {{ 'catalog.track-inventory-inherit' | translate }}\r\n </option>\r\n </select>\r\n </clr-select-container>\r\n <clr-input-container>\r\n <label\r\n >{{ 'catalog.stock-on-hand' | translate }}\r\n <vdr-help-tooltip\r\n [content]=\"'catalog.stock-on-hand-tooltip' | translate\"\r\n ></vdr-help-tooltip\r\n ></label>\r\n <input\r\n [class.inventory-untracked]=\"inventoryIsNotTracked(formGroup)\"\r\n clrInput\r\n type=\"number\"\r\n [min]=\"getStockOnHandMinValue(formGroup)\"\r\n step=\"1\"\r\n formControlName=\"stockOnHand\"\r\n [readonly]=\"!(updatePermission | hasPermission)\"\r\n [vdrDisabled]=\"inventoryIsNotTracked(formGroup)\"\r\n />\r\n </clr-input-container>\r\n <div [class.inventory-untracked]=\"inventoryIsNotTracked(formGroup)\">\r\n <label class=\"clr-control-label\"\r\n >{{ 'catalog.stock-allocated' | translate }}\r\n <vdr-help-tooltip\r\n [content]=\"'catalog.stock-allocated-tooltip' | translate\"\r\n ></vdr-help-tooltip\r\n ></label>\r\n <div class=\"value\">\r\n {{ variant.stockAllocated }}\r\n </div>\r\n </div>\r\n <div [class.inventory-untracked]=\"inventoryIsNotTracked(formGroup)\">\r\n <label class=\"clr-control-label\"\r\n >{{ 'catalog.stock-saleable' | translate }}\r\n <vdr-help-tooltip\r\n [content]=\"'catalog.stock-saleable-tooltip' | translate\"\r\n ></vdr-help-tooltip\r\n ></label>\r\n <div class=\"value\">\r\n {{ getSaleableStockLevel(variant) }}\r\n </div>\r\n </div>\r\n </div>\r\n\r\n <div class=\"variant-form-input-row\">\r\n <div\r\n class=\"out-of-stock-threshold-wrapper\"\r\n [class.inventory-untracked]=\"inventoryIsNotTracked(formGroup)\"\r\n >\r\n <label class=\"clr-control-label\"\r\n >{{ 'catalog.out-of-stock-threshold' | translate\r\n }}<vdr-help-tooltip\r\n [content]=\"'catalog.out-of-stock-threshold-tooltip' | translate\"\r\n ></vdr-help-tooltip\r\n ></label>\r\n <div class=\"flex\">\r\n <clr-input-container>\r\n <input\r\n clrInput\r\n type=\"number\"\r\n [formControl]=\"formGroup.get('outOfStockThreshold')\"\r\n [readonly]=\"!(updatePermission | hasPermission)\"\r\n [vdrDisabled]=\"\r\n formGroup.get('useGlobalOutOfStockThreshold')?.value !==\r\n false || inventoryIsNotTracked(formGroup)\r\n \"\r\n />\r\n </clr-input-container>\r\n <clr-toggle-wrapper>\r\n <input\r\n type=\"checkbox\"\r\n clrToggle\r\n name=\"useGlobalOutOfStockThreshold\"\r\n formControlName=\"useGlobalOutOfStockThreshold\"\r\n [vdrDisabled]=\"\r\n !(updatePermission | hasPermission) ||\r\n inventoryIsNotTracked(formGroup)\r\n \"\r\n />\r\n <label\r\n >{{ 'catalog.use-global-value' | translate }} ({{\r\n globalOutOfStockThreshold\r\n }})</label\r\n >\r\n </clr-toggle-wrapper>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n <div class=\"custom-fields\">\r\n <div class=\"variant-form-input-row\">\r\n <section formGroupName=\"customFields\" *ngIf=\"customFields.length\">\r\n <vdr-tabbed-custom-fields\r\n entityName=\"ProductVariant\"\r\n [customFields]=\"customFields\"\r\n [compact]=\"true\"\r\n [customFieldsFormGroup]=\"formGroup.get('customFields')\"\r\n [readonly]=\"!(updatePermission | hasPermission)\"\r\n ></vdr-tabbed-custom-fields>\r\n </section>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n <div class=\"card-block\">\r\n <div class=\"options-facets\">\r\n <vdr-entity-info [entity]=\"variant\"></vdr-entity-info>\r\n <div *ngIf=\"variant.options.length\">\r\n <div class=\"options\">\r\n <vdr-chip\r\n *ngFor=\"let option of variant.options | sort: 'groupId'\"\r\n [colorFrom]=\"optionGroupName(option.groupId)\"\r\n [invert]=\"true\"\r\n (iconClick)=\"editOption(option)\"\r\n [icon]=\"(updatePermission | hasPermission) && 'pencil'\"\r\n >\r\n <span class=\"option-group-name\">{{ optionGroupName(option.groupId) }}</span>\r\n {{ optionName(option) }}\r\n </vdr-chip>\r\n <a [routerLink]=\"['./', 'options']\" class=\"btn btn-link btn-sm\"\r\n >{{ 'catalog.edit-options' | translate }}...</a\r\n >\r\n </div>\r\n </div>\r\n <div class=\"flex-spacer\"></div>\r\n <div class=\"facets\">\r\n <vdr-facet-value-chip\r\n *ngFor=\"let facetValue of existingFacetValues(variant)\"\r\n [facetValue]=\"facetValue\"\r\n [removable]=\"updatePermission | hasPermission\"\r\n (remove)=\"removeFacetValue(variant, facetValue.id)\"\r\n ></vdr-facet-value-chip>\r\n <vdr-facet-value-chip\r\n *ngFor=\"let facetValue of pendingFacetValues(variant)\"\r\n [facetValue]=\"facetValue\"\r\n [removable]=\"updatePermission | hasPermission\"\r\n (remove)=\"removeFacetValue(variant, facetValue.id)\"\r\n ></vdr-facet-value-chip>\r\n <button\r\n *vdrIfPermissions=\"updatePermission\"\r\n class=\"btn btn-sm btn-secondary\"\r\n (click)=\"selectFacetValueClick.emit([variant.id])\"\r\n >\r\n <clr-icon shape=\"plus\"></clr-icon>\r\n {{ 'catalog.add-facets' | translate }}\r\n </button>\r\n </div>\r\n </div>\r\n </div>\r\n <ng-container *vdrIfMultichannel>\r\n <div class=\"card-block\" *vdrIfDefaultChannelActive>\r\n <div class=\"flex channel-assignment\">\r\n <ng-container *ngFor=\"let channel of variant.channels\">\r\n <vdr-chip\r\n *ngIf=\"!isDefaultChannel(channel.code)\"\r\n icon=\"times-circle\"\r\n [title]=\"'catalog.remove-from-channel' | translate\"\r\n (iconClick)=\"\r\n removeFromChannel.emit({ channelId: channel.id, variant: variant })\r\n \"\r\n >\r\n <vdr-channel-badge [channelCode]=\"channel.code\"></vdr-channel-badge>\r\n {{ channel.code | channelCodeToLabel }}\r\n </vdr-chip>\r\n </ng-container>\r\n <button class=\"btn btn-sm\" (click)=\"assignToChannel.emit(variant)\">\r\n <clr-icon shape=\"layers\"></clr-icon>\r\n {{ 'catalog.assign-to-channel' | translate }}\r\n </button>\r\n </div>\r\n </div>\r\n </ng-container>\r\n </ng-container>\r\n </div>\r\n</div>\r\n",
|
|
3804
|
-
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
3805
|
-
styles: [".with-selected{display:flex;min-height:52px;align-items:center;border:1px solid var(--color-component-border-100);border-radius:3px;padding:6px 18px}.with-selected vdr-select-toggle{margin-right:12px}.with-selected>label{margin-right:12px}.variant-container{transition:background-color .2s;min-height:330px}.variant-container.disabled{background-color:var(--color-component-bg-200)}.variant-container .header-row{display:flex;align-items:center;flex-wrap:wrap}.variant-container .variant-body{display:flex;flex-direction:column}@media screen and (min-width: 768px){.variant-container .variant-body{flex-direction:row}}.variant-container .details{display:flex;flex-direction:column;flex:1;margin-right:12px}@media screen and (min-width: 768px){.variant-container .details{flex-direction:row;height:36px}}.variant-container .details .name{flex:1}.variant-container .details .name ::ng-deep .clr-control-container{width:100%}.variant-container .details .name ::ng-deep .clr-control-container input.clr-input{min-width:100%}.variant-container .details .sku{width:160px;margin-right:20px;flex:0}.variant-container .details ::ng-deep .name input{min-width:300px}.variant-container .right-controls{display:flex}.variant-container .tax-category-label{margin-top:3px}.variant-container .variant-form-inputs{flex:1;display:flex;flex-direction:column}@media screen and (min-width: 768px){.variant-container .variant-form-inputs{flex-direction:row}}.variant-container .variant-form-input-row{display:flex;flex-wrap:wrap}@media screen and (min-width: 768px){.variant-container .variant-form-input-row{margin:0 6px 8px 24px}}.variant-container .variant-form-input-row>*{margin-right:24px;margin-bottom:24px}.variant-container .track-inventory-toggle{margin-top:22px}.variant-container .clr-form-control{margin-top:0}.variant-container .facets{display:flex;flex-wrap:wrap;align-items:center}.variant-container .pricing{display:flex}.variant-container .pricing>div{margin-right:12px}.variant-container .option-group-name{color:var(--color-text-200);text-transform:uppercase;font-size:10px;margin-right:3px;height:11px}.variant-container .options-facets{display:flex;color:var(--color-grey-400)}.variant-container ::ng-deep .clr-control-container{width:100%}.channel-assignment{justify-content:flex-end;flex-wrap:wrap;max-height:110px;overflow-y:auto}.channel-assignment .btn{margin:6px 12px 6px 0}.out-of-stock-threshold-wrapper{display:flex;flex-direction:column}.out-of-stock-threshold-wrapper clr-toggle-wrapper{margin-left:24px}.inventory-untracked{opacity:.5}\n"]
|
|
3806
|
-
},] }
|
|
3807
|
-
];
|
|
3808
|
-
ProductVariantsListComponent.ctorParameters = () => [
|
|
3809
|
-
{ type: ChangeDetectorRef },
|
|
3810
|
-
{ type: ModalService },
|
|
3811
|
-
{ type: DataService }
|
|
3812
|
-
];
|
|
3813
|
-
ProductVariantsListComponent.propDecorators = {
|
|
3814
|
-
formArray: [{ type: Input, args: ['productVariantsFormArray',] }],
|
|
3815
|
-
variants: [{ type: Input }],
|
|
3816
|
-
paginationConfig: [{ type: Input }],
|
|
3817
|
-
channelPriceIncludesTax: [{ type: Input }],
|
|
3818
|
-
taxCategories: [{ type: Input }],
|
|
3819
|
-
facets: [{ type: Input }],
|
|
3820
|
-
optionGroups: [{ type: Input }],
|
|
3821
|
-
customFields: [{ type: Input }],
|
|
3822
|
-
customOptionFields: [{ type: Input }],
|
|
3823
|
-
activeLanguage: [{ type: Input }],
|
|
3824
|
-
pendingAssetChanges: [{ type: Input }],
|
|
3825
|
-
assignToChannel: [{ type: Output }],
|
|
3826
|
-
removeFromChannel: [{ type: Output }],
|
|
3827
|
-
assetChange: [{ type: Output }],
|
|
3828
|
-
selectionChange: [{ type: Output }],
|
|
3829
|
-
selectFacetValueClick: [{ type: Output }],
|
|
3830
|
-
updateProductOption: [{ type: Output }]
|
|
3831
|
-
};
|
|
3832
|
-
|
|
3833
|
-
class ProductVariantsTableComponent {
|
|
3834
|
-
constructor(changeDetector) {
|
|
3835
|
-
this.changeDetector = changeDetector;
|
|
3836
|
-
this.formGroupMap = new Map();
|
|
3837
|
-
this.updatePermission = [Permission.UpdateCatalog, Permission.UpdateProduct];
|
|
3838
|
-
}
|
|
3839
|
-
ngOnInit() {
|
|
3840
|
-
this.subscription = this.formArray.valueChanges
|
|
3841
|
-
.pipe(map(value => value.length), debounceTime(1), distinctUntilChanged())
|
|
3842
|
-
.subscribe(() => {
|
|
3843
|
-
this.buildFormGroupMap();
|
|
3844
|
-
});
|
|
3845
|
-
this.buildFormGroupMap();
|
|
3846
|
-
}
|
|
3847
|
-
ngOnDestroy() {
|
|
3848
|
-
if (this.subscription) {
|
|
3849
|
-
this.subscription.unsubscribe();
|
|
3850
|
-
}
|
|
3851
|
-
}
|
|
3852
|
-
trackByFn(index, item) {
|
|
3853
|
-
if (item.id != null) {
|
|
3854
|
-
return item.id;
|
|
3855
|
-
}
|
|
3856
|
-
else {
|
|
3857
|
-
return index;
|
|
3858
|
-
}
|
|
3859
|
-
}
|
|
3860
|
-
getFeaturedAsset(variant) {
|
|
3861
|
-
var _a;
|
|
3862
|
-
return ((_a = this.pendingAssetChanges[variant.id]) === null || _a === void 0 ? void 0 : _a.featuredAsset) || variant.featuredAsset;
|
|
3863
|
-
}
|
|
3864
|
-
optionGroupName(optionGroupId) {
|
|
3865
|
-
const group = this.optionGroups.find(g => g.id === optionGroupId);
|
|
3866
|
-
return group && group.name;
|
|
3867
|
-
}
|
|
3868
|
-
buildFormGroupMap() {
|
|
3869
|
-
this.formGroupMap.clear();
|
|
3870
|
-
for (const controlGroup of this.formArray.controls) {
|
|
3871
|
-
this.formGroupMap.set(controlGroup.value.id, controlGroup);
|
|
3872
|
-
}
|
|
3873
|
-
this.changeDetector.markForCheck();
|
|
3874
|
-
}
|
|
3875
|
-
}
|
|
3876
|
-
ProductVariantsTableComponent.decorators = [
|
|
3877
|
-
{ type: Component, args: [{
|
|
3878
|
-
selector: 'vdr-product-variants-table',
|
|
3879
|
-
template: "<table class=\"table\">\r\n <thead>\r\n <tr>\r\n <th></th>\r\n <th>{{ 'common.name' | translate }}</th>\r\n <th>{{ 'catalog.sku' | translate }}</th>\r\n <ng-container *ngFor=\"let optionGroup of optionGroups | sort: 'id'\">\r\n <th>{{ optionGroup.name }}</th>\r\n </ng-container>\r\n <th>{{ 'catalog.price' | translate }}</th>\r\n <th>{{ 'catalog.stock-on-hand' | translate }}</th>\r\n <th>{{ 'common.enabled' | translate }}</th>\r\n </tr>\r\n </thead>\r\n <tbody>\r\n <tr *ngFor=\"let variant of variants | paginate: paginationConfig; index as i; trackBy: trackByFn\">\r\n <ng-container *ngIf=\"formGroupMap.get(variant.id) as formGroup\" [formGroup]=\"formGroup\">\r\n <td class=\"left align-middle\" [class.disabled]=\"!formGroup.get('enabled')!.value\">\r\n <div class=\"card-img\">\r\n <div class=\"featured-asset\">\r\n <img\r\n *ngIf=\"getFeaturedAsset(variant) as featuredAsset; else placeholder\"\r\n [src]=\"featuredAsset | assetPreview: 'tiny'\"\r\n />\r\n <ng-template #placeholder>\r\n <div class=\"placeholder\">\r\n <clr-icon shape=\"image\" size=\"48\"></clr-icon>\r\n </div>\r\n </ng-template>\r\n </div>\r\n </div>\r\n </td>\r\n <td class=\"left align-middle\" [class.disabled]=\"!formGroup.get('enabled')!.value\">\r\n <clr-input-container>\r\n <input\r\n clrInput\r\n type=\"text\"\r\n formControlName=\"name\"\r\n [readonly]=\"!(updatePermission | hasPermission)\"\r\n [placeholder]=\"'common.name' | translate\"\r\n />\r\n </clr-input-container>\r\n </td>\r\n <td class=\"left align-middle\" [class.disabled]=\"!formGroup.get('enabled')!.value\">\r\n <clr-input-container>\r\n <input\r\n clrInput\r\n type=\"text\"\r\n formControlName=\"sku\"\r\n [readonly]=\"!(updatePermission | hasPermission)\"\r\n [placeholder]=\"'catalog.sku' | translate\"\r\n />\r\n </clr-input-container>\r\n </td>\r\n <ng-container *ngFor=\"let option of variant.options | sort: 'groupId'\">\r\n <td\r\n class=\"left align-middle\"\r\n [class.disabled]=\"!formGroup.get('enabled')!.value\"\r\n [style.color]=\"optionGroupName(option.groupId) | stringToColor\"\r\n >\r\n {{ option.name }}\r\n </td>\r\n </ng-container>\r\n <td class=\"left align-middle price\" [class.disabled]=\"!formGroup.get('enabled')!.value\">\r\n <clr-input-container>\r\n <vdr-currency-input\r\n *ngIf=\"!channelPriceIncludesTax\"\r\n clrInput\r\n [currencyCode]=\"variant.currencyCode\"\r\n [readonly]=\"!(updatePermission | hasPermission)\"\r\n formControlName=\"price\"\r\n ></vdr-currency-input>\r\n <vdr-currency-input\r\n *ngIf=\"channelPriceIncludesTax\"\r\n clrInput\r\n [currencyCode]=\"variant.currencyCode\"\r\n [readonly]=\"!(updatePermission | hasPermission)\"\r\n formControlName=\"priceWithTax\"\r\n ></vdr-currency-input>\r\n </clr-input-container>\r\n </td>\r\n <td class=\"left align-middle stock\" [class.disabled]=\"!formGroup.get('enabled')!.value\">\r\n <clr-input-container>\r\n <input\r\n clrInput\r\n type=\"number\"\r\n min=\"0\"\r\n step=\"1\"\r\n formControlName=\"stockOnHand\"\r\n [readonly]=\"!(updatePermission | hasPermission)\"\r\n />\r\n </clr-input-container>\r\n </td>\r\n <td class=\"left align-middle stock\" [class.disabled]=\"!formGroup.get('enabled')!.value\">\r\n <clr-toggle-wrapper>\r\n <input\r\n type=\"checkbox\"\r\n clrToggle\r\n name=\"enabled\"\r\n formControlName=\"enabled\"\r\n [vdrDisabled]=\"!(updatePermission | hasPermission)\"\r\n />\r\n </clr-toggle-wrapper>\r\n </td>\r\n </ng-container>\r\n </tr>\r\n </tbody>\r\n</table>\r\n",
|
|
3880
|
-
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
3881
|
-
styles: [".placeholder{color:var(--color-grey-300)}.stock input,.price input{max-width:96px}td{transition:background-color .2s}td.disabled{background-color:var(--color-component-bg-200)}\n"]
|
|
3882
|
-
},] }
|
|
3883
|
-
];
|
|
3884
|
-
ProductVariantsTableComponent.ctorParameters = () => [
|
|
3885
|
-
{ type: ChangeDetectorRef }
|
|
3886
|
-
];
|
|
3887
|
-
ProductVariantsTableComponent.propDecorators = {
|
|
3888
|
-
formArray: [{ type: Input, args: ['productVariantsFormArray',] }],
|
|
3889
|
-
variants: [{ type: Input }],
|
|
3890
|
-
paginationConfig: [{ type: Input }],
|
|
3891
|
-
channelPriceIncludesTax: [{ type: Input }],
|
|
3892
|
-
optionGroups: [{ type: Input }],
|
|
3893
|
-
pendingAssetChanges: [{ type: Input }]
|
|
3894
|
-
};
|
|
3895
|
-
|
|
3896
|
-
class VariantPriceDetailComponent {
|
|
3897
|
-
constructor(dataService) {
|
|
3898
|
-
this.dataService = dataService;
|
|
3899
|
-
this.priceChange$ = new BehaviorSubject(0);
|
|
3900
|
-
this.taxCategoryIdChange$ = new BehaviorSubject('');
|
|
3901
|
-
}
|
|
3902
|
-
ngOnInit() {
|
|
3903
|
-
const taxRates$ = this.dataService.settings
|
|
3904
|
-
.getTaxRatesSimple(999, 0, 'cache-first')
|
|
3905
|
-
.mapStream(data => data.taxRates.items);
|
|
3906
|
-
const activeChannel$ = this.dataService.settings
|
|
3907
|
-
.getActiveChannel('cache-first')
|
|
3908
|
-
.refetchOnChannelChange()
|
|
3909
|
-
.mapStream(data => data.activeChannel);
|
|
3910
|
-
this.taxRate$ = combineLatest(activeChannel$, taxRates$, this.taxCategoryIdChange$).pipe(map(([channel, taxRates, taxCategoryId]) => {
|
|
3911
|
-
const defaultTaxZone = channel.defaultTaxZone;
|
|
3912
|
-
if (!defaultTaxZone) {
|
|
3913
|
-
return 0;
|
|
3914
|
-
}
|
|
3915
|
-
const applicableRate = taxRates.find(taxRate => taxRate.zone.id === defaultTaxZone.id && taxRate.category.id === taxCategoryId);
|
|
3916
|
-
if (!applicableRate) {
|
|
3917
|
-
return 0;
|
|
3918
|
-
}
|
|
3919
|
-
return applicableRate.value;
|
|
3920
|
-
}));
|
|
3921
|
-
this.grossPrice$ = combineLatest(this.taxRate$, this.priceChange$).pipe(map(([taxRate, price]) => {
|
|
3922
|
-
return Math.round(price * ((100 + taxRate) / 100));
|
|
3923
|
-
}));
|
|
3924
|
-
}
|
|
3925
|
-
ngOnChanges(changes) {
|
|
3926
|
-
if ('price' in changes) {
|
|
3927
|
-
this.priceChange$.next(changes.price.currentValue);
|
|
3928
|
-
}
|
|
3929
|
-
if ('taxCategoryId' in changes) {
|
|
3930
|
-
this.taxCategoryIdChange$.next(changes.taxCategoryId.currentValue);
|
|
3931
|
-
}
|
|
3932
|
-
}
|
|
3933
|
-
}
|
|
3934
|
-
VariantPriceDetailComponent.decorators = [
|
|
3935
|
-
{ type: Component, args: [{
|
|
3936
|
-
selector: 'vdr-variant-price-detail',
|
|
3937
|
-
template: "<label class=\"clr-control-label\">{{ 'catalog.taxes' | translate }}</label>\r\n<div *ngIf=\"priceIncludesTax\" class=\"value\">\r\n {{ 'catalog.price-includes-tax-at' | translate: { rate: taxRate$ | async } }}\r\n</div>\r\n<div *ngIf=\"!priceIncludesTax\" class=\"value\">\r\n {{\r\n 'catalog.price-with-tax-in-default-zone'\r\n | translate: { price: grossPrice$ | async | localeCurrency: currencyCode, rate: taxRate$ | async }\r\n }}\r\n</div>\r\n",
|
|
3938
|
-
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
3939
|
-
styles: [":host{display:flex;flex-direction:column}.value{margin-top:3px}\n"]
|
|
3940
|
-
},] }
|
|
3941
|
-
];
|
|
3942
|
-
VariantPriceDetailComponent.ctorParameters = () => [
|
|
3943
|
-
{ type: DataService }
|
|
3944
|
-
];
|
|
3945
|
-
VariantPriceDetailComponent.propDecorators = {
|
|
3946
|
-
priceIncludesTax: [{ type: Input }],
|
|
3947
|
-
price: [{ type: Input }],
|
|
3948
|
-
currencyCode: [{ type: Input }],
|
|
3949
|
-
taxCategoryId: [{ type: Input }]
|
|
3950
|
-
};
|
|
3951
|
-
|
|
3952
|
-
const CATALOG_COMPONENTS = [
|
|
3953
|
-
ProductListComponent,
|
|
3954
|
-
ProductDetailComponent,
|
|
3955
|
-
FacetListComponent,
|
|
3956
|
-
FacetDetailComponent,
|
|
3957
|
-
GenerateProductVariantsComponent,
|
|
3958
|
-
ProductVariantsListComponent,
|
|
3959
|
-
ApplyFacetDialogComponent,
|
|
3960
|
-
AssetListComponent,
|
|
3961
|
-
AssetsComponent,
|
|
3962
|
-
VariantPriceDetailComponent,
|
|
3963
|
-
CollectionListComponent,
|
|
3964
|
-
CollectionDetailComponent,
|
|
3965
|
-
CollectionTreeComponent,
|
|
3966
|
-
CollectionTreeNodeComponent,
|
|
3967
|
-
CollectionContentsComponent,
|
|
3968
|
-
ProductVariantsTableComponent,
|
|
3969
|
-
OptionValueInputComponent,
|
|
3970
|
-
UpdateProductOptionDialogComponent,
|
|
3971
|
-
ProductVariantsEditorComponent,
|
|
3972
|
-
AssignProductsToChannelDialogComponent,
|
|
3973
|
-
AssetDetailComponent,
|
|
3974
|
-
ConfirmVariantDeletionDialogComponent,
|
|
3975
|
-
ProductOptionsEditorComponent,
|
|
3976
|
-
];
|
|
3977
|
-
class CatalogModule {
|
|
3978
|
-
}
|
|
3979
|
-
CatalogModule.decorators = [
|
|
3980
|
-
{ type: NgModule, args: [{
|
|
3981
|
-
imports: [SharedModule, RouterModule.forChild(catalogRoutes)],
|
|
3982
|
-
exports: [...CATALOG_COMPONENTS],
|
|
3983
|
-
declarations: [...CATALOG_COMPONENTS],
|
|
3984
|
-
},] }
|
|
3985
|
-
];
|
|
3986
|
-
|
|
3987
|
-
// This file was generated by the build-public-api.ts script
|
|
3988
|
-
|
|
3989
|
-
/**
|
|
3990
|
-
* Generated bundle index. Do not edit.
|
|
3991
|
-
*/
|
|
3992
|
-
|
|
3993
|
-
export { ApplyFacetDialogComponent, AssetDetailComponent, AssetListComponent, AssetResolver, AssetsComponent, AssignProductsToChannelDialogComponent, CatalogModule, CollectionContentsComponent, CollectionDetailComponent, CollectionListComponent, CollectionResolver, CollectionTreeComponent, CollectionTreeNodeComponent, ConfirmVariantDeletionDialogComponent, FacetDetailComponent, FacetListComponent, FacetResolver, GenerateProductVariantsComponent, GeneratedVariant, OPTION_VALUE_INPUT_VALUE_ACCESSOR, OptionValueInputComponent, ProductDetailComponent, ProductDetailService, ProductListComponent, ProductOptionsEditorComponent, ProductResolver, ProductVariantsEditorComponent, ProductVariantsListComponent, ProductVariantsResolver, ProductVariantsTableComponent, UpdateProductOptionDialogComponent, VariantPriceDetailComponent, arrayToTree, assetBreadcrumb, catalogRoutes, collectionBreadcrumb, facetBreadcrumb, productBreadcrumb, productOptionsEditorBreadcrumb, productVariantEditorBreadcrumb, replaceLast, ɵ0, ɵ1, ɵ2, ɵ3, ɵ4, ɵ5, ɵ6, ɵ7, ɵ8, ɵ9 };
|
|
3994
|
-
//# sourceMappingURL=vendure-admin-ui-catalog.js.map
|