From 4519f9ad5a39fa3fbff1a17a7a68d7563cafa1e6 Mon Sep 17 00:00:00 2001 From: Michael Hawkins Date: Thu, 24 Aug 2023 14:27:27 +0800 Subject: [PATCH] WIP - behat and text updates --- .../customlink/classes/communication_feature.php | 3 +++ .../customlink/lang/en/communication_customlink.php | 3 ++- .../provider/customlink/tests/behat/custom_link.feature | 9 ++++----- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/communication/provider/customlink/classes/communication_feature.php b/communication/provider/customlink/classes/communication_feature.php index f123eb4e5850b..30c70e0a82336 100644 --- a/communication/provider/customlink/classes/communication_feature.php +++ b/communication/provider/customlink/classes/communication_feature.php @@ -168,5 +168,8 @@ public static function set_form_definition(\MoodleQuickForm $mform): void { $mform->addRule('customlinkurl', get_string('required'), 'required', null, 'server'); $mform->addRule('customlinkurl', get_string('maximumchars', '', 255), 'maxlength', 255, 'client'); $mform->addRule('customlinkurl', get_string('maximumchars', '', 255), 'maxlength', 255, 'server'); + $mform->insertElementBefore($mform->createElement('static', 'customlinkurlinfo', '', + get_string('customlinkurlinfo', 'communication_customlink'), + 'addcommunicationoptionshere'), 'addcommunicationoptionshere'); } } diff --git a/communication/provider/customlink/lang/en/communication_customlink.php b/communication/provider/customlink/lang/en/communication_customlink.php index 2b246a78d8c7e..b684484cdb7c5 100644 --- a/communication/provider/customlink/lang/en/communication_customlink.php +++ b/communication/provider/customlink/lang/en/communication_customlink.php @@ -24,6 +24,7 @@ $string['cachedef_customlink'] = 'Custom link data'; $string['customlinkurl'] = 'Custom link URL'; -$string['customlinkurl_help'] = 'The URL of an existing room/channel set up for this course in a messaging or other communication service you would like to link to.'; +$string['customlinkurl_help'] = 'Provide a link to an existing room from any communication service you would like to make available to participants - such as Microsoft Teams, Slack or Matrix.'; +$string['customlinkurlinfo'] = 'The URL of an existing room already set up for this course.'; $string['pluginname'] = 'Custom link'; $string['privacy:metadata'] = 'Custom link communication plugin does not store any personal data.'; diff --git a/communication/provider/customlink/tests/behat/custom_link.feature b/communication/provider/customlink/tests/behat/custom_link.feature index 6c507110381ae..a73e2786c9166 100644 --- a/communication/provider/customlink/tests/behat/custom_link.feature +++ b/communication/provider/customlink/tests/behat/custom_link.feature @@ -23,18 +23,17 @@ Feature: Communication custom link When I am on the "Course 1" "Course" page logged in as "teacher1" #TODO: Try to avoid CSS elements And ".btn-footer-communication" "css_element" should not be visible - And I am on the "Course 1" "course editing" page - And I expand all fieldsets + And I navigate to "Communication" in current page administration And the "Communication service" select box should contain "Custom link" And I should not see "Custom link URL" And I select "Custom link" from the "Communication service" singleselect And I should see "Custom link URL" # Simulate a custom link using the FQDN of an internal URL to avoid external dependency. And I set the following fields to these values: - | communicationroomname | Test URL | - | customlinkurl | /stable_master/my/ | + | communicationroomname | Test URL | + | customlinkurl | /stable_master/my/ | #TODO: Have a better way to do a FQDN ^^ - And I press "Save and display" + And I press "Save changes" Then I should see "Your Custom link room is ready" And ".btn-footer-communication" "css_element" should be visible And I click on ".btn-footer-communication" "css_element"