Skip to content

Commit

Permalink
[MWPW-156736] Validation state for partner URL does not clear (#173)
Browse files Browse the repository at this point in the history
  • Loading branch information
qiyundai authored Aug 15, 2024
1 parent 30334d1 commit a2deb69
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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');

Expand Down
8 changes: 0 additions & 8 deletions ecc/blocks/form-handler/form-handler.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down
5 changes: 3 additions & 2 deletions ecc/components/partner-selector/partner-selector.js
Original file line number Diff line number Diff line change
Expand Up @@ -154,9 +154,10 @@ export default class PartnerSelector extends LitElement {
</div>
<div class="partner-input">
<label>${this.fieldLabels.urlLabelText}</label>
<sp-textfield pattern=${LINK_REGEX} value=${this.partner.link} placeholder="Enter partner full URL", @change=${(event) => {
<sp-textfield pattern=${LINK_REGEX} value=${this.partner.link} placeholder="Enter partner full URL" @change=${(event) => {
this.updatePartner({ link: event.target.value });
}}></sp-textfield>
// FIXME: I really shouldn't need to do this, but the pattern attribute doesn't reset properly.
}} ?valid=${this.partner.link?.match(LINK_REGEX)}></sp-textfield>
</div>
</div>
</div>
Expand Down

0 comments on commit a2deb69

Please sign in to comment.