MM-52818 - create config setting to enable/disable playbooks product (#23508)

* create config setting to enable/disable playbooks product

* fix to config name

* fix typo

* revert changes to package-lock.json

* update name of test

---------

Co-authored-by: Mattermost Build <build@mattermost.com>
Этот коммит содержится в:
Scott Bishel
2023-06-05 15:18:20 -06:00
коммит произвёл GitHub
родитель 3705d7af4d
Коммит 22275fa0f5
7 изменённых файлов: 33 добавлений и 3 удалений

Просмотреть файл

@@ -37,8 +37,8 @@ function configureClient() {
function loadRemoteModules() {
/* eslint-disable no-console */
return async (/*dispatch: DispatchFunc, getState: GetStateFunc*/) => {
// const config = getConfig(getState());
return async (dispatch: DispatchFunc, getState: GetStateFunc) => {
const config = getConfig(getState());
/**
* products contains a map of product IDs to a function that will load all of their parts. Calling that
@@ -47,7 +47,7 @@ function loadRemoteModules() {
* Note that these import paths must be statically defined or else they won't be found at runtime. They
* can't be constructed based on the name of a product at runtime.
*/
const products = [
let products = [
{
id: 'boards',
load: () => ({
@@ -65,6 +65,9 @@ function loadRemoteModules() {
}),
},
];
if (config.EnablePlaybooks !== 'true') {
products = products.filter((p) => p.id !== 'playbooks');
}
await Promise.all(products.map(async (product) => {
if (!REMOTE_CONTAINERS[product.id]) {