Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions .github/workflows/create-jira-issue.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Trigger Jira Issue Creation

on:
pull_request:
types:
- closed

jobs:
prepare:
runs-on: ubuntu-latest
environment:
name: ${{ github.event.pull_request.base.ref }}
outputs:
story_summary: ${{ vars.MIGRATION_BACKLOG_JIRA_STORY_SUMMARY }}
story_description: ${{ vars.MIGRATION_BACKLOG_JIRA_STORY_DESCRIPTION }}
steps:
- run: echo "Preparing input vars..."
create-jira-issue:
needs: prepare
if: github.event.pull_request.merged == true
uses: nelc/actions-hub/.github/workflows/create-jira-issue.yml@main
with:
story_summary: ${{ needs.prepare.outputs.story_summary }}
story_description: ${{ needs.prepare.outputs.story_description }}
subtask_summary: "${{ github.event.pull_request.title }}"
subtask_description: "${{ github.event.pull_request.body }} 🔗 PR: ${{ github.event.pull_request.html_url }}"
environment: ${{ github.event.pull_request.base.ref }}
secrets:
MIGRATION_BACKLOG_JIRA_EMAIL: ${{ secrets.MIGRATION_BACKLOG_JIRA_EMAIL }}
MIGRATION_BACKLOG_JIRA_TOKEN: ${{ secrets.MIGRATION_BACKLOG_JIRA_TOKEN }}
MIGRATION_BACKLOG_JIRA_URL: ${{ secrets.MIGRATION_BACKLOG_JIRA_URL }}
MIGRATION_BACKLOG_JIRA_PROJECT: ${{ secrets.MIGRATION_BACKLOG_JIRA_PROJECT }}
MIGRATION_BACKLOG_JIRA_EPIC_KEY: ${{ secrets.MIGRATION_BACKLOG_JIRA_EPIC_KEY }}
MIGRATION_BACKLOG_JIRA_EPIC_LINK_FIELD: ${{ secrets.MIGRATION_BACKLOG_JIRA_EPIC_LINK_FIELD }}
44 changes: 34 additions & 10 deletions edx_sga/static/js/src/edx_sga.js
Original file line number Diff line number Diff line change
Expand Up @@ -409,7 +409,7 @@ function StaffGradedAssignmentXBlock(runtime, element) {


function sendResizeMessage(height) {
// This blocks checks to see if the xBlock is part
// This blocks checks to see if the xBlock is part
// of Learning MFE
if (window.parent !== window) {
window.parent.postMessage({
Expand Down Expand Up @@ -474,23 +474,47 @@ function StaffGradedAssignmentXBlock(runtime, element) {
return deferred.promise();
}

function loadjs(url) {
$('<script>')
.attr('type', 'text/javascript')
.attr('src', window.baseUrl + url)
.appendTo(element);
function loadjs(src) {
return new Promise((resolve, reject) => {
const script = document.createElement('script');
script.src = src;
script.async = true; // Essential for non-blocking loading

// Resolve the promise when the script is successfully loaded
script.onload = () => {
console.log(`Script loaded: ${src}`);
resolve(script);
};

// Reject the promise if there's an error loading the script
script.onerror = () => {
const errorMsg = `Failed to load script: ${src}`;
console.error(errorMsg);
reject(new Error(errorMsg));
};

// Append the script to the element
element.appendChild(script);
});
}

if (require === undefined) {
/**
* The LMS does not use require.js (although it loads it...) and
* does not already load jquery.fileupload. (It looks like it uses
* jquery.ajaxfileupload instead. But our XBlock uses
* jquery.fileupload.
*/
loadjs('js/vendor/jQuery-File-Upload/js/jquery.iframe-transport.js');
loadjs('js/vendor/jQuery-File-Upload/js/jquery.fileupload.js');
xblock($, _);
baseUrl = window.baseUrl || '';
// Refactored code to wait for both jQuery File Upload dependencies
Promise.all([
loadjs(baseUrl + 'js/vendor/jQuery-File-Upload/js/jquery.iframe-transport.js'),
loadjs(baseUrl + 'js/vendor/jQuery-File-Upload/js/jquery.fileupload.js'),
]).then(() => {
xblock($, _);
}).catch((error) => {
// Handle any errors during loading
console.error("Error loading scripts:", error);
});
} else {
/**
* Studio, on the other hand, uses require.js and already knows about
Expand Down
Loading