Skip to content

Commit

Permalink
Merge branch 'release-14.22.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions committed Jun 24, 2024
2 parents c225cee + 5954c58 commit 596a191
Show file tree
Hide file tree
Showing 5 changed files with 61 additions and 8 deletions.
6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@
"minimum-stability": "dev",
"require": {
"oat-sa/oatbox-extension-installer": "~1.1||dev-master",
"oat-sa/generis": ">=15.22",
"oat-sa/tao-core": ">=54.10.0",
"oat-sa/generis": ">=15.36.4",
"oat-sa/tao-core": ">=54.14.7",
"oat-sa/extension-tao-delivery": ">=15.0.0",
"oat-sa/extension-tao-group": ">=7.0.0",
"oat-sa/extension-tao-item": ">=11.0.0",
"oat-sa/extension-tao-test": ">=15.0.0",
"oat-sa/extension-tao-testqti": ">=44.15.0"
"oat-sa/extension-tao-testqti": ">=48.7.0"
},
"autoload": {
"psr-4": {
Expand Down
14 changes: 12 additions & 2 deletions controller/DeliveryMgmt.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
* Copyright (c) 2014-2019 (original work) Open Assessment Technologies SA;
* Copyright (c) 2014-2024 (original work) Open Assessment Technologies SA;
*
*
*/
Expand All @@ -27,6 +27,7 @@
use oat\oatbox\event\EventManager;
use oat\tao\helpers\Template;
use oat\tao\model\accessControl\RoleBasedContextRestrictAccess;
use oat\tao\model\featureFlag\FeatureFlagCheckerInterface;
use oat\tao\model\featureFlag\FeatureFlagChecker;
use oat\tao\model\resources\ResourceWatcher;
use oat\tao\model\TaoOntology;
Expand Down Expand Up @@ -138,9 +139,13 @@ public function editDelivery()
$this->setData('groupTree', $tree->render());
}

$solarDesignEnabled = $this->getFeatureFlagChecker()->isEnabled(
FeatureFlagCheckerInterface::FEATURE_FLAG_SOLAR_DESIGN_ENABLED
);

$this->setData(
'ttdisabled',
$this->isUserRestricted()
$this->isUserRestricted() || $solarDesignEnabled
);

// testtaker brick
Expand Down Expand Up @@ -372,4 +377,9 @@ private function getRoleBasedContextRestrictAccess(): RoleBasedContextRestrictAc
{
return $this->getPsrContainer()->get(RoleBasedContextRestrictAccess::class);
}

private function getFeatureFlagChecker(): FeatureFlagCheckerInterface
{
return $this->getServiceLocator()->get(FeatureFlagChecker::class);
}
}
45 changes: 44 additions & 1 deletion views/js/controller/DeliveryMgmt/editDelivery.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,56 @@
define([
'jquery',
'util/url',
'services/features',
'ui/modal',
'css!taoDeliveryRdfCss/delivery-rdf.css'
], function ($, urlUtil) {
], function ($, urlUtil, features) {
'use strict';

/**
* Finds property block and hides it adding .hidden class
* @param {string} propName
*/
function hidePropertyBlockByName(propName) {
const inputCssQuery = `form[action="/taoDeliveryRdf/DeliveryMgmt/editDelivery"] input[name="${propName}"]`;
$(inputCssQuery).closest('form > div').addClass('hidden');
}

return {
start(){

const featuresPath = 'taoDeliveryRdf/deliveryMgmt/';
if(!features.isVisible(`${featuresPath}resourceIdentifier`)) {
hidePropertyBlockByName('id');
}
if(!features.isVisible(`${featuresPath}maxExecutions`)) {
hidePropertyBlockByName('http_2_www_0_tao_0_lu_1_Ontologies_1_TAODelivery_0_rdf_3_Maxexec');
}
if(!features.isVisible(`${featuresPath}maxExecutions`)) {
hidePropertyBlockByName('http_2_www_0_tao_0_lu_1_Ontologies_1_TAODelivery_0_rdf_3_Maxexec');
}
if(!features.isVisible(`${featuresPath}startDate`)) {
hidePropertyBlockByName('http_2_www_0_tao_0_lu_1_Ontologies_1_TAODelivery_0_rdf_3_PeriodStart');
}
if(!features.isVisible(`${featuresPath}endDate`)) {
hidePropertyBlockByName('http_2_www_0_tao_0_lu_1_Ontologies_1_TAODelivery_0_rdf_3_PeriodEnd');
}
if(!features.isVisible(`${featuresPath}displayOrder`)) {
hidePropertyBlockByName('http_2_www_0_tao_0_lu_1_Ontologies_1_TAODelivery_0_rdf_3_DisplayOrder');
}
if(!features.isVisible(`${featuresPath}access`)) {
hidePropertyBlockByName('http_2_www_0_tao_0_lu_1_Ontologies_1_TAODelivery_0_rdf_3_AccessSettings_0');
}
if(!features.isVisible(`${featuresPath}proctoringSettings`)) {
hidePropertyBlockByName('http_2_www_0_tao_0_lu_1_Ontologies_1_TAODelivery_0_rdf_3_ProctorAccessible_0');
}
if(!features.isVisible(`${featuresPath}publicationId`)) {
hidePropertyBlockByName('http_2_www_0_tao_0_lu_1_Ontologies_1_taoDeliverConnect_0_rdf_3_PublicationId');
}
if(!features.isVisible(`${featuresPath}assessmentProjectId`)) {
hidePropertyBlockByName('http_2_www_0_tao_0_lu_1_Ontologies_1_TAODelivery_0_rdf_3_AssessmentProjectId');
}

$('#exclude-btn').click(function() {
const delivery = $(this).data('delivery');

Expand Down
Loading

0 comments on commit 596a191

Please sign in to comment.