Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
alexcarol committed Dec 13, 2024
1 parent 374023b commit be69fd7
Showing 1 changed file with 27 additions and 2 deletions.
29 changes: 27 additions & 2 deletions eds/blocks/form/form.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,16 +89,41 @@ export default async function decorate(block) {
// merge config and baseFormProps
const formProps = { ...baseFormProps, ...config };

console.log('formProps', formProps);

Check warning on line 92 in eds/blocks/form/form.js

View workflow job for this annotation

GitHub Actions / build

Unexpected console statement

console.log('window', window, window.initOneForm);

Check warning on line 94 in eds/blocks/form/form.js

View workflow job for this annotation

GitHub Actions / build

Unexpected console statement
const initResult = window.initOneForm(divId, formProps);
console.log('init result', initResult);

Check warning on line 96 in eds/blocks/form/form.js

View workflow job for this annotation

GitHub Actions / build

Unexpected console statement

console.log('window', window);

Check warning on line 98 in eds/blocks/form/form.js

View workflow job for this annotation

GitHub Actions / build

Unexpected console statement

const form = window.oneForm.attachToForm(divId);
form.on('load', (formApi) => {

Check failure on line 101 in eds/blocks/form/form.js

View workflow job for this annotation

GitHub Actions / build

'formApi' is defined but never used
//Perform API actions here

Check failure on line 102 in eds/blocks/form/form.js

View workflow job for this annotation

GitHub Actions / build

Expected exception block, space or tab after '//' in comment
console.log('form loaded');

Check warning on line 103 in eds/blocks/form/form.js

View workflow job for this annotation

GitHub Actions / build

Unexpected console statement
});

// workaround for initOneForm requiring the form div to be in the DOM,
// which it is not when loaded as a fragment
const observer = new MutationObserver((mutationsList) => {
mutationsList.forEach((mutation) => {
if (mutation.type === 'childlist') {
console.log('A child node has been added or removed.', document.getElementById(divId));

Check warning on line 111 in eds/blocks/form/form.js

View workflow job for this annotation

GitHub Actions / build

Unexpected console statement
}
if (mutation.type === 'childList' && document.getElementById(divId)) {
window.initOneForm(divId, formProps);
const initResult = window.initOneForm(divId, formProps);

Check failure on line 114 in eds/blocks/form/form.js

View workflow job for this annotation

GitHub Actions / build

'initResult' is already declared in the upper scope on line 95 column 9
console.log('init result', initResult);

Check warning on line 115 in eds/blocks/form/form.js

View workflow job for this annotation

GitHub Actions / build

Unexpected console statement
observer.observe(document.body, { childList: true, subtree: true });

const form = window.oneForm.attachToForm(divId);

Check failure on line 118 in eds/blocks/form/form.js

View workflow job for this annotation

GitHub Actions / build

'form' is already declared in the upper scope on line 100 column 9
form.on('load', (formApi) => {

Check failure on line 119 in eds/blocks/form/form.js

View workflow job for this annotation

GitHub Actions / build

'formApi' is defined but never used
//Perform API actions here

Check failure on line 120 in eds/blocks/form/form.js

View workflow job for this annotation

GitHub Actions / build

Expected exception block, space or tab after '//' in comment
console.log('form loaded');

Check warning on line 121 in eds/blocks/form/form.js

View workflow job for this annotation

GitHub Actions / build

Unexpected console statement
});
observer.disconnect();
}
});
});

Check failure on line 126 in eds/blocks/form/form.js

View workflow job for this annotation

GitHub Actions / build

Block must not be padded by blank lines

observer.observe(document.body, { childList: true, subtree: true });

Check failure on line 128 in eds/blocks/form/form.js

View workflow job for this annotation

GitHub Actions / build

More than 1 blank line not allowed
}

0 comments on commit be69fd7

Please sign in to comment.