Skip to content

Commit

Permalink
Merge pull request #239 from creative-commoners/pulls/4/remove-workar…
Browse files Browse the repository at this point in the history
…ound

FIX Remove workaround for nested redux form.
  • Loading branch information
sabina-talipova committed Mar 4, 2024
2 parents b6dcef0 + 654a1fd commit 746cb83
Show file tree
Hide file tree
Showing 6 changed files with 203 additions and 152 deletions.
4 changes: 2 additions & 2 deletions behat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ default:
- SilverStripe\Framework\Tests\Behaviour\CmsUiContext
- SilverStripe\BehatExtension\Context\BasicContext
- SilverStripe\BehatExtension\Context\LoginContext
-
-
SilverStripe\BehatExtension\Context\FixtureContext:
- '%paths.modules.linkfield%/tests/behat/features/files/'
- '%paths.modules.linkfield%/tests/behat/files/'

extensions:
SilverStripe\BehatExtension\MinkExtension:
Expand Down
2 changes: 1 addition & 1 deletion client/dist/js/bundle.js

Large diffs are not rendered by default.

11 changes: 0 additions & 11 deletions client/src/components/LinkModal/LinkModal.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,17 +42,6 @@ const LinkModal = ({ typeTitle, typeKey, linkID = 0, isOpen, onSuccess, onClosed
const onSubmit = async (modalData, action, submitFn) => {
let formSchema = null;

// Workaround to prevent the FormBuilder form from submitting when any nested FormBuilder forms are present
// This will happen when a FileLink is being used and the "Choose existing" link is clicked which
// will open up an asset-admin modal to select an existing file.
// Clicking any of the following submit buttons will cause LinkModal to inadvertanely submit:
// - "Insert file" which is present when the breakpoint is less than 'lg' (992px)
// - Save/Publish button after clicking on the 'Details' tab of a selected file
if (document.getElementById('Form_fileSelectForm_action_insert')
|| document.getElementById('Form_fileEditForm_Actions_Holder')) {
return Promise.resolve();
}

try {
formSchema = await submitFn();
} catch (error) {
Expand Down

0 comments on commit 746cb83

Please sign in to comment.