Skip to content

Commit

Permalink
Merge branch 'master' into issue-245
Browse files Browse the repository at this point in the history
  • Loading branch information
ferishili committed Nov 13, 2024
2 parents 11f6e5b + 158ded8 commit 22e3996
Show file tree
Hide file tree
Showing 8 changed files with 163 additions and 135 deletions.
11 changes: 11 additions & 0 deletions .github/workflows/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"main-moodle": "MOODLE_405_STABLE",
"main-php": "8.3",
"main-oc": "16.6",
"ocs": ["16.6", "15.11"],
"main-db": "mariadb",
"moodle-php": {
"MOODLE_405_STABLE": ["8.1", "8.2"]
},
"moodle-plugin-ci": "4.4.5"
}
15 changes: 15 additions & 0 deletions .github/workflows/config_all.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"main-moodle": "MOODLE_405_STABLE",
"main-php": "8.3",
"main-oc": "16.6",
"ocs": ["16.6", "15.11"],
"main-db": "mariadb",
"moodle-php": {
"MOODLE_401_STABLE": ["7.4", "8.0", "8.1"],
"MOODLE_402_STABLE": ["8.0", "8.1", "8.2"],
"MOODLE_403_STABLE": ["8.0", "8.1", "8.2"],
"MOODLE_404_STABLE": ["8.1", "8.2", "8.3"],
"MOODLE_405_STABLE": ["8.1", "8.2", "8.3"]
},
"moodle-plugin-ci": "4.4.5"
}
2 changes: 1 addition & 1 deletion .github/workflows/moodle-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on: [ push, pull_request ]

jobs:
call-moodle-ci-workflow:
uses: Opencast-Moodle/moodle-workflows-opencast/.github/workflows/moodle-ci.yml@master
uses: Opencast-Moodle/moodle-workflows-opencast/.github/workflows/moodle-ci.yml@main
with:
requires-tool-plugin: true
requires-mod-plugin: true
Expand Down
1 change: 1 addition & 0 deletions classes/setting_helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ public static function validate_aclownerrole_setting($data) {
$ocinstanceid = intval(ltrim($section ?? '', 'block_opencast_importvideossettings_'));
}

