wickes-css2 2.103.0-IC-976-pre-commit-lint.1 → 2.103.0-IC-976-pre-commit-lint.3
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/build/css/main.css +1 -1
- package/build/css/pages/page_book-consultant-thank-you-new.css +1 -1
- package/build/css/pages/page_pre_home_thank-you.css +1 -1
- package/build/css/pages/page_top-rated.css +1 -1
- package/build/img/TradePaint.svg +42 -14
- package/build/img/apple-pay.svg +12 -7
- package/build/img/big-white-apple-pay.svg +10 -5
- package/build/img/billie-logo.svg +4 -2
- package/build/img/billie-modal.svg +4 -2
- package/build/img/billie-pdp.svg +12 -9
- package/build/img/billie-spinner.svg +5 -3
- package/build/img/billie.svg +3 -1
- package/build/img/clearpay-logo.svg +6 -1
- package/build/img/clearpay-spinner.svg +4 -1
- package/build/img/energy-efficiency/energy-marker.svg +12 -1
- package/build/img/google-spinner.svg +14 -7
- package/build/img/googlepay.svg +23 -12
- package/build/img/home-banner_arrow.svg +7 -1
- package/build/img/ic-menu.svg +7 -1
- package/build/img/ic_info_big.svg +4 -1
- package/build/img/klarna-big.svg +18 -9
- package/build/img/klarna-sm.svg +5 -2
- package/build/img/klarna-spinner.svg +3 -1
- package/build/img/logo-klarna.svg +5 -2
- package/build/img/mastercard.svg +6 -3
- package/build/img/payapal_text.svg +6 -1
- package/build/img/payment/checkout/applepay.svg +12 -7
- package/build/img/payment/checkout/billie.svg +4 -2
- package/build/img/payment/checkout/clearpay.svg +5 -1
- package/build/img/payment/checkout/googlepay.svg +23 -12
- package/build/img/payment/checkout/mastercard.svg +13 -1
- package/build/img/payment/checkout/paypal.svg +37 -1
- package/build/img/payment/checkout/visa.svg +8 -1
- package/build/img/payment/footer/applepay.svg +12 -7
- package/build/img/payment/footer/billie.svg +3 -1
- package/build/img/payment/footer/clearpay.svg +18 -10
- package/build/img/payment/footer/googlepay.svg +23 -12
- package/build/img/payment/footer/mastercard.svg +13 -1
- package/build/img/payment/footer/paypal.svg +37 -1
- package/build/img/payment/footer/visa.svg +8 -1
- package/build/img/paypal.svg +8 -1
- package/build/img/paypal_logo_loader_paypal.svg +4 -1
- package/build/img/paypal_logo_loader_pp.svg +10 -1
- package/build/img/placeholders/full-width-img.svg +9 -1
- package/build/img/placeholders/img-2-to-1.svg +9 -1
- package/build/img/placeholders/img-3-to-4.svg +9 -1
- package/build/img/placeholders/img-4-to-3.svg +9 -1
- package/build/img/proposition_arrow_click.svg +7 -1
- package/build/img/proposition_delivery.svg +7 -1
- package/build/img/proposition_price.svg +7 -1
- package/build/img/proposition_returns.svg +7 -1
- package/build/img/social-icon-facebook.svg +8 -1
- package/build/img/social-icon-instagram.svg +15 -1
- package/build/img/social-icon-pinterest.svg +7 -1
- package/build/img/socials/facebook.svg +5 -1
- package/build/img/socials/instagram.svg +5 -1
- package/build/img/socials/pinterest.svg +5 -1
- package/build/img/socials/tiktok.svg +5 -1
- package/build/img/socials/x-twitter.svg +5 -1
- package/build/img/socials/youtube.svg +5 -1
- package/build/img/socials_facebook_color.svg +7 -1
- package/build/img/socials_facebook_white_blue_color.svg +5 -1
- package/build/img/socials_info_big.svg +7 -1
- package/build/img/socials_instagram_color.svg +16 -1
- package/build/img/socials_pinterest_color.svg +4 -1
- package/build/img/socials_twitter_color.svg +4 -1
- package/build/img/socials_whatsapp_color.svg +5 -1
- package/build/img/socials_youtube_color.svg +4 -1
- package/build/img/stars.svg +8 -1
- package/build/img/visa-logo.svg +3 -1
- package/build/img/wickes-dc-logo.svg +17 -13
- package/build/img/wickes-logo-v2.svg +15 -1
- package/build/img/wickes-logo.svg +36 -1
- package/build/img/young-minds.svg +10 -8
- package/build/js/account-members.min.js +1 -1
- package/build/js/basket.min.js +2 -2
- package/build/js/bootstrap.bundle.min.js +1 -1
- package/build/js/bundle.min.js +1 -1
- package/build/js/checkout.min.js +2 -2
- package/build/js/emulation.min.js +11866 -10333
- package/build/js/general.bundle.min.js +1 -1
- package/build/js/iframeResizer.min.js +2 -2
- package/build/js/kitchen/kitchen-plp.min.js +1 -1
- package/build/js/merged-checkout.min.js +2 -2
- package/build/js/my-orders.min.js +1 -1
- package/build/js/page/accordion.js +31 -29
- package/build/js/page/account-deletion.js +13 -13
- package/build/js/page/account-hub.js +128 -119
- package/build/js/page/account-members.js +229 -216
- package/build/js/page/address-book.js +186 -184
- package/build/js/page/basket/add-project-list-id.js +158 -130
- package/build/js/page/basket/clearpay.js +17 -17
- package/build/js/page/basket/display-energy-efficiency.js +13 -13
- package/build/js/page/basket/gtm.js +60 -54
- package/build/js/page/basket/klarna.js +2 -2
- package/build/js/page/basket/paypal.js +33 -33
- package/build/js/page/basket/session-sync.js +5 -5
- package/build/js/page/basket/summary-mobile.js +16 -16
- package/build/js/page/basket/wisdom.js +54 -39
- package/build/js/page/basket-v2.js +415 -261
- package/build/js/page/basket.js +42 -39
- package/build/js/page/billie-business-type.js +22 -22
- package/build/js/page/business-account-form.js +12 -12
- package/build/js/page/buying-guides-guttering.js +3 -3
- package/build/js/page/category-landing.js +18 -11
- package/build/js/page/change-password.js +100 -99
- package/build/js/page/checkout-confirmation-new.js +127 -70
- package/build/js/page/checkout-confirmation.js +6 -6
- package/build/js/page/checkout-delivery-address.js +35 -32
- package/build/js/page/checkout-delivery-details-loader.js +2 -5
- package/build/js/page/checkout-edit-address.js +1 -1
- package/build/js/page/checkout-payment-details.js +170 -172
- package/build/js/page/checkout-sign-in.js +15 -11
- package/build/js/page/checkout.js +1 -1
- package/build/js/page/cms-homepage.js +87 -45
- package/build/js/page/components/charity.js +114 -120
- package/build/js/page/components/csrf.js +4 -4
- package/build/js/page/components/discounts.js +39 -39
- package/build/js/page/components/favourite-product.js +125 -113
- package/build/js/page/components/global-search.js +204 -192
- package/build/js/page/components/modal-observer.js +43 -46
- package/build/js/page/components/order-summary.js +26 -22
- package/build/js/page/components/pagination.js +124 -117
- package/build/js/page/components/retry-action.js +2 -2
- package/build/js/page/components/saving-shopping-list.js +381 -314
- package/build/js/page/components/sticky-order-observer.js +36 -39
- package/build/js/page/components/voucher.js +46 -47
- package/build/js/page/copy-project-id.js +23 -23
- package/build/js/page/countdown-timer.js +6 -6
- package/build/js/page/default-store.js +40 -34
- package/build/js/page/design-appointment.js +6 -3
- package/build/js/page/energy-efficiency.js +39 -25
- package/build/js/page/finance-tabs.js +4 -4
- package/build/js/page/general/cookie.js +20 -10
- package/build/js/page/installation/calculator.js +12 -16
- package/build/js/page/installation/fi.js +76 -71
- package/build/js/page/installation/generic.js +21 -20
- package/build/js/page/installation/installation.js +36 -22
- package/build/js/page/installation/pdp-generic.js +3 -9
- package/build/js/page/installation/ti.js +26 -24
- package/build/js/page/installer-files-form.js +98 -76
- package/build/js/page/installer-form.js +502 -447
- package/build/js/page/installer-validation.js +848 -761
- package/build/js/page/instore-checkout.js +2 -2
- package/build/js/page/kitchen/card-carousel.js +21 -21
- package/build/js/page/kitchen/colour-swatches.js +153 -149
- package/build/js/page/kitchen/kitchen-card.js +62 -64
- package/build/js/page/kitchen/mobile-nav.js +26 -27
- package/build/js/page/kitchen/plp-filters-chips.js +72 -70
- package/build/js/page/kitchen/plp-filters-mobile.js +64 -60
- package/build/js/page/kitchen/plp-filters-panel.js +106 -102
- package/build/js/page/kitchen/plp-filters-utils.js +54 -53
- package/build/js/page/kitchen/plp-filters.js +210 -194
- package/build/js/page/kitchen/sort-by.js +149 -149
- package/build/js/page/klarna-modal-scroll-disable.js +4 -4
- package/build/js/page/merged-checkout.js +6 -3
- package/build/js/page/my-account.js +44 -46
- package/build/js/page/my-orders.js +153 -149
- package/build/js/page/online-exclusive.js +28 -31
- package/build/js/page/pdp-favourite.js +4 -4
- package/build/js/page/pdp-tile.js +0 -4
- package/build/js/page/pdp.js +41 -37
- package/build/js/page/personal-details.js +307 -277
- package/build/js/page/plp-cards-v2.js +39 -25
- package/build/js/page/plp-favourite.js +9 -9
- package/build/js/page/plp-img-v2.js +2 -3
- package/build/js/page/plp-load-more.js +66 -66
- package/build/js/page/plp.js +9 -10
- package/build/js/page/pre-home.js +159 -144
- package/build/js/page/project-list/generate-project-id.js +77 -68
- package/build/js/page/project-list-note.js +234 -232
- package/build/js/page/project-list.js +2 -3
- package/build/js/page/quiz.js +292 -292
- package/build/js/page/select-address.js +27 -14
- package/build/js/page/smart-banner.js +8 -5
- package/build/js/page/ti.js +67 -42
- package/build/js/page/top-rated.js +36 -29
- package/build/js/page/track-my-order.js +172 -156
- package/build/js/page/tradePro-rewards.js +34 -36
- package/build/js/page/utils/array-utils.js +13 -10
- package/build/js/page/utils/copy-to-clipboard.js +45 -45
- package/build/js/page/utils/create-event.js +8 -8
- package/build/js/page/utils/errorMesages.js +12 -11
- package/build/js/page/utils/helpers.js +14 -9
- package/build/js/page/utils/http-action.js +4 -5
- package/build/js/page/utils/loader.js +5 -5
- package/build/js/page/utils/routes.js +9 -9
- package/build/js/page/utils/url-query.js +4 -4
- package/build/js/page/utils/validation.js +93 -96
- package/build/js/page/wickes-dc.js +51 -44
- package/build/js/page/wismo.js +12 -12
- package/build/js/page/your-details.js +77 -41
- package/build/js/pdp-favourite-product.bundle.min.js +1 -1
- package/build/js/pdp.bundle.min.js +1 -1
- package/build/js/personal-details.min.js +1 -1
- package/build/js/plp-favourite-product.bundle.min.js +1 -1
- package/build/js/plp.bundle.min.js +1 -1
- package/build/js/project-list.min.js +16 -16
- package/build/js/pstrength.min.js +28 -34
- package/build/js/wickers.json +2069 -2069
- package/package.json +7 -3
- package/src/data/data_account-families.json +1 -1
- package/src/data/data_bathroom-installation.json +1 -1
- package/src/data/data_bathroom-ranges.json +14 -14
- package/src/data/data_business-pages.json +27 -27
- package/src/data/data_calendar.json +7 -1
- package/src/data/data_checkout-order.json +306 -306
- package/src/data/data_contact-us-form.json +17 -17
- package/src/data/data_contact-us-reasons.json +16 -16
- package/src/data/data_design-appointment.json +27 -12
- package/src/data/data_discounts.json +4 -4
- package/src/data/data_fdl-new-product.json +6 -6
- package/src/data/data_fdl-product.json +75 -87
- package/src/data/data_flooring-installation.json +6 -6
- package/src/data/data_great-quality.json +2 -2
- package/src/data/data_heating-plumbing.json +2 -2
- package/src/data/data_how-to_fit-corrugated-sheeting.json +245 -258
- package/src/data/data_journey-price-lists.json +1 -1
- package/src/data/data_kb-brouchure-requests.json +10 -10
- package/src/data/data_kitchen-brochure-request.json +1 -1
- package/src/data/data_kitchen-cabinets.json +1 -1
- package/src/data/data_kitchen-plp.json +24 -18
- package/src/data/data_kitchen-ranges.json +21 -23
- package/src/data/data_latest-offers.json +1044 -1044
- package/src/data/data_locators.json +130 -132
- package/src/data/data_next-steps.json +20 -20
- package/src/data/data_notification-page.json +72 -24
- package/src/data/data_online-ranges.json +1 -1
- package/src/data/data_page-category-hub.json +1 -1
- package/src/data/data_page-confirmation.json +9 -9
- package/src/data/data_page-project-multiple-list.json +18 -18
- package/src/data/data_pre-home.json +1090 -1082
- package/src/data/data_price-event-new.json +1 -1
- package/src/data/data_saved-project-list.json +8 -8
- package/src/data/data_seo-widgets.json +31 -31
- package/src/data/data_shopping-cart-v2.json +1 -2
- package/src/data/data_shopping-cart-with-energy.json +229 -229
- package/src/data/data_storage-solutions.json +99 -99
- package/src/data/data_tile-installation.json +1 -1
- package/src/data/data_top-rated-perfect-product.json +204 -204
- package/src/data/data_trade-essentials.json +1 -1
- package/src/data/data_tradePro_cards.json +0 -1
- package/src/data/data_user-address-saved.json +33 -33
- package/src/data/data_voucher_tradePro.json +5 -5
- package/src/data/data_wismo.json +12 -12
- package/src/data/how-to-guides/data-how_to_fit-bath-and-taps.json +2 -2
- package/src/data/how-to-guides/data_how-to-change-door-window-furniture.json +274 -274
- package/src/data/how-to-guides/data_how-to-fit-door-locks.json +3 -8
- package/src/data/how-to-guides/data_how-to-fit-worktop.json +5 -13
- package/src/data/how-to-guides/data_how-to-fit_basin-and-taps.json +2 -6
- package/src/data/how-to-guides/data_how-to-fit_bath-and-taps.json +3 -10
- package/src/data/how-to-guides/data_how-to-plumb-a-kitchen-appliance.json +3 -7
- package/src/data/how-to-guides/data_how-to-unblock-sink.json +5 -7
- package/src/data/how-to-guides/data_how-to_bleed-radiator.json +134 -134
- package/src/data/how-to-guides/data_how-to_build-raised-deck.json +4 -4
- package/src/data/how-to-guides/data_how-to_change-socket.json +2 -2
- package/src/data/how-to-guides/data_how-to_fit-guttering.json +282 -282
- package/src/data/how-to-guides/data_how-to_fit-toilet.json +2 -2
- package/src/data/how-to-guides/data_how-to_fit-wall-tiles.json +77 -23
- package/src/data/how-to-guides/data_how-to_fit-worktops.json +3 -4
- package/src/data/how-to-guides/data_how-to_fix-leaking-sink.json +3 -3
- package/src/data/how-to-guides/data_how-to_fix-leaking-tap.json +3 -3
- package/src/data/how-to-guides/data_how-to_garden-calendar.json +4 -5
- package/src/data/how-to-guides/data_how-to_grow-fruit-veg.json +3 -3
- package/src/data/how-to-guides/data_how-to_hang-internal-door.json +266 -266
- package/src/data/how-to-guides/data_how-to_install-artificial-grass.json +3 -4
- package/src/data/how-to-guides/data_how-to_install-base-wall-cabinets.json +3 -4
- package/src/data/how-to-guides/data_how-to_install-composite-decking.json +6 -14
- package/src/data/how-to-guides/data_how-to_install-deck-lighting.json +4 -7
- package/src/data/how-to-guides/data_how-to_install-fence.json +5 -5
- package/src/data/how-to-guides/data_how-to_insulate-loft.json +2 -2
- package/src/data/how-to-guides/data_how-to_lay-deck.json +4 -6
- package/src/data/how-to-guides/data_how-to_lay-laminate-flooring.json +3 -8
- package/src/data/how-to-guides/data_how-to_lay-maintain-turf.json +4 -4
- package/src/data/how-to-guides/data_how-to_lay-path.json +5 -6
- package/src/data/how-to-guides/data_how-to_lay-patio.json +5 -5
- package/src/data/how-to-guides/data_how-to_lay-solid-wood-flooring.json +0 -8
- package/src/data/how-to-guides/data_how-to_lay-vinyl-carpet-tiles.json +3 -3
- package/src/data/how-to-guides/data_how-to_paint-a-room.json +5 -5
- package/src/data/how-to-guides/data_how-to_plaster-wall.json +8 -6
- package/src/data/how-to-guides/data_how-to_plumb-kitchen-appliances.json +3 -3
- package/src/data/how-to-guides/data_how-to_prepare-interior-woodwork.json +5 -5
- package/src/data/how-to-guides/data_how-to_prepare-paint-exterior-walls.json +1 -1
- package/src/data/how-to-guides/data_how-to_prepare-wall-and-ceilings.json +9 -9
- package/src/data/how-to-guides/data_how-to_put_up_shelf.json +4 -4
- package/src/data/how-to-guides/data_how-to_remove-replace-tiles.json +3 -3
- package/src/data/how-to-guides/data_how-to_repair-wall.json +384 -385
- package/src/data/how-to-guides/data_how-to_tile-bathroom.json +3 -4
- package/src/data/how-to-guides/data_how-to_unblock-sink.json +3 -3
- package/src/data/how-to-guides/data_install-composite-decking.json +4 -4
- package/src/data/how-to-guides/data_planting-techniques.json +3 -3
- package/src/data/how-to-guides/fit-roofing-shingles.json +4 -4
- package/src/data/how-to-guides/hubs/data_how-to_hub_home.json +1 -1
- package/src/data/my-account/data_address-book.json +12 -3
- package/src/data/my-account/data_my-order.json +1 -1
- package/src/data/my-account/data_personal-details.json +32 -8
- package/src/data/navigation.json +1016 -805
- package/src/data/page_how-to-choose-your-doors.json +1 -2
- package/src/data/public/wickers.json +2069 -2069
- package/src/img/TradePaint.svg +42 -14
- package/src/img/apple-pay.svg +12 -7
- package/src/img/big-white-apple-pay.svg +10 -5
- package/src/img/billie-logo.svg +4 -2
- package/src/img/billie-modal.svg +4 -2
- package/src/img/billie-pdp.svg +12 -9
- package/src/img/billie-spinner.svg +5 -3
- package/src/img/billie.svg +3 -1
- package/src/img/clearpay-logo.svg +6 -1
- package/src/img/clearpay-spinner.svg +4 -1
- package/src/img/energy-efficiency/energy-marker.svg +12 -1
- package/src/img/google-spinner.svg +14 -7
- package/src/img/googlepay.svg +23 -12
- package/src/img/home-banner_arrow.svg +7 -1
- package/src/img/ic-menu.svg +7 -1
- package/src/img/ic_info_big.svg +4 -1
- package/src/img/klarna-big.svg +18 -9
- package/src/img/klarna-sm.svg +5 -2
- package/src/img/klarna-spinner.svg +3 -1
- package/src/img/logo-klarna.svg +5 -2
- package/src/img/mastercard.svg +6 -3
- package/src/img/payapal_text.svg +6 -1
- package/src/img/payment/checkout/applepay.svg +12 -7
- package/src/img/payment/checkout/billie.svg +4 -2
- package/src/img/payment/checkout/clearpay.svg +5 -1
- package/src/img/payment/checkout/googlepay.svg +23 -12
- package/src/img/payment/checkout/mastercard.svg +13 -1
- package/src/img/payment/checkout/paypal.svg +37 -1
- package/src/img/payment/checkout/visa.svg +8 -1
- package/src/img/payment/footer/applepay.svg +12 -7
- package/src/img/payment/footer/billie.svg +3 -1
- package/src/img/payment/footer/clearpay.svg +18 -10
- package/src/img/payment/footer/googlepay.svg +23 -12
- package/src/img/payment/footer/mastercard.svg +13 -1
- package/src/img/payment/footer/paypal.svg +37 -1
- package/src/img/payment/footer/visa.svg +8 -1
- package/src/img/paypal.svg +8 -1
- package/src/img/paypal_logo_loader_paypal.svg +4 -1
- package/src/img/paypal_logo_loader_pp.svg +10 -1
- package/src/img/placeholders/full-width-img.svg +9 -1
- package/src/img/placeholders/img-2-to-1.svg +9 -1
- package/src/img/placeholders/img-3-to-4.svg +9 -1
- package/src/img/placeholders/img-4-to-3.svg +9 -1
- package/src/img/proposition_arrow_click.svg +7 -1
- package/src/img/proposition_delivery.svg +7 -1
- package/src/img/proposition_price.svg +7 -1
- package/src/img/proposition_returns.svg +7 -1
- package/src/img/social-icon-facebook.svg +8 -1
- package/src/img/social-icon-instagram.svg +15 -1
- package/src/img/social-icon-pinterest.svg +7 -1
- package/src/img/socials/facebook.svg +5 -1
- package/src/img/socials/instagram.svg +5 -1
- package/src/img/socials/pinterest.svg +5 -1
- package/src/img/socials/tiktok.svg +5 -1
- package/src/img/socials/x-twitter.svg +5 -1
- package/src/img/socials/youtube.svg +5 -1
- package/src/img/socials_facebook_color.svg +7 -1
- package/src/img/socials_facebook_white_blue_color.svg +5 -1
- package/src/img/socials_info_big.svg +7 -1
- package/src/img/socials_instagram_color.svg +16 -1
- package/src/img/socials_pinterest_color.svg +4 -1
- package/src/img/socials_twitter_color.svg +4 -1
- package/src/img/socials_whatsapp_color.svg +5 -1
- package/src/img/socials_youtube_color.svg +4 -1
- package/src/img/stars.svg +8 -1
- package/src/img/visa-logo.svg +3 -1
- package/src/img/wickes-dc-logo.svg +17 -13
- package/src/img/wickes-logo-v2.svg +15 -1
- package/src/img/wickes-logo.svg +36 -1
- package/src/img/young-minds.svg +10 -8
- package/src/js/components/anchors-scroll.js +9 -6
- package/src/js/components/badge-cashback.js +5 -6
- package/src/js/components/banner-placement-manager.js +269 -232
- package/src/js/components/card-color-slider.js +29 -29
- package/src/js/components/card-slider.js +78 -73
- package/src/js/components/cards-slider.js +64 -58
- package/src/js/components/charity-donations.js +3 -4
- package/src/js/components/checkout_your-details.js +68 -67
- package/src/js/components/clamp.js +47 -32
- package/src/js/components/click-disable.js +7 -7
- package/src/js/components/date-selection.js +50 -37
- package/src/js/components/file-loader.js +33 -33
- package/src/js/components/finance.js +3 -4
- package/src/js/components/flatpickr.js +135 -149
- package/src/js/components/gallery-pdp.js +97 -98
- package/src/js/components/gallery-range.js +107 -109
- package/src/js/components/general/accordion.js +31 -29
- package/src/js/components/general/back-to-top.js +40 -37
- package/src/js/components/general/backdrop.js +15 -15
- package/src/js/components/general/cart-slider.js +15 -12
- package/src/js/components/general/clamp-content.js +80 -80
- package/src/js/components/general/clamp.js +53 -38
- package/src/js/components/general/clear-input.js +25 -25
- package/src/js/components/general/cookie-chat-back.js +19 -13
- package/src/js/components/general/cookies-policy.js +5 -5
- package/src/js/components/general/create-popup-slider.js +169 -175
- package/src/js/components/general/device-type.js +3 -3
- package/src/js/components/general/footer.js +82 -52
- package/src/js/components/general/handleAccordion.js +28 -28
- package/src/js/components/general/is-trade-pro.js +15 -9
- package/src/js/components/general/main-nav.js +8 -8
- package/src/js/components/general/main-navigation.js +67 -73
- package/src/js/components/general/mini-basket-slider.js +6 -6
- package/src/js/components/general/notification.js +58 -40
- package/src/js/components/general/offer-banner.js +58 -58
- package/src/js/components/general/scroll-disable.js +45 -44
- package/src/js/components/general/search-filter.js +16 -16
- package/src/js/components/general/search.js +27 -29
- package/src/js/components/general/snack-bar.js +20 -11
- package/src/js/components/general/sticky_header.js +8 -7
- package/src/js/components/general/switchVat.js +154 -154
- package/src/js/components/general/text-clamp.js +14 -16
- package/src/js/components/general/tooltips.js +2 -2
- package/src/js/components/general/validation.js +47 -41
- package/src/js/components/leave-event.js +116 -113
- package/src/js/components/loader.js +11 -11
- package/src/js/components/modal-slider.js +57 -52
- package/src/js/components/order-item-cc.js +59 -69
- package/src/js/components/pdp-read-more.js +7 -11
- package/src/js/components/pdp-video.js +2 -2
- package/src/js/components/pwdstrength.js +13 -17
- package/src/js/components/range-cards.js +12 -12
- package/src/js/components/range-types.js +11 -11
- package/src/js/components/scrollbar.js +23 -20
- package/src/js/components/share-project-list.js +4 -5
- package/src/js/components/show-more-less.js +2 -2
- package/src/js/components/similar-slider.js +19 -10
- package/src/js/components/sticky-aside.js +84 -83
- package/src/js/components/store-locator-facilities.js +17 -15
- package/src/js/components/tabs.js +16 -17
- package/src/js/components/toggle-password-visibility.js +50 -50
- package/src/js/components/tradepro-notification-copy.js +5 -6
- package/src/js/components/voucher-remove.js +1 -2
- package/src/js/components/wisdom.js +35 -26
- package/src/js/components/zoom.js +67 -59
- package/src/js/emulation/account-hub.js +40 -40
- package/src/js/emulation/account-members.js +37 -36
- package/src/js/emulation/add-project-list-id-local.js +24 -18
- package/src/js/emulation/add.to.any.customisation.js +44 -38
- package/src/js/emulation/autocomplete.js +123 -114
- package/src/js/emulation/banner-placement-manager.js +40 -35
- package/src/js/emulation/basket-data.js +2123 -2037
- package/src/js/emulation/basket.js +58 -57
- package/src/js/emulation/big-wins.js +1079 -903
- package/src/js/emulation/chat-bot.js +14 -14
- package/src/js/emulation/checkLocalEnv.js +4 -4
- package/src/js/emulation/checkout-delivery-details.js +28 -25
- package/src/js/emulation/checkout-payment-details.js +46 -37
- package/src/js/emulation/checkout-sign-in-emulation.js +36 -33
- package/src/js/emulation/checkout_your-details.js +47 -46
- package/src/js/emulation/click-and-collect-modal.js +18 -20
- package/src/js/emulation/cnc-notifications.js +9 -10
- package/src/js/emulation/custom-slider-emulation.js +16 -17
- package/src/js/emulation/date-selection.js +25 -25
- package/src/js/emulation/default-store.js +92 -86
- package/src/js/emulation/favourite-product-local.js +31 -29
- package/src/js/emulation/find-address.js +41 -42
- package/src/js/emulation/footer-date.js +6 -3
- package/src/js/emulation/forms.js +352 -308
- package/src/js/emulation/generate-project-id-local.js +26 -23
- package/src/js/emulation/global-search-local.js +125 -122
- package/src/js/emulation/google-maps-store-info.js +25 -29
- package/src/js/emulation/home-movers.js +47 -49
- package/src/js/emulation/input-file.js +638 -558
- package/src/js/emulation/kitchen-plp-data.js +4528 -3670
- package/src/js/emulation/loadMore.js +13 -14
- package/src/js/emulation/main-nav-data.js +1058 -848
- package/src/js/emulation/mini-basket.js +34 -34
- package/src/js/emulation/mini-cart.js +12 -11
- package/src/js/emulation/mock.js +23 -23
- package/src/js/emulation/my-orders-local.js +30 -30
- package/src/js/emulation/paymentLoader.js +16 -16
- package/src/js/emulation/pdf-file-loader.js +88 -90
- package/src/js/emulation/pdp.js +18 -12
- package/src/js/emulation/personal-details-local.js +57 -56
- package/src/js/emulation/plp-load-more.js +16 -13
- package/src/js/emulation/popover-mini-basket.js +244 -238
- package/src/js/emulation/project-list-multiple.js +24 -18
- package/src/js/emulation/project-list-pdp.js +319 -316
- package/src/js/emulation/project-list-print.js +43 -40
- package/src/js/emulation/quiz-local.js +11 -11
- package/src/js/emulation/reference-field.js +2 -7
- package/src/js/emulation/selectable.js +19 -18
- package/src/js/emulation/shopping-list.js +19 -17
- package/src/js/emulation/sign-up.js +17 -21
- package/src/js/emulation/store-locator-list.js +11 -13
- package/src/js/emulation/switchCalendar.js +12 -8
- package/src/js/emulation/total-amount-loader.js +14 -13
- package/src/js/emulation/user.js +32 -32
- package/src/js/emulation/vat-toggle.js +1 -1
- package/src/js/emulation/wickes-responsive.js +178 -189
- package/src/js/emulation/wismo-details.js +22 -30
- package/src/js/emulation/your-details.js +34 -22
- package/src/js/helpers/jquery.cookiebar.js +270 -192
- package/src/js/helpers/responsive.js +69 -69
- package/src/js/helpers/safari-back.js +4 -4
- package/src/js/libs/bootstrap.bundle.min.js +1 -1
- package/src/js/libs/iframeResizer.min.js +2 -2
- package/src/js/libs/jquery.pstrength.custom-1.2.0.js +28 -34
- package/src/js/libs/simplebar.js +3 -3
- package/src/js/page/accordion.js +31 -29
- package/src/js/page/account-deletion.js +13 -13
- package/src/js/page/account-hub.js +128 -119
- package/src/js/page/account-members.js +229 -216
- package/src/js/page/address-book.js +186 -184
- package/src/js/page/basket/add-project-list-id.js +158 -130
- package/src/js/page/basket/clearpay.js +17 -17
- package/src/js/page/basket/display-energy-efficiency.js +13 -13
- package/src/js/page/basket/gtm.js +60 -54
- package/src/js/page/basket/klarna.js +2 -2
- package/src/js/page/basket/paypal.js +33 -33
- package/src/js/page/basket/session-sync.js +5 -5
- package/src/js/page/basket/summary-mobile.js +16 -16
- package/src/js/page/basket/wisdom.js +54 -39
- package/src/js/page/basket-v2.js +415 -261
- package/src/js/page/basket.js +42 -39
- package/src/js/page/billie-business-type.js +22 -22
- package/src/js/page/business-account-form.js +12 -12
- package/src/js/page/buying-guides-guttering.js +3 -3
- package/src/js/page/category-landing.js +18 -11
- package/src/js/page/change-password.js +100 -99
- package/src/js/page/checkout-confirmation-new.js +127 -70
- package/src/js/page/checkout-confirmation.js +6 -6
- package/src/js/page/checkout-delivery-address.js +35 -32
- package/src/js/page/checkout-delivery-details-loader.js +2 -5
- package/src/js/page/checkout-edit-address.js +1 -1
- package/src/js/page/checkout-payment-details.js +170 -172
- package/src/js/page/checkout-sign-in.js +15 -11
- package/src/js/page/checkout.js +1 -1
- package/src/js/page/cms-homepage.js +87 -45
- package/src/js/page/components/charity.js +114 -120
- package/src/js/page/components/csrf.js +4 -4
- package/src/js/page/components/discounts.js +39 -39
- package/src/js/page/components/favourite-product.js +125 -113
- package/src/js/page/components/global-search.js +204 -192
- package/src/js/page/components/modal-observer.js +43 -46
- package/src/js/page/components/order-summary.js +26 -22
- package/src/js/page/components/pagination.js +124 -117
- package/src/js/page/components/retry-action.js +2 -2
- package/src/js/page/components/saving-shopping-list.js +381 -314
- package/src/js/page/components/sticky-order-observer.js +36 -39
- package/src/js/page/components/voucher.js +46 -47
- package/src/js/page/copy-project-id.js +23 -23
- package/src/js/page/countdown-timer.js +6 -6
- package/src/js/page/default-store.js +40 -34
- package/src/js/page/design-appointment.js +6 -3
- package/src/js/page/energy-efficiency.js +39 -25
- package/src/js/page/finance-tabs.js +4 -4
- package/src/js/page/general/cookie.js +20 -10
- package/src/js/page/installation/calculator.js +12 -16
- package/src/js/page/installation/fi.js +76 -71
- package/src/js/page/installation/generic.js +21 -20
- package/src/js/page/installation/installation.js +36 -22
- package/src/js/page/installation/pdp-generic.js +3 -9
- package/src/js/page/installation/ti.js +26 -24
- package/src/js/page/installer-files-form.js +98 -76
- package/src/js/page/installer-form.js +502 -447
- package/src/js/page/installer-validation.js +848 -761
- package/src/js/page/instore-checkout.js +2 -2
- package/src/js/page/kitchen/card-carousel.js +21 -21
- package/src/js/page/kitchen/colour-swatches.js +153 -149
- package/src/js/page/kitchen/kitchen-card.js +62 -64
- package/src/js/page/kitchen/mobile-nav.js +26 -27
- package/src/js/page/kitchen/plp-filters-chips.js +72 -70
- package/src/js/page/kitchen/plp-filters-mobile.js +64 -60
- package/src/js/page/kitchen/plp-filters-panel.js +106 -102
- package/src/js/page/kitchen/plp-filters-utils.js +54 -53
- package/src/js/page/kitchen/plp-filters.js +210 -194
- package/src/js/page/kitchen/sort-by.js +149 -149
- package/src/js/page/klarna-modal-scroll-disable.js +4 -4
- package/src/js/page/merged-checkout.js +6 -3
- package/src/js/page/my-account.js +44 -46
- package/src/js/page/my-orders.js +153 -149
- package/src/js/page/online-exclusive.js +28 -31
- package/src/js/page/pdp-favourite.js +4 -4
- package/src/js/page/pdp-tile.js +0 -4
- package/src/js/page/pdp.js +41 -37
- package/src/js/page/personal-details.js +307 -277
- package/src/js/page/plp-cards-v2.js +39 -25
- package/src/js/page/plp-favourite.js +9 -9
- package/src/js/page/plp-img-v2.js +2 -3
- package/src/js/page/plp-load-more.js +66 -66
- package/src/js/page/plp.js +9 -10
- package/src/js/page/pre-home.js +159 -144
- package/src/js/page/project-list/generate-project-id.js +77 -68
- package/src/js/page/project-list-note.js +234 -232
- package/src/js/page/project-list.js +2 -3
- package/src/js/page/quiz.js +292 -292
- package/src/js/page/select-address.js +27 -14
- package/src/js/page/smart-banner.js +8 -5
- package/src/js/page/ti.js +67 -42
- package/src/js/page/top-rated.js +36 -29
- package/src/js/page/track-my-order.js +172 -156
- package/src/js/page/tradePro-rewards.js +34 -36
- package/src/js/page/utils/array-utils.js +13 -10
- package/src/js/page/utils/copy-to-clipboard.js +45 -45
- package/src/js/page/utils/create-event.js +8 -8
- package/src/js/page/utils/errorMesages.js +12 -11
- package/src/js/page/utils/helpers.js +14 -9
- package/src/js/page/utils/http-action.js +4 -5
- package/src/js/page/utils/loader.js +5 -5
- package/src/js/page/utils/routes.js +9 -9
- package/src/js/page/utils/url-query.js +4 -4
- package/src/js/page/utils/validation.js +93 -96
- package/src/js/page/wickes-dc.js +51 -44
- package/src/js/page/wismo.js +12 -12
- package/src/js/page/your-details.js +77 -41
- package/src/layouts/app_sticky_header.hbs +0 -1
- package/src/scss/barclays-paypage-combined.css +585 -585
- package/src/scss/barclays-paypage-desktop.css +496 -496
- package/src/scss/barclays-paypage-mobile.css +494 -494
- package/src/scss/category-main.scss +8 -2
- package/src/scss/common/_cat-common.scss +1 -0
- package/src/scss/common/_plp-common.scss +1 -0
- package/src/scss/components/_billie-modal.scss +2 -2
- package/src/scss/components/_card.scss +1 -0
- package/src/scss/components/_find-a-store.scss +1 -0
- package/src/scss/components/_gallery-pdp-critical.scss +2 -2
- package/src/scss/components/_kitchen-card.scss +2 -2
- package/src/scss/components/_notifications-critical.scss +2 -2
- package/src/scss/components/_offer-banner.scss +1 -0
- package/src/scss/components/_order-summary.scss +1 -1
- package/src/scss/components/_page-overlay.scss +1 -1
- package/src/scss/components/_price-block.scss +1 -0
- package/src/scss/components/_price.scss +1 -1
- package/src/scss/components/_range-card.scss +0 -1
- package/src/scss/components/_recommended.scss +0 -1
- package/src/scss/components/_rewards.scss +1 -1
- package/src/scss/components/_share-list-modal.scss +1 -1
- package/src/scss/components/_shopping-list-note.scss +1 -1
- package/src/scss/components/_steps-three.scss +1 -1
- package/src/scss/components/_steps.scss +2 -2
- package/src/scss/components/_tc-generic.scss +1 -1
- package/src/scss/components/_thank-you-modal.scss +3 -1
- package/src/scss/components/_ti-total-area.scss +1 -1
- package/src/scss/components/_user-address-delivery.scss +1 -1
- package/src/scss/components/kitchen/_price.scss +1 -1
- package/src/scss/components/my-account/_contacts.scss +3 -1
- package/src/scss/components/special-opening-schedule-v2.scss +3 -3
- package/src/scss/components/special-opening-schedule.scss +2 -2
- package/src/scss/helpers/_variables.scss +157 -154
- package/src/scss/helpers/helpers-pdp-critical/_elements-critical-pdp.scss +1 -0
- package/src/scss/helpers/helpers-pdp-critical/_helpers-critical-pdp.scss +4 -0
- package/src/scss/libs/_bootstrap-extracted.scss +24 -6
- package/src/scss/libs/_skeleton.scss +3 -3
- package/src/scss/libs/simplebar.css +3 -3
- package/src/scss/libs/swiper.css +479 -384
- package/src/scss/main.scss +140 -70
- package/src/scss/my-account-main-v2.scss +38 -19
- package/src/scss/my-account-main.scss +38 -19
- package/src/scss/pages/_checkout-widget.scss +1 -1
- package/src/scss/pages/_checkout_your-details.scss +1 -0
- package/src/scss/pages/checkout-new.scss +1 -0
- package/src/scss/pages/checkout.scss +1 -0
- package/src/scss/pages/iframe-paypage.scss +9 -8
- package/src/scss/pages/page_book-consultant-thank-you-new.scss +2 -2
- package/src/scss/pages/page_installer.scss +2 -2
- package/src/scss/pages/page_my-account_tradePro.scss +1 -1
- package/src/scss/pages/page_new-checkout_login-register.scss +1 -1
- package/src/scss/pages/page_pre_home_thank-you.scss +2 -2
- package/src/scss/pages/page_product-details-critical.scss +1 -0
- package/src/scss/pages/page_products-list-combined.scss +4 -0
- package/src/scss/pages/page_store-locator-details.scss +1 -1
- package/src/scss/pages/page_top-rated.scss +14 -14
- package/src/scss/pages/page_wismo-details.scss +1 -1
- package/src/scss/pages/tradePro-rewards-old.scss +1 -1
- package/src/scss/partials/_breadcrumbs-critical.scss +2 -2
- package/src/scss/partials/_breadcrumbs.scss +2 -2
- package/src/scss/partials/_header-critical.scss +1 -1
- package/src/scss/partials/_header.scss +1 -1
- package/src/scss/store-locator-main.scss +3 -0
- package/build/js/page/business-pages.js +0 -13
- package/src/js/page/business-pages.js +0 -13
|
@@ -1,487 +1,542 @@
|
|
|
1
1
|
var Wick = Wick || {};
|
|
2
2
|
|
|
3
3
|
Wick.InstallerForm = {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
},
|
|
11
|
-
TEST_HOSTNAMES: {
|
|
12
|
-
upload_domain: 's3.eu-west-1.amazonaws.com',
|
|
13
|
-
register_url: 'https://installer-registration.devexternal.wickes.co.uk'
|
|
14
|
-
},
|
|
15
|
-
CUSTOMER_DATA_URL: '/api/installer/application/customer',
|
|
16
|
-
getEnv: function () {
|
|
17
|
-
return window.location.origin.startsWith('https://www.wickes.co.uk') ? 'prod' : 'test';
|
|
18
|
-
},
|
|
19
|
-
getHostnames: function() {
|
|
20
|
-
var env = Wick.InstallerForm.getEnv();
|
|
21
|
-
return env === 'prod'
|
|
22
|
-
? Wick.InstallerForm.PROD_HOSTNAMES
|
|
23
|
-
: Wick.InstallerForm.TEST_HOSTNAMES;
|
|
24
|
-
},
|
|
25
|
-
filesForm: {
|
|
26
|
-
setValue: function(installerFileName, value) {
|
|
27
|
-
var inputFileRow = $('input.installer_question-file_input[name="' + installerFileName + '"]');
|
|
28
|
-
|
|
29
|
-
inputFileRow.attr('data-value', value);
|
|
4
|
+
stepSlideDuration: 400,
|
|
5
|
+
stepTransitionDuration: 400,
|
|
6
|
+
steps: [1, 2, 3],
|
|
7
|
+
PROD_HOSTNAMES: {
|
|
8
|
+
upload_domain: 's3.eu-west-1.amazonaws.com',
|
|
9
|
+
register_url: 'https://installer-registration.external.wickes.co.uk',
|
|
30
10
|
},
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
inputFileRow.attr('data-value', '');
|
|
35
|
-
inputFileRow.prop('value', '');
|
|
11
|
+
TEST_HOSTNAMES: {
|
|
12
|
+
upload_domain: 's3.eu-west-1.amazonaws.com',
|
|
13
|
+
register_url: 'https://installer-registration.devexternal.wickes.co.uk',
|
|
36
14
|
},
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
addFileTemplate.removeClass('hide');
|
|
15
|
+
CUSTOMER_DATA_URL: '/api/installer/application/customer',
|
|
16
|
+
getEnv: function () {
|
|
17
|
+
return window.location.origin.startsWith('https://www.wickes.co.uk') ? 'prod' : 'test';
|
|
41
18
|
},
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
19
|
+
getHostnames: function () {
|
|
20
|
+
var env = Wick.InstallerForm.getEnv();
|
|
21
|
+
return env === 'prod'
|
|
22
|
+
? Wick.InstallerForm.PROD_HOSTNAMES
|
|
23
|
+
: Wick.InstallerForm.TEST_HOSTNAMES;
|
|
46
24
|
},
|
|
47
|
-
|
|
48
|
-
|
|
25
|
+
filesForm: {
|
|
26
|
+
setValue: function (installerFileName, value) {
|
|
27
|
+
var inputFileRow = $(
|
|
28
|
+
'input.installer_question-file_input[name="' + installerFileName + '"]'
|
|
29
|
+
);
|
|
30
|
+
|
|
31
|
+
inputFileRow.attr('data-value', value);
|
|
32
|
+
},
|
|
33
|
+
removeValue: function (installerFileName) {
|
|
34
|
+
var inputFileRow = $(
|
|
35
|
+
'input.installer_question-file_input[name="' + installerFileName + '"]'
|
|
36
|
+
);
|
|
37
|
+
|
|
38
|
+
inputFileRow.attr('data-value', '');
|
|
39
|
+
inputFileRow.prop('value', '');
|
|
40
|
+
},
|
|
41
|
+
showAddFileTemplate: function (installerFileName) {
|
|
42
|
+
var addFileTemplate = $(
|
|
43
|
+
'label.installer_question-file_label[data-installer-file-name="' +
|
|
44
|
+
installerFileName +
|
|
45
|
+
'"]'
|
|
46
|
+
);
|
|
47
|
+
|
|
48
|
+
addFileTemplate.removeClass('hide');
|
|
49
|
+
},
|
|
50
|
+
hideAddFileTemplate: function (installerFileName) {
|
|
51
|
+
var addFileTemplate = $(
|
|
52
|
+
'label.installer_question-file_label[data-installer-file-name="' +
|
|
53
|
+
installerFileName +
|
|
54
|
+
'"]'
|
|
55
|
+
);
|
|
56
|
+
|
|
57
|
+
addFileTemplate.addClass('hide');
|
|
58
|
+
},
|
|
59
|
+
showErrorNotification: function (installerFileName, error) {
|
|
60
|
+
Wick.InstallerValidation.addErrorNotificationToElement(installerFileName, error, true);
|
|
61
|
+
},
|
|
62
|
+
hideErrorNotification: function (installerFileName) {
|
|
63
|
+
Wick.InstallerValidation.removeErrorNotificationFromElement(installerFileName);
|
|
64
|
+
},
|
|
65
|
+
showDefaultError: function (element) {
|
|
66
|
+
Wick.InstallerValidation.addErrorNotificationToElement(
|
|
67
|
+
element.attr('name'),
|
|
68
|
+
Wick.InstallerValidation.steps['2'][element.attr('name')].error,
|
|
69
|
+
true
|
|
70
|
+
);
|
|
71
|
+
},
|
|
72
|
+
hideDefaultError: function (element) {
|
|
73
|
+
Wick.InstallerValidation.removeErrorNotificationFromElement(element.attr('name'));
|
|
74
|
+
},
|
|
75
|
+
showImagePreviewTemplate: function (installerFileName) {
|
|
76
|
+
var previewTemplate = $(
|
|
77
|
+
'.installer_question-file_result_wrapper[data-installer-file-name="' +
|
|
78
|
+
installerFileName +
|
|
79
|
+
'"]'
|
|
80
|
+
);
|
|
81
|
+
|
|
82
|
+
previewTemplate.removeClass('hide');
|
|
83
|
+
},
|
|
84
|
+
hideImagePreviewTemplate: function (installerFileName) {
|
|
85
|
+
var previewTemplate = $(
|
|
86
|
+
'.installer_question-file_result_wrapper[data-installer-file-name="' +
|
|
87
|
+
installerFileName +
|
|
88
|
+
'"]'
|
|
89
|
+
);
|
|
90
|
+
|
|
91
|
+
previewTemplate.addClass('hide');
|
|
92
|
+
},
|
|
93
|
+
readFile: function (file, installerFileName) {
|
|
94
|
+
var reader = new FileReader();
|
|
95
|
+
var imagePreviewTemplate = $(
|
|
96
|
+
'div.installer_question-file_result_wrapper[data-installer-file-name="' +
|
|
97
|
+
installerFileName +
|
|
98
|
+
'"]'
|
|
99
|
+
);
|
|
100
|
+
|
|
101
|
+
reader.onload = function (e) {
|
|
102
|
+
var imagePreviewElement = imagePreviewTemplate.find('img');
|
|
103
|
+
|
|
104
|
+
imagePreviewElement.attr('src', e.target.result);
|
|
105
|
+
};
|
|
106
|
+
|
|
107
|
+
reader.readAsDataURL(file);
|
|
108
|
+
},
|
|
109
|
+
showSpinner: function () {
|
|
110
|
+
var loader = $('.installer__loader');
|
|
111
|
+
loader.addClass('show');
|
|
112
|
+
},
|
|
113
|
+
hideSpinner: function () {
|
|
114
|
+
var loader = $('.installer__loader');
|
|
115
|
+
loader.removeClass('show');
|
|
116
|
+
},
|
|
117
|
+
addFileHandler: function (file, installerFileName) {
|
|
118
|
+
Wick.S3bucketUpload.uploadImage(file, installerFileName);
|
|
119
|
+
},
|
|
120
|
+
onSuccessFileAdd: function (file, installerFileName, fileLink) {
|
|
121
|
+
Wick.InstallerForm.filesForm.hideErrorNotification(installerFileName);
|
|
122
|
+
Wick.InstallerForm.filesForm.hideAddFileTemplate(installerFileName);
|
|
123
|
+
Wick.InstallerForm.filesForm.showImagePreviewTemplate(installerFileName);
|
|
124
|
+
Wick.InstallerForm.filesForm.readFile(file, installerFileName);
|
|
125
|
+
Wick.InstallerForm.filesForm.setValue(installerFileName, fileLink);
|
|
126
|
+
},
|
|
127
|
+
removeFileHandler: function (installerFileName) {
|
|
128
|
+
Wick.InstallerForm.filesForm.hideErrorNotification(installerFileName);
|
|
129
|
+
Wick.InstallerForm.filesForm.removeValue(installerFileName);
|
|
130
|
+
Wick.InstallerForm.filesForm.hideImagePreviewTemplate(installerFileName);
|
|
131
|
+
Wick.InstallerForm.filesForm.showAddFileTemplate(installerFileName);
|
|
132
|
+
},
|
|
133
|
+
fileRadioButtonHandler: function (element) {
|
|
134
|
+
var radioWrapper = element.closest('.installer_question-radio');
|
|
135
|
+
var wrapper = element.closest('.installer_question-wrap');
|
|
136
|
+
if (wrapper.attr('data-question-file') !== undefined) {
|
|
137
|
+
var fileList = wrapper.find('.installer_question-file_list');
|
|
138
|
+
var text = element.siblings('span').text().toUpperCase();
|
|
139
|
+
if (text === 'YES') {
|
|
140
|
+
fileList.removeClass('hide');
|
|
141
|
+
wrapper.find('.form-row__error').remove();
|
|
142
|
+
} else {
|
|
143
|
+
fileList.addClass('hide');
|
|
144
|
+
if (radioWrapper.attr('data-radio-optional') === undefined) {
|
|
145
|
+
Wick.InstallerForm.filesForm.showDefaultError(element);
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
},
|
|
49
150
|
},
|
|
50
|
-
|
|
51
|
-
|
|
151
|
+
bindFileInputs: function () {
|
|
152
|
+
$('body').on('change', '.installer_question-file_input', function () {
|
|
153
|
+
var closestLabel = $(this).closest('.installer_question-file_label');
|
|
154
|
+
var file = $(this).get(0).files[0];
|
|
155
|
+
Wick.InstallerForm.filesForm.hideErrorNotification(
|
|
156
|
+
closestLabel.attr('data-installer-file-name')
|
|
157
|
+
);
|
|
158
|
+
Wick.InstallerForm.filesForm.addFileHandler(
|
|
159
|
+
file,
|
|
160
|
+
closestLabel.attr('data-installer-file-name')
|
|
161
|
+
);
|
|
162
|
+
});
|
|
52
163
|
},
|
|
53
|
-
|
|
54
|
-
|
|
164
|
+
bindDeleteFileButtons: function () {
|
|
165
|
+
$('body').on('click', '.delete_action', function () {
|
|
166
|
+
var closestLabel = $(this).closest('.installer_question-file_wrapper');
|
|
167
|
+
Wick.InstallerForm.filesForm.removeFileHandler(
|
|
168
|
+
closestLabel.attr('data-installer-file-name')
|
|
169
|
+
);
|
|
170
|
+
});
|
|
55
171
|
},
|
|
56
|
-
|
|
57
|
-
|
|
172
|
+
bindFileRadioButtons: function () {
|
|
173
|
+
$('body').on('click', '.installer_question-radio input[type="radio"]', function () {
|
|
174
|
+
Wick.InstallerForm.filesForm.hideDefaultError($(this));
|
|
175
|
+
Wick.InstallerForm.filesForm.fileRadioButtonHandler($(this));
|
|
176
|
+
});
|
|
58
177
|
},
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
178
|
+
bindStepSubmitButtons: function () {
|
|
179
|
+
$('body').on('click', '.btn[data-step]', function () {
|
|
180
|
+
var currentStep = $(this).attr('data-step');
|
|
181
|
+
var nextStep =
|
|
182
|
+
$(this).attr('data-back-action') === undefined
|
|
183
|
+
? +currentStep + 1
|
|
184
|
+
: +currentStep - 1;
|
|
185
|
+
Wick.InstallerForm.setFormStep(currentStep, nextStep);
|
|
186
|
+
});
|
|
63
187
|
},
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
188
|
+
bindBusinessTypeCheckboxes: function () {
|
|
189
|
+
let $formItemCheck = $('.form-row__field-item .checkbox-item'),
|
|
190
|
+
$formItemCheckInput = $('.chb input'),
|
|
191
|
+
$additionalForm = $('.additional-form');
|
|
192
|
+
|
|
193
|
+
$formItemCheck.on('change', function () {
|
|
194
|
+
if ($(this).find($formItemCheckInput).prop('checked')) {
|
|
195
|
+
$(this).parent().find($additionalForm).slideDown();
|
|
196
|
+
} else {
|
|
197
|
+
$(this).parent().find($additionalForm).slideUp();
|
|
198
|
+
}
|
|
199
|
+
});
|
|
68
200
|
},
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
reader.onload = function(e) {
|
|
74
|
-
var imagePreviewElement = imagePreviewTemplate.find('img');
|
|
75
|
-
|
|
76
|
-
imagePreviewElement.attr('src', e.target.result);
|
|
77
|
-
};
|
|
78
|
-
|
|
79
|
-
reader.readAsDataURL(file);
|
|
201
|
+
bindClearForm: function () {
|
|
202
|
+
$(window).bind('beforeunload', function () {
|
|
203
|
+
Wick.InstallerForm.clearFormData();
|
|
204
|
+
});
|
|
80
205
|
},
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
206
|
+
scrollToStepHeader: function (step) {
|
|
207
|
+
setTimeout(function () {
|
|
208
|
+
var element = $('.installer-block[data-step="' + step + '"] .installer-block__header');
|
|
209
|
+
var elementHeight = element.height();
|
|
210
|
+
|
|
211
|
+
$([document.documentElement, document.body]).animate(
|
|
212
|
+
{
|
|
213
|
+
scrollTop: element.offset().top - elementHeight,
|
|
214
|
+
},
|
|
215
|
+
Wick.InstallerForm.stepTransitionDuration
|
|
216
|
+
);
|
|
217
|
+
}, Wick.InstallerForm.stepSlideDuration + 1);
|
|
84
218
|
},
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
219
|
+
moveToStep: function (prevStep, nextStep) {
|
|
220
|
+
$('.installer-action').attr('data-step', nextStep);
|
|
221
|
+
$('.installer-application').attr('data-step', nextStep);
|
|
222
|
+
if (nextStep > prevStep) {
|
|
223
|
+
$('.installer-block[data-step="' + prevStep + '"]').attr('data-step-finished', '');
|
|
224
|
+
}
|
|
225
|
+
Wick.InstallerForm.toggleStep(prevStep);
|
|
226
|
+
Wick.InstallerForm.toggleStep(nextStep);
|
|
227
|
+
Wick.InstallerForm.scrollToStepHeader(nextStep);
|
|
88
228
|
},
|
|
89
|
-
|
|
90
|
-
|
|
229
|
+
toggleStep: function (step) {
|
|
230
|
+
var content = $(
|
|
231
|
+
'.installer-block[data-step="' + step + '"] .installer__accordion__header'
|
|
232
|
+
).siblings('.installer-block__content');
|
|
233
|
+
content.slideToggle(Wick.InstallerForm.stepSlideDuration);
|
|
234
|
+
content.toggleClass('.installer__accordion_collapsed');
|
|
91
235
|
},
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
236
|
+
setFormStep: function (prevStep, nextStep) {
|
|
237
|
+
var isFormValid = true;
|
|
238
|
+
Wick.InstallerValidation.removeGlobalErrorNotification();
|
|
239
|
+
if (Wick.InstallerForm.steps.indexOf(nextStep) !== -1) {
|
|
240
|
+
if (nextStep > prevStep) {
|
|
241
|
+
isFormValid = Wick.InstallerValidation.validateStepForInstallerForm(prevStep);
|
|
242
|
+
}
|
|
243
|
+
if (isFormValid) {
|
|
244
|
+
Wick.InstallerForm.moveToStep(prevStep, nextStep);
|
|
245
|
+
} else {
|
|
246
|
+
$('.installer-block[data-step="' + prevStep + '"]').removeAttr(
|
|
247
|
+
'data-step-finished'
|
|
248
|
+
);
|
|
249
|
+
}
|
|
250
|
+
} else {
|
|
251
|
+
if (nextStep > prevStep) {
|
|
252
|
+
isFormValid = Wick.InstallerValidation.validateInstallerForm();
|
|
253
|
+
}
|
|
254
|
+
if (isFormValid) {
|
|
255
|
+
const submit = Wick.InstallerForm.recaptchaDecorate(
|
|
256
|
+
'submit',
|
|
257
|
+
Wick.InstallerForm.submit
|
|
258
|
+
);
|
|
259
|
+
submit();
|
|
260
|
+
}
|
|
261
|
+
}
|
|
98
262
|
},
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
263
|
+
clearFormData: function () {
|
|
264
|
+
var inputs = Object.assign(
|
|
265
|
+
Wick.InstallerValidation.steps[1],
|
|
266
|
+
Wick.InstallerValidation.steps[2],
|
|
267
|
+
Wick.InstallerValidation.steps[3]
|
|
268
|
+
);
|
|
269
|
+
|
|
270
|
+
return Object.keys(inputs).forEach(function (elementName) {
|
|
271
|
+
var element = $('[name="' + elementName + '"]');
|
|
272
|
+
var type = element.attr('type');
|
|
273
|
+
|
|
274
|
+
if (element.prop('tagName') === 'SELECT') {
|
|
275
|
+
element.prop('value', '');
|
|
276
|
+
return;
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
switch (type) {
|
|
280
|
+
case 'radio':
|
|
281
|
+
case 'checkbox':
|
|
282
|
+
$('[name="' + elementName + '"]:checked').prop('checked', false);
|
|
283
|
+
return;
|
|
284
|
+
case 'file':
|
|
285
|
+
default:
|
|
286
|
+
element.prop('value', '');
|
|
287
|
+
element.prop('value', '');
|
|
288
|
+
return;
|
|
289
|
+
}
|
|
290
|
+
});
|
|
104
291
|
},
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
292
|
+
gatheringFormData: function () {
|
|
293
|
+
var inputs = Object.assign(
|
|
294
|
+
Wick.InstallerValidation.steps[1],
|
|
295
|
+
Wick.InstallerValidation.steps[2],
|
|
296
|
+
Wick.InstallerValidation.steps[3]
|
|
297
|
+
);
|
|
298
|
+
|
|
299
|
+
return Object.keys(inputs).reduce(function (prev, elementName) {
|
|
300
|
+
var next = {
|
|
301
|
+
[elementName]: Wick.InstallerValidation.getValueByName(elementName),
|
|
302
|
+
};
|
|
303
|
+
return Object.assign(prev, next);
|
|
304
|
+
}, {});
|
|
305
|
+
},
|
|
306
|
+
formatInstallationTypes: function (unformattedData) {
|
|
307
|
+
var installationtypes = {};
|
|
308
|
+
|
|
309
|
+
unformattedData.installationTypes.forEach(function (type) {
|
|
310
|
+
if (type === 'kitchens') {
|
|
311
|
+
installationtypes.kitchens = {
|
|
312
|
+
installationsNumber: unformattedData.installationsNumber_kitchen,
|
|
313
|
+
gasSafeRegistration: unformattedData.gasSafeRegistration,
|
|
314
|
+
hasSolidWorktopsExperience: unformattedData.hasSolidWorktopsExperience,
|
|
315
|
+
canArrangePreviousWorks: unformattedData.canArrangePreviousWorks_kitchen,
|
|
316
|
+
};
|
|
317
|
+
|
|
318
|
+
if (unformattedData.gasSafeCardFront) {
|
|
319
|
+
installationtypes.kitchens.gasSafeCardFront = unformattedData.gasSafeCardFront;
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
if (unformattedData.gasSafeCardBack) {
|
|
323
|
+
installationtypes.kitchens.gasSafeCardBack = unformattedData.gasSafeCardBack;
|
|
324
|
+
}
|
|
325
|
+
|
|
326
|
+
if (unformattedData.gasSafeCertificate) {
|
|
327
|
+
installationtypes.kitchens.gasSafeCertificate =
|
|
328
|
+
unformattedData.gasSafeCertificate;
|
|
329
|
+
}
|
|
330
|
+
}
|
|
331
|
+
if (type === 'bathrooms') {
|
|
332
|
+
installationtypes.bathrooms = {
|
|
333
|
+
installationsNumber: unformattedData.installationsNumber_bathroom,
|
|
334
|
+
canArrangePreviousWorks: unformattedData.canArrangePreviousWorks_bathroom,
|
|
335
|
+
};
|
|
336
|
+
}
|
|
337
|
+
if (type === 'flooring') {
|
|
338
|
+
installationtypes.flooring = {
|
|
339
|
+
installationsNumber: unformattedData.installationsNumber_flooring,
|
|
340
|
+
flooringTypes: unformattedData.flooringTypes,
|
|
341
|
+
installers: unformattedData.installers_flooring,
|
|
342
|
+
hasFlooringQualification: unformattedData.hasFlooringQualification,
|
|
343
|
+
canArrangePreviousWorks: unformattedData.canArrangePreviousWorks_flooring,
|
|
344
|
+
};
|
|
345
|
+
}
|
|
346
|
+
if (type === 'tiling') {
|
|
347
|
+
installationtypes.tiling = {
|
|
348
|
+
installationsNumber: unformattedData.installationsNumber_tiling,
|
|
349
|
+
tilingTypes: unformattedData.tilingTypes,
|
|
350
|
+
installers: unformattedData.installers_tiling,
|
|
351
|
+
hasTilingQualification: unformattedData.hasTilingQualification,
|
|
352
|
+
canArrangePreviousWorks: unformattedData.canArrangePreviousWorks_tiling,
|
|
353
|
+
};
|
|
354
|
+
}
|
|
355
|
+
});
|
|
356
|
+
|
|
357
|
+
return installationtypes;
|
|
358
|
+
},
|
|
359
|
+
formatFormData: function (unformattedData) {
|
|
360
|
+
var installerInfo = {
|
|
361
|
+
personalDetails: {
|
|
362
|
+
email: unformattedData.email,
|
|
363
|
+
title: unformattedData.title,
|
|
364
|
+
firstName: unformattedData.firstName,
|
|
365
|
+
lastName: unformattedData.lastName,
|
|
366
|
+
},
|
|
367
|
+
businessDetails: {
|
|
368
|
+
businessName: unformattedData.businessName,
|
|
369
|
+
businessType: unformattedData.businessType,
|
|
370
|
+
postCode: unformattedData.postCode,
|
|
371
|
+
line1: unformattedData.line1,
|
|
372
|
+
town: unformattedData.town,
|
|
373
|
+
mobileNumber: unformattedData.mobileNumber,
|
|
374
|
+
},
|
|
375
|
+
proofOfInstaller: {
|
|
376
|
+
hasLiabilityInsurance: unformattedData.hasLiabilityInsurance,
|
|
377
|
+
hasPartPCertificate: unformattedData.hasPartPCertificate,
|
|
378
|
+
hasAsbestosAwarenessCertificate: unformattedData.hasAsbestosAwarenessCertificate,
|
|
379
|
+
hasVatCertificate: unformattedData.hasVatCertificate,
|
|
380
|
+
},
|
|
381
|
+
installationTypes: Wick.InstallerForm.formatInstallationTypes(unformattedData),
|
|
382
|
+
additionalInstallationTypes: unformattedData.additionalInstallationTypes,
|
|
383
|
+
preferences: unformattedData.preferences,
|
|
384
|
+
};
|
|
385
|
+
|
|
386
|
+
if (unformattedData.line2) {
|
|
387
|
+
installerInfo.businessDetails.line2 = unformattedData.line2;
|
|
119
388
|
}
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
bindFileInputs: function () {
|
|
124
|
-
$('body').on('change', '.installer_question-file_input', function() {
|
|
125
|
-
var closestLabel = $(this).closest('.installer_question-file_label');
|
|
126
|
-
var file = $(this).get(0).files[0];
|
|
127
|
-
Wick.InstallerForm.filesForm.hideErrorNotification(closestLabel.attr('data-installer-file-name'));
|
|
128
|
-
Wick.InstallerForm.filesForm.addFileHandler(file, closestLabel.attr('data-installer-file-name'));
|
|
129
|
-
});
|
|
130
|
-
},
|
|
131
|
-
bindDeleteFileButtons: function () {
|
|
132
|
-
$('body').on('click', '.delete_action', function() {
|
|
133
|
-
var closestLabel = $(this).closest('.installer_question-file_wrapper');
|
|
134
|
-
Wick.InstallerForm.filesForm.removeFileHandler(closestLabel.attr('data-installer-file-name'));
|
|
135
|
-
});
|
|
136
|
-
},
|
|
137
|
-
bindFileRadioButtons: function () {
|
|
138
|
-
$('body').on('click', '.installer_question-radio input[type="radio"]', function() {
|
|
139
|
-
Wick.InstallerForm.filesForm.hideDefaultError($(this));
|
|
140
|
-
Wick.InstallerForm.filesForm.fileRadioButtonHandler($(this));
|
|
141
|
-
});
|
|
142
|
-
},
|
|
143
|
-
bindStepSubmitButtons: function () {
|
|
144
|
-
$('body').on('click', '.btn[data-step]', function() {
|
|
145
|
-
var currentStep = $(this).attr('data-step');
|
|
146
|
-
var nextStep = $(this).attr('data-back-action') === undefined ? +currentStep + 1 : +currentStep - 1;
|
|
147
|
-
Wick.InstallerForm.setFormStep(currentStep, nextStep);
|
|
148
|
-
});
|
|
149
|
-
},
|
|
150
|
-
bindBusinessTypeCheckboxes: function () {
|
|
151
|
-
let $formItemCheck = $('.form-row__field-item .checkbox-item'),
|
|
152
|
-
$formItemCheckInput = $('.chb input'),
|
|
153
|
-
$additionalForm = $('.additional-form');
|
|
154
|
-
|
|
155
|
-
$formItemCheck.on('change', function () {
|
|
156
|
-
if ($(this).find($formItemCheckInput).prop('checked')) {
|
|
157
|
-
$(this).parent().find($additionalForm).slideDown();
|
|
158
|
-
} else {
|
|
159
|
-
$(this).parent().find($additionalForm).slideUp();
|
|
160
|
-
}
|
|
161
|
-
})
|
|
162
|
-
},
|
|
163
|
-
bindClearForm: function () {
|
|
164
|
-
$(window).bind('beforeunload', function(){
|
|
165
|
-
Wick.InstallerForm.clearFormData();
|
|
166
|
-
});
|
|
167
|
-
},
|
|
168
|
-
scrollToStepHeader: function (step) {
|
|
169
|
-
setTimeout(function () {
|
|
170
|
-
var element = $('.installer-block[data-step="'+ step +'"] .installer-block__header');
|
|
171
|
-
var elementHeight = element.height();
|
|
172
|
-
$([document.documentElement, document.body]).animate({
|
|
173
|
-
scrollTop: element.offset().top - elementHeight
|
|
174
|
-
}, Wick.InstallerForm.stepTransitionDuration);
|
|
175
|
-
}, Wick.InstallerForm.stepSlideDuration + 1)
|
|
176
|
-
},
|
|
177
|
-
moveToStep: function (prevStep, nextStep) {
|
|
178
|
-
$('.installer-action').attr('data-step', nextStep);
|
|
179
|
-
$('.installer-application').attr('data-step', nextStep);
|
|
180
|
-
if (nextStep > prevStep) {
|
|
181
|
-
$('.installer-block[data-step="' + prevStep + '"]').attr('data-step-finished', '');
|
|
182
|
-
}
|
|
183
|
-
Wick.InstallerForm.toggleStep(prevStep);
|
|
184
|
-
Wick.InstallerForm.toggleStep(nextStep);
|
|
185
|
-
Wick.InstallerForm.scrollToStepHeader(nextStep);
|
|
186
|
-
},
|
|
187
|
-
toggleStep: function(step) {
|
|
188
|
-
var content = $('.installer-block[data-step="' + step + '"] .installer__accordion__header').siblings('.installer-block__content');
|
|
189
|
-
content.slideToggle(Wick.InstallerForm.stepSlideDuration);
|
|
190
|
-
content.toggleClass('.installer__accordion_collapsed');
|
|
191
|
-
},
|
|
192
|
-
setFormStep: function (prevStep, nextStep) {
|
|
193
|
-
var isFormValid = true;
|
|
194
|
-
Wick.InstallerValidation.removeGlobalErrorNotification();
|
|
195
|
-
if (Wick.InstallerForm.steps.indexOf(nextStep) !== -1) {
|
|
196
|
-
if (nextStep > prevStep) {
|
|
197
|
-
isFormValid = Wick.InstallerValidation.validateStepForInstallerForm(prevStep);
|
|
198
|
-
}
|
|
199
|
-
if (isFormValid) {
|
|
200
|
-
Wick.InstallerForm.moveToStep(prevStep, nextStep);
|
|
201
|
-
} else {
|
|
202
|
-
$('.installer-block[data-step="' + prevStep + '"]').removeAttr('data-step-finished');
|
|
203
|
-
}
|
|
204
|
-
} else {
|
|
205
|
-
if (nextStep > prevStep) {
|
|
206
|
-
isFormValid = Wick.InstallerValidation.validateInstallerForm();
|
|
207
|
-
}
|
|
208
|
-
if (isFormValid) {
|
|
209
|
-
const submit = Wick.InstallerForm.recaptchaDecorate("submit", Wick.InstallerForm.submit)
|
|
210
|
-
submit();
|
|
211
|
-
}
|
|
212
|
-
}
|
|
213
|
-
},
|
|
214
|
-
clearFormData: function () {
|
|
215
|
-
var inputs = Object.assign(
|
|
216
|
-
Wick.InstallerValidation.steps[1],
|
|
217
|
-
Wick.InstallerValidation.steps[2],
|
|
218
|
-
Wick.InstallerValidation.steps[3]
|
|
219
|
-
);
|
|
220
|
-
|
|
221
|
-
return Object
|
|
222
|
-
.keys(inputs)
|
|
223
|
-
.forEach(function (elementName) {
|
|
224
|
-
var element = $('[name="'+ elementName +'"]');
|
|
225
|
-
var type = element.attr("type");
|
|
226
|
-
|
|
227
|
-
if (element.prop('tagName') === 'SELECT') {
|
|
228
|
-
element.prop('value', '');
|
|
229
|
-
return;
|
|
389
|
+
|
|
390
|
+
if (unformattedData.liabilityInsurance) {
|
|
391
|
+
installerInfo.proofOfInstaller.liabilityInsurance = unformattedData.liabilityInsurance;
|
|
230
392
|
}
|
|
231
393
|
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
$('[name="'+ elementName +'"]:checked').prop('checked', false);
|
|
236
|
-
return;
|
|
237
|
-
case 'file':
|
|
238
|
-
default:
|
|
239
|
-
element.prop('value', '');
|
|
240
|
-
element.prop('value', '');
|
|
241
|
-
return;
|
|
394
|
+
if (unformattedData.partPCertificateFront) {
|
|
395
|
+
installerInfo.proofOfInstaller.partPCertificateFront =
|
|
396
|
+
unformattedData.partPCertificateFront;
|
|
242
397
|
}
|
|
243
|
-
})
|
|
244
|
-
},
|
|
245
|
-
gatheringFormData: function () {
|
|
246
|
-
var inputs = Object.assign(
|
|
247
|
-
Wick.InstallerValidation.steps[1],
|
|
248
|
-
Wick.InstallerValidation.steps[2],
|
|
249
|
-
Wick.InstallerValidation.steps[3]
|
|
250
|
-
);
|
|
251
|
-
|
|
252
|
-
return Object
|
|
253
|
-
.keys(inputs)
|
|
254
|
-
.reduce(function (prev, elementName) {
|
|
255
|
-
var next = {
|
|
256
|
-
[elementName]: Wick.InstallerValidation.getValueByName(elementName)
|
|
257
|
-
};
|
|
258
|
-
return Object.assign(
|
|
259
|
-
prev,
|
|
260
|
-
next
|
|
261
|
-
)
|
|
262
|
-
}, {})
|
|
263
|
-
},
|
|
264
|
-
formatInstallationTypes: function (unformattedData) {
|
|
265
|
-
var installationtypes = {};
|
|
266
|
-
|
|
267
|
-
unformattedData.installationTypes.forEach(function (type) {
|
|
268
|
-
if (type === 'kitchens') {
|
|
269
|
-
installationtypes.kitchens = {
|
|
270
|
-
installationsNumber: unformattedData.installationsNumber_kitchen,
|
|
271
|
-
gasSafeRegistration: unformattedData.gasSafeRegistration,
|
|
272
|
-
hasSolidWorktopsExperience: unformattedData.hasSolidWorktopsExperience,
|
|
273
|
-
canArrangePreviousWorks: unformattedData.canArrangePreviousWorks_kitchen
|
|
274
|
-
};
|
|
275
398
|
|
|
276
|
-
if (
|
|
277
|
-
|
|
399
|
+
if (unformattedData.partPCertificateBack) {
|
|
400
|
+
installerInfo.proofOfInstaller.partPCertificateBack =
|
|
401
|
+
unformattedData.partPCertificateBack;
|
|
278
402
|
}
|
|
279
403
|
|
|
280
|
-
if (
|
|
281
|
-
|
|
404
|
+
if (unformattedData.asbestosAwarenessCertificate) {
|
|
405
|
+
installerInfo.proofOfInstaller.asbestosAwarenessCertificate =
|
|
406
|
+
unformattedData.asbestosAwarenessCertificate;
|
|
282
407
|
}
|
|
283
408
|
|
|
284
|
-
if (
|
|
285
|
-
|
|
409
|
+
if (
|
|
410
|
+
unformattedData.hasVatCertificate === 'installer_application_vat_registered_yes' &&
|
|
411
|
+
!!unformattedData.vatCertificate
|
|
412
|
+
) {
|
|
413
|
+
installerInfo.proofOfInstaller.vatCertificate = unformattedData.vatCertificate;
|
|
414
|
+
}
|
|
415
|
+
|
|
416
|
+
if (unformattedData.businessType !== 'sole_trader') {
|
|
417
|
+
if (unformattedData.hasCompanyIncorporationCertificate) {
|
|
418
|
+
installerInfo.proofOfInstaller.hasCompanyIncorporationCertificate =
|
|
419
|
+
unformattedData.hasCompanyIncorporationCertificate;
|
|
420
|
+
}
|
|
421
|
+
if (unformattedData.companyIncorporationCertificate) {
|
|
422
|
+
installerInfo.proofOfInstaller.companyIncorporationCertificate =
|
|
423
|
+
unformattedData.companyIncorporationCertificate;
|
|
424
|
+
}
|
|
286
425
|
}
|
|
287
|
-
}
|
|
288
|
-
if (type === 'bathrooms') {
|
|
289
|
-
installationtypes.bathrooms = {
|
|
290
|
-
installationsNumber: unformattedData.installationsNumber_bathroom,
|
|
291
|
-
canArrangePreviousWorks: unformattedData.canArrangePreviousWorks_bathroom
|
|
292
|
-
};
|
|
293
|
-
}
|
|
294
|
-
if (type === 'flooring') {
|
|
295
|
-
installationtypes.flooring = {
|
|
296
|
-
installationsNumber: unformattedData.installationsNumber_flooring,
|
|
297
|
-
flooringTypes: unformattedData.flooringTypes,
|
|
298
|
-
installers: unformattedData.installers_flooring,
|
|
299
|
-
hasFlooringQualification: unformattedData.hasFlooringQualification,
|
|
300
|
-
canArrangePreviousWorks: unformattedData.canArrangePreviousWorks_flooring
|
|
301
|
-
};
|
|
302
|
-
}
|
|
303
|
-
if (type === 'tiling') {
|
|
304
|
-
installationtypes.tiling = {
|
|
305
|
-
installationsNumber: unformattedData.installationsNumber_tiling,
|
|
306
|
-
tilingTypes: unformattedData.tilingTypes,
|
|
307
|
-
installers: unformattedData.installers_tiling,
|
|
308
|
-
hasTilingQualification: unformattedData.hasTilingQualification,
|
|
309
|
-
canArrangePreviousWorks: unformattedData.canArrangePreviousWorks_tiling
|
|
310
|
-
};
|
|
311
|
-
}
|
|
312
|
-
});
|
|
313
|
-
|
|
314
|
-
return installationtypes;
|
|
315
|
-
},
|
|
316
|
-
formatFormData: function (unformattedData) {
|
|
317
|
-
var installerInfo = {
|
|
318
|
-
personalDetails: {
|
|
319
|
-
email: unformattedData.email,
|
|
320
|
-
title: unformattedData.title,
|
|
321
|
-
firstName: unformattedData.firstName,
|
|
322
|
-
lastName: unformattedData.lastName
|
|
323
|
-
},
|
|
324
|
-
businessDetails: {
|
|
325
|
-
businessName: unformattedData.businessName,
|
|
326
|
-
businessType: unformattedData.businessType,
|
|
327
|
-
postCode: unformattedData.postCode,
|
|
328
|
-
line1: unformattedData.line1,
|
|
329
|
-
town: unformattedData.town,
|
|
330
|
-
mobileNumber: unformattedData.mobileNumber
|
|
331
|
-
},
|
|
332
|
-
proofOfInstaller: {
|
|
333
|
-
hasLiabilityInsurance: unformattedData.hasLiabilityInsurance,
|
|
334
|
-
hasPartPCertificate: unformattedData.hasPartPCertificate,
|
|
335
|
-
hasAsbestosAwarenessCertificate: unformattedData.hasAsbestosAwarenessCertificate,
|
|
336
|
-
hasVatCertificate: unformattedData.hasVatCertificate,
|
|
337
|
-
},
|
|
338
|
-
installationTypes: Wick.InstallerForm.formatInstallationTypes(unformattedData),
|
|
339
|
-
additionalInstallationTypes: unformattedData.additionalInstallationTypes,
|
|
340
|
-
preferences: unformattedData.preferences
|
|
341
|
-
};
|
|
342
426
|
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
if (!!unformattedData.partPCertificateFront) {
|
|
352
|
-
installerInfo.proofOfInstaller.partPCertificateFront = unformattedData.partPCertificateFront;
|
|
353
|
-
}
|
|
354
|
-
|
|
355
|
-
if (!!unformattedData.partPCertificateBack) {
|
|
356
|
-
installerInfo.proofOfInstaller.partPCertificateBack = unformattedData.partPCertificateBack;
|
|
357
|
-
}
|
|
358
|
-
|
|
359
|
-
if (!!unformattedData.asbestosAwarenessCertificate) {
|
|
360
|
-
installerInfo.proofOfInstaller.asbestosAwarenessCertificate = unformattedData.asbestosAwarenessCertificate;
|
|
361
|
-
}
|
|
362
|
-
|
|
363
|
-
if (unformattedData.hasVatCertificate === 'installer_application_vat_registered_yes' && !!unformattedData.vatCertificate) {
|
|
364
|
-
installerInfo.proofOfInstaller.vatCertificate = unformattedData.vatCertificate;
|
|
365
|
-
}
|
|
366
|
-
|
|
367
|
-
if (unformattedData.businessType !== 'sole_trader') {
|
|
368
|
-
if (!!unformattedData.hasCompanyIncorporationCertificate) {
|
|
369
|
-
installerInfo.proofOfInstaller.hasCompanyIncorporationCertificate = unformattedData.hasCompanyIncorporationCertificate;
|
|
370
|
-
}
|
|
371
|
-
if (!!unformattedData.companyIncorporationCertificate) {
|
|
372
|
-
installerInfo.proofOfInstaller.companyIncorporationCertificate = unformattedData.companyIncorporationCertificate;
|
|
373
|
-
}
|
|
374
|
-
}
|
|
375
|
-
|
|
376
|
-
if (unformattedData.businessType === 'sole_trader') {
|
|
377
|
-
if (!!unformattedData.hasUtrNumber) {
|
|
378
|
-
installerInfo.proofOfInstaller.hasUtrNumber = unformattedData.hasUtrNumber;
|
|
379
|
-
}
|
|
380
|
-
if (!!unformattedData.utrNumberCopy) {
|
|
381
|
-
installerInfo.proofOfInstaller.utrNumberCopy = unformattedData.utrNumberCopy;
|
|
382
|
-
}
|
|
383
|
-
}
|
|
384
|
-
|
|
385
|
-
return installerInfo;
|
|
386
|
-
},
|
|
387
|
-
redirectToThankYouPage: function () {
|
|
388
|
-
window.location.href = './page_installer-thank-you.html';
|
|
389
|
-
},
|
|
390
|
-
handleSubmitSuccess: function () {
|
|
391
|
-
Wick.InstallerForm.filesForm.hideSpinner();
|
|
392
|
-
Wick.InstallerForm.redirectToThankYouPage();
|
|
393
|
-
},
|
|
394
|
-
handleSubmitError: function (error) {
|
|
395
|
-
Wick.InstallerForm.filesForm.hideSpinner();
|
|
396
|
-
if (error.status === 202) {
|
|
397
|
-
Wick.InstallerForm.redirectToThankYouPage();
|
|
398
|
-
}
|
|
399
|
-
if (error.status >= 400 && error.status < 600) {
|
|
400
|
-
Wick.InstallerValidation.addGlobalErrorNotification(3, ['submit']);
|
|
401
|
-
}
|
|
402
|
-
},
|
|
403
|
-
submit: function (recaptchaToken) {
|
|
404
|
-
var hostnames = Wick.InstallerForm.getHostnames();
|
|
405
|
-
var URL_POST_LINK = hostnames.register_url + '/installer';
|
|
406
|
-
|
|
407
|
-
var unformatedData = Wick.InstallerForm.gatheringFormData();
|
|
408
|
-
var installerInfo = Wick.InstallerForm.formatFormData(unformatedData);
|
|
409
|
-
installerInfo['g-recaptcha-response'] = recaptchaToken;
|
|
410
|
-
|
|
411
|
-
Wick.InstallerForm.filesForm.showSpinner();
|
|
412
|
-
|
|
413
|
-
$.ajax({
|
|
414
|
-
type: 'POST',
|
|
415
|
-
url: URL_POST_LINK,
|
|
416
|
-
contentType: 'application/json',
|
|
417
|
-
data: JSON.stringify(installerInfo)
|
|
418
|
-
})
|
|
419
|
-
.done(Wick.InstallerForm.handleSubmitSuccess)
|
|
420
|
-
.fail(Wick.InstallerForm.handleSubmitError);
|
|
421
|
-
},
|
|
422
|
-
retrieveCustomerData: function() {
|
|
423
|
-
const $emailField = $('#email');
|
|
424
|
-
$.ajax({
|
|
425
|
-
type: 'GET',
|
|
426
|
-
url: Wick.InstallerForm.CUSTOMER_DATA_URL,
|
|
427
|
-
success: function(data) {
|
|
428
|
-
Wick.InstallerForm.populateCustomerData(data);
|
|
429
|
-
if ($emailField.val()) {
|
|
430
|
-
$emailField.prop('disabled', true);
|
|
427
|
+
if (unformattedData.businessType === 'sole_trader') {
|
|
428
|
+
if (unformattedData.hasUtrNumber) {
|
|
429
|
+
installerInfo.proofOfInstaller.hasUtrNumber = unformattedData.hasUtrNumber;
|
|
430
|
+
}
|
|
431
|
+
if (unformattedData.utrNumberCopy) {
|
|
432
|
+
installerInfo.proofOfInstaller.utrNumberCopy = unformattedData.utrNumberCopy;
|
|
433
|
+
}
|
|
431
434
|
}
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
435
|
+
|
|
436
|
+
return installerInfo;
|
|
437
|
+
},
|
|
438
|
+
redirectToThankYouPage: function () {
|
|
439
|
+
window.location.href = './page_installer-thank-you.html';
|
|
440
|
+
},
|
|
441
|
+
handleSubmitSuccess: function () {
|
|
442
|
+
Wick.InstallerForm.filesForm.hideSpinner();
|
|
443
|
+
Wick.InstallerForm.redirectToThankYouPage();
|
|
444
|
+
},
|
|
445
|
+
handleSubmitError: function (error) {
|
|
446
|
+
Wick.InstallerForm.filesForm.hideSpinner();
|
|
447
|
+
if (error.status === 202) {
|
|
448
|
+
Wick.InstallerForm.redirectToThankYouPage();
|
|
449
|
+
}
|
|
450
|
+
if (error.status >= 400 && error.status < 600) {
|
|
451
|
+
Wick.InstallerValidation.addGlobalErrorNotification(3, ['submit']);
|
|
452
|
+
}
|
|
453
|
+
},
|
|
454
|
+
submit: function (recaptchaToken) {
|
|
455
|
+
var hostnames = Wick.InstallerForm.getHostnames();
|
|
456
|
+
var URL_POST_LINK = hostnames.register_url + '/installer';
|
|
457
|
+
|
|
458
|
+
var unformatedData = Wick.InstallerForm.gatheringFormData();
|
|
459
|
+
var installerInfo = Wick.InstallerForm.formatFormData(unformatedData);
|
|
460
|
+
installerInfo['g-recaptcha-response'] = recaptchaToken;
|
|
461
|
+
|
|
462
|
+
Wick.InstallerForm.filesForm.showSpinner();
|
|
463
|
+
|
|
464
|
+
$.ajax({
|
|
465
|
+
type: 'POST',
|
|
466
|
+
url: URL_POST_LINK,
|
|
467
|
+
contentType: 'application/json',
|
|
468
|
+
data: JSON.stringify(installerInfo),
|
|
465
469
|
})
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
470
|
+
.done(Wick.InstallerForm.handleSubmitSuccess)
|
|
471
|
+
.fail(Wick.InstallerForm.handleSubmitError);
|
|
472
|
+
},
|
|
473
|
+
retrieveCustomerData: function () {
|
|
474
|
+
const $emailField = $('#email');
|
|
475
|
+
$.ajax({
|
|
476
|
+
type: 'GET',
|
|
477
|
+
url: Wick.InstallerForm.CUSTOMER_DATA_URL,
|
|
478
|
+
success: function (data) {
|
|
479
|
+
Wick.InstallerForm.populateCustomerData(data);
|
|
480
|
+
if ($emailField.val()) {
|
|
481
|
+
$emailField.prop('disabled', true);
|
|
482
|
+
}
|
|
483
|
+
},
|
|
484
|
+
});
|
|
485
|
+
},
|
|
486
|
+
populateCustomerData: function (data) {
|
|
487
|
+
$('#title option')
|
|
488
|
+
.filter(function () {
|
|
489
|
+
return $(this).text().toLowerCase() === data.title.toLowerCase();
|
|
490
|
+
})
|
|
491
|
+
.prop('selected', true);
|
|
492
|
+
$('#first-name').val(data.firstName);
|
|
493
|
+
$('#surname').val(data.lastName);
|
|
494
|
+
$('#email').val(data.email);
|
|
495
|
+
$('#tel').val(data.phone);
|
|
496
|
+
$('#business-name').val(data.businessName);
|
|
497
|
+
$('#address-line-1').val(data.line1);
|
|
498
|
+
$('#address-line-2').val(data.line2);
|
|
499
|
+
$('#city-town').val(data.town);
|
|
500
|
+
$('#postcode').val(data.postcode);
|
|
501
|
+
$('#Email').prop('checked', data.sendEmail);
|
|
502
|
+
$('#SMS').prop('checked', data.sendSms);
|
|
503
|
+
$('#Phone').prop('checked', data.sendPhone);
|
|
504
|
+
$('#Post').prop('checked', data.sendPost);
|
|
505
|
+
},
|
|
506
|
+
|
|
507
|
+
RECAPTCHA_PUBLIC_KEY: '6LdVZ74ZAAAAABiyCm6Szsv5T9wbrOCegkskM2iR',
|
|
508
|
+
|
|
509
|
+
recaptchaDecorate: function (action, f) {
|
|
510
|
+
return function () {
|
|
511
|
+
const context = this;
|
|
512
|
+
const args = arguments;
|
|
513
|
+
grecaptcha.ready(function () {
|
|
514
|
+
grecaptcha
|
|
515
|
+
.execute(Wick.InstallerForm.RECAPTCHA_PUBLIC_KEY, {
|
|
516
|
+
action: action,
|
|
517
|
+
})
|
|
518
|
+
.then(function (token) {
|
|
519
|
+
f.call(context, token, ...args);
|
|
520
|
+
});
|
|
521
|
+
});
|
|
522
|
+
};
|
|
523
|
+
},
|
|
469
524
|
};
|
|
470
525
|
|
|
471
526
|
$(document).ready(function () {
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
527
|
+
Wick.InstallerForm.bindClearForm();
|
|
528
|
+
Wick.InstallerForm.bindFileInputs();
|
|
529
|
+
Wick.InstallerForm.bindDeleteFileButtons();
|
|
530
|
+
Wick.InstallerForm.bindFileRadioButtons();
|
|
531
|
+
Wick.InstallerForm.bindStepSubmitButtons();
|
|
532
|
+
Wick.InstallerForm.bindBusinessTypeCheckboxes();
|
|
533
|
+
Wick.InstallerForm.retrieveCustomerData();
|
|
479
534
|
});
|
|
480
535
|
|
|
481
536
|
// Polyfills
|
|
482
537
|
if (!String.prototype.startsWith) {
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
538
|
+
String.prototype.startsWith = function (searchString, position) {
|
|
539
|
+
position = position || 0;
|
|
540
|
+
return this.indexOf(searchString, position) === position;
|
|
541
|
+
};
|
|
487
542
|
}
|