Skip to content

Commit

Permalink
Merge branch 'master' into dvz/studio-editable-block-callback-refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielVZ96 authored Dec 5, 2023
2 parents cd78eb3 + 0650b4f commit 893ff58
Show file tree
Hide file tree
Showing 119 changed files with 1,185 additions and 3,540 deletions.
12 changes: 12 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,15 @@ updates:
interval: "weekly"
reviewers:
- "openedx/arbi-bom"
- package-ecosystem: "github-actions"
directory: "/.github/actions/unit-tests/"
schedule:
interval: "weekly"
reviewers:
- "openedx/arbi-bom"
- package-ecosystem: "github-actions"
directory: "/.github/actions/verify-tests-count/"
schedule:
interval: "weekly"
reviewers:
- "openedx/arbi-bom"
2 changes: 1 addition & 1 deletion .github/workflows/docker-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
uses: docker/setup-qemu-action@v2

- name: Login to DockerHub
uses: docker/login-action@v2
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/js-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
run: git fetch --depth=1 origin master

- name: Setup Node
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pylint-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
- module-name: lms-1
path: "--django-settings-module=lms.envs.test lms/djangoapps/badges/ lms/djangoapps/branding/ lms/djangoapps/bulk_email/ lms/djangoapps/bulk_enroll/ lms/djangoapps/bulk_user_retirement/ lms/djangoapps/ccx/ lms/djangoapps/certificates/ lms/djangoapps/commerce/ lms/djangoapps/course_api/ lms/djangoapps/course_blocks/ lms/djangoapps/course_home_api/ lms/djangoapps/course_wiki/ lms/djangoapps/coursewarehistoryextended/ lms/djangoapps/debug/ lms/djangoapps/courseware/ lms/djangoapps/course_goals/ lms/djangoapps/rss_proxy/"
- module-name: lms-2
path: "--django-settings-module=lms.envs.test lms/djangoapps/gating/ lms/djangoapps/grades/ lms/djangoapps/instructor/ lms/djangoapps/instructor_analytics/ lms/djangoapps/discussion/ lms/djangoapps/edxnotes/ lms/djangoapps/email_marketing/ lms/djangoapps/experiments/ lms/djangoapps/instructor_task/ lms/djangoapps/learner_dashboard/ lms/djangoapps/learner_recommendations/ lms/djangoapps/learner_home/ lms/djangoapps/lms_initialization/ lms/djangoapps/lms_xblock/ lms/djangoapps/lti_provider/ lms/djangoapps/mailing/ lms/djangoapps/mobile_api/ lms/djangoapps/monitoring/ lms/djangoapps/ora_staff_grader/ lms/djangoapps/program_enrollments/ lms/djangoapps/rss_proxy lms/djangoapps/static_template_view/ lms/djangoapps/staticbook/ lms/djangoapps/support/ lms/djangoapps/survey/ lms/djangoapps/teams/ lms/djangoapps/tests/ lms/djangoapps/user_tours/ lms/djangoapps/verify_student/ lms/djangoapps/mfe_config_api/ lms/envs/ lms/lib/ lms/tests.py"
path: "--django-settings-module=lms.envs.test lms/djangoapps/gating/ lms/djangoapps/grades/ lms/djangoapps/instructor/ lms/djangoapps/instructor_analytics/ lms/djangoapps/discussion/ lms/djangoapps/edxnotes/ lms/djangoapps/email_marketing/ lms/djangoapps/experiments/ lms/djangoapps/instructor_task/ lms/djangoapps/learner_dashboard/ lms/djangoapps/learner_home/ lms/djangoapps/lms_initialization/ lms/djangoapps/lms_xblock/ lms/djangoapps/lti_provider/ lms/djangoapps/mailing/ lms/djangoapps/mobile_api/ lms/djangoapps/monitoring/ lms/djangoapps/ora_staff_grader/ lms/djangoapps/program_enrollments/ lms/djangoapps/rss_proxy lms/djangoapps/static_template_view/ lms/djangoapps/staticbook/ lms/djangoapps/support/ lms/djangoapps/survey/ lms/djangoapps/teams/ lms/djangoapps/tests/ lms/djangoapps/user_tours/ lms/djangoapps/verify_student/ lms/djangoapps/mfe_config_api/ lms/envs/ lms/lib/ lms/tests.py"
- module-name: openedx-1
path: "--django-settings-module=lms.envs.test openedx/core/types/ openedx/core/djangoapps/ace_common/ openedx/core/djangoapps/agreements/ openedx/core/djangoapps/api_admin/ openedx/core/djangoapps/auth_exchange/ openedx/core/djangoapps/bookmarks/ openedx/core/djangoapps/cache_toolbox/ openedx/core/djangoapps/catalog/ openedx/core/djangoapps/ccxcon/ openedx/core/djangoapps/commerce/ openedx/core/djangoapps/common_initialization/ openedx/core/djangoapps/common_views/ openedx/core/djangoapps/config_model_utils/ openedx/core/djangoapps/content/ openedx/core/djangoapps/content_libraries/ openedx/core/djangoapps/content_staging/ openedx/core/djangoapps/contentserver/ openedx/core/djangoapps/cookie_metadata/ openedx/core/djangoapps/cors_csrf/ openedx/core/djangoapps/course_apps/ openedx/core/djangoapps/course_date_signals/ openedx/core/djangoapps/course_groups/ openedx/core/djangoapps/courseware_api/ openedx/core/djangoapps/crawlers/ openedx/core/djangoapps/credentials/ openedx/core/djangoapps/credit/ openedx/core/djangoapps/dark_lang/ openedx/core/djangoapps/debug/ openedx/core/djangoapps/demographics/ openedx/core/djangoapps/discussions/ openedx/core/djangoapps/django_comment_common/ openedx/core/djangoapps/embargo/ openedx/core/djangoapps/enrollments/ openedx/core/djangoapps/external_user_ids/ openedx/core/djangoapps/zendesk_proxy/ openedx/core/djangolib/ openedx/core/lib/ openedx/core/tests/ openedx/core/djangoapps/course_live/"
- module-name: openedx-2
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/quality-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
python-version: ${{ matrix.python-version }}

