Skip to content

Commit

Permalink
BEHAT and Moodle CI implemented
Browse files Browse the repository at this point in the history
  • Loading branch information
prasanna-lmsace committed Sep 25, 2023
1 parent b834850 commit 84af36c
Show file tree
Hide file tree
Showing 93 changed files with 4,018 additions and 1,392 deletions.
20 changes: 17 additions & 3 deletions .github/workflows/moodle-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,22 @@ jobs:
strategy:
fail-fast: false
matrix:
php: ['8.0']
moodle-branch: ['MOODLE_401_STABLE']
database: [pgsql, mariadb]
include:
- php: '8.0'
moodle-branch: 'MOODLE_402_STABLE'
database: 'pgsql'
- php: '8.0'
moodle-branch: 'MOODLE_402_STABLE'
database: 'mariadb'
- php: '8.0'
moodle-branch: 'MOODLE_401_STABLE'
database: 'mariadb'
- php: '7.4'
moodle-branch: 'MOODLE_401_STABLE'
database: 'pgsql'
- php: '7.4'
moodle-branch: 'MOODLE_400_STABLE'
database: 'mariadb'

steps:
- name: Check out repository code
Expand All @@ -57,6 +70,7 @@ jobs:
- name: Install moodle-plugin-ci
run: |
moodle-plugin-ci add-plugin --clone https://github.com/catalyst/moodle-mod_facetoface.git --branch MOODLE_400_STABLE
moodle-plugin-ci install --plugin ./plugin --db-host=127.0.0.1
env:
DB: ${{ matrix.database }}
Expand Down
2 changes: 1 addition & 1 deletion actions/notification/amd/build/chaptersource.min.js

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

2 changes: 1 addition & 1 deletion actions/notification/amd/build/chaptersource.min.js.map

Large diffs are not rendered by default.

57 changes: 33 additions & 24 deletions actions/notification/amd/src/chaptersource.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,20 +26,20 @@
define(['jquery', 'core/ajax', 'core/notification', 'core/modal_factory', 'core/fragment', 'core/str', 'core/modal_events'],
function($, Ajax, Notification, ModalFactory, Fragment, Str, ModalEvents) {

const previewModalBody = function(contextID, userid = null) {

const previewModalBody = function(contextID, userid=null) {

var params;
if (window.tinyMCE !== undefined) {
// editorPlugin = window.tinyMCE;
var params = {
// EditorPlugin = window.tinyMCE;
params = {
contentheader: window.tinyMCE.get('id_pulsenotification_headercontent_editor').getContent(),
contentstatic: window.tinyMCE.get('id_pulsenotification_staticcontent_editor').getContent(),
contentfooter: window.tinyMCE.get('id_pulsenotification_footercontent_editor').getContent(),
userid: userid
};
} else {
// editorPlugin = document;
var params = {
// EditorPlugin = document;
params = {
contentheader: document.querySelector('#id_pulsenotification_headercontent_editoreditable').innerHTML,
contentstatic: document.querySelector('#id_pulsenotification_staticcontent_editoreditable').innerHTML,
contentfooter: document.querySelector('#id_pulsenotification_footercontent_editoreditable').innerHTML,
Expand All @@ -48,6 +48,7 @@ define(['jquery', 'core/ajax', 'core/notification', 'core/modal_factory', 'core/
}

var dynamicparams = {};

if (document.querySelector('[name=pulsenotification_dynamiccontent]') !== null) {
dynamicparams = {
contentdynamic: document.querySelector('[name=pulsenotification_dynamiccontent]').value,
Expand All @@ -56,9 +57,19 @@ define(['jquery', 'core/ajax', 'core/notification', 'core/modal_factory', 'core/
contentlength: document.querySelector('[name=pulsenotification_contentlength]').value,
};
}
// Get the form data.
var formData;
var form = document.forms['pulse-automation-template'];
var formdata = new FormData(form);
formdata = new URLSearchParams(formdata).toString();
formData = {
formdata: formdata
};

return Fragment.loadFragment('pulseaction_notification', 'preview_content', contextID, {...params, ...dynamicparams});
}
var finalParams = {...params, ...dynamicparams, ...formData};

return Fragment.loadFragment('pulseaction_notification', 'preview_content', contextID, finalParams);
};

const previewModal = function(contextID) {

Expand All @@ -74,9 +85,11 @@ define(['jquery', 'core/ajax', 'core/notification', 'core/modal_factory', 'core/
e.preventDefault();
var target = e.target;
modal.setBody(previewModalBody(contextID, target.value));
})
})
});
});
});

return;
}).catch();
};

const notificationModal = function(contextID, instance, userid) {
Expand All @@ -92,15 +105,8 @@ define(['jquery', 'core/ajax', 'core/notification', 'core/modal_factory', 'core/
large: true,
}).then((modal) => {
modal.show();

/* modal.getRoot().on(ModalEvents.bodyRendered, function() {
modal.getRoot().get(0).querySelector('[name=userselector]').addEventListener('change', (e) => {
e.preventDefault();
var target = e.target;
modal.setBody(previewModalBody(contextID, target.value));
})
}) */
});
return;
}).catch();
};

return {
Expand All @@ -127,14 +133,17 @@ define(['jquery', 'core/ajax', 'core/notification', 'core/modal_factory', 'core/
updateChapter: function() {

const SELECTORS = {
chaperType : "#id_pulsenotification_contenttype",
chaperType: "#id_pulsenotification_contenttype",
mod: "#id_pulsenotification_dynamiccontent"
};

document.querySelector(SELECTORS.chaperType).addEventListener("change", (e) => resetChapter());
document.querySelector(SELECTORS.mod).addEventListener("change", (e) => resetChapter());
document.querySelector(SELECTORS.chaperType).addEventListener("change", () => resetChapter());
document.querySelector(SELECTORS.mod).addEventListener("change", () => resetChapter());
var chapter = document.querySelector("#id_pulsenotification_chapterid");

/**
*
*/
function resetChapter() {
chapter.innerHTML = '';
chapter.value = '';
Expand All @@ -152,7 +161,7 @@ define(['jquery', 'core/ajax', 'core/notification', 'core/modal_factory', 'core/

btn.addEventListener('click', function() {
previewModal(contextid);
})
});
},

reportModal: function(contextID) {
Expand Down
46 changes: 0 additions & 46 deletions actions/notification/amd/src/notification.js

This file was deleted.

Loading

0 comments on commit 84af36c

Please sign in to comment.