Skip to content
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

FilePicker and Markdown: Remove file entries on destroy and file change event #5989

Merged
merged 7 commits into from
Feb 27, 2025

Conversation

stsrki
Copy link
Collaborator

@stsrki stsrki commented Feb 25, 2025

Further improves on #5980

I have changed how removeFileEntry is called. Now, it removes all entries when the component is destroyed and when the file(s) is changed. If there were previous file entries, then it will remove them.

I have also deleted RemoveFileEntry as it didn't make sense to keep it.

@stsrki stsrki requested a review from tesar-tech February 25, 2025 12:00
Copy link
Collaborator

@tesar-tech tesar-tech left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree with "batch removal", but I liked the call from dotnet more - because there we can tell when we want that (after OnImageUploadChanged)
If you do it in js you basically moving the logic there, which gets confusing and hard to maintain. imo the js calls should be as stupid as possible - while keeping the decisions/flows/logic in c#.

@stsrki
Copy link
Collaborator Author

stsrki commented Feb 26, 2025

I agree with "batch removal", but I liked the call from dotnet more - because there we can tell when we want that (after OnImageUploadChanged) If you do it in js you basically moving the logic there, which gets confusing and hard to maintain. imo the js calls should be as stupid as possible - while keeping the decisions/flows/logic in c#.

The problem with fully JS or fully C# side is that none works 100% times. It all depends on the specific implementation. So I think we can have a hybrid. Use JS fully for FilePicker, and hybrid for Markdown.

@stsrki stsrki requested a review from tesar-tech February 26, 2025 09:02
@stsrki stsrki merged commit 21922d9 into rel-1.7 Feb 27, 2025
2 checks passed
@stsrki stsrki deleted the rel-1.7-fix-file-upload branch February 27, 2025 12:17
@github-actions github-actions bot locked and limited conversation to collaborators Feb 27, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants