Fix file browser when files should be included

pull/3019/head
Mark McDowall 6 years ago
parent b63cbbdaaa
commit c3a6e01040

@ -38,7 +38,10 @@ class PathInputConnector extends Component {
// Listeners
onFetchPaths = (path) => {
this.props.fetchPaths({ path });
this.props.fetchPaths({
path,
includeFiles: this.props.includeFiles
});
}
onClearPaths = () => {
@ -60,6 +63,7 @@ class PathInputConnector extends Component {
}
PathInputConnector.propTypes = {
includeFiles: PropTypes.bool.isRequired,
fetchPaths: PropTypes.func.isRequired,
clearPaths: PropTypes.func.isRequired
};

@ -20,6 +20,8 @@ function getType(type) {
return inputTypes.NUMBER;
case 'path':
return inputTypes.PATH;
case 'filepath':
return inputTypes.PATH;
case 'select':
return inputTypes.SELECT;
case 'tag':
@ -84,7 +86,7 @@ function ProviderFieldFormGroup(props) {
errors={errors}
warnings={warnings}
pending={pending}
hasFileBrowser={false}
includeFiles={type === 'filepath' ? true : undefined}
onChange={onChange}
{...otherProps}
/>

@ -46,14 +46,16 @@ export const actionHandlers = handleThunks({
const {
path,
allowFoldersWithoutTrailingSlashes = false
allowFoldersWithoutTrailingSlashes = false,
includeFiles = false
} = payload;
const promise = createAjaxRequest({
url: '/filesystem',
data: {
path,
allowFoldersWithoutTrailingSlashes
allowFoldersWithoutTrailingSlashes,
includeFiles
}
}).request;

Loading…
Cancel
Save