diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..7c4e659 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,11 @@ +# .github/workflows/ci.yml +name: ci + +on: [push, pull_request] + +jobs: + test: + uses: catalyst/catalyst-moodle-workflows/.github/workflows/ci.yml@main + with: + disable_behat: true + disable_phpdoc: true diff --git a/.github/workflows/master.yml b/.github/workflows/master.yml deleted file mode 100644 index 66fbd9b..0000000 --- a/.github/workflows/master.yml +++ /dev/null @@ -1,144 +0,0 @@ -name: master branch test - -on: [push, pull_request] - -jobs: - citest: - name: CI test - env: - IGNORE_PATHS: tests/fixtures - runs-on: 'ubuntu-latest' - - services: - postgres: - image: postgres:10 - env: - POSTGRES_USER: 'postgres' - POSTGRES_HOST_AUTH_METHOD: 'trust' - options: >- - --health-cmd pg_isready - --health-interval 10s - --health-timeout 5s - --health-retries 3 - ports: - - 5432:5432 - - mariadb: - image: mariadb:10.5 - env: - MYSQL_USER: 'root' - MYSQL_ALLOW_EMPTY_PASSWORD: "true" - ports: - - 3306:3306 - options: >- - --health-cmd="mysqladmin ping" - --health-interval 10s - --health-timeout 5s - --health-retries 3 - strategy: - fail-fast: false - matrix: - include: - - php: '7.1' - moodle-branch: 'MOODLE_35_STABLE' - database: 'mariadb' - node: '14.15' - - php: '7.2' - moodle-branch: 'MOODLE_35_STABLE' - database: 'pgsql' - node: '14.15' - - php: '7.3' - moodle-branch: 'MOODLE_38_STABLE' - database: 'mariadb' - node: '14.15' - - php: '7.3' - moodle-branch: 'MOODLE_38_STABLE' - database: 'pgsql' - node: '14.15' - - php: '7.3' - moodle-branch: 'MOODLE_39_STABLE' - database: 'mariadb' - node: '14.15' - - php: '7.3' - moodle-branch: 'MOODLE_39_STABLE' - database: 'pgsql' - node: '14.15' - - php: '7.3' - moodle-branch: 'MOODLE_310_STABLE' - database: 'mariadb' - node: '14.15' - - php: '7.3' - moodle-branch: 'MOODLE_310_STABLE' - database: 'pgsql' - node: '14.15' - - steps: - - name: Check out repository code - uses: actions/checkout@v2 - with: - path: plugin - - - name: Install node ${{ matrix.node }} - uses: actions/setup-node@v2 - with: - node-version: ${{ matrix.node }} - - - name: Setup PHP ${{ matrix.php }} - uses: shivammathur/setup-php@v2 - with: - php-version: ${{ matrix.php }} - extensions: pgsql, mysqli, zip, gd, xmlrpc, soap - coverage: none - - - name: Initialise moodle-plugin-ci - run: | - composer create-project -n --no-dev --prefer-dist moodlehq/moodle-plugin-ci ci ^3 - # Add dirs to $PATH - echo $(cd ci/bin; pwd) >> $GITHUB_PATH - echo $(cd ci/vendor/bin; pwd) >> $GITHUB_PATH - # PHPUnit depends on en_AU.UTF-8 locale - sudo locale-gen en_AU.UTF-8 - - name: Install Moodle - run: moodle-plugin-ci install -vvv --plugin ./plugin --db-host=127.0.0.1 - env: - DB: ${{ matrix.database }} - MOODLE_BRANCH: ${{ matrix.moodle-branch }} - - - name: Run phplint - if: ${{ always() }} - run: moodle-plugin-ci phplint - - - name: Run codechecker - if: ${{ always() }} - run: moodle-plugin-ci codechecker - - - name: Run validate - if: ${{ always() }} - run: moodle-plugin-ci validate - - - name: Run savepoints - if: ${{ always() }} - run: moodle-plugin-ci savepoints - - - name: Run mustache - continue-on-error: true # This step will show errors but will not fail - if: ${{ always() }} - run: moodle-plugin-ci mustache - - - name: Run phpunit - if: ${{ always() }} - run: moodle-plugin-ci phpunit - - - name: Run behat - if: ${{ always() }} - run: moodle-plugin-ci behat --profile chrome - - - name: PHP Copy/Paste Detector - continue-on-error: true # This step will show errors but will not fail - if: ${{ always() }} - run: moodle-plugin-ci phpcpd - - - name: PHP Mess Detector - continue-on-error: true # This step will show errors but will not fail - if: ${{ always() }} - run: moodle-plugin-ci phpmd diff --git a/README.md b/README.md index a1c5128..be32ebe 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -![Build Status](https://github.com/catalyst/moodle-tool_trigger/actions/workflows/master.yml/badge.svg?branch=master) +[![ci](https://github.com/catalyst/moodle-tool_trigger/actions/workflows/ci.yml/badge.svg?branch=MOODLE_35_STABLE)](https://github.com/catalyst/moodle-tool_trigger/actions/workflows/ci.yml?branch=MOODLE_35_STABLE) # Event Trigger @@ -12,7 +12,7 @@ Each workflow is made up of a series of *steps*. Steps can be things like: The plugin is designed to be extensible and contributions are welcome to extend the available actions. -More configuration documentation can be found at the following link: +More configuration documentation can be found at the following link: * https://github.com/catalyst/moodle-tool_trigger/wiki @@ -20,22 +20,13 @@ More Information on Moodle events can be found in the Moodle documentation at th * https://docs.moodle.org/dev/Event_2 -## Supported Moodle Versions -This plugin currently supports Moodle: - -* 3.5 -* 3.8 -* 3.9 -* 3.10 -* 3.11 - ## Branches ## The following maps the plugin version to use depending on your Moodle version. -| Moodle verion | Branch | -| ------------------ | ----------- | -| Moodle 3.5 to 3.10 | master | -| Moodle 3.11+ | MOODLE_311 | +| Moodle verion | Branch | +| ------------------ | ------------------ | +| Moodle 3.5 to 3.10 | MOODLE_35_STABLE | +| Moodle 3.11+ | MOODLE_311_STABLE | ## Moodle Plugin Installation The following sections outline how to install the Moodle plugin. @@ -55,7 +46,7 @@ To install the plugin in Moodle via the Moodle User Interface: 3. Install plugin from Moodle Plugin directory or via zip upload. ## Plugin Setup -Plugin setup and configuration documentation can be found at the following link: +Plugin setup and configuration documentation can be found at the following link: * https://github.com/catalyst/moodle-tool_trigger/wiki @@ -74,7 +65,7 @@ https://www.catalyst-au.net/ # Contributing and Support -Issues, and pull requests using github are welcome and encouraged! +Issues, and pull requests using github are welcome and encouraged! https://github.com/catalyst/moodle-tool_trigger/issues diff --git a/amd/build/import_workflow.min.js b/amd/build/import_workflow.min.js index cd58e91..5000d1b 100644 --- a/amd/build/import_workflow.min.js +++ b/amd/build/import_workflow.min.js @@ -1,2 +1,12 @@ -define ("tool_trigger/import_workflow",["jquery","core/str","core/modal_factory","core/modal_events","core/templates","core/ajax","core/fragment","core/notification"],function(a,b,c,d,e,f,g,h){var k={},l,m,n="

