Skip to content

[FC-0009] Studio backend APIs to support copying and pasting of entire Units#32812

Merged
bradenmacdonald merged 4 commits intoopenedx:masterfrom
open-craft:braden/copy-units
Aug 2, 2023
Merged

[FC-0009] Studio backend APIs to support copying and pasting of entire Units#32812
bradenmacdonald merged 4 commits intoopenedx:masterfrom
open-craft:braden/copy-units

Conversation

@bradenmacdonald
Copy link
Contributor

@bradenmacdonald bradenmacdonald commented Jul 22, 2023

Description

This updates the "copy/paste" APIs in Studio so that they work with entire Units (vertical XBlocks and their children), and not just individual "leaf" XBlocks/components.

Supporting information

Tickets:

Testing instructions

We can do more comprehensive testing of the copy/paste code once the UI is implemented. For now, just check the test code and that there are no regressions to copying of individual components.

This code also changes XmlMixin. I've tried to keep the change as small as possible (so it shouldn't really affect what happens with the ImportRuntime during import/export) but it is possible this affects the import/export process. Try exporting a substantial course before checking out this PR, then with this PR active, import that course and export it again and check for any changes in the resulting final export file.

Deadline

None

Other information

Private-ref: MNG-3769

@openedx-webhooks openedx-webhooks added the open-source-contribution PR author is not from Axim or 2U label Jul 22, 2023
@openedx-webhooks
Copy link

Thanks for the pull request, @bradenmacdonald!

As a core committer in this repo, you can merge this once the pull request is approved per the core committer reviewer requirements and according to the agreement with your edX Champion.

@bradenmacdonald bradenmacdonald changed the title Braden/copy units [FC-0009] Studio backend APIs to support copying and pasting of entire Units Jul 25, 2023
@bradenmacdonald bradenmacdonald force-pushed the braden/copy-units branch 2 times, most recently from 345c13c to 967a25e Compare July 25, 2023 20:30
@bradenmacdonald bradenmacdonald added the FC Relates to an Axim Funded Contribution project label Jul 25, 2023
@bradenmacdonald
Copy link
Contributor Author

@ormsbee FYI, in case you're interested or would like to review.

@bradenmacdonald bradenmacdonald force-pushed the braden/copy-units branch 3 times, most recently from 7075469 to 3451b9b Compare July 27, 2023 21:30
Copy link
Member

@Agrendalath Agrendalath left a comment

Choose a reason for hiding this comment

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

@bradenmacdonald, I noticed that the timezones changed in exports from 0 to Z (e.g., <chapter display_name="Section" start="2021-01-01T00:00:00+00:00"> to <chapter display_name="Section" start="2021-01-01T00:00:00Z">. It probably makes no difference, but I wanted to note this.

👍

  • I tested this: checked the XML exports for regressions, checked that the clipboard still works
  • I read through the code
  • I checked for accessibility issues: n/a
  • Includes documentation: n/a
  • I made sure any change in configuration variables is reflected in the corresponding client's configuration-secure repository: n/a

user_id: int,
# Hint to use as usage ID (block_id) for the new XBlock
slug_hint: str | None = None,
# UsageKey of the XBlock that this one is a copy of
Copy link
Member

Choose a reason for hiding this comment

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

Nit: this format looks nice, but the IDEs won't catch it. In most IDEs, you see the description of all params while hovering over a function's name. This feature works correctly when they are described with :param arg_name: description.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

OK, thanks. I'll tweak in a future PR.

@bradenmacdonald bradenmacdonald merged commit 1aed4e6 into openedx:master Aug 2, 2023
@bradenmacdonald bradenmacdonald deleted the braden/copy-units branch August 2, 2023 19:24
@edx-pipeline-bot
Copy link
Contributor

2U Release Notice: This PR has been deployed to the edX staging environment in preparation for a release to production.

@edx-pipeline-bot
Copy link
Contributor

2U Release Notice: This PR has been deployed to the edX production environment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core committer FC Relates to an Axim Funded Contribution project open-source-contribution PR author is not from Axim or 2U

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

4 participants