Prevent boards product from being included automatically (#23539)

* Prevent boards product from being included automatically

* Fix config diff test

* Update prepackaged plugin version

Co-authored-by: Scott Bishel <scott.bishel@mattermost.com>

* Readd boards/dist to the gitignore

* Does not enable the focalboard plugin by default

* Update plugin version to v7.10.3

---------

Co-authored-by: Scott Bishel <scott.bishel@mattermost.com>
Этот коммит содержится в:
Miguel de la Cruz
2023-06-12 18:51:43 +02:00
коммит произвёл GitHub
родитель d8cb5f3a6e
Коммит 1215584665
16 изменённых файлов: 708 добавлений и 8807 удалений

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

@@ -131,21 +131,6 @@ export default class Client extends Client4 {
return this.doFetch<PluginManifest>(this.getPluginsRoute(), options);
};
// *****************************************************************************
// Boards client
// based on "webapp/boards/src/octoClient.ts"
// *****************************************************************************
async patchUserConfig(userID: string, patch: UserConfigPatch): Promise<UserPreference[] | undefined> {
const path = `/users/${encodeURIComponent(userID)}/config`;
const options = {
method: 'put',
body: JSON.stringify(patch),
};
return this.doFetch<UserPreference[]>(this.getBoardsRoute() + path, options);
}
}
// Variable to hold cache
@@ -168,9 +153,6 @@ async function makeClient(userRequest?: UserRequest, useCache = true): Promise<C
const userProfile = await client.login(userRequest.username, userRequest.password);
const user = {...userProfile, password: userRequest.password};
// Manually do until boards as product is consistent in all the codebase.
client.setUseBoardsProduct(true);
if (useCache) {
clients[cacheKey] = {client, user};
}
@@ -197,18 +179,4 @@ type ClientCache = {
user: UserProfile | null;
};
// Boards types
interface UserPreference {
user_id: string;
category: string;
name: string;
value: any;
}
interface UserConfigPatch {
updatedFields?: Record<string, string>;
deletedFields?: string[];
}
export {Client, makeClient};

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

@@ -14,20 +14,10 @@ import {getOnPremServerConfig} from './default_config';
import {createRandomTeam} from './team';
import {createRandomUser} from './user';
const boardsUserConfigPatch = {
updatedFields: {
welcomePageViewed: '1',
onboardingTourStep: '999',
tourCategory: 'board',
version72MessageCanceled: 'true',
},
};
export async function initSetup({
userPrefix = 'user',
teamPrefix = {name: 'team', displayName: 'Team'},
withDefaultProfileImage = true,
skipBoardsUserConfig = true,
} = {}) {
try {
// Login the admin user via API
@@ -65,10 +55,6 @@ export async function initSetup({
];
await userClient.savePreferences(user.id, preferences);
if (skipBoardsUserConfig) {
await userClient.patchUserConfig(user.id, boardsUserConfigPatch);
}
return {
adminClient,
adminUser,