Loading...

";function i(){var a={jsonformdata:JSON.stringify({})};m.setBody(n);m.setBody(g.loadFragment("tool_trigger","new_import_form",l,a))}function j(a){a.preventDefault();var c=m.getRoot().find("form").serialize();m.setBody(n);f.call([{methodname:"tool_trigger_process_import_form",args:{jsonformdata:JSON.stringify(c)}}])[0].done(function(a){var b=JSON.parse(a);if("success"==b.errorcode){location.reload(!0)}else{Object.keys(b.message).forEach(function(a){h.addNotification({message:b.message[a],type:"error"})})}m.hide()}).fail(function(){h.addNotification({message:b.get_string("errorimportworkflow","tool_trigger"),type:"error"});m.hide()})}k.init=function(e){l=e;b.get_string("importmodaltitle","tool_trigger").then(function(b){c.create({type:c.types.SAVE_CANCEL,title:b,body:n,large:!0},a("[name=importbtn]")).done(function(a){m=a;m.getRoot().on(d.save,j);m.getRoot().on(d.hidden,i);i()})})};return k}); -//# sourceMappingURL=import_workflow.min.js.map +/** + * Workflow step select javascript. + * + * @module tool_trigger/workflow + * @class Workflow + * @copyright 2018 Matt Porritt + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + * @since 3.4 + */ +define("tool_trigger/import_workflow",["jquery","core/str","core/modal_factory","core/modal_events","core/templates","core/ajax","core/fragment","core/notification"],(function($,Str,ModalFactory,ModalEvents,Templates,ajax,Fragment,Notification){var contextid,modalObj,ImportWorkflow={},spinner='

Loading...

';function updateModalBody(){var params={jsonformdata:JSON.stringify({})};modalObj.setBody(spinner),modalObj.setBody(Fragment.loadFragment("tool_trigger","new_import_form",contextid,params))}function processModalForm(e){e.preventDefault();var fileform=modalObj.getRoot().find("form").serialize();modalObj.setBody(spinner),ajax.call([{methodname:"tool_trigger_process_import_form",args:{jsonformdata:JSON.stringify(fileform)}}])[0].done((function(responsejson){var responseobj=JSON.parse(responsejson);"success"==responseobj.errorcode?location.reload(!0):Object.keys(responseobj.message).forEach((function(key){Notification.addNotification({message:responseobj.message[key],type:"error"})})),modalObj.hide()})).fail((function(){Notification.addNotification({message:Str.get_string("errorimportworkflow","tool_trigger"),type:"error"}),modalObj.hide()}))}return ImportWorkflow.init=function(context){contextid=context,Str.get_string("importmodaltitle","tool_trigger").then((function(title){ModalFactory.create({type:ModalFactory.types.SAVE_CANCEL,title:title,body:spinner,large:!0},$("[name=importbtn]")).done((function(modal){(modalObj=modal).getRoot().on(ModalEvents.save,processModalForm),modalObj.getRoot().on(ModalEvents.hidden,updateModalBody),updateModalBody()}))}))},ImportWorkflow})); + +//# sourceMappingURL=import_workflow.min.js.map \ No newline at end of file diff --git a/amd/build/import_workflow.min.js.map b/amd/build/import_workflow.min.js.map index 8b5431d..79a6fab 100644 --- a/amd/build/import_workflow.min.js.map +++ b/amd/build/import_workflow.min.js.map @@ -1 +1 @@ -{"version":3,"sources":["../src/import_workflow.js"],"names":["define","$","Str","ModalFactory","ModalEvents","Templates","ajax","Fragment","Notification","ImportWorkflow","contextid","modalObj","spinner","updateModalBody","params","jsonformdata","JSON","stringify","setBody","loadFragment","processModalForm","e","preventDefault","fileform","getRoot","find","serialize","call","methodname","args","done","responsejson","responseobj","parse","errorcode","location","reload","Object","keys","message","forEach","key","addNotification","type","hide","fail","get_string","init","context","then","title","create","types","SAVE_CANCEL","body","large","modal","on","save","hidden"],"mappings":"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","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n * Workflow step select javascript.\n *\n * @module tool_trigger/workflow\n * @package tool_trigger\n * @class Workflow\n * @copyright 2018 Matt Porritt \n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n * @since 3.4\n */\n\ndefine(\n ['jquery', 'core/str', 'core/modal_factory', 'core/modal_events','core/templates', 'core/ajax', 'core/fragment',\n 'core/notification'],\n function ($, Str, ModalFactory, ModalEvents, Templates, ajax, Fragment, Notification) {\n\n /**\n * Module level variables.\n */\n var ImportWorkflow = {};\n var contextid;\n var modalObj;\n var spinner = '

'\n + 'Loading...'\n + '

';\n\n /**\n * Updates the body of the modal window.\n *\n * @private\n */\n function updateModalBody() {\n var formdata = {};\n var params = {jsonformdata: JSON.stringify(formdata)};\n modalObj.setBody(spinner);\n modalObj.setBody(Fragment.loadFragment('tool_trigger', 'new_import_form', contextid, params));\n }\n\n /**\n * Updates Moodle form with selected information.\n * @private\n */\n function processModalForm(e) {\n e.preventDefault(); // Stop modal from closing.\n\n // Form data.\n var fileform = modalObj.getRoot().find('form').serialize();\n modalObj.setBody(spinner);\n\n // Submit form via ajax to do server side validation.\n ajax.call([{\n methodname: 'tool_trigger_process_import_form',\n args: {\n jsonformdata: JSON.stringify(fileform)\n },\n }])[0].done(function(responsejson) {\n var responseobj = JSON.parse(responsejson);\n\n if (responseobj.errorcode == 'success') {\n // Validation succeeded! Update the list of workflows.\n location.reload(true); // We're lazy so we'll just reload the page.\n } else {\n Object.keys(responseobj.message).forEach(function(key) {\n Notification.addNotification({\n message: responseobj.message[key],\n type: 'error'\n });\n });\n }\n\n modalObj.hide(); // Hide the modal.\n\n }).fail(function() {\n // Validation failed!\n Notification.addNotification({\n message: Str.get_string('errorimportworkflow', 'tool_trigger'),\n type: 'error'\n });\n\n modalObj.hide(); // Hide the modal.\n });\n }\n\n /**\n * Initialise the class.\n *\n * @public\n */\n ImportWorkflow.init = function(context) {\n // Save the context ID in a closure variable.\n contextid = context;\n\n // Get the Title String.\n Str.get_string('importmodaltitle', 'tool_trigger').then(function(title) {\n // Create the Modal.\n ModalFactory.create({\n type: ModalFactory.types.SAVE_CANCEL,\n title: title,\n body: spinner,\n large: true\n }, $('[name=importbtn]'))\n .done(function(modal) {\n modalObj = modal;\n modalObj.getRoot().on(ModalEvents.save, processModalForm);\n modalObj.getRoot().on(ModalEvents.hidden, updateModalBody);\n updateModalBody();\n });\n });\n\n };\n\n return ImportWorkflow;\n });\n"],"file":"import_workflow.min.js"} \ No newline at end of file +{"version":3,"file":"import_workflow.min.js","sources":["../src/import_workflow.js"],"sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n * Workflow step select javascript.\n *\n * @module tool_trigger/workflow\n * @class Workflow\n * @copyright 2018 Matt Porritt \n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n * @since 3.4\n */\n\ndefine(\n ['jquery', 'core/str', 'core/modal_factory', 'core/modal_events','core/templates', 'core/ajax', 'core/fragment',\n 'core/notification'],\n function ($, Str, ModalFactory, ModalEvents, Templates, ajax, Fragment, Notification) {\n\n /**\n * Module level variables.\n */\n var ImportWorkflow = {};\n var contextid;\n var modalObj;\n var spinner = '

