Skip to content
This repository has been archived by the owner on Dec 9, 2024. It is now read-only.

Commit

Permalink
Merge pull request #351 from solocommand/fix-idx-bool
Browse files Browse the repository at this point in the history
Revert custom submit button handling
  • Loading branch information
solocommand authored Jun 20, 2022
2 parents 0ea12b9 + 5780159 commit 4744c1c
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 65 deletions.
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ services:
LIVERELOAD_PORT: 61269
TENANT_KEY: ${EXAMPLE_TENANT_KEY-p1_sandbox}
HOST: www-p1-sandbox.dev.parameter1.com
SITE_ID: ${EXAMPLE_SITE_ID-5ec4407aa7124b22008b4569}
SITE_ID: ${EXAMPLE_SITE_ID-5ed294c6c13a4626008b4568}

GRAPHQL_URI: ${GRAPHQL_URI-http://graphql-server-tauron}
OEMBED_URI: ${OEMBED_URI-https://oembed}
Expand Down
38 changes: 0 additions & 38 deletions packages/marko-web-identity-x/browser/form/common/button.vue

This file was deleted.

28 changes: 2 additions & 26 deletions packages/marko-web-identity-x/browser/profile.vue
Original file line number Diff line number Diff line change
Expand Up @@ -144,9 +144,9 @@
/>

<div class="d-flex align-items-center">
<Button :disabled="!canSubmit" color="primary">
<button type="submit" class="btn btn-primary">
{{ buttonLabel }}
</Button>
</button>
<span v-if="didSubmit" class="ml-2">
{{ submitMessage }}
</span>
Expand Down Expand Up @@ -176,7 +176,6 @@ import post from './utils/post';
import cookiesEnabled from './utils/cookies-enabled';
import regionCountryCodes from './utils/region-country-codes';
import Button from './form/common/button.vue';
import AddressBlock from './form/address-block.vue';
import CustomBoolean from './form/fields/custom-boolean.vue';
import CustomSelect from './form/fields/custom-select.vue';
Expand All @@ -199,7 +198,6 @@ const { isArray } = Array;
export default {
components: {
AddressBlock,
Button,
CustomBoolean,
CustomSelect,
GivenName,
Expand Down Expand Up @@ -323,28 +321,6 @@ export default {
return [...this.requiredServerFields, ...this.requiredClientFields];
},
canSubmit() {
const needSelect = this.customSelectFieldAnswers.some(
fa => fa.field.required && fa.answers.length === 0,
);
if (needSelect) return false;
// check if a write-in value is required
const needWriteIn = this.customSelectFieldAnswers.some(
fa => fa.field.required && fa.answers.every(({ id, writeInValue }) => {
const option = fa.field.options.find(opt => opt.id === id);
return option && option.canWriteIn && !writeInValue;
}),
);
if (needWriteIn) return false;
const needBool = this.customBooleanFieldAnswers.some(
fa => fa.field.required && !fa.hasAnswered,
);
if (needBool) return false;
// @todo check if required fields are set? html required should cover...
return true;
},
/**
*
*/
Expand Down

0 comments on commit 4744c1c

Please sign in to comment.