oat-sa/tao-core

TAO core extension

Installs: 56 822

Dependents: 7

Suggesters: 0

Security: 0

Stars: 40

Watchers: 48

Forks: 27

Open Issues: 52

Type:tao-extension

v46.5.0 2020-10-23 08:34 UTC

This package is auto-updated.

Last update: 2020-10-27 14:23:14 UTC


README

Task Queue Doc

Feature flag

You can now define feature flag in environment global variables.

How to use it

You can use feature flag to easily switch off/on parts of TAO functionality.

Feature flag name

It is import tht we will use FEATURE_FLAG prefix for our feature flags to recognise them and they prupose in environment variable list.

AbstractFeatureFlagFormPropertyMapper

To hide/show form fields you can extend AbstractFeatureFlagFormPropertyMapper with your configurable service that has OPTION_FEATURE_FLAG_FORM_FIELDS mapped to list of fields that you want to hide/show.

<?php
use oat\taoLti\models\classes\LtiProvider\FeatureFlagFormPropertyMapper;    

return new FeatureFlagFormPropertyMapper(
    [
        FeatureFlagFormPropertyMapper::OPTION_FEATURE_FLAG_FORM_FIELDS => [
                'formField_01' => [
                    'FEATURE_FLAG_NAME'
                ]
            ]
    ]
);

This configuration will display formField_01 when FEATURE_FLAG_NAME is enabled

SectionVisibilityFilterInterface

tao/SectionVisibilityFilter is responsible for listing sections that can be disabled from user. In order to add more sections that have to be disabled/enabled based on feature flag.

<?php

return new oat\tao\model\menu\SectionVisibilityFilter(array(
    'featureFlagSections' => [
        'sectionName' => [
            'FETURE_FLAG_01'
        ]
    ]
));

This configuration will display sectionName when FETURE_FLAG_01 is enabled.