'\n + 'Loading...'\n + '

';\n\n /**\n * Updates the body of the modal window.\n *\n * @private\n */\n function updateModalBody() {\n var formdata = {};\n var params = {jsonformdata: JSON.stringify(formdata)};\n modalObj.setBody(spinner);\n modalObj.setBody(Fragment.loadFragment('tool_trigger', 'new_import_form', contextid, params));\n }\n\n /**\n * Updates Moodle form with selected information.\n *\n * @param {event} e The event from the modal submitting.\n * @private\n */\n function processModalForm(e) {\n e.preventDefault(); // Stop modal from closing.\n\n // Form data.\n var fileform = modalObj.getRoot().find('form').serialize();\n modalObj.setBody(spinner);\n\n // Submit form via ajax to do server side validation.\n ajax.call([{\n methodname: 'tool_trigger_process_import_form',\n args: {\n jsonformdata: JSON.stringify(fileform)\n },\n }])[0].done(function(responsejson) {\n var responseobj = JSON.parse(responsejson);\n\n if (responseobj.errorcode == 'success') {\n // Validation succeeded! Update the list of workflows.\n location.reload(true); // We're lazy so we'll just reload the page.\n } else {\n Object.keys(responseobj.message).forEach(function(key) {\n Notification.addNotification({\n message: responseobj.message[key],\n type: 'error'\n });\n });\n }\n\n modalObj.hide(); // Hide the modal.\n\n }).fail(function() {\n // Validation failed!\n Notification.addNotification({\n message: Str.get_string('errorimportworkflow', 'tool_trigger'),\n type: 'error'\n });\n\n modalObj.hide(); // Hide the modal.\n });\n }\n\n /**\n * Initialise the class.\n *\n * @param {int} context the context id from PHP.\n * @public\n */\n ImportWorkflow.init = function(context) {\n // Save the context ID in a closure variable.\n contextid = context;\n\n // Get the Title String.\n Str.get_string('importmodaltitle', 'tool_trigger').then(function(title) {\n // Create the Modal.\n ModalFactory.create({\n type: ModalFactory.types.SAVE_CANCEL,\n title: title,\n body: spinner,\n large: true\n }, $('[name=importbtn]'))\n .done(function(modal) {\n modalObj = modal;\n modalObj.getRoot().on(ModalEvents.save, processModalForm);\n modalObj.getRoot().on(ModalEvents.hidden, updateModalBody);\n updateModalBody();\n });\n });\n\n };\n\n return ImportWorkflow;\n });\n"],"names":["define","$","Str","ModalFactory","ModalEvents","Templates","ajax","Fragment","Notification","contextid","modalObj","ImportWorkflow","spinner","updateModalBody","params","jsonformdata","JSON","stringify","setBody","loadFragment","processModalForm","e","preventDefault","fileform","getRoot","find","serialize","call","methodname","args","done","responsejson","responseobj","parse","errorcode","location","reload","Object","keys","message","forEach","key","addNotification","type","hide","fail","get_string","init","context","then","title","create","types","SAVE_CANCEL","body","large","modal","on","save","hidden"],"mappings":";;;;;;;;;AAyBAA,sCACE,CAAC,SAAU,WAAY,qBAAsB,oBAAoB,iBAAkB,YAAa,gBAC5F,sBACE,SAAUC,EAAGC,IAAKC,aAAcC,YAAaC,UAAWC,KAAMC,SAAUC,kBAMhEC,UACAC,SAFAC,eAAiB,GAGjBC,QAAU,gIASLC,sBAEDC,OAAS,CAACC,aAAcC,KAAKC,UADlB,KAEfP,SAASQ,QAAQN,SACjBF,SAASQ,QAAQX,SAASY,aAAa,eAAgB,kBAAmBV,UAAWK,kBAShFM,iBAAiBC,GACtBA,EAAEC,qBAGEC,SAAWb,SAASc,UAAUC,KAAK,QAAQC,YAC/ChB,SAASQ,QAAQN,SAGjBN,KAAKqB,KAAK,CAAC,CACPC,WAAY,mCACZC,KAAM,CACFd,aAAcC,KAAKC,UAAUM,cAEjC,GAAGO,MAAK,SAASC,kBACbC,YAAchB,KAAKiB,MAAMF,cAEA,WAAzBC,YAAYE,UAEZC,SAASC,QAAO,GAEhBC,OAAOC,KAAKN,YAAYO,SAASC,SAAQ,SAASC,KAC9CjC,aAAakC,gBAAgB,CACzBH,QAASP,YAAYO,QAAQE,KAC7BE,KAAM,aAKlBjC,SAASkC,UAEVC,MAAK,WAEJrC,aAAakC,gBAAgB,CACzBH,QAASrC,IAAI4C,WAAW,sBAAuB,gBAC/CH,KAAM,UAGVjC,SAASkC,iBAUjBjC,eAAeoC,KAAO,SAASC,SAE3BvC,UAAYuC,QAGZ9C,IAAI4C,WAAW,mBAAoB,gBAAgBG,MAAK,SAASC,OAE7D/C,aAAagD,OAAO,CAChBR,KAAMxC,aAAaiD,MAAMC,YACzBH,MAAOA,MACPI,KAAM1C,QACN2C,OAAO,GACRtD,EAAE,qBACJ6B,MAAK,SAAS0B,QACX9C,SAAW8C,OACFhC,UAAUiC,GAAGrD,YAAYsD,KAAMtC,kBACxCV,SAASc,UAAUiC,GAAGrD,YAAYuD,OAAQ9C,iBAC1CA,yBAMLF"} \ No newline at end of file diff --git a/amd/build/step_select.min.js b/amd/build/step_select.min.js index 489ccbe..4a7eb21 100644 --- a/amd/build/step_select.min.js +++ b/amd/build/step_select.min.js @@ -1,2 +1,12 @@ -define ("tool_trigger/step_select",["jquery","core/str","core/modal_factory","core/modal_events","core/templates","core/ajax","core/fragment","core/notification"],function(a,b,c,d,e,f,g,h){var u={},v,w,x="

