Skip to content

Commit

Permalink
pkp/pkp-lib#10820 Add showErrorFooter prop in Form and FormPage compo…
Browse files Browse the repository at this point in the history
…nents
  • Loading branch information
blesildaramirez committed Feb 5, 2025
1 parent bed14c2 commit 7a898b8
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
8 changes: 8 additions & 0 deletions src/components/Form/Form.vue
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@
:visible-locales="visibleLocales"
:available-locales="availableLocales"
:is-saving="isSaving"
:show-error-footer="showErrorFooter"
@change="fieldChanged"
@page-submitted="nextPage"
@previous-page="setCurrentPage(false)"
Expand Down Expand Up @@ -135,6 +136,13 @@ export default {
* Async function, receiving data from form and returning {validationError, data} from useFetch
*/
customSubmit: Function,
/** If the error summary is shown in the form's footer. */
showErrorFooter: {
type: Boolean,
default() {
return true;
},
},
},
emits: [
/** When the form props need to be updated. The payload is an object with any keys that need to be modified. */
Expand Down
8 changes: 7 additions & 1 deletion src/components/Form/FormPage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
aria-live="polite"
>
<FormErrors
v-if="Object.keys(errors).length"
v-if="Object.keys(errors).length && showErrorFooter"
:errors="errors"
:fields="fields"
@showField="showField"
Expand Down Expand Up @@ -108,6 +108,12 @@ export default {
},
},
isSaving: Boolean,
showErrorFooter: {
type: Boolean,
default() {
return true;
},
},
},
data() {
return {
Expand Down

0 comments on commit 7a898b8

Please sign in to comment.