openedx / frontend-app-authoring

Front-end for the Open edX Studio experience, implemented in React and Paragon.
GNU Affero General Public License v3.0
13 stars 75 forks source link

Library Home - Create Content #1040

Closed bradenmacdonald closed 1 month ago

bradenmacdonald commented 4 months ago

Designs: Mid-fi Figma

✅ In Scope:

  1. The NEW should be shown to users who have permission to create content in a library (i.e. they have "author" or "admin" permission on the library, or are part of a group that does).
    • If a user has only "read-only" access to a library, the NEW button should be hidden. This includes the "NEW" button in the empty state that's shown when there is no content in the library.
    • If a user has only "read-only" access to a library, they should see a small "read-only" indicator underneath the Library title.
  2. Clicking on the NEW button from the library home page (or from the empty state if there are no components in the library) will display the Add Content Drawer.
    • Note: unlike the "Tag Drawer", this is a sidebar not an overlay. So it "squishes" the page, rather than overlapping it.
  3. Implement all of the buttons shown in Figma, but make "Collection" and "Advanced/Other" disabled for now. Hide "Unit" entirely. Screenshot 2024-05-23 at 6 53 53 PM
  4. Clicking any button (that's not disabled) should close the add drawer, and add a blank component of that type to the library. The search index should be updated synchronously as part of this operation, and any search results cached on the frontend by React-Query should be invalidated (kept for now but re-fetched in the background).

🛑 Out of Scope: For now, there is no way to set the title, tags, description, nor content of the newly-created items. They just show up in the library.

ChrisChV commented 4 months ago

For now, there is no way to set the title, tags, description, nor content of the newly-created items. They just show up in the library.

@bradenmacdonald In the mockups they are using the existing MFE editors. I think we can link it on this story

bradenmacdonald commented 4 months ago

@ChrisChV OK, if it's easy to do, then sure :) But I'm not sure if they work with content in libraries.

ChrisChV commented 4 months ago

But I'm not sure if they work with content in libraries

Good point. I will check it

ChrisChV commented 4 months ago

@bradenmacdonald For now the MFE editors are using the courseId for save the new block.We need more changes to use it with content libraries. Would that be in the scope? To create a new issue?

bradenmacdonald commented 4 months ago

@ChrisChV The second link you showed is already using learningContextId which is great. But the problem is different, I think - you have to use a totally different API to load and save changes for v2 libraries compared to v1 courses. So the actual code for calling the API will need to be changed.

I will discuss with Jenna about which epic to include this in. For now, assume editing is out of scope for epic 1.

jmakowski1123 commented 4 months ago

We had initially created a separate Epic for creating new content workflows (both content and tagging). Maybe it makes sense to revive those as separate epics, since it sounds like the process of using the most current text/problem/video editors is more complicated than anticipated? I'll create separate epic tickets for those two and can continue the discussion there, but agree it's a separate epic than this one.

ChrisChV commented 2 months ago

Hi @jmakowski1123 this is ready for AC testing in https://tagging-preview.staging.do.opencraft.hosting/dashboard

jmakowski1123 commented 2 months ago

Thanks @ChrisChV ! i've created a status for tickets - Ready for AC testing. Please can you change the status as tickets are ready, and then I will check that column regularly and test as tickets become available?

ChrisChV commented 2 months ago

Thanks @jmakowski1123!

Please can you change the status as tickets are ready, and then I will check that column regularly and test as tickets become available?

@jmakowski1123 I don't have permission to move tickets in the board CC @bradenmacdonald

jmakowski1123 commented 2 months ago

Got it, sorry about the @ChrisChV . @sarina , is there a permission we can give Chris to make it possible to change ticket statuses as an eng lead?

sarina commented 2 months ago

@ChrisChV added you to Triage group, so you can move tickets. Please look for your invitation in your inbox.

ChrisChV commented 2 months ago

@sarina Thanks! :+1:

jmakowski1123 commented 2 months ago

Works as expected when I have authoring permissions! @bradenmacdonald I'm trying to create a dummy account to descope permissions so I can test whether the button disappears as intended, but I don't seem to be able to access the django admin. What am I doing wrong? https://app.tagging-preview.staging.do.opencraft.hosting/admin

ChrisChV commented 2 months ago

Hi @jmakowski1123

What am I doing wrong? https://app.tagging-preview.staging.do.opencraft.hosting/admin

This is the link to the django admin: https://tagging-preview.staging.do.opencraft.hosting/admin/

I'm trying to create a dummy account to descope permissions so I can test whether the button disappears as intended

About this. I created a dummy user: user: dummy@test.com password: 123456789

Also, I created a public read library: https://app.tagging-preview.staging.do.opencraft.hosting/course-authoring/library/lib:SampleTaxonomyOrg1:publicread

You can test that feature by logging in with the dummy user and visiting the public read library.

jmakowski1123 commented 2 months ago

Thanks @ChrisChV ! So when I log into the public read-only library with the dummy account, two things:

  1. I still see the "new button", but grayed out. It's a better user experience to not see the button at all, when I don't have permissions to do that task. Can the button disappear entirely?
  2. The requirements specify a small "read-only" text indicator underneath the library title. I'm realizing that wasn't part of the UI design - it could just done in small text beneath the library title.

Image

bradenmacdonald commented 2 months ago

@jmakowski1123 @ChrisChV Also, if the "New" button is hidden, the "+ Add Component" button should be hidden as well. Currently it's not even disabled (see screenshot)

ChrisChV commented 2 months ago

@jmakowski1123 This is the result

image

ChrisChV commented 1 month ago

@jmakowski1123 @lizc577 @sdaitzman @marcotuts This is ready for another AC testing on the sandbox

jmakowski1123 commented 1 month ago

This looks good, thanks!

ChrisChV commented 1 month ago

This looks good, thanks!

@jmakowski1123 Thanks! I moved this to Done