Bugfix/GoogleDrive Loader Folder id (#4714)
* fix google drive loader folder id * lint fix
This commit is contained in:
parent
24426266ba
commit
4038eb13fc
|
|
@ -69,7 +69,8 @@ class GoogleDrive_DocumentLoaders implements INode {
|
||||||
type: 'asyncMultiOptions',
|
type: 'asyncMultiOptions',
|
||||||
loadMethod: 'listFiles',
|
loadMethod: 'listFiles',
|
||||||
description: 'Select files from your Google Drive',
|
description: 'Select files from your Google Drive',
|
||||||
refresh: true
|
refresh: true,
|
||||||
|
optional: true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: 'Folder ID',
|
label: 'Folder ID',
|
||||||
|
|
|
||||||
|
|
@ -32,6 +32,11 @@ const fetchList = async ({ name, nodeData, previousNodes, currentNode }) => {
|
||||||
const selectedParam = nodeData.inputParams.find((param) => param.name === name)
|
const selectedParam = nodeData.inputParams.find((param) => param.name === name)
|
||||||
const loadMethod = selectedParam?.loadMethod
|
const loadMethod = selectedParam?.loadMethod
|
||||||
|
|
||||||
|
let credentialId = nodeData.credential
|
||||||
|
if (!credentialId && (nodeData.inputs?.credential || nodeData.inputs?.['FLOWISE_CREDENTIAL_ID'])) {
|
||||||
|
credentialId = nodeData.inputs.credential || nodeData.inputs?.['FLOWISE_CREDENTIAL_ID']
|
||||||
|
}
|
||||||
|
|
||||||
let config = {
|
let config = {
|
||||||
headers: {
|
headers: {
|
||||||
'x-request-from': 'internal',
|
'x-request-from': 'internal',
|
||||||
|
|
@ -41,7 +46,11 @@ const fetchList = async ({ name, nodeData, previousNodes, currentNode }) => {
|
||||||
}
|
}
|
||||||
|
|
||||||
let lists = await axios
|
let lists = await axios
|
||||||
.post(`${baseURL}/api/v1/node-load-method/${nodeData.name}`, { ...nodeData, loadMethod, previousNodes, currentNode }, config)
|
.post(
|
||||||
|
`${baseURL}/api/v1/node-load-method/${nodeData.name}`,
|
||||||
|
{ ...nodeData, loadMethod, previousNodes, currentNode, credential: credentialId },
|
||||||
|
config
|
||||||
|
)
|
||||||
.then(async function (response) {
|
.then(async function (response) {
|
||||||
return response.data
|
return response.data
|
||||||
})
|
})
|
||||||
|
|
@ -62,7 +71,8 @@ export const AsyncDropdown = ({
|
||||||
disabled = false,
|
disabled = false,
|
||||||
freeSolo = false,
|
freeSolo = false,
|
||||||
disableClearable = false,
|
disableClearable = false,
|
||||||
multiple = false
|
multiple = false,
|
||||||
|
fullWidth = false
|
||||||
}) => {
|
}) => {
|
||||||
const customization = useSelector((state) => state.customization)
|
const customization = useSelector((state) => state.customization)
|
||||||
const theme = useTheme()
|
const theme = useTheme()
|
||||||
|
|
@ -175,7 +185,7 @@ export const AsyncDropdown = ({
|
||||||
multiple={multiple}
|
multiple={multiple}
|
||||||
filterSelectedOptions={multiple}
|
filterSelectedOptions={multiple}
|
||||||
size='small'
|
size='small'
|
||||||
sx={{ mt: 1, width: multiple ? '90%' : '100%' }}
|
sx={{ mt: 1, width: fullWidth ? '100%' : multiple ? '90%' : '100%' }}
|
||||||
open={open}
|
open={open}
|
||||||
onOpen={() => {
|
onOpen={() => {
|
||||||
setOpen(true)
|
setOpen(true)
|
||||||
|
|
@ -309,5 +319,6 @@ AsyncDropdown.propTypes = {
|
||||||
credentialNames: PropTypes.array,
|
credentialNames: PropTypes.array,
|
||||||
disableClearable: PropTypes.bool,
|
disableClearable: PropTypes.bool,
|
||||||
isCreateNewOption: PropTypes.bool,
|
isCreateNewOption: PropTypes.bool,
|
||||||
multiple: PropTypes.bool
|
multiple: PropTypes.bool,
|
||||||
|
fullWidth: PropTypes.bool
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -243,6 +243,7 @@ const DocStoreInputHandler = ({ inputParam, data, disabled = false, onNodeDataCh
|
||||||
value={data.inputs[inputParam.name] ?? inputParam.default ?? 'choose an option'}
|
value={data.inputs[inputParam.name] ?? inputParam.default ?? 'choose an option'}
|
||||||
onSelect={(newValue) => handleDataChange({ inputParam, newValue })}
|
onSelect={(newValue) => handleDataChange({ inputParam, newValue })}
|
||||||
onCreateNew={() => addAsyncOption(inputParam.name)}
|
onCreateNew={() => addAsyncOption(inputParam.name)}
|
||||||
|
fullWidth={true}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
{inputParam.refresh && (
|
{inputParam.refresh && (
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue