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

"Create new component" should only create component after editor is saved #1482

Open
bradenmacdonald opened this issue Nov 7, 2024 · 8 comments
Assignees

Comments

@bradenmacdonald
Copy link
Contributor

bradenmacdonald commented Nov 7, 2024

As a course author, when I click "Add new Component" and the editor opens to configure the blank component, if I click cancel and discard changes, I expect nothing to have been added to my course.


Currently, in both courses and libraries, when you press an "Add New Component" button...

Course Library
Screenshot Screenshot

... Studio will first add a blank component (of the given type) to the course/library (invisible to the user), and then open the editor. If you cancel out of the editor, if "feels" like nothing should happen, but you will find that a blank component was already added to the course/library.

This has two problems:

  1. The "cancel" action doesn't cancel the addition of the component, which seems like a bug.
  2. We can't set a friendly ID/slug for the component, because its title is not set at the time of creation.
@bradenmacdonald
Copy link
Contributor Author

@jmakowski1123 Can you please review and prioritize this ticket (or not).

@navinkarkera
Copy link
Contributor

@bradenmacdonald There is another bug which could be fixed if we implement this issue. In any collection page, if we add a component, for eg., a text component and if we click somewhere anywhere except for input boxes in the modal, it is reloaded.

vokoscreenNG-2024-11-08_17-38-05.mp4

@jmakowski1123
Copy link

Since this changes behavior in both courses and libraries, what's the risk of pushing for Sumac post cut?

@bradenmacdonald
Copy link
Contributor Author

@jmakowski1123 I think this will be a large refactor and so I recommend aiming for Teak instead. In any case, I believe @dcoa from eduNEXT will be taking this on (?) so you can also check with her.

@dcoa
Copy link
Contributor

dcoa commented Nov 19, 2024

Hi, sorry for the late response, I haven't started working on it but I made some review and I agree with Braden.

@bradenmacdonald
Copy link
Contributor Author

@dcoa Do you plan to work on this soon?

I have started some work on adding type information to the editors' redux state, and I think it will be very helpful for this project. #1537 is the first PR with more to follow.

@dcoa
Copy link
Contributor

dcoa commented Dec 2, 2024

Thank @bradenmacdonald, that will help a lot.

Yes, I allocated time to start working on this in the current sprint, in the meantime I was wondering how to manage the assets when it is a new component, the images for example, how could be temporary stored until the save button creates the block.

@bradenmacdonald
Copy link
Contributor Author

@dcoa Yeah, that could be a challenge. You could simply store them in memory as File objects until saved, perhaps? I don't think we currently have any API for uploading them before the component is created.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: In grooming
Development

No branches or pull requests

4 participants