Loading...

";function i(){var b=a("[name=stepjson]").val(),c=[];if(""!==b){c=JSON.parse(b)}return c}function j(b){a("[name=stepjson]").val(JSON.stringify(b));a("[name=isstepschanged]").val(1)}function k(){var a={jsonformdata:JSON.stringify({})};w.setBody(x);w.setBody(g.loadFragment("tool_trigger","new_base_form",v,a))}function l(b){var c=b.map(function(a,b){return{name:a.name,typedesc:a.typedesc,stepdesc:a.stepdesc,steporder:b}});e.render("tool_trigger/workflow_steps",{rows:c}).then(function(b){a("#steps-table").html(b);t()}).fail(function(){h.exception({message:"Error updating steps table"})})}function m(b){b.preventDefault();var c=w.getRoot().find("form"),d=c.serializeArray().reduce(function(a,b){if(b.name.endsWith("[]")){var c=b.name.substring(0,b.name.length-2);if(a[c]===void 0){a[c]=[b.value]}else{a[c].push(b.value)}}else if("sesskey"!==b.name&&!b.name.startsWith("_qf__")&&!b.value.startsWith("_qf__")){a[b.name]=b.value}return a},{});d.stepdesc=a("[name=stepclass] option:selected").text();d.typedesc=a("[name=type] option:selected").text();f.call([{methodname:"tool_trigger_validate_form",args:{stepclass:d.stepclass,jsonformdata:JSON.stringify(c.serialize())}}])[0].done(function(){var a=i();if(0<=d.steporder){a[d.steporder]=d}else{a.push(d);d.steporder=a.length-1}j(a);l(a);w.hide()}).fail(function(){q(d.type,d.stepclass,"",c.serialize())})}function n(b){a("[name=stepclass]").empty().append(a("