$ocinstanceid = $ocinstanceid == 0 ? 1 : $ocinstanceid;
// Do only if a workflow was set.
if (!empty($data)) {
$roles = json_decode(get_config('block_opencast', 'roles_' . $ocinstanceid));
Expand Down
2 changes: 1 addition & 1 deletion tests/behat/block_opencast_deletedraft.feature
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ Feature: Delete draft
And I upload "blocks/opencast/tests/fixtures/test.mp4" file to "Presenter video" filemanager
And I click on "Add video" "button"
Then I should see "test.mp4"
When I click on ".generaltable i.fa-trash" "css_element"
When I click on ".generaltable i.fa-trash-can" "css_element"
Then I should see "Delete video before transfer to Opencast"
And I click on "Continue" "button"
Then I should see "The video is deleted successfully"
Expand Down
4 changes: 2 additions & 2 deletions tests/behat/block_opencast_deleteevent.feature
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ Feature: Delete videos
@javascript
Scenario: A teacher should be able to delete a video
When I click on "Go to overview..." "link"
And I click on "#opencast-videos-table-1234-1234-1234-1234-1234_r0 i.fa-trash" "css_element"
And I click on "#opencast-videos-table-1234-1234-1234-1234-1234_r0 i.fa-trash-can" "css_element"
And I click on "Delete video permanently" "button"
Then I should see "The video will be deleted shortly"

Expand All @@ -43,6 +43,6 @@ Feature: Delete videos
| config | value | plugin |
| deleteworkflow_1 | delete | block_opencast |
When I click on "Go to overview..." "link"
And I click on "#opencast-videos-table-1234-1234-1234-1234-1234_r0 i.fa-trash" "css_element"
And I click on "#opencast-videos-table-1234-1234-1234-1234-1234_r0 i.fa-trash-can" "css_element"
And I click on "Delete video permanently" "button"
Then I should see "The video will be deleted shortly"
254 changes: 127 additions & 127 deletions tests/behat/block_opencast_manageseries.feature
Original file line number Diff line number Diff line change
@@ -1,127 +1,127 @@
@block @block_opencast @block_opencast_manageseries
Feature: Manage series as Teacher
In order to manage series for a course
As teacher
I need to be able to create, edit, import and delete series

Background:
Given the following "users" exist:
| username | firstname | lastname | email | idnumber |
| teacher1 | Teacher | 1 | teacher1@example.com | T1 |
And the following "courses" exist:
| fullname | shortname | category |
| Course 1 | C1 | 0 |
And the following "course enrolments" exist:
| user | course | role |
| teacher1 | C1 | editingteacher |
And I setup the default settigns for opencast plugins
And the following config values are set as admin:
| config | value | plugin |
| apiurl_1 | http://testapi:8080 | tool_opencast |
| apipassword_1 | opencast | tool_opencast |
| apiusername_1 | admin | tool_opencast |
| ocinstances | [{"id":1,"name":"Default","isvisible":true,"isdefault":true}] | tool_opencast |
| limituploadjobs_1 | 0 | block_opencast |
| group_creation_1 | 0 | block_opencast |
| group_name_1 | Moodle_course_[COURSEID] | block_opencast |
| series_name_1 | Course_Series_[COURSEID] | block_opencast |
| enablechunkupload_1 | 0 | block_opencast |
| workflow_roles_1 | republish-metadata | block_opencast |
And I setup the opencast test api
And I upload a testvideo
And I log in as "admin"
And I am on "Course 1" course homepage with editing mode on
And I add the "Opencast Videos" block

@javascript
Scenario: Teachers should be able to create a new series
When I click on "Go to overview..." "link"
And I click on "Manage series" "link"
Then I should see "Test series"
When I click on "Create new series" "button"
Then I should see "Title"
Then ".modal i.icon[title='Required']" "css_element" should be visible
When I set the field "Title" to "My new series"
And I set the field "Rights" to "Some user"
And I select "ALLRIGHTS" from the "License" singleselect
And I click on "Create new series" "button" in the ".modal" "css_element"
And I wait "2" seconds
Then I should see "My new series"
And I should see "84bab8de-5688-46a1-9af0-5ce9122eeb6a"

@javascript
Scenario: Teachers should be able to edit an existing series
When I click on "Go to overview..." "link"
And I click on "Manage series" "link"
Then I should see "Test series"
When I click on ".tabulator-row-odd i.fa-edit" "css_element"
Then I should see "Title"
When I set the field "Title" to "Another series title"
And I set the field "Rights" to "Some user"
And I select "ALLRIGHTS" from the "License" singleselect
And I click on "Edit series" "button"
And I wait "2" seconds
Then I should not see "Updating the series metadata failed"
And I should see "Another series title"

@javascript
Scenario: Teachers should not be able to create/import series if the maximum number of series is reached
Given the following config values are set as admin:
| config | value | plugin |
| maxseries_1 | 1 | block_opencast |
When I click on "Go to overview..." "link"
And I click on "Manage series" "link"
Then I should not see "Create new series"
And I should not see "Import series"

@javascript
Scenario: Teachers should not be able to select a different default series
Given I create a second series
When I click on "Go to overview..." "link"
And I click on "Manage series" "link"
And I click on ".tabulator-row-even input[name=\"defaultseries\"]" "css_element"
Then I should see "Do you really want to use this series as new default series"
When I click on "Save changes" "button"
And I wait "2" seconds
Then I should not see "Changing the default series failed"

@javascript
Scenario: Teachers should be able to delete a series
Given I create a second series
When I click on "Go to overview..." "link"
And I click on "Manage series" "link"
And I click on ".tabulator-row-even i.fa-trash" "css_element"
Then I should see "Are you sure you want to delete this series"
When I click on "Delete" "button" in the ".modal" "css_element"
And I wait "2" seconds
Then I should not see "Another series"

@javascript
Scenario: Teachers should be able to import a series
When I click on "Go to overview..." "link"
And I click on "Manage series" "link"
And I click on "Import series" "button"
And I set the field "Series ID" to "1111-1111-1111-1111-1111"
And I click on "Import series" "button" in the ".modal" "css_element"
And I wait "2" seconds
Then I should not see "The series could not be imported"

@javascript
Scenario: When manually deleting a block, teacher will be asked to decide whether to delete seriesmapping in a confirmation.
When I open the action menu in "Opencast Videos" "block"
And I click on "Delete Opencast Videos block" "link"
Then I should see "Remove Opencast Block?"
When I click on "Delete block, but keep series mapping" "link"
Then I add the "Opencast Videos" block
And I click on "Go to overview..." "link"
And I click on "Manage series" "link"
Then I should see "Test series"
When I am on "Course 1" course homepage with editing mode on
When I open the action menu in "Opencast Videos" "block"
And I click on "Delete Opencast Videos block" "link"
When I click on "Delete block and series mapping" "text"
And I wait to be redirected
Then I add the "Opencast Videos" block
And I click on "Go to overview..." "link"
And I click on "Manage series" "link"
Then I should see "No series is defined yet."
@block @block_opencast @block_opencast_manageseries
Feature: Manage series as Teacher
In order to manage series for a course
As teacher
I need to be able to create, edit, import and delete series

Background:
Given the following "users" exist:
| username | firstname | lastname | email | idnumber |
| teacher1 | Teacher | 1 | teacher1@example.com | T1 |
And the following "courses" exist:
| fullname | shortname | category |
| Course 1 | C1 | 0 |
And the following "course enrolments" exist:
| user | course | role |
| teacher1 | C1 | editingteacher |
And I setup the default settigns for opencast plugins
And the following config values are set as admin:
| config | value | plugin |
| apiurl_1 | http://testapi:8080 | tool_opencast |
| apipassword_1 | opencast | tool_opencast |
| apiusername_1 | admin | tool_opencast |
| ocinstances | [{"id":1,"name":"Default","isvisible":true,"isdefault":true}] | tool_opencast |
| limituploadjobs_1 | 0 | block_opencast |
| group_creation_1 | 0 | block_opencast |
| group_name_1 | Moodle_course_[COURSEID] | block_opencast |
| series_name_1 | Course_Series_[COURSEID] | block_opencast |
| enablechunkupload_1 | 0 | block_opencast |
| workflow_roles_1 | republish-metadata | block_opencast |
And I setup the opencast test api
And I upload a testvideo
And I log in as "admin"
And I am on "Course 1" course homepage with editing mode on
And I add the "Opencast Videos" block

@javascript
Scenario: Teachers should be able to create a new series
When I click on "Go to overview..." "link"
And I click on "Manage series" "link"
Then I should see "Test series"
When I click on "Create new series" "button"
Then I should see "Title"
Then ".modal i.icon[title='Required']" "css_element" should be visible
When I set the field "Title" to "My new series"
And I set the field "Rights" to "Some user"
And I select "ALLRIGHTS" from the "License" singleselect
And I click on "Create new series" "button" in the ".modal" "css_element"
And I wait "2" seconds
Then I should see "My new series"
And I should see "84bab8de-5688-46a1-9af0-5ce9122eeb6a"

@javascript
Scenario: Teachers should be able to edit an existing series
When I click on "Go to overview..." "link"
And I click on "Manage series" "link"
Then I should see "Test series"
When I click on ".tabulator-row-odd i.fa-edit" "css_element"
Then I should see "Title"
When I set the field "Title" to "Another series title"
And I set the field "Rights" to "Some user"
And I select "ALLRIGHTS" from the "License" singleselect
And I click on "Edit series" "button"
And I wait "2" seconds
Then I should not see "Updating the series metadata failed"
And I should see "Another series title"

@javascript
Scenario: Teachers should not be able to create/import series if the maximum number of series is reached
Given the following config values are set as admin:
| config | value | plugin |
| maxseries_1 | 1 | block_opencast |
When I click on "Go to overview..." "link"
And I click on "Manage series" "link"
Then I should not see "Create new series"
And I should not see "Import series"

@javascript
Scenario: Teachers should not be able to select a different default series
Given I create a second series
When I click on "Go to overview..." "link"
And I click on "Manage series" "link"
And I click on ".tabulator-row-even input[name=\"defaultseries\"]" "css_element"
Then I should see "Do you really want to use this series as new default series"
When I click on "Save changes" "button"
And I wait "2" seconds
Then I should not see "Changing the default series failed"

@javascript
Scenario: Teachers should be able to delete a series
Given I create a second series
When I click on "Go to overview..." "link"
And I click on "Manage series" "link"
And I click on ".tabulator-row-even i.fa-trash" "css_element"
Then I should see "Are you sure you want to delete this series"
When I click on "Delete" "button" in the ".modal" "css_element"
And I wait "2" seconds
Then I should not see "Another series"

@javascript
Scenario: Teachers should be able to import a series
When I click on "Go to overview..." "link"
And I click on "Manage series" "link"
And I click on "Import series" "button"
And I set the field "Series ID" to "1111-1111-1111-1111-1111"
And I click on "Import series" "button" in the ".modal" "css_element"
And I wait "2" seconds
Then I should not see "The series could not be imported"

@javascript
Scenario: When manually deleting a block, teacher will be asked to decide whether to delete seriesmapping in a confirmation.
When I open the action menu in "Opencast Videos" "block"
And I click on "Delete Opencast Videos block" "link"
Then I should see "Remove Opencast Block?"
When I click on "Delete block, but keep series mapping" "link"
Then I add the "Opencast Videos" block
And I click on "Go to overview..." "link"
And I click on "Manage series" "link"
Then I should see "Test series"
When I am on "Course 1" course homepage with editing mode on
When I open the action menu in "Opencast Videos" "block"
And I click on "Delete Opencast Videos block" "link"
When I click on "Delete block and series mapping" "text"
And I wait to be redirected
Then I add the "Opencast Videos" block
And I click on "Go to overview..." "link"
And I click on "Manage series" "link"
Then I should see "No series is defined yet."
9 changes: 5 additions & 4 deletions version.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,17 @@
* Version details
*
* @package block_opencast
* @copyright 2024 Thomas Niedermaier <[email protected]>
* @copyright 2017 Andreas Wagner, SYNERGY LEARNING
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();

$plugin->component = 'block_opencast';
$plugin->release = 'v4.4-r2';
$plugin->version = 2024061400;
$plugin->requires = 2022112800; // Requires Moodle 4.1+.
$plugin->release = 'v4.5-r1';
$plugin->version = 2024111100;
$plugin->requires = 2024100700; // Requires Moodle 4.5+.
$plugin->maturity = MATURITY_STABLE;
$plugin->dependencies = [
'tool_opencast' => 2024060400,
'tool_opencast' => 2024111100,
];

0 comments on commit 22e3996

Please sign in to comment.