-
Notifications
You must be signed in to change notification settings - Fork 2.6k
fix: Default data for local file nodes #4426
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -93,9 +93,9 @@ const props = defineProps<{ nodeModel: any }>() | |
|
|
||
| const file_type_list_options = ['TXT', 'DOCX', 'PDF', 'HTML', 'XLS', 'XLSX', 'ZIP', 'CSV'] | ||
| const form = { | ||
| file_type_list: [], | ||
| file_size_limit: 50, | ||
| file_count_limit: 100, | ||
| file_type_list: ['TXT', 'DOCX', 'PDF', 'HTML', 'XLS', 'XLSX', 'ZIP', 'CSV'], | ||
| file_size_limit: 100, | ||
| file_count_limit: 50, | ||
| } | ||
|
|
||
| const form_data = computed({ | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The provided code does not contain any immediate irregularities, but there are some areas where it can be improved or optimized:
Here's a slightly modified version with some of these considerations: import { defineProps, computed } from 'vue';
const props = defineProps<{ nodeModel: any }>();
// Define static constants outside components to improve reusability and maintainability
export const FILE_TYPE_LIST_OPTIONS = [
'TXT',
'DOCX',
'PDF',
'HTML',
'XLS',
'XLSX',
'ZIP',
'CSV'
];
const form = {
file_type_list: FILE_TYPE_LIST_OPTIONS,
// Set reasonable limits for file size and count considering typical use cases
file_size_limit: 100 * 1024 * 1024, // e.g., 100 MB
file_count_limit: 50,
};
const formData = computed(() => ({
selectedFileTypeList: getSelectedFileTypes(), // Implement a helper function separately
}));
// Helper function to filter out unselected types dynamically based on user input
function getSelectedFileTypes() {
// Example logic: return checked/selected file types here
}Summary:
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are no major irregularities or significant issues in the provided code snippet. However, there is an unnecessary property (
node_data) being defined within theconfigobject. This could be removed as it seems to serve no purpose at this point.Here's a revised version of the code that removes the unused
node_dataproperty:This change reduces redundancy and maintains clarity in the component's structure.