-
Notifications
You must be signed in to change notification settings - Fork 89
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
feat: publish single library component #1407
feat: publish single library component #1407
Conversation
Thanks for the pull request, @DanielVZ96! What's next?Please work through the following steps to get your changes ready for engineering review: 🔘 Get product approvalIf you haven't already, check this list to see if your contribution needs to go through the product review process.
🔘 Provide contextTo help your reviewers and other members of the community understand the purpose and larger context of your changes, feel free to add as much of the following information to the PR description as you can:
🔘 Get a green buildIf one or more checks are failing, continue working on your changes until this is no longer the case and your build turns green. 🔘 Let us know that your PR is ready for review:Who will review my changes?This repository is currently maintained by Where can I find more information?If you'd like to get more details on all aspects of the review process for open source pull requests (OSPRs), check out the following resources:
When can I expect my changes to be merged?Our goal is to get community contributions seen and reviewed as efficiently as possible. However, the amount of time that it takes to review and merge a PR can vary significantly based on factors such as:
💡 As a result it may take up to several weeks or months to complete a review and merge your PR. |
8f31a41
to
6140adb
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #1407 +/- ##
==========================================
+ Coverage 93.11% 93.12% +0.01%
==========================================
Files 1051 1051
Lines 20207 20237 +30
Branches 4300 4302 +2
==========================================
+ Hits 18816 18846 +30
Misses 1331 1331
Partials 60 60 ☔ View full report in Codecov by Sentry. |
f3ce68c
to
1cbc96b
Compare
const publishComponent = usePublishComponent(usageKey); | ||
const { data: componentMetadata } = useLibraryBlockMetadata(usageKey); | ||
// Only can be published when the component has been modified after the last published date. | ||
const canPublish = (new Date(componentMetadata?.modified ?? 0)) > (new Date(componentMetadata?.lastPublished ?? 0)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if we don't have data about the modified date we shouldn't be able to publish, and because of this we default the date to 0.
3931057
to
1eca22f
Compare
@DanielVZ96 Let me know when this is ready for review, and don't forget to un-mark it as draft. |
1eca22f
to
9227b47
Compare
@bradenmacdonald ready for review! |
That's not necessary unless they were previously disabled. They're now on by default, so all you have to do is not enable those waffle flags :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, and seems to be working well in my tests. Just found one very tiny nit on comment formatting.
d2b86de
to
7fb017d
Compare
Rebased because there is some weird CI error in |
7fb017d
to
f7c757b
Compare
Ah, turns out it was testing the merged version, and there was actually a duplicate. Fixed now :) |
Description
Implements and enables the publish button functionality in the libraries v2 component sidebar.
Supporting information
Testing instructions
$ tutor dev run lms ./manage.py lms shell -c "from waffle.models import Flag; Flag.objects.update_or_create(name='contentstore.new_studio_mfe.disable_legacy_libraries', defaults={'everyone': False}); Flag.objects.update_or_create(name='contentstore.new_studio_mfe.disable_new_libraries', defaults={'everyone': False})"
componentMetadata QUERY
]Deadline
ASAP