From a2deb695af9659acb753296b0b4c52eefa8c624c Mon Sep 17 00:00:00 2001 From: Qiyun Dai Date: Thu, 15 Aug 2024 10:29:19 -0500 Subject: [PATCH] [MWPW-156736] Validation state for partner URL does not clear (#173) --- .../controllers/event-format-component-controller.js | 8 -------- ecc/blocks/form-handler/form-handler.js | 8 -------- ecc/components/partner-selector/partner-selector.js | 5 +++-- 3 files changed, 3 insertions(+), 18 deletions(-) diff --git a/ecc/blocks/form-handler/controllers/event-format-component-controller.js b/ecc/blocks/form-handler/controllers/event-format-component-controller.js index 8ab49606..d0f0951e 100644 --- a/ecc/blocks/form-handler/controllers/event-format-component-controller.js +++ b/ecc/blocks/form-handler/controllers/event-format-component-controller.js @@ -24,14 +24,6 @@ function prepopulateTimeZone(component) { } function initStepLock(component) { - const { search } = window.location; - const urlParams = new URLSearchParams(search); - const skipValidation = urlParams.get('skipValidation'); - - if (skipValidation === 'true' && ['stage', 'local'].includes(MILO_CONFIG.env.name)) { - return; - } - const step = component.closest('.fragment'); const inputs = component.querySelectorAll('#bu-select-input, #series-select-input'); diff --git a/ecc/blocks/form-handler/form-handler.js b/ecc/blocks/form-handler/form-handler.js index fa694220..531b3600 100644 --- a/ecc/blocks/form-handler/form-handler.js +++ b/ecc/blocks/form-handler/form-handler.js @@ -151,14 +151,6 @@ function getCurrentFragment(props) { } function validateRequiredFields(fields) { - const { search } = window.location; - const urlParams = new URLSearchParams(search); - const skipValidation = urlParams.get('skipValidation'); - - if (skipValidation === 'true' && ['stage', 'local'].includes(MILO_CONFIG.env.name)) { - return true; - } - return fields.length === 0 || Array.from(fields).every((f) => f.value); } diff --git a/ecc/components/partner-selector/partner-selector.js b/ecc/components/partner-selector/partner-selector.js index 0038f3fe..9d602aee 100644 --- a/ecc/components/partner-selector/partner-selector.js +++ b/ecc/components/partner-selector/partner-selector.js @@ -154,9 +154,10 @@ export default class PartnerSelector extends LitElement {
- { + { this.updatePartner({ link: event.target.value }); -}}> + // FIXME: I really shouldn't need to do this, but the pattern attribute doesn't reset properly. +}} ?valid=${this.partner.link?.match(LINK_REGEX)}>