- name: Setup Node
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/static-assets-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
sudo apt-get install libxmlsec1-dev pkg-config
- name: Setup Node
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}

Expand Down
1 change: 0 additions & 1 deletion .github/workflows/unit-test-shards.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@
"lms/djangoapps/instructor_task/",
"lms/djangoapps/learner_dashboard/",
"lms/djangoapps/learner_home/",
"lms/djangoapps/learner_recommendations/",
"lms/djangoapps/lms_initialization/",
"lms/djangoapps/lms_xblock/",
"lms/djangoapps/lti_provider/",
Expand Down
6 changes: 5 additions & 1 deletion cms/djangoapps/contentstore/asset_storage_handlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -435,11 +435,15 @@ def _get_assets_in_json_format(assets, course_key, assets_usage_locations_map):
for asset in assets:
asset_key = asset['asset_key']
asset_key_string = str(asset_key)
usage_locations = getattr(assets_usage_locations_map, 'asset_key_string', [])
thumbnail_asset_key = _get_thumbnail_asset_key(asset, course_key)
asset_is_locked = asset.get('locked', False)
asset_file_size = asset.get('length', None)

try:
usage_locations = assets_usage_locations_map[asset_key_string]
except KeyError:
usage_locations = []

asset_in_json = get_asset_json(
asset['displayname'],
asset['contentType'],
Expand Down
9 changes: 5 additions & 4 deletions cms/djangoapps/contentstore/views/import_export.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,8 @@ def import_handler(request, course_key_string):
else:
return _write_chunk(request, courselike_key)
elif request.method == 'GET': # assume html
if use_new_import_page(courselike_key):

if use_new_import_page(courselike_key) and not library:
return redirect(get_import_url(courselike_key))
status_url = reverse_course_url(
"import_status_handler", courselike_key, kwargs={'filename': "fillerName"}
Expand Down Expand Up @@ -314,8 +315,8 @@ def export_handler(request, course_key_string):
course_key = CourseKey.from_string(course_key_string)
if not has_course_author_access(request.user, course_key):
raise PermissionDenied()

if isinstance(course_key, LibraryLocator):
library = isinstance(course_key, LibraryLocator)
if library:
courselike_block = modulestore().get_library(course_key)
context = {
'context_library': courselike_block,
Expand All @@ -340,7 +341,7 @@ def export_handler(request, course_key_string):
export_olx.delay(request.user.id, course_key_string, request.LANGUAGE_CODE)
return JsonResponse({'ExportStatus': 1})
elif 'text/html' in requested_format:
if use_new_export_page(course_key):
if use_new_export_page(course_key) and not library:
return redirect(get_export_url(course_key))
return render_to_response('export.html', context)
else:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@
is_self_paced,
get_taxonomy_tags_widget_url,
load_services_for_studio,
duplicate_block,
)

from .create_xblock import create_xblock
Expand Down Expand Up @@ -220,11 +221,11 @@ def handle_xblock(request, usage_key_string=None):
status=400,
)

dest_usage_key = _duplicate_block(
dest_usage_key = duplicate_block(
parent_usage_key,
duplicate_source_usage_key,
request.user,
request.json.get("display_name"),
display_name=request.json.get('display_name'),
)

return JsonResponse(
Expand Down Expand Up @@ -735,29 +736,6 @@ def _move_item(source_usage_key, target_parent_usage_key, user, target_index=Non
return JsonResponse(context)


def _duplicate_block(
parent_usage_key,
duplicate_source_usage_key,
user,
display_name=None,
is_child=False,
):
"""
Duplicate an existing xblock as a child of the supplied parent_usage_key.
"""
store = modulestore()
with store.bulk_operations(duplicate_source_usage_key.course_key):
source_item = store.get_item(duplicate_source_usage_key)
return source_item.studio_duplicate(
parent_usage_key=parent_usage_key,
duplicate_source_usage_key=duplicate_source_usage_key,
user=user,
store=store,
display_name=display_name,
is_child=is_child,
)


@login_required
def delete_item(request, usage_key):
"""
Expand Down Expand Up @@ -1236,9 +1214,6 @@ def create_xblock_info( # lint-amnesty, pylint: disable=too-many-statements
else:
xblock_info["staff_only_message"] = False

# If the ENABLE_COPY_PASTE_UNITS feature flag is enabled, we show the newer menu that allows copying/pasting
xblock_info["enable_copy_paste_units"] = ENABLE_COPY_PASTE_UNITS.is_enabled()

# If the ENABLE_TAGGING_TAXONOMY_LIST_PAGE feature flag is enabled, we show the "Manage Tags" options
if use_tagging_taxonomy_list_page():
xblock_info["use_tagging_taxonomy_list_page"] = True
Expand All @@ -1251,6 +1226,10 @@ def create_xblock_info( # lint-amnesty, pylint: disable=too-many-statements
xblock, course=course
)

if course_outline or is_xblock_unit:
# If the ENABLE_COPY_PASTE_UNITS feature flag is enabled, we show the newer menu that allows copying/pasting
xblock_info["enable_copy_paste_units"] = ENABLE_COPY_PASTE_UNITS.is_enabled()

if is_xblock_unit and summary_configuration.is_enabled():
xblock_info["summary_configuration_enabled"] = summary_configuration.is_summary_enabled(xblock_info['id'])

Expand Down
1 change: 1 addition & 0 deletions cms/static/js/base.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ function(
$body.click(function() {
$('.nav-dd .nav-item .wrapper-nav-sub').removeClass('is-shown');
$('.nav-dd .nav-item .title').removeClass('is-selected');
$('.custom-dropdown .dropdown-options').hide();
});

$('.nav-dd .nav-item, .filterable-column .nav-item').click(function(e) {
Expand Down
1 change: 1 addition & 0 deletions cms/static/js/i18n/eo/djangojs.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions cms/static/js/i18n/rtl/djangojs.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions cms/static/js/i18n/tr-tr/djangojs.js
Original file line number Diff line number Diff line change
Expand Up @@ -716,6 +716,8 @@
"Email": "E-posta",
"Email Address (Sign In)": "E-posta Adresi (Giri\u015f Yap)",
"Email address": "E-posta adresi",
"Email cannot be sent to the following users via batch enrollment. They will be allowed to enroll once they register:": "A\u015fa\u011f\u0131daki kullan\u0131c\u0131lara toplu kay\u0131t yoluyla e-posta g\u00f6nderilemez. Sisteme kay\u0131t olduklar\u0131nda derslere kaydolmalar\u0131na izin verilecektir:",
"Email cannot be sent to the following users via batch enrollment. They will be enrolled once they register:": "A\u015fa\u011f\u0131daki kullan\u0131c\u0131lara toplu kay\u0131t yoluyla e-posta g\u00f6nderilemez. Sisteme kay\u0131t olduklar\u0131nda derslere kaydedileceklerdir:",
"Emails successfully sent. The following users are no longer enrolled in the course:": "E-postalar ba\u015far\u0131yla g\u00f6nderildi. A\u015fa\u011f\u0131daki kullan\u0131c\u0131lar bu derse art\u0131k kay\u0131tl\u0131 de\u011filler:",
"Embed": "G\u00f6m\u00fcl\u00fc",
"Emoticons": "\u0130fadeler",
Expand All @@ -733,6 +735,7 @@
"Ends {end}": "Bitti {end}",
"Engage with posts": "G\u00f6nderilerle etkile\u015fimde bulunun",
"Enroll Now": "Hemen Kaydol",
"Enroll in a {programName}'s course": "{programName} dersine kaydol",
"Enrolled": "Kay\u0131tland\u0131",
"Enrolling you in the selected course": "Se\u00e7ilen derse sizi kay\u0131t ediyor",
"Enrollment Date": "Kay\u0131t Tarihi",
Expand Down Expand Up @@ -1703,6 +1706,7 @@
"Submit enrollment change": "Kay\u0131t de\u011fi\u015fimini g\u00f6nder",
"Submitted": "Girildi",
"Subscript": "Alt simge",
"Subscription trial expires in less than 24 hours": "Abonelik deneme s\u00fcresi 24 saat i\u00e7inde sona eriyor",
"Subscription trial expires in {remainingDays} day": [
"Abonelik deneme s\u00fcresi {remainingDays} g\u00fcn i\u00e7inde sona eriyor",
"Abonelik deneme s\u00fcresi {remainingDays} g\u00fcn i\u00e7inde sona eriyor"
Expand Down Expand Up @@ -2248,6 +2252,7 @@
"You did not submit the required files: {requiredFiles}.": "Gerekli dosyalar\u0131 g\u00f6ndermediniz: {requiredFiles}.",
"You don't seem to have Flash installed. Get Flash to continue your verification.": "Flash'\u0131 y\u00fcklememi\u015f g\u00f6z\u00fck\u00fcyorsunuz. Do\u011frulamaya devam etmeniz i\u00e7in Flash'\u0131 y\u00fckleyin.",
"You don't seem to have a webcam connected.": "Ba\u011fl\u0131 bir web kameran\u0131z olmad\u0131\u011f\u0131 g\u00f6r\u00fcnmekte.",
"You have access to the {enterpriseName} dashboard": "{enterpriseName} paneline eri\u015fiminiz var",
"You have added a criterion. You will need to select an option for the criterion in the Learner Training step. To do this, click the Assessment Steps tab.": "Bir \u00f6l\u00e7\u00fct eklediniz. \u00d6\u011frenci E\u011fitimi ad\u0131m\u0131nda, \u00f6l\u00e7\u00fct i\u00e7in bir se\u00e7enek belirlemelisiniz. Bunu yapmak i\u00e7in, De\u011ferlendirme Ad\u0131mlar\u0131 sekmesine t\u0131klay\u0131n\u0131z.",
"You have already verified your ID!": "Kimli\u011finizi \u00e7oktan do\u011frulad\u0131n\u0131z!",
"You have an active subscription to the {programName} program but are not enrolled in any courses. Enroll in a remaining course and enjoy verified access.": "{programName} program\u0131na etkin bir aboneli\u011finiz var ancak herhangi bir derse kay\u0131tl\u0131 de\u011filsiniz. Mevcut bir derse kaydolun ve do\u011frulanm\u0131\u015f eri\u015fimin keyfini \u00e7\u0131kar\u0131n.",
Expand Down Expand Up @@ -2343,6 +2348,11 @@
"Your upload of '{file}' succeeded.": "'{file}' y\u00fcklemeniz ba\u015far\u0131l\u0131.",
"Your verification status is good until {verificationGoodUntil}.": "{verificationGoodUntil} a\u015famas\u0131na dek do\u011frulama durumunuz iyi.",
"Your video uploads are not complete.": "Video y\u00fcklemeleriniz tamamlanmad\u0131.",
"Your {programName} trial will expire at {trialEndTime} on {trialEndDate} and the card on file will be charged {subscriptionPrice}.": "{programName} deneme s\u00fcr\u00fc\u015f\u00fcn\u00fcz {trialEndDate} tarihinde {trialEndTime} saati itibariyle sona erecek ve dosyadaki karttan {subscriptionPrice} tahsil edilecektir.",
"Your {programName} trial will expire in {remainingDays} day at {trialEndTime} on {trialEndDate} and the card on file will be charged {subscriptionPrice}.": [
"{programName} deneme s\u00fcr\u00fc\u015f\u00fcn\u00fcz {remainingDays} g\u00fcn sonra {trialEndDate} tarihinde {trialEndTime} saati itibariyle sona erecek ve dosyadaki karttan {subscriptionPrice} tahsil edilecektir.",
"{programName} deneme s\u00fcr\u00fc\u015f\u00fcn\u00fcz {remainingDays} g\u00fcn sonra {trialEndDate} tarihinde {trialEndTime} saati itibariyle sona erecek ve dosyadaki karttan {subscriptionPrice} tahsil edilecektir."
],
"Your {program} Certificate": "{program} Sertifikan\u0131z",
"Yourself": "Kendiniz",
"Zoom In": "B\u00fcy\u00fct",
Expand Down
27 changes: 0 additions & 27 deletions cms/static/js/spec/views/pages/container_subviews_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -581,33 +581,6 @@ describe('Container Subviews', function() {
});
});

describe('PublishHistory', function() {
var lastPublishCss = '.wrapper-last-publish';

it('renders never published when the block is unpublished', function() {
renderContainerPage(this, mockContainerXBlockHtml, {
published: false, published_on: null, published_by: null
});
expect(containerPage.$(lastPublishCss).text()).toContain('Never published');
});

it('renders the last published date and user when the block is published', function() {
renderContainerPage(this, mockContainerXBlockHtml);
fetch({
published: true, published_on: 'Jul 01, 2014 at 12:45 UTC', published_by: 'amako'
});
expect(containerPage.$(lastPublishCss).text())
.toContain('Last published Jul 01, 2014 at 12:45 UTC by amako');
});

it('renders correctly when the block is published without publish info', function() {
renderContainerPage(this, mockContainerXBlockHtml);
fetch({
published: true, published_on: null, published_by: null
});
expect(containerPage.$(lastPublishCss).text()).toContain('Previously published');
});
});

describe('Message Area', function() {
var messageSelector = '.container-message .warning',
Expand Down
Loading

0 comments on commit 893ff58

Please sign in to comment.