-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Use image-uploader and image-uploader-modal to handle image uploads #20564
Comments
Hi @AFZL210, thanks for proposing this as a good first issue. I am removing the label for now and looping in @DubeySandeep to approve the label. It will be added back if approved. Thanks! |
Task Overview: Approach: Thanks! |
@Nabanita29 The approch sounds good. I'm assigning you the create new topic modal part. Note: For now just replace the old component with new one don't delete the old component code now, we will remove it once we have fully replaced the old one. Setps to create a topic:
Here you will the the image uploader component this is the one which you have to replace. |
Hi may i know is this issue resolved ,I want to try this out |
@sankshaypusa This issue is still open, if you want to work on it just tell me which sub-part you would like to work and Per the usual guidance at https://github.com/oppia/oppia/wiki/Contributing-code-to-Oppia#choosing-a-good-first-issue, please provide proof that you are able to solve the issue locally. If it looks good, we can assign you to this issue. Please also follow the other instructions on that wiki page if you have not yet done so. Thanks. |
Unassigning @Nabanita29 due to inactivity. |
HI AFZL210 thanks for your response i would like to work on the Create new subtopic modal and I am new to open-source contribution and would like to solve this issue,I will provide proof of the solution as well |
@sankshaypusa Yes sure, you can start working on it and once it's fixed I will assign it to you. |
Hi AFZL210 I would like to know what result you expect from this issue, do we need any admin privileges to access? |
Hi @HardikGoyal2003 , I hope this message finds you well. I would like to request assignment for the issue regarding the use of image-uploader and image-uploader-modal to handle image uploads (#20564). Files to be Changed:- I understand that the task involves replacing the oppia-thumbnail-uploader with the new components and updating the backend handler and frontend service accordingly. I am eager to contribute to this issue and will ensure to follow the guidelines and provide proof of the solution as required. Thank you for considering my request. I look forward to your response. Best regards, |
Hey @KartikSuryavanshi, could you please specify the changes for one file, including the lines you’ll modify and the new content? Thanks! |
Hey @seanlip Before: <oppia-thumbnail-uploader After:- Explanation: |
Hey @KartikSuryavanshi, could you provide a video demo showing that this implementation works correctly with the feature? If everything is functioning well, I'd be happy to assign you this issue. Thanks! |
Hey @HardikGoyal2003 i made the changes and the new thumbnail uploader is working quite good!! Uploading Screen Recording 2024-10-01 at 12.mp4… |
Hey @KartikSuryavanshi I don't see any video demo, I think it isn't uploaded properly, kindly check. Thanks! |
Hey @HardikGoyal2003 i tried doing many attempts but it shows uploading .Can u check the below link!! |
Hey @KartikSuryavanshi This looks good, feel free to make a Pr, assigning this issue to you!! Thanks! |
Hey @HardikGoyal2003 , Thank you for assigning the issue to me! I will begin working on it right away and create a PR shortly. I'll keep you updated with my progress. |
Hey @HardikGoyal2003, I'm facing persistent linter issues, and despite my attempts to fix them, the errors keep appearing. The main issues highlighted are related to: Trailing whitespaces (e.g., lines 28, 119, and 120 in the HTML file). I’ve attached a screenshot for reference. Could you please help me figure out why these issues keep coming back and what I can do to resolve them? Thanks in advance for your help! |
@KartikSuryavanshi Whitespace characters remain and haven't been fully removed. Please verify the specified position for any whitespace. Also, comments should begin with a capital letter and end with a period. Let me know if this issue persists. |
Hey @HardikGoyal2003 I’ll continue troubleshooting, but please let me know if there are any suggestions for resolving this. |
Hey @KartikSuryavanshi, the issue is that after you remove your changes, you're not using |
Hey @HardikGoyal2003 Plz have a look!! |
Hey @KartikSuryavanshi, look at the second image at the top center. It displays a modified file marked in red, indicating it hasn’t been added yet, which is causing the error. |
Okay, I’ll check that out! Thanks for pointing it out.I will keep u updated! |
Hey @HardikGoyal2003 |
@KartikSuryavanshi Move the pointer after the comma on line 117 and press the right arrow key. If the pointer moves to the next line, there is no whitespace; otherwise, you'll find out a whitespace there. |
Hey @HardikGoyal2003 Can u help me with this issue? |
|
Hey @HardikGoyal2003 plz help with this linting issues!! |
@KartikSuryavanshi Are you using tabs instead of spaces? In general you should use spaces everywhere. Also usually you'll want to put [previewTitle] just a single space after the tag name (and align everything else to that). |
Hey @KartikSuryavanshi Are you working on this or should I unassign this?? |
Hey @HardikGoyal2003, I wanted to clarify that this issue needs to be addressed in parts, as @AFZL210 mentioned. Here’s a breakdown of the components that require changes: Create New Topic Modal: create-new-topic-modal.component.ts Topic Editor Tab: topic-editor-tab.directive.ts Create New Subtopic Modal: create-new-subtopic-modal.component.ts Subtopic Editor Tab: subtopic-editor-tab.component.ts For now, I will replace the old component with the new one but do not delete the old component code just yet. We can remove it later once we’ve fully transitioned to the new one. However, I encountered an issue when implementing a function to listen to the imageSave event—it seems to break the topic editor. I will need some time to dig deeper into this issue and would appreciate any guidance you can provide. Thanks! |
@KartikSuryavanshi Retaining the old code complicates maintenance. We need to address this together. If you need assistance, please share the stack trace of the error for better clarity! |
Hi @HardikGoyal2003, Thank you for your feedback! I understand the importance of maintaining clean code. I will gather the stack trace of the error and provide it shortly for better clarity on the issue. |
For some reason @KartikSuryavanshi is assigned to this issue but his PR hasn't been worked on for ages: #21036. Deassigning him. @KartikSuryavanshi If you are not working on an issue, please deassign yourself. Don't leave issues hanging, because that also blocks them for new contributors. Thanks. |
@seanlip Apologies for the delay. I'll ensure to deassign myself from issues I'm not actively working on in the future. Thanks for pointing it out! |
Hi, Line 53 in c75c613
Which one do you think is the best? |
@torack51 I think the second one is the best, although it might be worth looking into why we seem to be saving images to local storage in different ways throughout the app. Is there any possibility for standardization, so that all the callers of the image local storage service use a single approach? I'm not sure if I can give you much guidance on the last question, it will probably need more debugging. If you still have trouble, please put all the relevant information (including repro steps and things you've tried) in a debugging doc and we can take a look. Thanks! |
Hello @seanlip , sorry for the late reply but my devserver stopped working, similarly to this discussion topic : https://github.com/oppia/oppia/discussions/21158. oppia/core/templates/components/forms/custom-forms-directives/image-uploader.component.ts Lines 122 to 156 in 3e8ecd0
Apart from that, I believe that my implementation for create-new-topic-modal is complete. I'll start working on the rest and keep you updated with my progress. |
Thanks @torack51. Did you get a solution to the "devserver stopped working" issue? If so, it would be helpful if you could post it in the discussion thread since other folks seem to be having trouble as well. Other than that, it would be great to hear more about your analysis and your progress -- I think it's worth cataloguing the different instances where we save images and what their differences are, and proposing how you plan to standardize them. Thanks for keeping the thread updated! |
We have a lot of components and modals just to handle image uploads, and recently we created two components: (1) image-uploader and (2) image-uploader-modal. These two components can handle any type of image needed for our use case. This issue aims to remove all the other image upload-related components and use this newly created image-uploader and image-uploader-modal component.
Create new topic modal (create-new-topic-modal.component.ts)
component used: oppia-thumbnail-uploader
Topic editor tab (topic-editor-tab.directive.ts)
component used: oppia-thumbnail-uploader
Create new subtopic modal (create-new-subtopic-modal.component.ts)
component used: oppia-thumbnail-uploader
Subtopic editor tab (subtopic-editor-tab.component.ts)
component used: oppia-thumbnail-uploader
oppia-image-uploader-modal
Data returned when closed:
newImageDataUrl(string)
dimensions({height: number, width: number})
newBgColor(string)
Props:
maxImageSizeInKB (number)
aspectRatio (string)
imageName (string)
bgColor (string)
allowedBgColors (string[])
allowedImageFormats (string[])
previewImageUrl (optional(string))
previewDescriptionBgColor (optional(string))
previewTitle (optional(string))
previewDescription (optional(string))
previewFooter (optional(string))
oppia-image-uploader
This is the highest level component which takes all the props and shows the preview, and handles all the events.
ImageUploaderData {
filename: string;
bg_color: string;
image_data: Blob;
}
Emitted Events:
imageSave (ImageUploaderData)
Props:
maxImageSizeInKB (number)
aspectRatio (string)
imageName (string)
bgColor (string)
allowedImageFormats (string[])
orientation (string) - landscape/portrait
previewDescriptionBgColor (optional(string))
previewTitle (optional(string))
previewDescription (optional(string))
previewFooter (optional(string))
filename (optional(string))
disabled (optional(boolean))
Steps to Follow
bytes
- Check which request is made when saving an entity like topic, story etc. example.The text was updated successfully, but these errors were encountered: