refactor(parameterComponent): remove unused 'suffixes' prop from ParameterComponent
refactor(codeTabsComponent): remove unused 'suffixes' prop from CodeTabsComponent refactor(inputFileComponent): remove unused 'suffixes' prop from InputFileComponent refactor(editNodeModal): remove unused 'suffixes' prop from EditNodeModal refactor(types): remove unused 'suffixes' prop from FileComponentType
This commit is contained in:
parent
9735fa2abe
commit
0f9827564e
5 changed files with 3 additions and 15 deletions
|
|
@ -462,7 +462,6 @@ export default function ParameterComponent({
|
|||
value={data.node?.template[name].value ?? ""}
|
||||
onChange={handleOnNewValue}
|
||||
fileTypes={data.node?.template[name].fileTypes}
|
||||
suffixes={data.node?.template[name].suffixes}
|
||||
onFileChange={(filePath: string) => {
|
||||
data.node!.template[name].file_path = filePath;
|
||||
}}
|
||||
|
|
|
|||
|
|
@ -444,11 +444,6 @@ export default function CodeTabsComponent({
|
|||
templateField
|
||||
].fileTypes
|
||||
}
|
||||
suffixes={
|
||||
node.data.node.template[
|
||||
templateField
|
||||
].suffixes
|
||||
}
|
||||
onFileChange={(
|
||||
value: any
|
||||
) => {
|
||||
|
|
|
|||
|
|
@ -9,7 +9,6 @@ export default function InputFileComponent({
|
|||
value,
|
||||
onChange,
|
||||
disabled,
|
||||
suffixes,
|
||||
fileTypes,
|
||||
onFileChange,
|
||||
editNode = false,
|
||||
|
|
@ -41,8 +40,8 @@ export default function InputFileComponent({
|
|||
}, [disabled, onChange]);
|
||||
|
||||
function checkFileType(fileName: string): boolean {
|
||||
for (let index = 0; index < suffixes.length; index++) {
|
||||
if (fileName.endsWith(suffixes[index])) {
|
||||
for (let index = 0; index < fileTypes.length; index++) {
|
||||
if (fileName.endsWith(fileTypes[index])) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
@ -57,7 +56,7 @@ export default function InputFileComponent({
|
|||
// Create a file input element
|
||||
const input = document.createElement("input");
|
||||
input.type = "file";
|
||||
input.accept = suffixes.join(",");
|
||||
input.accept = fileTypes.join(",");
|
||||
input.style.display = "none"; // Hidden from view
|
||||
input.multiple = false; // Allow only one file selection
|
||||
|
||||
|
|
|
|||
|
|
@ -380,10 +380,6 @@ const EditNodeModal = forwardRef(
|
|||
myData.node.template[templateParam]
|
||||
.fileTypes
|
||||
}
|
||||
suffixes={
|
||||
myData.node.template[templateParam]
|
||||
.suffixes
|
||||
}
|
||||
onFileChange={(filePath: string) => {
|
||||
data.node!.template[
|
||||
templateParam
|
||||
|
|
|
|||
|
|
@ -119,7 +119,6 @@ export type FileComponentType = {
|
|||
disabled: boolean;
|
||||
onChange: (value: string[] | string) => void;
|
||||
value: string;
|
||||
suffixes: Array<string>;
|
||||
fileTypes: Array<string>;
|
||||
onFileChange: (value: string) => void;
|
||||
editNode?: boolean;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue