Skip to content

Commit

Permalink
Merge branch '1.7' into 1.8
Browse files Browse the repository at this point in the history
  • Loading branch information
emteknetnz committed Jun 22, 2021
2 parents bfe63b7 + 0970e03 commit a287291
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 3 deletions.
2 changes: 1 addition & 1 deletion client/dist/js/bundle.js

Large diffs are not rendered by default.

13 changes: 11 additions & 2 deletions client/src/containers/InsertMediaModal/InsertMediaModal.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import FormBuilderModal from 'components/FormBuilderModal/FormBuilderModal';
import classnames from 'classnames';
import PropTypes from 'prop-types';
import getFormSchema from 'lib/getFormSchema';
import qs from 'qs';

class InsertMediaModal extends Component {
constructor(props) {
Expand Down Expand Up @@ -197,13 +198,21 @@ function mapStateToProps(state, ownProps) {
return {};
}

const requireTextFieldUrl = ownProps.requireLinkText ? '?requireLinkText=true' : '';
const queryMap = {};
if (ownProps.requireLinkText) {
queryMap.requireLinkText = true;
}
if (ownProps.fileSelected) {
queryMap.fileSelected = true;
}
let query = qs.stringify(queryMap);
query = query ? `?${query}` : '';

// set schemaUrl for `fileSchemaModalHandler` to load the default form values properly
// This schema URL is not actually passed down to the Editor, it's just use to set the
// form schema overrides
return {
schemaUrl: `${schemaUrl}/${targetId}${requireTextFieldUrl}`,
schemaUrl: `${schemaUrl}/${targetId}${query}`,
type: formSchema && formSchema.type
};
}
Expand Down
2 changes: 2 additions & 0 deletions tests/behat/features/insert-an-image.feature
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ Feature: Insert an image into a page
When I select the image "file1.jpg" in the "Content" HTML field
And I press the "Insert from Files" HTML field button
Then I should see the "Update file" button
# Assert redux override functionality
Then I should see an "#Form_fileInsertForm_AltText[value='My alt']" element
When I press the "Details" button
And I fill in "Form_fileEditForm_Title" with "file one updated"
And I press the "Save" button
Expand Down

0 comments on commit a287291

Please sign in to comment.