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>
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
3705d7af4d
Коммит
22275fa0f5
@@ -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]) {
|
||||
|
||||
@@ -82,6 +82,7 @@ export type ClientConfig = {
|
||||
EnableOAuthServiceProvider: string;
|
||||
EnableOpenServer: string;
|
||||
EnableOutgoingWebhooks: string;
|
||||
EnablePlaybooks: string;
|
||||
EnablePostIconOverride: string;
|
||||
EnablePostUsernameOverride: string;
|
||||
EnablePreviewFeatures: string;
|
||||
@@ -818,6 +819,7 @@ export type JobSettings = {
|
||||
|
||||
export type ProductSettings = {
|
||||
EnablePublicSharedBoards: boolean;
|
||||
EnablePlaybooks: boolean;
|
||||
};
|
||||
|
||||
export type PluginSettings = {
|
||||
|
||||
Ссылка в новой задаче
Block a user