Merge branch 'MM-50966-in-product-expansion' into MM-51456-update-overage-notices
Этот коммит содержится в:
@@ -1,5 +1,3 @@
|
|||||||
/plugin/ @mattermost/toolkit
|
|
||||||
|
|
||||||
/.github/workflows/channels-ci.yml @mattermost/web-platform
|
/.github/workflows/channels-ci.yml @mattermost/web-platform
|
||||||
/webapp/package.json @mattermost/web-platform
|
/webapp/package.json @mattermost/web-platform
|
||||||
/webapp/channels/package.json @mattermost/web-platform
|
/webapp/channels/package.json @mattermost/web-platform
|
||||||
|
|||||||
@@ -22,8 +22,6 @@ describe('New Channel modal with Boards enabled', () => {
|
|||||||
cy.apiLogin(sysadmin);
|
cy.apiLogin(sysadmin);
|
||||||
cy.visit(`/${testTeam.name}/channels/town-square`);
|
cy.visit(`/${testTeam.name}/channels/town-square`);
|
||||||
});
|
});
|
||||||
|
|
||||||
cy.shouldHaveFeatureFlag('BoardsProduct', true);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('MM-T5141 New Channel is created with an associated Board', () => {
|
it('MM-T5141 New Channel is created with an associated Board', () => {
|
||||||
|
|||||||
@@ -145,4 +145,42 @@ describe('Edit Message', () => {
|
|||||||
cy.get(postText).should('have.text', `${secondMessage} Another new message Edited`);
|
cy.get(postText).should('have.text', `${secondMessage} Another new message Edited`);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it('MM-T5416 should discard any changes made after cancelling the edit and opening the edit textbox again should display the original message', () => {
|
||||||
|
const message = 'World!';
|
||||||
|
cy.postMessage(message);
|
||||||
|
|
||||||
|
// * Verify message is sent and not pending
|
||||||
|
cy.getLastPostId().then((postId) => {
|
||||||
|
const postText = `#postMessageText_${postId}`;
|
||||||
|
cy.get(postText).should('have.text', message);
|
||||||
|
|
||||||
|
// # Open edit textbox
|
||||||
|
cy.uiGetPostTextBox().type('{uparrow}');
|
||||||
|
|
||||||
|
// * Edit Post Input should appear, and edit the post
|
||||||
|
cy.get('#edit_textbox').should('be.visible');
|
||||||
|
|
||||||
|
// * Press the escape key to cancel
|
||||||
|
cy.get('#edit_textbox').should('have.text', message).type(' Another new message{esc}');
|
||||||
|
cy.get('#edit_textbox').should('not.exist');
|
||||||
|
|
||||||
|
// * Check that the message wasn't edited
|
||||||
|
cy.get(postText).should('have.text', message);
|
||||||
|
});
|
||||||
|
|
||||||
|
cy.getLastPostId().then((postId) => {
|
||||||
|
const postText = `#postMessageText_${postId}`;
|
||||||
|
cy.get(postText).should('have.text', message);
|
||||||
|
|
||||||
|
// # Open edit textbox again
|
||||||
|
cy.uiGetPostTextBox().type('{uparrow}');
|
||||||
|
|
||||||
|
// * Edit Post Input should appear, and edit the post
|
||||||
|
cy.get('#edit_textbox').should('be.visible');
|
||||||
|
|
||||||
|
// * Opening the edit textbox again after previously cancelling the edit should contain the original message.
|
||||||
|
cy.get('#edit_textbox').should('have.text', message);
|
||||||
|
});
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -5,7 +5,6 @@ import {expect} from '@playwright/test';
|
|||||||
import {UserProfile} from '@mattermost/types/users';
|
import {UserProfile} from '@mattermost/types/users';
|
||||||
|
|
||||||
import {Client, createRandomTeam, getAdminClient, getDefaultAdminUser, makeClient} from './support/server';
|
import {Client, createRandomTeam, getAdminClient, getDefaultAdminUser, makeClient} from './support/server';
|
||||||
import {boardsPluginId, callsPluginId} from './support/constant';
|
|
||||||
import {defaultTeam} from './support/util';
|
import {defaultTeam} from './support/util';
|
||||||
import testConfig from './test.config';
|
import testConfig from './test.config';
|
||||||
|
|
||||||
@@ -97,26 +96,15 @@ async function printClientInfo(client: Client) {
|
|||||||
- BuildHashEnterprise = ${config.BuildHashEnterprise}
|
- BuildHashEnterprise = ${config.BuildHashEnterprise}
|
||||||
- BuildEnterpriseReady = ${config.BuildEnterpriseReady}
|
- BuildEnterpriseReady = ${config.BuildEnterpriseReady}
|
||||||
- FeatureFlagAppsEnabled = ${config.FeatureFlagAppsEnabled}
|
- FeatureFlagAppsEnabled = ${config.FeatureFlagAppsEnabled}
|
||||||
- FeatureFlagBoardsProduct = ${config.FeatureFlagBoardsProduct}
|
|
||||||
- FeatureFlagCallsEnabled = ${config.FeatureFlagCallsEnabled}
|
- FeatureFlagCallsEnabled = ${config.FeatureFlagCallsEnabled}
|
||||||
- TelemetryId = ${config.TelemetryId}`);
|
- TelemetryId = ${config.TelemetryId}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
function getProductsAsPlugin() {
|
|
||||||
const productsAsPlugin = [callsPluginId];
|
|
||||||
|
|
||||||
if (!testConfig.boardsProductEnabled) {
|
|
||||||
productsAsPlugin.push(boardsPluginId);
|
|
||||||
}
|
|
||||||
|
|
||||||
return productsAsPlugin;
|
|
||||||
}
|
|
||||||
|
|
||||||
async function ensurePluginsLoaded(client: Client) {
|
async function ensurePluginsLoaded(client: Client) {
|
||||||
const pluginStatus = await client.getPluginStatuses();
|
const pluginStatus = await client.getPluginStatuses();
|
||||||
const plugins = await client.getPlugins();
|
const plugins = await client.getPlugins();
|
||||||
|
|
||||||
getProductsAsPlugin().forEach(async (pluginId) => {
|
testConfig.ensurePluginsInstalled.forEach(async (pluginId) => {
|
||||||
const isInstalled = pluginStatus.some((plugin) => plugin.plugin_id === pluginId);
|
const isInstalled = pluginStatus.some((plugin) => plugin.plugin_id === pluginId);
|
||||||
if (!isInstalled) {
|
if (!isInstalled) {
|
||||||
// eslint-disable-next-line no-console
|
// eslint-disable-next-line no-console
|
||||||
|
|||||||
53
e2e-tests/playwright/package-lock.json
сгенерированный
53
e2e-tests/playwright/package-lock.json
сгенерированный
@@ -8,7 +8,7 @@
|
|||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@percy/cli": "1.18.0",
|
"@percy/cli": "1.18.0",
|
||||||
"@percy/playwright": "1.0.4",
|
"@percy/playwright": "1.0.4",
|
||||||
"@playwright/test": "1.30.0",
|
"@playwright/test": "1.32.3",
|
||||||
"async-wait-until": "2.0.12",
|
"async-wait-until": "2.0.12",
|
||||||
"chalk": "4.1.2",
|
"chalk": "4.1.2",
|
||||||
"deepmerge": "4.3.0",
|
"deepmerge": "4.3.0",
|
||||||
@@ -428,18 +428,21 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@playwright/test": {
|
"node_modules/@playwright/test": {
|
||||||
"version": "1.30.0",
|
"version": "1.32.3",
|
||||||
"resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.30.0.tgz",
|
"resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.32.3.tgz",
|
||||||
"integrity": "sha512-SVxkQw1xvn/Wk/EvBnqWIq6NLo1AppwbYOjNLmyU0R1RoQ3rLEBtmjTnElcnz8VEtn11fptj1ECxK0tgURhajw==",
|
"integrity": "sha512-BvWNvK0RfBriindxhLVabi8BRe3X0J9EVjKlcmhxjg4giWBD/xleLcg2dz7Tx0agu28rczjNIPQWznwzDwVsZQ==",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@types/node": "*",
|
"@types/node": "*",
|
||||||
"playwright-core": "1.30.0"
|
"playwright-core": "1.32.3"
|
||||||
},
|
},
|
||||||
"bin": {
|
"bin": {
|
||||||
"playwright": "cli.js"
|
"playwright": "cli.js"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=14"
|
"node": ">=14"
|
||||||
|
},
|
||||||
|
"optionalDependencies": {
|
||||||
|
"fsevents": "2.3.2"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@types/json-schema": {
|
"node_modules/@types/json-schema": {
|
||||||
@@ -1396,6 +1399,19 @@
|
|||||||
"resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz",
|
||||||
"integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8="
|
"integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8="
|
||||||
},
|
},
|
||||||
|
"node_modules/fsevents": {
|
||||||
|
"version": "2.3.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz",
|
||||||
|
"integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==",
|
||||||
|
"hasInstallScript": true,
|
||||||
|
"optional": true,
|
||||||
|
"os": [
|
||||||
|
"darwin"
|
||||||
|
],
|
||||||
|
"engines": {
|
||||||
|
"node": "^8.16.0 || ^10.6.0 || >=11.0.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/get-stream": {
|
"node_modules/get-stream": {
|
||||||
"version": "5.2.0",
|
"version": "5.2.0",
|
||||||
"resolved": "https://registry.npmjs.org/get-stream/-/get-stream-5.2.0.tgz",
|
"resolved": "https://registry.npmjs.org/get-stream/-/get-stream-5.2.0.tgz",
|
||||||
@@ -1927,9 +1943,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/playwright-core": {
|
"node_modules/playwright-core": {
|
||||||
"version": "1.30.0",
|
"version": "1.32.3",
|
||||||
"resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.30.0.tgz",
|
"resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.32.3.tgz",
|
||||||
"integrity": "sha512-7AnRmTCf+GVYhHbLJsGUtskWTE33SwMZkybJ0v6rqR1boxq2x36U7p1vDRV7HO2IwTZgmycracLxPEJI49wu4g==",
|
"integrity": "sha512-SB+cdrnu74ZIn5Ogh/8278ngEh9NEEV0vR4sJFmK04h2iZpybfbqBY0bX6+BLYWVdV12JLLI+JEFtSnYgR+mWg==",
|
||||||
"bin": {
|
"bin": {
|
||||||
"playwright": "cli.js"
|
"playwright": "cli.js"
|
||||||
},
|
},
|
||||||
@@ -2677,12 +2693,13 @@
|
|||||||
"integrity": "sha512-4cSkWqpu7uK9zzeVwtMWrgGbP34GUlvZsWdEEt98ep6ZECQA+iGB75pOpIVwcsHKXtkDRE6fgugtxNXs5uHpMg=="
|
"integrity": "sha512-4cSkWqpu7uK9zzeVwtMWrgGbP34GUlvZsWdEEt98ep6ZECQA+iGB75pOpIVwcsHKXtkDRE6fgugtxNXs5uHpMg=="
|
||||||
},
|
},
|
||||||
"@playwright/test": {
|
"@playwright/test": {
|
||||||
"version": "1.30.0",
|
"version": "1.32.3",
|
||||||
"resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.30.0.tgz",
|
"resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.32.3.tgz",
|
||||||
"integrity": "sha512-SVxkQw1xvn/Wk/EvBnqWIq6NLo1AppwbYOjNLmyU0R1RoQ3rLEBtmjTnElcnz8VEtn11fptj1ECxK0tgURhajw==",
|
"integrity": "sha512-BvWNvK0RfBriindxhLVabi8BRe3X0J9EVjKlcmhxjg4giWBD/xleLcg2dz7Tx0agu28rczjNIPQWznwzDwVsZQ==",
|
||||||
"requires": {
|
"requires": {
|
||||||
"@types/node": "*",
|
"@types/node": "*",
|
||||||
"playwright-core": "1.30.0"
|
"fsevents": "2.3.2",
|
||||||
|
"playwright-core": "1.32.3"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"@types/json-schema": {
|
"@types/json-schema": {
|
||||||
@@ -3366,6 +3383,12 @@
|
|||||||
"resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz",
|
||||||
"integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8="
|
"integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8="
|
||||||
},
|
},
|
||||||
|
"fsevents": {
|
||||||
|
"version": "2.3.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz",
|
||||||
|
"integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==",
|
||||||
|
"optional": true
|
||||||
|
},
|
||||||
"get-stream": {
|
"get-stream": {
|
||||||
"version": "5.2.0",
|
"version": "5.2.0",
|
||||||
"resolved": "https://registry.npmjs.org/get-stream/-/get-stream-5.2.0.tgz",
|
"resolved": "https://registry.npmjs.org/get-stream/-/get-stream-5.2.0.tgz",
|
||||||
@@ -3747,9 +3770,9 @@
|
|||||||
"integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA=="
|
"integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA=="
|
||||||
},
|
},
|
||||||
"playwright-core": {
|
"playwright-core": {
|
||||||
"version": "1.30.0",
|
"version": "1.32.3",
|
||||||
"resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.30.0.tgz",
|
"resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.32.3.tgz",
|
||||||
"integrity": "sha512-7AnRmTCf+GVYhHbLJsGUtskWTE33SwMZkybJ0v6rqR1boxq2x36U7p1vDRV7HO2IwTZgmycracLxPEJI49wu4g=="
|
"integrity": "sha512-SB+cdrnu74ZIn5Ogh/8278ngEh9NEEV0vR4sJFmK04h2iZpybfbqBY0bX6+BLYWVdV12JLLI+JEFtSnYgR+mWg=="
|
||||||
},
|
},
|
||||||
"prelude-ls": {
|
"prelude-ls": {
|
||||||
"version": "1.2.1",
|
"version": "1.2.1",
|
||||||
|
|||||||
@@ -13,7 +13,7 @@
|
|||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@percy/cli": "1.18.0",
|
"@percy/cli": "1.18.0",
|
||||||
"@percy/playwright": "1.0.4",
|
"@percy/playwright": "1.0.4",
|
||||||
"@playwright/test": "1.30.0",
|
"@playwright/test": "1.32.3",
|
||||||
"async-wait-until": "2.0.12",
|
"async-wait-until": "2.0.12",
|
||||||
"chalk": "4.1.2",
|
"chalk": "4.1.2",
|
||||||
"deepmerge": "4.3.0",
|
"deepmerge": "4.3.0",
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import {defineConfig, devices} from '@playwright/test';
|
|||||||
import {duration} from '@e2e-support/util';
|
import {duration} from '@e2e-support/util';
|
||||||
import testConfig from '@e2e-test.config';
|
import testConfig from '@e2e-test.config';
|
||||||
|
|
||||||
const defaultOutputFolder = 'playwright-report';
|
const defaultOutputFolder = './playwright-report';
|
||||||
|
|
||||||
export default defineConfig({
|
export default defineConfig({
|
||||||
globalSetup: require.resolve('./global_setup'),
|
globalSetup: require.resolve('./global_setup'),
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
|
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
|
||||||
// See LICENSE.txt for license information.
|
// See LICENSE.txt for license information.
|
||||||
|
|
||||||
|
export const appsPluginId = 'com.mattermost.apps';
|
||||||
export const boardsPluginId = 'focalboard';
|
export const boardsPluginId = 'focalboard';
|
||||||
export const boardsProductId = 'boards';
|
export const boardsProductId = 'boards';
|
||||||
export const callsPluginId = 'com.mattermost.calls';
|
export const callsPluginId = 'com.mattermost.calls';
|
||||||
|
|||||||
@@ -5,22 +5,10 @@ import os from 'node:os';
|
|||||||
|
|
||||||
import {expect, test} from '@playwright/test';
|
import {expect, test} from '@playwright/test';
|
||||||
|
|
||||||
import {boardsPluginId, callsPluginId} from './constant';
|
import {callsPluginId} from './constant';
|
||||||
import {getAdminClient} from './server/init';
|
import {getAdminClient} from './server/init';
|
||||||
import {isSmallScreen} from './util';
|
import {isSmallScreen} from './util';
|
||||||
|
|
||||||
export async function shouldHaveBoardsEnabled(enabled = true) {
|
|
||||||
const {adminClient} = await getAdminClient();
|
|
||||||
const config = await adminClient.getConfig();
|
|
||||||
|
|
||||||
const boardsEnabled =
|
|
||||||
(typeof config.FeatureFlags.BoardsProduct === 'boolean' && config.FeatureFlags.BoardsProduct) ||
|
|
||||||
config.PluginSettings.PluginStates[boardsPluginId].Enable;
|
|
||||||
|
|
||||||
const matched = boardsEnabled === enabled;
|
|
||||||
expect(matched, matched ? '' : `Boards expect "${enabled}" but actual "${boardsEnabled}"`).toBeTruthy();
|
|
||||||
}
|
|
||||||
|
|
||||||
export async function shouldHaveCallsEnabled(enabled = true) {
|
export async function shouldHaveCallsEnabled(enabled = true) {
|
||||||
const {adminClient} = await getAdminClient();
|
const {adminClient} = await getAdminClient();
|
||||||
const config = await adminClient.getConfig();
|
const config = await adminClient.getConfig();
|
||||||
|
|||||||
@@ -167,8 +167,9 @@ async function makeClient(userRequest?: UserRequest, useCache = true): Promise<C
|
|||||||
|
|
||||||
const userProfile = await client.login(userRequest.username, userRequest.password);
|
const userProfile = await client.login(userRequest.username, userRequest.password);
|
||||||
const user = {...userProfile, password: userRequest.password};
|
const user = {...userProfile, password: userRequest.password};
|
||||||
const config = await client.getClientConfigOld();
|
|
||||||
client.setUseBoardsProduct(config.FeatureFlagBoardsProduct === 'true');
|
// Manually do until boards as product is consistent in all the codebase.
|
||||||
|
client.setUseBoardsProduct(true);
|
||||||
|
|
||||||
if (useCache) {
|
if (useCache) {
|
||||||
clients[cacheKey] = {client, user};
|
clients[cacheKey] = {client, user};
|
||||||
|
|||||||
@@ -6,7 +6,6 @@ import merge from 'deepmerge';
|
|||||||
import {
|
import {
|
||||||
AdminConfig,
|
AdminConfig,
|
||||||
ExperimentalSettings,
|
ExperimentalSettings,
|
||||||
FeatureFlags,
|
|
||||||
PasswordSettings,
|
PasswordSettings,
|
||||||
ServiceSettings,
|
ServiceSettings,
|
||||||
TeamSettings,
|
TeamSettings,
|
||||||
@@ -23,7 +22,6 @@ export function getOnPremServerConfig(): AdminConfig {
|
|||||||
type TestAdminConfig = {
|
type TestAdminConfig = {
|
||||||
ClusterSettings: Partial<ClusterSettings>;
|
ClusterSettings: Partial<ClusterSettings>;
|
||||||
ExperimentalSettings: Partial<ExperimentalSettings>;
|
ExperimentalSettings: Partial<ExperimentalSettings>;
|
||||||
FeatureFlags: Partial<FeatureFlags>;
|
|
||||||
PasswordSettings: Partial<PasswordSettings>;
|
PasswordSettings: Partial<PasswordSettings>;
|
||||||
PluginSettings: Partial<PluginSettings>;
|
PluginSettings: Partial<PluginSettings>;
|
||||||
ServiceSettings: Partial<ServiceSettings>;
|
ServiceSettings: Partial<ServiceSettings>;
|
||||||
@@ -40,9 +38,6 @@ const onPremServerConfig = (): Partial<TestAdminConfig> => {
|
|||||||
ExperimentalSettings: {
|
ExperimentalSettings: {
|
||||||
EnableAppBar: true,
|
EnableAppBar: true,
|
||||||
},
|
},
|
||||||
FeatureFlags: {
|
|
||||||
BoardsProduct: testConfig.boardsProductEnabled,
|
|
||||||
},
|
|
||||||
PasswordSettings: {
|
PasswordSettings: {
|
||||||
MinimumLength: 5,
|
MinimumLength: 5,
|
||||||
Lowercase: false,
|
Lowercase: false,
|
||||||
@@ -57,11 +52,6 @@ const onPremServerConfig = (): Partial<TestAdminConfig> => {
|
|||||||
defaultenabled: true,
|
defaultenabled: true,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
PluginStates: {
|
|
||||||
focalboard: {
|
|
||||||
Enable: !testConfig.boardsProductEnabled,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
ServiceSettings: {
|
ServiceSettings: {
|
||||||
SiteURL: testConfig.baseURL,
|
SiteURL: testConfig.baseURL,
|
||||||
@@ -180,7 +170,6 @@ const defaultServerConfig: AdminConfig = {
|
|||||||
EnableCustomGroups: true,
|
EnableCustomGroups: true,
|
||||||
SelfHostedPurchase: true,
|
SelfHostedPurchase: true,
|
||||||
AllowSyncedDrafts: true,
|
AllowSyncedDrafts: true,
|
||||||
SelfHostedExpansion: false,
|
|
||||||
},
|
},
|
||||||
TeamSettings: {
|
TeamSettings: {
|
||||||
SiteName: 'Mattermost',
|
SiteName: 'Mattermost',
|
||||||
@@ -686,7 +675,6 @@ const defaultServerConfig: AdminConfig = {
|
|||||||
GraphQL: false,
|
GraphQL: false,
|
||||||
InsightsEnabled: true,
|
InsightsEnabled: true,
|
||||||
CommandPalette: false,
|
CommandPalette: false,
|
||||||
BoardsProduct: false,
|
|
||||||
SendWelcomePost: true,
|
SendWelcomePost: true,
|
||||||
WorkTemplate: false,
|
WorkTemplate: false,
|
||||||
PostPriority: true,
|
PostPriority: true,
|
||||||
|
|||||||
@@ -1,13 +1,7 @@
|
|||||||
import {test as base, Browser} from '@playwright/test';
|
import {test as base, Browser} from '@playwright/test';
|
||||||
|
|
||||||
import {TestBrowser} from './browser_context';
|
import {TestBrowser} from './browser_context';
|
||||||
import {
|
import {shouldHaveCallsEnabled, shouldHaveFeatureFlag, shouldSkipInSmallScreen, shouldRunInLinux} from './flag';
|
||||||
shouldHaveBoardsEnabled,
|
|
||||||
shouldHaveCallsEnabled,
|
|
||||||
shouldHaveFeatureFlag,
|
|
||||||
shouldSkipInSmallScreen,
|
|
||||||
shouldRunInLinux,
|
|
||||||
} from './flag';
|
|
||||||
import {initSetup, getAdminClient} from './server';
|
import {initSetup, getAdminClient} from './server';
|
||||||
import {hideDynamicChannelsContent, waitForAnimationEnd, waitUntil} from './test_action';
|
import {hideDynamicChannelsContent, waitForAnimationEnd, waitUntil} from './test_action';
|
||||||
import {pages} from './ui/pages';
|
import {pages} from './ui/pages';
|
||||||
@@ -36,7 +30,6 @@ class PlaywrightExtended {
|
|||||||
readonly testBrowser: TestBrowser;
|
readonly testBrowser: TestBrowser;
|
||||||
|
|
||||||
// ./flag
|
// ./flag
|
||||||
readonly shouldHaveBoardsEnabled;
|
|
||||||
readonly shouldHaveCallsEnabled;
|
readonly shouldHaveCallsEnabled;
|
||||||
readonly shouldHaveFeatureFlag;
|
readonly shouldHaveFeatureFlag;
|
||||||
readonly shouldSkipInSmallScreen;
|
readonly shouldSkipInSmallScreen;
|
||||||
@@ -62,7 +55,6 @@ class PlaywrightExtended {
|
|||||||
this.testBrowser = new TestBrowser(browser);
|
this.testBrowser = new TestBrowser(browser);
|
||||||
|
|
||||||
// ./flag
|
// ./flag
|
||||||
this.shouldHaveBoardsEnabled = shouldHaveBoardsEnabled;
|
|
||||||
this.shouldHaveCallsEnabled = shouldHaveCallsEnabled;
|
this.shouldHaveCallsEnabled = shouldHaveCallsEnabled;
|
||||||
this.shouldHaveFeatureFlag = shouldHaveFeatureFlag;
|
this.shouldHaveFeatureFlag = shouldHaveFeatureFlag;
|
||||||
this.shouldSkipInSmallScreen = shouldSkipInSmallScreen;
|
this.shouldSkipInSmallScreen = shouldSkipInSmallScreen;
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ export default class ChannelsPostCreate {
|
|||||||
readonly input;
|
readonly input;
|
||||||
readonly attachmentButton;
|
readonly attachmentButton;
|
||||||
readonly emojiButton;
|
readonly emojiButton;
|
||||||
|
readonly sendButton: Locator;
|
||||||
|
|
||||||
constructor(container: Locator) {
|
constructor(container: Locator) {
|
||||||
this.container = container;
|
this.container = container;
|
||||||
@@ -16,12 +17,17 @@ export default class ChannelsPostCreate {
|
|||||||
this.input = container.getByTestId('post_textbox');
|
this.input = container.getByTestId('post_textbox');
|
||||||
this.attachmentButton = container.getByLabel('attachment');
|
this.attachmentButton = container.getByLabel('attachment');
|
||||||
this.emojiButton = container.getByLabel('select an emoji');
|
this.emojiButton = container.getByLabel('select an emoji');
|
||||||
|
this.sendButton = container.getByTestId('SendMessageButton');
|
||||||
}
|
}
|
||||||
|
|
||||||
async postMessage(message: string) {
|
async postMessage(message: string) {
|
||||||
await this.input.fill(message);
|
await this.input.fill(message);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async sendMessage() {
|
||||||
|
await this.sendButton.click();
|
||||||
|
}
|
||||||
|
|
||||||
async toBeVisible() {
|
async toBeVisible() {
|
||||||
await expect(this.container).toBeVisible();
|
await expect(this.container).toBeVisible();
|
||||||
await expect(this.input).toBeVisible();
|
await expect(this.input).toBeVisible();
|
||||||
|
|||||||
@@ -49,6 +49,10 @@ export default class ChannelsPage {
|
|||||||
await this.postCreate.postMessage(message);
|
await this.postCreate.postMessage(message);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async sendMessage() {
|
||||||
|
await this.postCreate.sendMessage();
|
||||||
|
}
|
||||||
|
|
||||||
async getFirstPost() {
|
async getFirstPost() {
|
||||||
await this.page.getByTestId('postView').first().waitFor();
|
await this.page.getByTestId('postView').first().waitFor();
|
||||||
const post = await this.page.getByTestId('postView').first();
|
const post = await this.page.getByTestId('postView').first();
|
||||||
|
|||||||
@@ -3,6 +3,9 @@
|
|||||||
|
|
||||||
import {Page, ViewportSize} from '@playwright/test';
|
import {Page, ViewportSize} from '@playwright/test';
|
||||||
import * as dotenv from 'dotenv';
|
import * as dotenv from 'dotenv';
|
||||||
|
|
||||||
|
import {appsPluginId, callsPluginId} from '@e2e-support/constant';
|
||||||
|
|
||||||
dotenv.config();
|
dotenv.config();
|
||||||
|
|
||||||
export type TestArgs = {
|
export type TestArgs = {
|
||||||
@@ -17,7 +20,7 @@ export type TestConfig = {
|
|||||||
adminUsername: string;
|
adminUsername: string;
|
||||||
adminPassword: string;
|
adminPassword: string;
|
||||||
adminEmail: string;
|
adminEmail: string;
|
||||||
boardsProductEnabled: boolean;
|
ensurePluginsInstalled: string[];
|
||||||
resetBeforeTest: boolean;
|
resetBeforeTest: boolean;
|
||||||
haClusterEnabled: boolean;
|
haClusterEnabled: boolean;
|
||||||
haClusterNodeCount: number;
|
haClusterNodeCount: number;
|
||||||
@@ -41,7 +44,10 @@ const config: TestConfig = {
|
|||||||
adminUsername: process.env.PW_ADMIN_USERNAME || 'sysadmin',
|
adminUsername: process.env.PW_ADMIN_USERNAME || 'sysadmin',
|
||||||
adminPassword: process.env.PW_ADMIN_PASSWORD || 'Sys@dmin-sample1',
|
adminPassword: process.env.PW_ADMIN_PASSWORD || 'Sys@dmin-sample1',
|
||||||
adminEmail: process.env.PW_ADMIN_EMAIL || 'sysadmin@sample.mattermost.com',
|
adminEmail: process.env.PW_ADMIN_EMAIL || 'sysadmin@sample.mattermost.com',
|
||||||
boardsProductEnabled: parseBool(process.env.PW_BOARDS_PRODUCT_ENABLED, true),
|
ensurePluginsInstalled:
|
||||||
|
typeof process.env?.PW_ENSURE_PLUGINS_INSTALLED === 'string'
|
||||||
|
? process.env.PW_ENSURE_PLUGINS_INSTALLED.split(',')
|
||||||
|
: [appsPluginId, callsPluginId],
|
||||||
haClusterEnabled: parseBool(process.env.PW_HA_CLUSTER_ENABLED, false),
|
haClusterEnabled: parseBool(process.env.PW_HA_CLUSTER_ENABLED, false),
|
||||||
haClusterNodeCount: parseNumber(process.env.PW_HA_CLUSTER_NODE_COUNT, 2),
|
haClusterNodeCount: parseNumber(process.env.PW_HA_CLUSTER_NODE_COUNT, 2),
|
||||||
haClusterName: process.env.PW_HA_CLUSTER_NAME || 'mm_dev_cluster',
|
haClusterName: process.env.PW_HA_CLUSTER_NAME || 'mm_dev_cluster',
|
||||||
|
|||||||
@@ -7,8 +7,6 @@ import {shouldSkipInSmallScreen} from '@e2e-support/flag';
|
|||||||
shouldSkipInSmallScreen();
|
shouldSkipInSmallScreen();
|
||||||
|
|
||||||
test('MM-T4274 Create an Empty Board', async ({pw, pages}) => {
|
test('MM-T4274 Create an Empty Board', async ({pw, pages}) => {
|
||||||
await pw.shouldHaveBoardsEnabled();
|
|
||||||
|
|
||||||
// Create and sign in a new user
|
// Create and sign in a new user
|
||||||
const {user} = await pw.initSetup();
|
const {user} = await pw.initSetup();
|
||||||
|
|
||||||
|
|||||||
@@ -7,8 +7,6 @@ import {shouldSkipInSmallScreen} from '@e2e-support/flag';
|
|||||||
shouldSkipInSmallScreen();
|
shouldSkipInSmallScreen();
|
||||||
|
|
||||||
test('Board template', async ({pw, pages, browserName, viewport}, testInfo) => {
|
test('Board template', async ({pw, pages, browserName, viewport}, testInfo) => {
|
||||||
await pw.shouldHaveBoardsEnabled();
|
|
||||||
|
|
||||||
// Create and sign in a new user
|
// Create and sign in a new user
|
||||||
const {user} = await pw.initSetup();
|
const {user} = await pw.initSetup();
|
||||||
|
|
||||||
|
|||||||
@@ -7,8 +7,6 @@ import {shouldSkipInSmallScreen} from '@e2e-support/flag';
|
|||||||
shouldSkipInSmallScreen();
|
shouldSkipInSmallScreen();
|
||||||
|
|
||||||
test('View untitled board', async ({pw, pages, browserName, viewport}, testInfo) => {
|
test('View untitled board', async ({pw, pages, browserName, viewport}, testInfo) => {
|
||||||
await pw.shouldHaveBoardsEnabled();
|
|
||||||
|
|
||||||
// Create and sign in a new user
|
// Create and sign in a new user
|
||||||
const {user} = await pw.initSetup();
|
const {user} = await pw.initSetup();
|
||||||
|
|
||||||
|
|||||||
@@ -102,11 +102,11 @@ GOFLAGS ?= $(GOFLAGS:)
|
|||||||
export GOBIN ?= $(PWD)/bin
|
export GOBIN ?= $(PWD)/bin
|
||||||
GO=go
|
GO=go
|
||||||
DELVE=dlv
|
DELVE=dlv
|
||||||
LDFLAGS += -X "github.com/mattermost/mattermost-server/v6/model.BuildNumber=$(BUILD_NUMBER)"
|
LDFLAGS += -X "github.com/mattermost/mattermost-server/server/v8/model.BuildNumber=$(BUILD_NUMBER)"
|
||||||
LDFLAGS += -X "github.com/mattermost/mattermost-server/v6/model.BuildDate=$(BUILD_DATE)"
|
LDFLAGS += -X "github.com/mattermost/mattermost-server/server/v8/model.BuildDate=$(BUILD_DATE)"
|
||||||
LDFLAGS += -X "github.com/mattermost/mattermost-server/v6/model.BuildHash=$(BUILD_HASH)"
|
LDFLAGS += -X "github.com/mattermost/mattermost-server/server/v8/model.BuildHash=$(BUILD_HASH)"
|
||||||
LDFLAGS += -X "github.com/mattermost/mattermost-server/v6/model.BuildHashEnterprise=$(BUILD_HASH_ENTERPRISE)"
|
LDFLAGS += -X "github.com/mattermost/mattermost-server/server/v8/model.BuildHashEnterprise=$(BUILD_HASH_ENTERPRISE)"
|
||||||
LDFLAGS += -X "github.com/mattermost/mattermost-server/v6/model.BuildEnterpriseReady=$(BUILD_ENTERPRISE_READY)"
|
LDFLAGS += -X "github.com/mattermost/mattermost-server/server/v8/model.BuildEnterpriseReady=$(BUILD_ENTERPRISE_READY)"
|
||||||
|
|
||||||
GO_MAJOR_VERSION = $(shell $(GO) version | cut -c 14- | cut -d' ' -f1 | cut -d'.' -f1)
|
GO_MAJOR_VERSION = $(shell $(GO) version | cut -c 14- | cut -d' ' -f1 | cut -d'.' -f1)
|
||||||
GO_MINOR_VERSION = $(shell $(GO) version | cut -c 14- | cut -d' ' -f1 | cut -d'.' -f2)
|
GO_MINOR_VERSION = $(shell $(GO) version | cut -c 14- | cut -d' ' -f1 | cut -d'.' -f2)
|
||||||
@@ -132,9 +132,7 @@ DIST_PATH_WIN=$(DIST_ROOT)/windows/mattermost
|
|||||||
TESTS=.
|
TESTS=.
|
||||||
|
|
||||||
# Packages lists
|
# Packages lists
|
||||||
TE_PACKAGES=$(shell $(GO) list ./... | grep -vE 'v6/server/playbooks|v6/server/boards')
|
SUITE_PACKAGES=$(shell $(GO) list ./...)
|
||||||
BOARDS_PACKAGES=$(shell $(GO) list ./... | grep -E 'v6/server/boards')
|
|
||||||
PLAYBOOKS_PACKAGES=$(shell $(GO) list ./... | grep -E 'v6/server/playbooks')
|
|
||||||
|
|
||||||
TEMPLATES_DIR=templates
|
TEMPLATES_DIR=templates
|
||||||
|
|
||||||
@@ -142,7 +140,7 @@ TEMPLATES_DIR=templates
|
|||||||
PLUGIN_PACKAGES ?= mattermost-plugin-antivirus-v0.1.2
|
PLUGIN_PACKAGES ?= mattermost-plugin-antivirus-v0.1.2
|
||||||
PLUGIN_PACKAGES += mattermost-plugin-autolink-v1.2.2
|
PLUGIN_PACKAGES += mattermost-plugin-autolink-v1.2.2
|
||||||
PLUGIN_PACKAGES += mattermost-plugin-aws-SNS-v1.2.0
|
PLUGIN_PACKAGES += mattermost-plugin-aws-SNS-v1.2.0
|
||||||
PLUGIN_PACKAGES += mattermost-plugin-calls-v0.14.0
|
PLUGIN_PACKAGES += mattermost-plugin-calls-v0.15.1
|
||||||
PLUGIN_PACKAGES += mattermost-plugin-channel-export-v1.0.0
|
PLUGIN_PACKAGES += mattermost-plugin-channel-export-v1.0.0
|
||||||
PLUGIN_PACKAGES += mattermost-plugin-confluence-v1.3.0
|
PLUGIN_PACKAGES += mattermost-plugin-confluence-v1.3.0
|
||||||
PLUGIN_PACKAGES += mattermost-plugin-custom-attributes-v1.3.1
|
PLUGIN_PACKAGES += mattermost-plugin-custom-attributes-v1.3.1
|
||||||
@@ -170,9 +168,9 @@ endif
|
|||||||
EE_PACKAGES=$(shell $(GO) list $(BUILD_ENTERPRISE_DIR)/...)
|
EE_PACKAGES=$(shell $(GO) list $(BUILD_ENTERPRISE_DIR)/...)
|
||||||
|
|
||||||
ifeq ($(BUILD_ENTERPRISE_READY),true)
|
ifeq ($(BUILD_ENTERPRISE_READY),true)
|
||||||
ALL_PACKAGES=$(TE_PACKAGES) $(BOARDS_PACKAGES) $(PLAYBOOKS_PACKAGES) $(EE_PACKAGES)
|
ALL_PACKAGES=$(SUITE_PACKAGES) $(EE_PACKAGES)
|
||||||
else
|
else
|
||||||
ALL_PACKAGES=$(TE_PACKAGES) $(BOARDS_PACKAGES) $(PLAYBOOKS_PACKAGES)
|
ALL_PACKAGES=$(SUITE_PACKAGES)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
all: run ## Alias for 'run'.
|
all: run ## Alias for 'run'.
|
||||||
@@ -189,7 +187,7 @@ endif
|
|||||||
include config.mk
|
include config.mk
|
||||||
include build/*.mk
|
include build/*.mk
|
||||||
|
|
||||||
LDFLAGS += -X "github.com/mattermost/mattermost-server/v6/model.MockCWS=$(MM_ENABLE_CWS_MOCK)"
|
LDFLAGS += -X "github.com/mattermost/mattermost-server/server/v8/model.MockCWS=$(MM_ENABLE_CWS_MOCK)"
|
||||||
|
|
||||||
RUN_IN_BACKGROUND ?=
|
RUN_IN_BACKGROUND ?=
|
||||||
ifeq ($(RUN_SERVER_IN_BACKGROUND),true)
|
ifeq ($(RUN_SERVER_IN_BACKGROUND),true)
|
||||||
@@ -270,7 +268,7 @@ else
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
plugin-checker:
|
plugin-checker:
|
||||||
$(GO) run $(GOFLAGS) ../plugin/checker
|
$(GO) run $(GOFLAGS) ./plugin/checker
|
||||||
|
|
||||||
prepackaged-plugins: ## Populate the prepackaged-plugins directory
|
prepackaged-plugins: ## Populate the prepackaged-plugins directory
|
||||||
@echo Downloading prepackaged plugins
|
@echo Downloading prepackaged plugins
|
||||||
@@ -349,9 +347,9 @@ ldap-mocks: ## Creates mock files for ldap.
|
|||||||
|
|
||||||
plugin-mocks: ## Creates mock files for plugins.
|
plugin-mocks: ## Creates mock files for plugins.
|
||||||
$(GO) install github.com/vektra/mockery/v2/...@v2.23.2
|
$(GO) install github.com/vektra/mockery/v2/...@v2.23.2
|
||||||
$(GOBIN)/mockery --dir ../plugin --name API --output ../plugin/plugintest --outpkg plugintest --case underscore --note 'Regenerate this file using `make plugin-mocks`.'
|
$(GOBIN)/mockery --dir ./plugin --name API --output ./plugin/plugintest --outpkg plugintest --case underscore --note 'Regenerate this file using `make plugin-mocks`.'
|
||||||
$(GOBIN)/mockery --dir ../plugin --name Hooks --output ../plugin/plugintest --outpkg plugintest --case underscore --note 'Regenerate this file using `make plugin-mocks`.'
|
$(GOBIN)/mockery --dir ./plugin --name Hooks --output ./plugin/plugintest --outpkg plugintest --case underscore --note 'Regenerate this file using `make plugin-mocks`.'
|
||||||
$(GOBIN)/mockery --dir ../plugin --name Driver --output ../plugin/plugintest --outpkg plugintest --case underscore --note 'Regenerate this file using `make plugin-mocks`.'
|
$(GOBIN)/mockery --dir ./plugin --name Driver --output ./plugin/plugintest --outpkg plugintest --case underscore --note 'Regenerate this file using `make plugin-mocks`.'
|
||||||
|
|
||||||
einterfaces-mocks: ## Creates mock files for einterfaces.
|
einterfaces-mocks: ## Creates mock files for einterfaces.
|
||||||
$(GO) install github.com/vektra/mockery/v2/...@v2.23.2
|
$(GO) install github.com/vektra/mockery/v2/...@v2.23.2
|
||||||
@@ -380,7 +378,7 @@ platform-mocks: ## Creates mocks for platform interfaces.
|
|||||||
$(GOBIN)/mockery --dir channels/app/platform --name SuiteIFace --output channels/app/platform/mocks --note 'Regenerate this file using `make platform-mocks`.'
|
$(GOBIN)/mockery --dir channels/app/platform --name SuiteIFace --output channels/app/platform/mocks --note 'Regenerate this file using `make platform-mocks`.'
|
||||||
|
|
||||||
pluginapi: ## Generates api and hooks glue code for plugins
|
pluginapi: ## Generates api and hooks glue code for plugins
|
||||||
$(GO) generate $(GOFLAGS) ../plugin
|
$(GO) generate $(GOFLAGS) ./plugin
|
||||||
|
|
||||||
mocks: store-mocks telemetry-mocks filestore-mocks ldap-mocks plugin-mocks einterfaces-mocks searchengine-mocks sharedchannel-mocks misc-mocks email-mocks platform-mocks
|
mocks: store-mocks telemetry-mocks filestore-mocks ldap-mocks plugin-mocks einterfaces-mocks searchengine-mocks sharedchannel-mocks misc-mocks email-mocks platform-mocks
|
||||||
|
|
||||||
@@ -412,7 +410,7 @@ go-junit-report:
|
|||||||
test-compile: ## Compile tests.
|
test-compile: ## Compile tests.
|
||||||
@echo COMPILE TESTS
|
@echo COMPILE TESTS
|
||||||
|
|
||||||
for package in $(TE_PACKAGES) $(BOARDS_PACKAGES) $(PLAYBOOKS_PACKAGES) $(EE_PACKAGES); do \
|
for package in $(SUITE_PACKAGES) $(EE_PACKAGES); do \
|
||||||
$(GO) test $(GOFLAGS) -c $$package; \
|
$(GO) test $(GOFLAGS) -c $$package; \
|
||||||
done
|
done
|
||||||
|
|
||||||
@@ -450,9 +448,7 @@ else
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
test-server-race: test-server-pre
|
test-server-race: test-server-pre
|
||||||
MM_DISABLE_PLAYBOOKS=true MM_DISABLE_BOARDS=true ./scripts/test.sh "$(GO)" "-race $(GOFLAGS)" "$(TE_PACKAGES) $(EE_PACKAGES)" "$(TESTS)" "$(TESTFLAGS)" "$(GOBIN)" "90m" "atomic"
|
./scripts/test.sh "$(GO)" "-race $(GOFLAGS)" "$(SUITE_PACKAGES) $(EE_PACKAGES)" "$(TESTS)" "$(TESTFLAGS)" "$(GOBIN)" "90m" "atomic"
|
||||||
MM_DISABLE_PLAYBOOKS=true MM_DISABLE_BOARDS=false ./scripts/test.sh "$(GO)" "-race $(GOFLAGS)" "$(BOARDS_PACKAGES)" "$(TESTS)" "$(TESTFLAGS)" "$(GOBIN)" "90m" "atomic"
|
|
||||||
MM_DISABLE_PLAYBOOKS=false MM_DISABLE_BOARDS=true ./scripts/test.sh "$(GO)" "-race $(GOFLAGS)" "$(PLAYBOOKS_PACKAGES)" "$(TESTS)" "$(TESTFLAGS)" "$(GOBIN)" "90m" "atomic"
|
|
||||||
ifneq ($(IS_CI),true)
|
ifneq ($(IS_CI),true)
|
||||||
ifneq ($(MM_NO_DOCKER),true)
|
ifneq ($(MM_NO_DOCKER),true)
|
||||||
ifneq ($(TEMP_DOCKER_SERVICES),)
|
ifneq ($(TEMP_DOCKER_SERVICES),)
|
||||||
@@ -463,9 +459,7 @@ ifneq ($(IS_CI),true)
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
test-server: test-server-pre
|
test-server: test-server-pre
|
||||||
MM_DISABLE_PLAYBOOKS=true MM_DISABLE_BOARDS=true ./scripts/test.sh "$(GO)" "$(GOFLAGS)" "$(TE_PACKAGES) $(EE_PACKAGES)" "$(TESTS)" "$(TESTFLAGS)" "$(GOBIN)" "45m" "count"
|
./scripts/test.sh "$(GO)" "$(GOFLAGS)" "$(SUITE_PACKAGES) $(EE_PACKAGES)" "$(TESTS)" "$(TESTFLAGS)" "$(GOBIN)" "90m" "count"
|
||||||
MM_DISABLE_PLAYBOOKS=true MM_DISABLE_BOARDS=false ./scripts/test.sh "$(GO)" "$(GOFLAGS)" "$(BOARDS_PACKAGES)" "$(TESTS)" "$(TESTFLAGS)" "$(GOBIN)" "45m" "count"
|
|
||||||
MM_DISABLE_PLAYBOOKS=false MM_DISABLE_BOARDS=true ./scripts/test.sh "$(GO)" "$(GOFLAGS)" "$(PLAYBOOKS_PACKAGES)" "$(TESTS)" "$(TESTFLAGS)" "$(GOBIN)" "45m" "count"
|
|
||||||
ifneq ($(IS_CI),true)
|
ifneq ($(IS_CI),true)
|
||||||
ifneq ($(MM_NO_DOCKER),true)
|
ifneq ($(MM_NO_DOCKER),true)
|
||||||
ifneq ($(TEMP_DOCKER_SERVICES),)
|
ifneq ($(TEMP_DOCKER_SERVICES),)
|
||||||
@@ -477,19 +471,15 @@ endif
|
|||||||
|
|
||||||
test-server-ee: check-prereqs-enterprise start-docker go-junit-report do-cover-file ## Runs EE tests.
|
test-server-ee: check-prereqs-enterprise start-docker go-junit-report do-cover-file ## Runs EE tests.
|
||||||
@echo Running only EE tests
|
@echo Running only EE tests
|
||||||
MM_DISABLE_PLAYBOOKS=true MM_DISABLE_BOARDS=true ./scripts/test.sh "$(GO)" "$(GOFLAGS)" "$(EE_PACKAGES)" "$(TESTS)" "$(TESTFLAGS)" "$(GOBIN)" "20m" "count"
|
./scripts/test.sh "$(GO)" "$(GOFLAGS)" "$(EE_PACKAGES)" "$(TESTS)" "$(TESTFLAGS)" "$(GOBIN)" "20m" "count"
|
||||||
|
|
||||||
test-server-quick: check-prereqs-enterprise ## Runs only quick tests.
|
test-server-quick: check-prereqs-enterprise ## Runs only quick tests.
|
||||||
ifeq ($(BUILD_ENTERPRISE_READY),true)
|
ifeq ($(BUILD_ENTERPRISE_READY),true)
|
||||||
@echo Running all tests
|
@echo Running all tests
|
||||||
MM_DISABLE_PLAYBOOKS=true MM_DISABLE_BOARDS=true $(GO) test $(GOFLAGS) -short $(TE_PACKAGES) $(EE_PACKAGES)
|
$(GO) test $(GOFLAGS) -short $(SUITE_PACKAGES) $(EE_PACKAGES)
|
||||||
MM_DISABLE_PLAYBOOKS=true MM_DISABLE_BOARDS=false $(GO) test $(GOFLAGS) -short $(BOARDS_PACKAGES)
|
|
||||||
MM_DISABLE_PLAYBOOKS=false MM_DISABLE_BOARDS=true $(GO) test $(GOFLAGS) -short $(PLAYBOOKS_PACKAGES)
|
|
||||||
else
|
else
|
||||||
@echo Running only TE tests
|
@echo Running only TE tests
|
||||||
MM_DISABLE_PLAYBOOKS=true MM_DISABLE_BOARDS=true $(GO) test $(GOFLAGS) -short $(TE_PACKAGES)
|
$(GO) test $(GOFLAGS) -short $(SUITE_PACKAGES)
|
||||||
MM_DISABLE_PLAYBOOKS=true MM_DISABLE_BOARDS=false $(GO) test $(GOFLAGS) -short $(BOARDS_PACKAGES)
|
|
||||||
MM_DISABLE_PLAYBOOKS=false MM_DISABLE_BOARDS=true $(GO) test $(GOFLAGS) -short $(PLAYBOOKS_PACKAGES)
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
internal-test-web-client: ## Runs web client tests.
|
internal-test-web-client: ## Runs web client tests.
|
||||||
@@ -552,20 +542,20 @@ run-server: setup-go-work prepackaged-binaries validate-go-version start-docker
|
|||||||
debug-server: start-docker ## Compile and start server using delve.
|
debug-server: start-docker ## Compile and start server using delve.
|
||||||
mkdir -p $(BUILD_WEBAPP_DIR)/channels/dist/files
|
mkdir -p $(BUILD_WEBAPP_DIR)/channels/dist/files
|
||||||
$(DELVE) debug $(PLATFORM_FILES) --build-flags="-ldflags '\
|
$(DELVE) debug $(PLATFORM_FILES) --build-flags="-ldflags '\
|
||||||
-X github.com/mattermost/mattermost-server/v6/model.BuildNumber=$(BUILD_NUMBER)\
|
-X github.com/mattermost/mattermost-server/server/v8/model.BuildNumber=$(BUILD_NUMBER)\
|
||||||
-X \"github.com/mattermost/mattermost-server/v6/model.BuildDate=$(BUILD_DATE)\"\
|
-X \"github.com/mattermost/mattermost-server/server/v8/model.BuildDate=$(BUILD_DATE)\"\
|
||||||
-X github.com/mattermost/mattermost-server/v6/model.BuildHash=$(BUILD_HASH)\
|
-X github.com/mattermost/mattermost-server/server/v8/model.BuildHash=$(BUILD_HASH)\
|
||||||
-X github.com/mattermost/mattermost-server/v6/model.BuildHashEnterprise=$(BUILD_HASH_ENTERPRISE)\
|
-X github.com/mattermost/mattermost-server/server/v8/model.BuildHashEnterprise=$(BUILD_HASH_ENTERPRISE)\
|
||||||
-X github.com/mattermost/mattermost-server/v6/model.BuildEnterpriseReady=$(BUILD_ENTERPRISE_READY)'"
|
-X github.com/mattermost/mattermost-server/server/v8/model.BuildEnterpriseReady=$(BUILD_ENTERPRISE_READY)'"
|
||||||
|
|
||||||
debug-server-headless: start-docker ## Debug server from within an IDE like VSCode or IntelliJ.
|
debug-server-headless: start-docker ## Debug server from within an IDE like VSCode or IntelliJ.
|
||||||
mkdir -p $(BUILD_WEBAPP_DIR)/channels/dist/files
|
mkdir -p $(BUILD_WEBAPP_DIR)/channels/dist/files
|
||||||
$(DELVE) debug --headless --listen=:2345 --api-version=2 --accept-multiclient $(PLATFORM_FILES) --build-flags="-ldflags '\
|
$(DELVE) debug --headless --listen=:2345 --api-version=2 --accept-multiclient $(PLATFORM_FILES) --build-flags="-ldflags '\
|
||||||
-X github.com/mattermost/mattermost-server/v6/model.BuildNumber=$(BUILD_NUMBER)\
|
-X github.com/mattermost/mattermost-server/server/v8/model.BuildNumber=$(BUILD_NUMBER)\
|
||||||
-X \"github.com/mattermost/mattermost-server/v6/model.BuildDate=$(BUILD_DATE)\"\
|
-X \"github.com/mattermost/mattermost-server/server/v8/model.BuildDate=$(BUILD_DATE)\"\
|
||||||
-X github.com/mattermost/mattermost-server/v6/model.BuildHash=$(BUILD_HASH)\
|
-X github.com/mattermost/mattermost-server/server/v8/model.BuildHash=$(BUILD_HASH)\
|
||||||
-X github.com/mattermost/mattermost-server/v6/model.BuildHashEnterprise=$(BUILD_HASH_ENTERPRISE)\
|
-X github.com/mattermost/mattermost-server/server/v8/model.BuildHashEnterprise=$(BUILD_HASH_ENTERPRISE)\
|
||||||
-X github.com/mattermost/mattermost-server/v6/model.BuildEnterpriseReady=$(BUILD_ENTERPRISE_READY)'"
|
-X github.com/mattermost/mattermost-server/server/v8/model.BuildEnterpriseReady=$(BUILD_ENTERPRISE_READY)'"
|
||||||
|
|
||||||
run-cli: start-docker ## Runs CLI.
|
run-cli: start-docker ## Runs CLI.
|
||||||
@echo Running mattermost for development
|
@echo Running mattermost for development
|
||||||
@@ -733,18 +723,18 @@ gen-serialized: ## Generates serialization methods for hot structs
|
|||||||
# would be to temporarily move all the structs to the same file,
|
# would be to temporarily move all the structs to the same file,
|
||||||
# but that involves a lot of manual work.
|
# but that involves a lot of manual work.
|
||||||
$(GO) install github.com/tinylib/msgp@v1.1.6
|
$(GO) install github.com/tinylib/msgp@v1.1.6
|
||||||
$(GOBIN)/msgp -file=../model/session.go -tests=false -o=../model/session_serial_gen.go
|
$(GOBIN)/msgp -file=./model/session.go -tests=false -o=./model/session_serial_gen.go
|
||||||
@echo "$$LICENSE_HEADER" > tmp.go
|
@echo "$$LICENSE_HEADER" > tmp.go
|
||||||
@cat ../model/session_serial_gen.go >> tmp.go
|
@cat ./model/session_serial_gen.go >> tmp.go
|
||||||
@mv tmp.go ../model/session_serial_gen.go
|
@mv tmp.go ./model/session_serial_gen.go
|
||||||
$(GOBIN)/msgp -file=../model/user.go -tests=false -o=../model/user_serial_gen.go
|
$(GOBIN)/msgp -file=./model/user.go -tests=false -o=./model/user_serial_gen.go
|
||||||
@echo "$$LICENSE_HEADER" > tmp.go
|
@echo "$$LICENSE_HEADER" > tmp.go
|
||||||
@cat ../model/user_serial_gen.go >> tmp.go
|
@cat ./model/user_serial_gen.go >> tmp.go
|
||||||
@mv tmp.go ../model/user_serial_gen.go
|
@mv tmp.go ./model/user_serial_gen.go
|
||||||
$(GOBIN)/msgp -file=../model/team_member.go -tests=false -o=../model/team_member_serial_gen.go
|
$(GOBIN)/msgp -file=./model/team_member.go -tests=false -o=./model/team_member_serial_gen.go
|
||||||
@echo "$$LICENSE_HEADER" > tmp.go
|
@echo "$$LICENSE_HEADER" > tmp.go
|
||||||
@cat ../model/team_member_serial_gen.go >> tmp.go
|
@cat ./model/team_member_serial_gen.go >> tmp.go
|
||||||
@mv tmp.go ../model/team_member_serial_gen.go
|
@mv tmp.go ./model/team_member_serial_gen.go
|
||||||
|
|
||||||
todo: ## Display TODO and FIXME items in the source code.
|
todo: ## Display TODO and FIXME items in the source code.
|
||||||
@! ag --ignore Makefile --ignore-dir runtime '(TODO|XXX|FIXME|"FIX ME")[: ]+'
|
@! ag --ignore Makefile --ignore-dir runtime '(TODO|XXX|FIXME|"FIX ME")[: ]+'
|
||||||
|
|||||||
@@ -11,10 +11,10 @@ import (
|
|||||||
|
|
||||||
"github.com/gorilla/mux"
|
"github.com/gorilla/mux"
|
||||||
|
|
||||||
"github.com/mattermost/mattermost-server/v6/server/boards/model"
|
"github.com/mattermost/mattermost-server/server/v8/boards/model"
|
||||||
"github.com/mattermost/mattermost-server/v6/server/boards/services/audit"
|
"github.com/mattermost/mattermost-server/server/v8/boards/services/audit"
|
||||||
|
|
||||||
"github.com/mattermost/mattermost-server/v6/server/platform/shared/mlog"
|
"github.com/mattermost/mattermost-server/server/v8/platform/shared/mlog"
|
||||||
)
|
)
|
||||||
|
|
||||||
type AdminSetPasswordData struct {
|
type AdminSetPasswordData struct {
|
||||||
|
|||||||
@@ -12,12 +12,12 @@ import (
|
|||||||
|
|
||||||
"github.com/gorilla/mux"
|
"github.com/gorilla/mux"
|
||||||
|
|
||||||
"github.com/mattermost/mattermost-server/v6/server/boards/app"
|
"github.com/mattermost/mattermost-server/server/v8/boards/app"
|
||||||
"github.com/mattermost/mattermost-server/v6/server/boards/model"
|
"github.com/mattermost/mattermost-server/server/v8/boards/model"
|
||||||
"github.com/mattermost/mattermost-server/v6/server/boards/services/audit"
|
"github.com/mattermost/mattermost-server/server/v8/boards/services/audit"
|
||||||
"github.com/mattermost/mattermost-server/v6/server/boards/services/permissions"
|
"github.com/mattermost/mattermost-server/server/v8/boards/services/permissions"
|
||||||
|
|
||||||
"github.com/mattermost/mattermost-server/v6/server/platform/shared/mlog"
|
"github.com/mattermost/mattermost-server/server/v8/platform/shared/mlog"
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
|||||||
@@ -13,8 +13,8 @@ import (
|
|||||||
|
|
||||||
"github.com/stretchr/testify/require"
|
"github.com/stretchr/testify/require"
|
||||||
|
|
||||||
"github.com/mattermost/mattermost-server/v6/server/boards/model"
|
"github.com/mattermost/mattermost-server/server/v8/boards/model"
|
||||||
"github.com/mattermost/mattermost-server/v6/server/platform/shared/mlog"
|
"github.com/mattermost/mattermost-server/server/v8/platform/shared/mlog"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestErrorResponse(t *testing.T) {
|
func TestErrorResponse(t *testing.T) {
|
||||||
|
|||||||
@@ -10,11 +10,11 @@ import (
|
|||||||
|
|
||||||
"github.com/gorilla/mux"
|
"github.com/gorilla/mux"
|
||||||
|
|
||||||
"github.com/mattermost/mattermost-server/v6/server/boards/model"
|
"github.com/mattermost/mattermost-server/server/v8/boards/model"
|
||||||
"github.com/mattermost/mattermost-server/v6/server/boards/services/audit"
|
"github.com/mattermost/mattermost-server/server/v8/boards/services/audit"
|
||||||
|
|
||||||
mm_model "github.com/mattermost/mattermost-server/v6/model"
|
mm_model "github.com/mattermost/mattermost-server/server/v8/model"
|
||||||
"github.com/mattermost/mattermost-server/v6/server/platform/shared/mlog"
|
"github.com/mattermost/mattermost-server/server/v8/platform/shared/mlog"
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
|||||||
@@ -6,8 +6,8 @@ package api
|
|||||||
import (
|
import (
|
||||||
"net/http"
|
"net/http"
|
||||||
|
|
||||||
"github.com/mattermost/mattermost-server/v6/server/boards/model"
|
"github.com/mattermost/mattermost-server/server/v8/boards/model"
|
||||||
"github.com/mattermost/mattermost-server/v6/server/boards/services/audit"
|
"github.com/mattermost/mattermost-server/server/v8/boards/services/audit"
|
||||||
)
|
)
|
||||||
|
|
||||||
// makeAuditRecord creates an audit record pre-populated with data from the request.
|
// makeAuditRecord creates an audit record pre-populated with data from the request.
|
||||||
|
|||||||
@@ -13,12 +13,12 @@ import (
|
|||||||
|
|
||||||
"github.com/gorilla/mux"
|
"github.com/gorilla/mux"
|
||||||
|
|
||||||
"github.com/mattermost/mattermost-server/v6/server/boards/model"
|
"github.com/mattermost/mattermost-server/server/v8/boards/model"
|
||||||
"github.com/mattermost/mattermost-server/v6/server/boards/services/audit"
|
"github.com/mattermost/mattermost-server/server/v8/boards/services/audit"
|
||||||
"github.com/mattermost/mattermost-server/v6/server/boards/services/auth"
|
"github.com/mattermost/mattermost-server/server/v8/boards/services/auth"
|
||||||
"github.com/mattermost/mattermost-server/v6/server/boards/utils"
|
"github.com/mattermost/mattermost-server/server/v8/boards/utils"
|
||||||
|
|
||||||
"github.com/mattermost/mattermost-server/v6/server/platform/shared/mlog"
|
"github.com/mattermost/mattermost-server/server/v8/platform/shared/mlog"
|
||||||
)
|
)
|
||||||
|
|
||||||
func (a *API) registerAuthRoutes(r *mux.Router) {
|
func (a *API) registerAuthRoutes(r *mux.Router) {
|
||||||
|
|||||||
@@ -12,10 +12,10 @@ import (
|
|||||||
|
|
||||||
"github.com/gorilla/mux"
|
"github.com/gorilla/mux"
|
||||||
|
|
||||||
"github.com/mattermost/mattermost-server/v6/server/boards/model"
|
"github.com/mattermost/mattermost-server/server/v8/boards/model"
|
||||||
"github.com/mattermost/mattermost-server/v6/server/boards/services/audit"
|
"github.com/mattermost/mattermost-server/server/v8/boards/services/audit"
|
||||||
|
|
||||||
"github.com/mattermost/mattermost-server/v6/server/platform/shared/mlog"
|
"github.com/mattermost/mattermost-server/server/v8/platform/shared/mlog"
|
||||||
)
|
)
|
||||||
|
|
||||||
func (a *API) registerBlocksRoutes(r *mux.Router) {
|
func (a *API) registerBlocksRoutes(r *mux.Router) {
|
||||||
@@ -72,7 +72,6 @@ func (a *API) handleGetBlocks(w http.ResponseWriter, r *http.Request) {
|
|||||||
query := r.URL.Query()
|
query := r.URL.Query()
|
||||||
parentID := query.Get("parent_id")
|
parentID := query.Get("parent_id")
|
||||||
blockType := query.Get("type")
|
blockType := query.Get("type")
|
||||||
all := query.Get("all")
|
|
||||||
blockID := query.Get("block_id")
|
blockID := query.Get("block_id")
|
||||||
boardID := mux.Vars(r)["boardID"]
|
boardID := mux.Vars(r)["boardID"]
|
||||||
|
|
||||||
@@ -122,18 +121,11 @@ func (a *API) handleGetBlocks(w http.ResponseWriter, r *http.Request) {
|
|||||||
auditRec.AddMeta("boardID", boardID)
|
auditRec.AddMeta("boardID", boardID)
|
||||||
auditRec.AddMeta("parentID", parentID)
|
auditRec.AddMeta("parentID", parentID)
|
||||||
auditRec.AddMeta("blockType", blockType)
|
auditRec.AddMeta("blockType", blockType)
|
||||||
auditRec.AddMeta("all", all)
|
|
||||||
auditRec.AddMeta("blockID", blockID)
|
auditRec.AddMeta("blockID", blockID)
|
||||||
|
|
||||||
var blocks []*model.Block
|
var blocks []*model.Block
|
||||||
var block *model.Block
|
var block *model.Block
|
||||||
switch {
|
switch {
|
||||||
case all != "":
|
|
||||||
blocks, err = a.app.GetBlocksForBoard(boardID)
|
|
||||||
if err != nil {
|
|
||||||
a.errorResponse(w, r, err)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
case blockID != "":
|
case blockID != "":
|
||||||
block, err = a.app.GetBlockByID(blockID)
|
block, err = a.app.GetBlockByID(blockID)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@@ -148,7 +140,12 @@ func (a *API) handleGetBlocks(w http.ResponseWriter, r *http.Request) {
|
|||||||
|
|
||||||
blocks = append(blocks, block)
|
blocks = append(blocks, block)
|
||||||
default:
|
default:
|
||||||
blocks, err = a.app.GetBlocks(boardID, parentID, blockType)
|
opts := model.QueryBlocksOptions{
|
||||||
|
BoardID: boardID,
|
||||||
|
ParentID: parentID,
|
||||||
|
BlockType: model.BlockType(blockType),
|
||||||
|
}
|
||||||
|
blocks, err = a.app.GetBlocks(opts)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
a.errorResponse(w, r, err)
|
a.errorResponse(w, r, err)
|
||||||
return
|
return
|
||||||
|
|||||||
@@ -10,10 +10,10 @@ import (
|
|||||||
|
|
||||||
"github.com/gorilla/mux"
|
"github.com/gorilla/mux"
|
||||||
|
|
||||||
"github.com/mattermost/mattermost-server/v6/server/boards/model"
|
"github.com/mattermost/mattermost-server/server/v8/boards/model"
|
||||||
"github.com/mattermost/mattermost-server/v6/server/boards/services/audit"
|
"github.com/mattermost/mattermost-server/server/v8/boards/services/audit"
|
||||||
|
|
||||||
"github.com/mattermost/mattermost-server/v6/server/platform/shared/mlog"
|
"github.com/mattermost/mattermost-server/server/v8/platform/shared/mlog"
|
||||||
)
|
)
|
||||||
|
|
||||||
func (a *API) registerBoardsRoutes(r *mux.Router) {
|
func (a *API) registerBoardsRoutes(r *mux.Router) {
|
||||||
|
|||||||
@@ -11,10 +11,10 @@ import (
|
|||||||
|
|
||||||
"github.com/gorilla/mux"
|
"github.com/gorilla/mux"
|
||||||
|
|
||||||
"github.com/mattermost/mattermost-server/v6/server/boards/model"
|
"github.com/mattermost/mattermost-server/server/v8/boards/model"
|
||||||
"github.com/mattermost/mattermost-server/v6/server/boards/services/audit"
|
"github.com/mattermost/mattermost-server/server/v8/boards/services/audit"
|
||||||
|
|
||||||
"github.com/mattermost/mattermost-server/v6/server/platform/shared/mlog"
|
"github.com/mattermost/mattermost-server/server/v8/platform/shared/mlog"
|
||||||
)
|
)
|
||||||
|
|
||||||
func (a *API) registerBoardsAndBlocksRoutes(r *mux.Router) {
|
func (a *API) registerBoardsAndBlocksRoutes(r *mux.Router) {
|
||||||
|
|||||||
@@ -12,10 +12,10 @@ import (
|
|||||||
|
|
||||||
"github.com/gorilla/mux"
|
"github.com/gorilla/mux"
|
||||||
|
|
||||||
"github.com/mattermost/mattermost-server/v6/server/boards/model"
|
"github.com/mattermost/mattermost-server/server/v8/boards/model"
|
||||||
"github.com/mattermost/mattermost-server/v6/server/boards/services/audit"
|
"github.com/mattermost/mattermost-server/server/v8/boards/services/audit"
|
||||||
|
|
||||||
"github.com/mattermost/mattermost-server/v6/server/platform/shared/mlog"
|
"github.com/mattermost/mattermost-server/server/v8/platform/shared/mlog"
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
|||||||
@@ -11,8 +11,8 @@ import (
|
|||||||
|
|
||||||
"github.com/gorilla/mux"
|
"github.com/gorilla/mux"
|
||||||
|
|
||||||
"github.com/mattermost/mattermost-server/v6/server/boards/model"
|
"github.com/mattermost/mattermost-server/server/v8/boards/model"
|
||||||
"github.com/mattermost/mattermost-server/v6/server/boards/services/audit"
|
"github.com/mattermost/mattermost-server/server/v8/boards/services/audit"
|
||||||
)
|
)
|
||||||
|
|
||||||
func (a *API) registerCategoriesRoutes(r *mux.Router) {
|
func (a *API) registerCategoriesRoutes(r *mux.Router) {
|
||||||
|
|||||||
@@ -10,11 +10,11 @@ import (
|
|||||||
|
|
||||||
"github.com/gorilla/mux"
|
"github.com/gorilla/mux"
|
||||||
|
|
||||||
"github.com/mattermost/mattermost-server/v6/server/boards/model"
|
"github.com/mattermost/mattermost-server/server/v8/boards/model"
|
||||||
"github.com/mattermost/mattermost-server/v6/server/boards/services/audit"
|
"github.com/mattermost/mattermost-server/server/v8/boards/services/audit"
|
||||||
|
|
||||||
mm_model "github.com/mattermost/mattermost-server/v6/model"
|
mm_model "github.com/mattermost/mattermost-server/server/v8/model"
|
||||||
"github.com/mattermost/mattermost-server/v6/server/platform/shared/mlog"
|
"github.com/mattermost/mattermost-server/server/v8/platform/shared/mlog"
|
||||||
)
|
)
|
||||||
|
|
||||||
func (a *API) registerChannelsRoutes(r *mux.Router) {
|
func (a *API) registerChannelsRoutes(r *mux.Router) {
|
||||||
|
|||||||
@@ -11,10 +11,10 @@ import (
|
|||||||
|
|
||||||
"github.com/gorilla/mux"
|
"github.com/gorilla/mux"
|
||||||
|
|
||||||
"github.com/mattermost/mattermost-server/v6/server/boards/model"
|
"github.com/mattermost/mattermost-server/server/v8/boards/model"
|
||||||
|
|
||||||
mm_model "github.com/mattermost/mattermost-server/v6/model"
|
mm_model "github.com/mattermost/mattermost-server/server/v8/model"
|
||||||
"github.com/mattermost/mattermost-server/v6/server/platform/shared/mlog"
|
"github.com/mattermost/mattermost-server/server/v8/platform/shared/mlog"
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
|||||||
@@ -8,8 +8,8 @@ import (
|
|||||||
|
|
||||||
"github.com/gorilla/mux"
|
"github.com/gorilla/mux"
|
||||||
|
|
||||||
"github.com/mattermost/mattermost-server/v6/server/boards/model"
|
"github.com/mattermost/mattermost-server/server/v8/boards/model"
|
||||||
"github.com/mattermost/mattermost-server/v6/server/boards/services/audit"
|
"github.com/mattermost/mattermost-server/server/v8/boards/services/audit"
|
||||||
)
|
)
|
||||||
|
|
||||||
func (a *API) registerContentBlocksRoutes(r *mux.Router) {
|
func (a *API) registerContentBlocksRoutes(r *mux.Router) {
|
||||||
|
|||||||
@@ -11,17 +11,17 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/mattermost/mattermost-server/v6/server/boards/app"
|
"github.com/mattermost/mattermost-server/server/v8/boards/app"
|
||||||
|
|
||||||
"github.com/gorilla/mux"
|
"github.com/gorilla/mux"
|
||||||
|
|
||||||
"github.com/mattermost/mattermost-server/v6/server/boards/model"
|
"github.com/mattermost/mattermost-server/server/v8/boards/model"
|
||||||
|
|
||||||
mm_model "github.com/mattermost/mattermost-server/v6/model"
|
"github.com/mattermost/mattermost-server/server/v8/boards/services/audit"
|
||||||
"github.com/mattermost/mattermost-server/v6/server/boards/services/audit"
|
mm_model "github.com/mattermost/mattermost-server/server/v8/model"
|
||||||
|
|
||||||
"github.com/mattermost/mattermost-server/v6/server/platform/shared/mlog"
|
"github.com/mattermost/mattermost-server/server/v8/platform/shared/mlog"
|
||||||
"github.com/mattermost/mattermost-server/v6/server/platform/shared/web"
|
"github.com/mattermost/mattermost-server/server/v8/platform/shared/web"
|
||||||
)
|
)
|
||||||
|
|
||||||
// FileUploadResponse is the response to a file upload
|
// FileUploadResponse is the response to a file upload
|
||||||
|
|||||||
@@ -12,10 +12,10 @@ import (
|
|||||||
|
|
||||||
"github.com/gorilla/mux"
|
"github.com/gorilla/mux"
|
||||||
|
|
||||||
"github.com/mattermost/mattermost-server/v6/server/boards/model"
|
"github.com/mattermost/mattermost-server/server/v8/boards/model"
|
||||||
"github.com/mattermost/mattermost-server/v6/server/boards/services/audit"
|
"github.com/mattermost/mattermost-server/server/v8/boards/services/audit"
|
||||||
|
|
||||||
mm_model "github.com/mattermost/mattermost-server/v6/model"
|
mm_model "github.com/mattermost/mattermost-server/server/v8/model"
|
||||||
)
|
)
|
||||||
|
|
||||||
func (a *API) registerInsightsRoutes(r *mux.Router) {
|
func (a *API) registerInsightsRoutes(r *mux.Router) {
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ import (
|
|||||||
|
|
||||||
"github.com/gorilla/mux"
|
"github.com/gorilla/mux"
|
||||||
|
|
||||||
"github.com/mattermost/mattermost-server/v6/server/boards/model"
|
"github.com/mattermost/mattermost-server/server/v8/boards/model"
|
||||||
)
|
)
|
||||||
|
|
||||||
func (a *API) registerLimitsRoutes(r *mux.Router) {
|
func (a *API) registerLimitsRoutes(r *mux.Router) {
|
||||||
|
|||||||
@@ -10,9 +10,9 @@ import (
|
|||||||
|
|
||||||
"github.com/gorilla/mux"
|
"github.com/gorilla/mux"
|
||||||
|
|
||||||
"github.com/mattermost/mattermost-server/v6/server/boards/model"
|
"github.com/mattermost/mattermost-server/server/v8/boards/model"
|
||||||
"github.com/mattermost/mattermost-server/v6/server/boards/services/audit"
|
"github.com/mattermost/mattermost-server/server/v8/boards/services/audit"
|
||||||
"github.com/mattermost/mattermost-server/v6/server/platform/shared/mlog"
|
"github.com/mattermost/mattermost-server/server/v8/platform/shared/mlog"
|
||||||
)
|
)
|
||||||
|
|
||||||
func (a *API) registerMembersRoutes(r *mux.Router) {
|
func (a *API) registerMembersRoutes(r *mux.Router) {
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ import (
|
|||||||
|
|
||||||
"github.com/gorilla/mux"
|
"github.com/gorilla/mux"
|
||||||
|
|
||||||
"github.com/mattermost/mattermost-server/v6/server/boards/model"
|
"github.com/mattermost/mattermost-server/server/v8/boards/model"
|
||||||
)
|
)
|
||||||
|
|
||||||
func (a *API) registerOnboardingRoutes(r *mux.Router) {
|
func (a *API) registerOnboardingRoutes(r *mux.Router) {
|
||||||
|
|||||||
@@ -9,10 +9,10 @@ import (
|
|||||||
|
|
||||||
"github.com/gorilla/mux"
|
"github.com/gorilla/mux"
|
||||||
|
|
||||||
"github.com/mattermost/mattermost-server/v6/server/boards/model"
|
"github.com/mattermost/mattermost-server/server/v8/boards/model"
|
||||||
"github.com/mattermost/mattermost-server/v6/server/boards/services/audit"
|
"github.com/mattermost/mattermost-server/server/v8/boards/services/audit"
|
||||||
|
|
||||||
"github.com/mattermost/mattermost-server/v6/server/platform/shared/mlog"
|
"github.com/mattermost/mattermost-server/server/v8/platform/shared/mlog"
|
||||||
)
|
)
|
||||||
|
|
||||||
func (a *API) registerSearchRoutes(r *mux.Router) {
|
func (a *API) registerSearchRoutes(r *mux.Router) {
|
||||||
|
|||||||
@@ -11,10 +11,10 @@ import (
|
|||||||
|
|
||||||
"github.com/gorilla/mux"
|
"github.com/gorilla/mux"
|
||||||
|
|
||||||
"github.com/mattermost/mattermost-server/v6/server/boards/model"
|
"github.com/mattermost/mattermost-server/server/v8/boards/model"
|
||||||
"github.com/mattermost/mattermost-server/v6/server/boards/services/audit"
|
"github.com/mattermost/mattermost-server/server/v8/boards/services/audit"
|
||||||
|
|
||||||
"github.com/mattermost/mattermost-server/v6/server/platform/shared/mlog"
|
"github.com/mattermost/mattermost-server/server/v8/platform/shared/mlog"
|
||||||
)
|
)
|
||||||
|
|
||||||
var ErrTurningOnSharing = errors.New("turning on sharing for board failed, see log for details")
|
var ErrTurningOnSharing = errors.New("turning on sharing for board failed, see log for details")
|
||||||
|
|||||||
@@ -9,8 +9,8 @@ import (
|
|||||||
|
|
||||||
"github.com/gorilla/mux"
|
"github.com/gorilla/mux"
|
||||||
|
|
||||||
mm_model "github.com/mattermost/mattermost-server/v6/model"
|
"github.com/mattermost/mattermost-server/server/v8/boards/model"
|
||||||
"github.com/mattermost/mattermost-server/v6/server/boards/model"
|
mm_model "github.com/mattermost/mattermost-server/server/v8/model"
|
||||||
)
|
)
|
||||||
|
|
||||||
func (a *API) registerStatisticsRoutes(r *mux.Router) {
|
func (a *API) registerStatisticsRoutes(r *mux.Router) {
|
||||||
|
|||||||
@@ -11,10 +11,10 @@ import (
|
|||||||
|
|
||||||
"github.com/gorilla/mux"
|
"github.com/gorilla/mux"
|
||||||
|
|
||||||
"github.com/mattermost/mattermost-server/v6/server/boards/model"
|
"github.com/mattermost/mattermost-server/server/v8/boards/model"
|
||||||
"github.com/mattermost/mattermost-server/v6/server/boards/services/audit"
|
"github.com/mattermost/mattermost-server/server/v8/boards/services/audit"
|
||||||
|
|
||||||
"github.com/mattermost/mattermost-server/v6/server/platform/shared/mlog"
|
"github.com/mattermost/mattermost-server/server/v8/platform/shared/mlog"
|
||||||
)
|
)
|
||||||
|
|
||||||
func (a *API) registerSubscriptionsRoutes(r *mux.Router) {
|
func (a *API) registerSubscriptionsRoutes(r *mux.Router) {
|
||||||
|
|||||||
@@ -10,9 +10,9 @@ import (
|
|||||||
"runtime"
|
"runtime"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/mattermost/mattermost-server/v6/server/boards/app"
|
"github.com/mattermost/mattermost-server/server/v8/boards/app"
|
||||||
"github.com/mattermost/mattermost-server/v6/server/boards/model"
|
"github.com/mattermost/mattermost-server/server/v8/boards/model"
|
||||||
"github.com/mattermost/mattermost-server/v6/server/platform/shared/mlog"
|
"github.com/mattermost/mattermost-server/server/v8/platform/shared/mlog"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestHello(t *testing.T) {
|
func TestHello(t *testing.T) {
|
||||||
|
|||||||
@@ -10,9 +10,9 @@ import (
|
|||||||
|
|
||||||
"github.com/gorilla/mux"
|
"github.com/gorilla/mux"
|
||||||
|
|
||||||
"github.com/mattermost/mattermost-server/v6/server/boards/model"
|
"github.com/mattermost/mattermost-server/server/v8/boards/model"
|
||||||
"github.com/mattermost/mattermost-server/v6/server/boards/services/audit"
|
"github.com/mattermost/mattermost-server/server/v8/boards/services/audit"
|
||||||
"github.com/mattermost/mattermost-server/v6/server/boards/utils"
|
"github.com/mattermost/mattermost-server/server/v8/boards/utils"
|
||||||
)
|
)
|
||||||
|
|
||||||
func (a *API) registerTeamsRoutes(r *mux.Router) {
|
func (a *API) registerTeamsRoutes(r *mux.Router) {
|
||||||
|
|||||||
@@ -9,10 +9,10 @@ import (
|
|||||||
|
|
||||||
"github.com/gorilla/mux"
|
"github.com/gorilla/mux"
|
||||||
|
|
||||||
"github.com/mattermost/mattermost-server/v6/server/boards/model"
|
"github.com/mattermost/mattermost-server/server/v8/boards/model"
|
||||||
"github.com/mattermost/mattermost-server/v6/server/boards/services/audit"
|
"github.com/mattermost/mattermost-server/server/v8/boards/services/audit"
|
||||||
|
|
||||||
"github.com/mattermost/mattermost-server/v6/server/platform/shared/mlog"
|
"github.com/mattermost/mattermost-server/server/v8/platform/shared/mlog"
|
||||||
)
|
)
|
||||||
|
|
||||||
func (a *API) registerTemplatesRoutes(r *mux.Router) {
|
func (a *API) registerTemplatesRoutes(r *mux.Router) {
|
||||||
|
|||||||
@@ -10,9 +10,9 @@ import (
|
|||||||
|
|
||||||
"github.com/gorilla/mux"
|
"github.com/gorilla/mux"
|
||||||
|
|
||||||
"github.com/mattermost/mattermost-server/v6/server/boards/model"
|
"github.com/mattermost/mattermost-server/server/v8/boards/model"
|
||||||
"github.com/mattermost/mattermost-server/v6/server/boards/services/audit"
|
"github.com/mattermost/mattermost-server/server/v8/boards/services/audit"
|
||||||
"github.com/mattermost/mattermost-server/v6/server/boards/utils"
|
"github.com/mattermost/mattermost-server/server/v8/boards/utils"
|
||||||
)
|
)
|
||||||
|
|
||||||
func (a *API) registerUsersRoutes(r *mux.Router) {
|
func (a *API) registerUsersRoutes(r *mux.Router) {
|
||||||
|
|||||||
@@ -8,19 +8,19 @@ import (
|
|||||||
"sync"
|
"sync"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/mattermost/mattermost-server/v6/server/boards/auth"
|
"github.com/mattermost/mattermost-server/server/v8/boards/auth"
|
||||||
"github.com/mattermost/mattermost-server/v6/server/boards/services/config"
|
"github.com/mattermost/mattermost-server/server/v8/boards/services/config"
|
||||||
"github.com/mattermost/mattermost-server/v6/server/boards/services/metrics"
|
"github.com/mattermost/mattermost-server/server/v8/boards/services/metrics"
|
||||||
"github.com/mattermost/mattermost-server/v6/server/boards/services/notify"
|
"github.com/mattermost/mattermost-server/server/v8/boards/services/notify"
|
||||||
"github.com/mattermost/mattermost-server/v6/server/boards/services/permissions"
|
"github.com/mattermost/mattermost-server/server/v8/boards/services/permissions"
|
||||||
"github.com/mattermost/mattermost-server/v6/server/boards/services/store"
|
"github.com/mattermost/mattermost-server/server/v8/boards/services/store"
|
||||||
"github.com/mattermost/mattermost-server/v6/server/boards/services/webhook"
|
"github.com/mattermost/mattermost-server/server/v8/boards/services/webhook"
|
||||||
"github.com/mattermost/mattermost-server/v6/server/boards/utils"
|
"github.com/mattermost/mattermost-server/server/v8/boards/utils"
|
||||||
"github.com/mattermost/mattermost-server/v6/server/boards/ws"
|
"github.com/mattermost/mattermost-server/server/v8/boards/ws"
|
||||||
|
|
||||||
mm_model "github.com/mattermost/mattermost-server/v6/model"
|
mm_model "github.com/mattermost/mattermost-server/server/v8/model"
|
||||||
"github.com/mattermost/mattermost-server/v6/server/platform/shared/filestore"
|
"github.com/mattermost/mattermost-server/server/v8/platform/shared/filestore"
|
||||||
"github.com/mattermost/mattermost-server/v6/server/platform/shared/mlog"
|
"github.com/mattermost/mattermost-server/server/v8/platform/shared/mlog"
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ import (
|
|||||||
|
|
||||||
"github.com/stretchr/testify/require"
|
"github.com/stretchr/testify/require"
|
||||||
|
|
||||||
"github.com/mattermost/mattermost-server/v6/server/boards/services/config"
|
"github.com/mattermost/mattermost-server/server/v8/boards/services/config"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestSetConfig(t *testing.T) {
|
func TestSetConfig(t *testing.T) {
|
||||||
|
|||||||
@@ -4,11 +4,11 @@
|
|||||||
package app
|
package app
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/mattermost/mattermost-server/v6/server/boards/model"
|
"github.com/mattermost/mattermost-server/server/v8/boards/model"
|
||||||
"github.com/mattermost/mattermost-server/v6/server/boards/services/auth"
|
"github.com/mattermost/mattermost-server/server/v8/boards/services/auth"
|
||||||
"github.com/mattermost/mattermost-server/v6/server/boards/utils"
|
"github.com/mattermost/mattermost-server/server/v8/boards/utils"
|
||||||
|
|
||||||
"github.com/mattermost/mattermost-server/v6/server/platform/shared/mlog"
|
"github.com/mattermost/mattermost-server/server/v8/platform/shared/mlog"
|
||||||
|
|
||||||
"github.com/pkg/errors"
|
"github.com/pkg/errors"
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -10,9 +10,9 @@ import (
|
|||||||
"github.com/pkg/errors"
|
"github.com/pkg/errors"
|
||||||
"github.com/stretchr/testify/require"
|
"github.com/stretchr/testify/require"
|
||||||
|
|
||||||
"github.com/mattermost/mattermost-server/v6/server/boards/model"
|
"github.com/mattermost/mattermost-server/server/v8/boards/model"
|
||||||
"github.com/mattermost/mattermost-server/v6/server/boards/services/auth"
|
"github.com/mattermost/mattermost-server/server/v8/boards/services/auth"
|
||||||
"github.com/mattermost/mattermost-server/v6/server/boards/utils"
|
"github.com/mattermost/mattermost-server/server/v8/boards/utils"
|
||||||
)
|
)
|
||||||
|
|
||||||
var mockUser = &model.User{
|
var mockUser = &model.User{
|
||||||
|
|||||||
@@ -9,29 +9,20 @@ import (
|
|||||||
"path/filepath"
|
"path/filepath"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/mattermost/mattermost-server/v6/server/boards/model"
|
"github.com/mattermost/mattermost-server/server/v8/boards/model"
|
||||||
"github.com/mattermost/mattermost-server/v6/server/boards/services/notify"
|
"github.com/mattermost/mattermost-server/server/v8/boards/services/notify"
|
||||||
"github.com/mattermost/mattermost-server/v6/server/boards/utils"
|
"github.com/mattermost/mattermost-server/server/v8/boards/utils"
|
||||||
|
|
||||||
"github.com/mattermost/mattermost-server/v6/server/platform/shared/mlog"
|
"github.com/mattermost/mattermost-server/server/v8/platform/shared/mlog"
|
||||||
)
|
)
|
||||||
|
|
||||||
var ErrBlocksFromMultipleBoards = errors.New("the block set contain blocks from multiple boards")
|
var ErrBlocksFromMultipleBoards = errors.New("the block set contain blocks from multiple boards")
|
||||||
|
|
||||||
func (a *App) GetBlocks(boardID, parentID string, blockType string) ([]*model.Block, error) {
|
func (a *App) GetBlocks(opts model.QueryBlocksOptions) ([]*model.Block, error) {
|
||||||
if boardID == "" {
|
if opts.BoardID == "" {
|
||||||
return []*model.Block{}, nil
|
return []*model.Block{}, nil
|
||||||
}
|
}
|
||||||
|
return a.store.GetBlocks(opts)
|
||||||
if blockType != "" && parentID != "" {
|
|
||||||
return a.store.GetBlocksWithParentAndType(boardID, parentID, blockType)
|
|
||||||
}
|
|
||||||
|
|
||||||
if blockType != "" {
|
|
||||||
return a.store.GetBlocksWithType(boardID, blockType)
|
|
||||||
}
|
|
||||||
|
|
||||||
return a.store.GetBlocksWithParent(boardID, parentID)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (a *App) DuplicateBlock(boardID string, blockID string, userID string, asTemplate bool) ([]*model.Block, error) {
|
func (a *App) DuplicateBlock(boardID string, blockID string, userID string, asTemplate bool) ([]*model.Block, error) {
|
||||||
@@ -514,10 +505,6 @@ func (a *App) GetBlockCountsByType() (map[string]int64, error) {
|
|||||||
return a.store.GetBlockCountsByType()
|
return a.store.GetBlockCountsByType()
|
||||||
}
|
}
|
||||||
|
|
||||||
func (a *App) GetBlocksForBoard(boardID string) ([]*model.Block, error) {
|
|
||||||
return a.store.GetBlocksForBoard(boardID)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (a *App) notifyBlockChanged(action notify.Action, block *model.Block, oldBlock *model.Block, modifiedByID string) {
|
func (a *App) notifyBlockChanged(action notify.Action, block *model.Block, oldBlock *model.Block, modifiedByID string) {
|
||||||
// don't notify if notifications service disabled, or block change is generated via system user.
|
// don't notify if notifications service disabled, or block change is generated via system user.
|
||||||
if a.notifications == nil || modifiedByID == model.SystemUserID {
|
if a.notifications == nil || modifiedByID == model.SystemUserID {
|
||||||
|
|||||||
@@ -12,9 +12,9 @@ import (
|
|||||||
"github.com/golang/mock/gomock"
|
"github.com/golang/mock/gomock"
|
||||||
"github.com/stretchr/testify/require"
|
"github.com/stretchr/testify/require"
|
||||||
|
|
||||||
mm_model "github.com/mattermost/mattermost-server/v6/model"
|
mm_model "github.com/mattermost/mattermost-server/server/v8/model"
|
||||||
|
|
||||||
"github.com/mattermost/mattermost-server/v6/server/boards/model"
|
"github.com/mattermost/mattermost-server/server/v8/boards/model"
|
||||||
)
|
)
|
||||||
|
|
||||||
type blockError struct {
|
type blockError struct {
|
||||||
@@ -207,10 +207,17 @@ func TestIsWithinViewsLimit(t *testing.T) {
|
|||||||
Views: mm_model.NewInt(2),
|
Views: mm_model.NewInt(2),
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
opts := model.QueryBlocksOptions{
|
||||||
|
BoardID: "board_id",
|
||||||
|
ParentID: "parent_id",
|
||||||
|
BlockType: model.BlockType("view"),
|
||||||
|
}
|
||||||
|
|
||||||
th.Store.EXPECT().GetCloudLimits().Return(cloudLimit, nil)
|
th.Store.EXPECT().GetCloudLimits().Return(cloudLimit, nil)
|
||||||
th.Store.EXPECT().GetUsedCardsCount().Return(1, nil)
|
th.Store.EXPECT().GetUsedCardsCount().Return(1, nil)
|
||||||
th.Store.EXPECT().GetCardLimitTimestamp().Return(int64(1), nil)
|
th.Store.EXPECT().GetCardLimitTimestamp().Return(int64(1), nil)
|
||||||
th.Store.EXPECT().GetBlocksWithParentAndType("board_id", "parent_id", "view").Return([]*model.Block{{}}, nil)
|
th.Store.EXPECT().GetBlocks(opts).Return([]*model.Block{{}}, nil)
|
||||||
|
|
||||||
withinLimits, err := th.App.isWithinViewsLimit("board_id", &model.Block{ParentID: "parent_id"})
|
withinLimits, err := th.App.isWithinViewsLimit("board_id", &model.Block{ParentID: "parent_id"})
|
||||||
assert.NoError(t, err)
|
assert.NoError(t, err)
|
||||||
@@ -225,10 +232,17 @@ func TestIsWithinViewsLimit(t *testing.T) {
|
|||||||
Views: mm_model.NewInt(1),
|
Views: mm_model.NewInt(1),
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
opts := model.QueryBlocksOptions{
|
||||||
|
BoardID: "board_id",
|
||||||
|
ParentID: "parent_id",
|
||||||
|
BlockType: model.BlockType("view"),
|
||||||
|
}
|
||||||
|
|
||||||
th.Store.EXPECT().GetCloudLimits().Return(cloudLimit, nil)
|
th.Store.EXPECT().GetCloudLimits().Return(cloudLimit, nil)
|
||||||
th.Store.EXPECT().GetUsedCardsCount().Return(1, nil)
|
th.Store.EXPECT().GetUsedCardsCount().Return(1, nil)
|
||||||
th.Store.EXPECT().GetCardLimitTimestamp().Return(int64(1), nil)
|
th.Store.EXPECT().GetCardLimitTimestamp().Return(int64(1), nil)
|
||||||
th.Store.EXPECT().GetBlocksWithParentAndType("board_id", "parent_id", "view").Return([]*model.Block{{}}, nil)
|
th.Store.EXPECT().GetBlocks(opts).Return([]*model.Block{{}}, nil)
|
||||||
|
|
||||||
withinLimits, err := th.App.isWithinViewsLimit("board_id", &model.Block{ParentID: "parent_id"})
|
withinLimits, err := th.App.isWithinViewsLimit("board_id", &model.Block{ParentID: "parent_id"})
|
||||||
assert.NoError(t, err)
|
assert.NoError(t, err)
|
||||||
@@ -243,10 +257,17 @@ func TestIsWithinViewsLimit(t *testing.T) {
|
|||||||
Views: mm_model.NewInt(2),
|
Views: mm_model.NewInt(2),
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
opts := model.QueryBlocksOptions{
|
||||||
|
BoardID: "board_id",
|
||||||
|
ParentID: "parent_id",
|
||||||
|
BlockType: model.BlockType("view"),
|
||||||
|
}
|
||||||
|
|
||||||
th.Store.EXPECT().GetCloudLimits().Return(cloudLimit, nil)
|
th.Store.EXPECT().GetCloudLimits().Return(cloudLimit, nil)
|
||||||
th.Store.EXPECT().GetUsedCardsCount().Return(1, nil)
|
th.Store.EXPECT().GetUsedCardsCount().Return(1, nil)
|
||||||
th.Store.EXPECT().GetCardLimitTimestamp().Return(int64(1), nil)
|
th.Store.EXPECT().GetCardLimitTimestamp().Return(int64(1), nil)
|
||||||
th.Store.EXPECT().GetBlocksWithParentAndType("board_id", "parent_id", "view").Return([]*model.Block{{}, {}, {}}, nil)
|
th.Store.EXPECT().GetBlocks(opts).Return([]*model.Block{{}, {}, {}}, nil)
|
||||||
|
|
||||||
withinLimits, err := th.App.isWithinViewsLimit("board_id", &model.Block{ParentID: "parent_id"})
|
withinLimits, err := th.App.isWithinViewsLimit("board_id", &model.Block{ParentID: "parent_id"})
|
||||||
assert.NoError(t, err)
|
assert.NoError(t, err)
|
||||||
@@ -261,10 +282,17 @@ func TestIsWithinViewsLimit(t *testing.T) {
|
|||||||
Views: mm_model.NewInt(2),
|
Views: mm_model.NewInt(2),
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
opts := model.QueryBlocksOptions{
|
||||||
|
BoardID: "board_id",
|
||||||
|
ParentID: "parent_id",
|
||||||
|
BlockType: model.BlockType("view"),
|
||||||
|
}
|
||||||
|
|
||||||
th.Store.EXPECT().GetCloudLimits().Return(cloudLimit, nil)
|
th.Store.EXPECT().GetCloudLimits().Return(cloudLimit, nil)
|
||||||
th.Store.EXPECT().GetUsedCardsCount().Return(1, nil)
|
th.Store.EXPECT().GetUsedCardsCount().Return(1, nil)
|
||||||
th.Store.EXPECT().GetCardLimitTimestamp().Return(int64(1), nil)
|
th.Store.EXPECT().GetCardLimitTimestamp().Return(int64(1), nil)
|
||||||
th.Store.EXPECT().GetBlocksWithParentAndType("board_id", "parent_id", "view").Return([]*model.Block{}, nil)
|
th.Store.EXPECT().GetBlocks(opts).Return([]*model.Block{}, nil)
|
||||||
|
|
||||||
withinLimits, err := th.App.isWithinViewsLimit("board_id", &model.Block{ParentID: "parent_id"})
|
withinLimits, err := th.App.isWithinViewsLimit("board_id", &model.Block{ParentID: "parent_id"})
|
||||||
assert.NoError(t, err)
|
assert.NoError(t, err)
|
||||||
@@ -333,10 +361,17 @@ func TestInsertBlocks(t *testing.T) {
|
|||||||
Views: mm_model.NewInt(2),
|
Views: mm_model.NewInt(2),
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
opts := model.QueryBlocksOptions{
|
||||||
|
BoardID: "test-board-id",
|
||||||
|
ParentID: "parent_id",
|
||||||
|
BlockType: model.BlockType("view"),
|
||||||
|
}
|
||||||
|
|
||||||
th.Store.EXPECT().GetCloudLimits().Return(cloudLimit, nil)
|
th.Store.EXPECT().GetCloudLimits().Return(cloudLimit, nil)
|
||||||
th.Store.EXPECT().GetUsedCardsCount().Return(1, nil)
|
th.Store.EXPECT().GetUsedCardsCount().Return(1, nil)
|
||||||
th.Store.EXPECT().GetCardLimitTimestamp().Return(int64(1), nil)
|
th.Store.EXPECT().GetCardLimitTimestamp().Return(int64(1), nil)
|
||||||
th.Store.EXPECT().GetBlocksWithParentAndType("test-board-id", "parent_id", "view").Return([]*model.Block{{}}, nil)
|
th.Store.EXPECT().GetBlocks(opts).Return([]*model.Block{{}}, nil)
|
||||||
|
|
||||||
_, err := th.App.InsertBlocks([]*model.Block{block}, "user-id-1")
|
_, err := th.App.InsertBlocks([]*model.Block{block}, "user-id-1")
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
@@ -365,10 +400,17 @@ func TestInsertBlocks(t *testing.T) {
|
|||||||
Views: mm_model.NewInt(2),
|
Views: mm_model.NewInt(2),
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
opts := model.QueryBlocksOptions{
|
||||||
|
BoardID: "test-board-id",
|
||||||
|
ParentID: "parent_id",
|
||||||
|
BlockType: model.BlockType("view"),
|
||||||
|
}
|
||||||
|
|
||||||
th.Store.EXPECT().GetCloudLimits().Return(cloudLimit, nil)
|
th.Store.EXPECT().GetCloudLimits().Return(cloudLimit, nil)
|
||||||
th.Store.EXPECT().GetUsedCardsCount().Return(1, nil)
|
th.Store.EXPECT().GetUsedCardsCount().Return(1, nil)
|
||||||
th.Store.EXPECT().GetCardLimitTimestamp().Return(int64(1), nil)
|
th.Store.EXPECT().GetCardLimitTimestamp().Return(int64(1), nil)
|
||||||
th.Store.EXPECT().GetBlocksWithParentAndType("test-board-id", "parent_id", "view").Return([]*model.Block{{}, {}}, nil)
|
th.Store.EXPECT().GetBlocks(opts).Return([]*model.Block{{}, {}}, nil)
|
||||||
|
|
||||||
_, err := th.App.InsertBlocks([]*model.Block{block}, "user-id-1")
|
_, err := th.App.InsertBlocks([]*model.Block{block}, "user-id-1")
|
||||||
require.Error(t, err)
|
require.Error(t, err)
|
||||||
@@ -406,10 +448,17 @@ func TestInsertBlocks(t *testing.T) {
|
|||||||
Views: mm_model.NewInt(2),
|
Views: mm_model.NewInt(2),
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
opts := model.QueryBlocksOptions{
|
||||||
|
BoardID: "test-board-id",
|
||||||
|
ParentID: "parent_id",
|
||||||
|
BlockType: model.BlockType("view"),
|
||||||
|
}
|
||||||
|
|
||||||
th.Store.EXPECT().GetCloudLimits().Return(cloudLimit, nil).Times(2)
|
th.Store.EXPECT().GetCloudLimits().Return(cloudLimit, nil).Times(2)
|
||||||
th.Store.EXPECT().GetUsedCardsCount().Return(1, nil).Times(2)
|
th.Store.EXPECT().GetUsedCardsCount().Return(1, nil).Times(2)
|
||||||
th.Store.EXPECT().GetCardLimitTimestamp().Return(int64(1), nil).Times(2)
|
th.Store.EXPECT().GetCardLimitTimestamp().Return(int64(1), nil).Times(2)
|
||||||
th.Store.EXPECT().GetBlocksWithParentAndType("test-board-id", "parent_id", "view").Return([]*model.Block{{}}, nil).Times(2)
|
th.Store.EXPECT().GetBlocks(opts).Return([]*model.Block{{}}, nil).Times(2)
|
||||||
|
|
||||||
_, err := th.App.InsertBlocks([]*model.Block{view1, view2}, "user-id-1")
|
_, err := th.App.InsertBlocks([]*model.Block{view1, view2}, "user-id-1")
|
||||||
require.Error(t, err)
|
require.Error(t, err)
|
||||||
|
|||||||
@@ -7,11 +7,11 @@ import (
|
|||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
"github.com/mattermost/mattermost-server/v6/server/boards/model"
|
"github.com/mattermost/mattermost-server/server/v8/boards/model"
|
||||||
"github.com/mattermost/mattermost-server/v6/server/boards/services/notify"
|
"github.com/mattermost/mattermost-server/server/v8/boards/services/notify"
|
||||||
"github.com/mattermost/mattermost-server/v6/server/boards/utils"
|
"github.com/mattermost/mattermost-server/server/v8/boards/utils"
|
||||||
|
|
||||||
"github.com/mattermost/mattermost-server/v6/server/platform/shared/mlog"
|
"github.com/mattermost/mattermost-server/server/v8/platform/shared/mlog"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
|
|||||||
@@ -4,10 +4,10 @@
|
|||||||
package app
|
package app
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/mattermost/mattermost-server/v6/server/boards/model"
|
"github.com/mattermost/mattermost-server/server/v8/boards/model"
|
||||||
"github.com/mattermost/mattermost-server/v6/server/boards/services/notify"
|
"github.com/mattermost/mattermost-server/server/v8/boards/services/notify"
|
||||||
|
|
||||||
"github.com/mattermost/mattermost-server/v6/server/platform/shared/mlog"
|
"github.com/mattermost/mattermost-server/server/v8/platform/shared/mlog"
|
||||||
)
|
)
|
||||||
|
|
||||||
func (a *App) CreateBoardsAndBlocks(bab *model.BoardsAndBlocks, userID string, addMember bool) (*model.BoardsAndBlocks, error) {
|
func (a *App) CreateBoardsAndBlocks(bab *model.BoardsAndBlocks, userID string, addMember bool) (*model.BoardsAndBlocks, error) {
|
||||||
|
|||||||
@@ -6,14 +6,14 @@ package app
|
|||||||
import (
|
import (
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/mattermost/mattermost-server/v6/server/boards/utils"
|
"github.com/mattermost/mattermost-server/server/v8/boards/utils"
|
||||||
|
|
||||||
"github.com/stretchr/testify/assert"
|
"github.com/stretchr/testify/assert"
|
||||||
|
|
||||||
"github.com/stretchr/testify/mock"
|
"github.com/stretchr/testify/mock"
|
||||||
"github.com/stretchr/testify/require"
|
"github.com/stretchr/testify/require"
|
||||||
|
|
||||||
"github.com/mattermost/mattermost-server/v6/server/boards/model"
|
"github.com/mattermost/mattermost-server/server/v8/boards/model"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestAddMemberToBoard(t *testing.T) {
|
func TestAddMemberToBoard(t *testing.T) {
|
||||||
|
|||||||
@@ -6,8 +6,8 @@ package app
|
|||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
"github.com/mattermost/mattermost-server/v6/server/boards/model"
|
"github.com/mattermost/mattermost-server/server/v8/boards/model"
|
||||||
"github.com/mattermost/mattermost-server/v6/server/boards/utils"
|
"github.com/mattermost/mattermost-server/server/v8/boards/utils"
|
||||||
)
|
)
|
||||||
|
|
||||||
func (a *App) CreateCard(card *model.Card, boardID string, userID string, disableNotify bool) (*model.Card, error) {
|
func (a *App) CreateCard(card *model.Card, boardID string, userID string, disableNotify bool) (*model.Card, error) {
|
||||||
|
|||||||
@@ -12,8 +12,8 @@ import (
|
|||||||
"github.com/stretchr/testify/assert"
|
"github.com/stretchr/testify/assert"
|
||||||
"github.com/stretchr/testify/require"
|
"github.com/stretchr/testify/require"
|
||||||
|
|
||||||
"github.com/mattermost/mattermost-server/v6/server/boards/model"
|
"github.com/mattermost/mattermost-server/server/v8/boards/model"
|
||||||
"github.com/mattermost/mattermost-server/v6/server/boards/utils"
|
"github.com/mattermost/mattermost-server/server/v8/boards/utils"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestCreateCard(t *testing.T) {
|
func TestCreateCard(t *testing.T) {
|
||||||
|
|||||||
@@ -7,8 +7,8 @@ import (
|
|||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
"github.com/mattermost/mattermost-server/v6/server/boards/model"
|
"github.com/mattermost/mattermost-server/server/v8/boards/model"
|
||||||
"github.com/mattermost/mattermost-server/v6/server/boards/utils"
|
"github.com/mattermost/mattermost-server/server/v8/boards/utils"
|
||||||
)
|
)
|
||||||
|
|
||||||
var errCategoryNotFound = errors.New("category ID specified in input does not exist for user")
|
var errCategoryNotFound = errors.New("category ID specified in input does not exist for user")
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ import (
|
|||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
"github.com/mattermost/mattermost-server/v6/server/boards/model"
|
"github.com/mattermost/mattermost-server/server/v8/boards/model"
|
||||||
)
|
)
|
||||||
|
|
||||||
const defaultCategoryBoards = "Boards"
|
const defaultCategoryBoards = "Boards"
|
||||||
|
|||||||
@@ -6,11 +6,11 @@ package app
|
|||||||
import (
|
import (
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/mattermost/mattermost-server/v6/server/boards/utils"
|
"github.com/mattermost/mattermost-server/server/v8/boards/utils"
|
||||||
|
|
||||||
"github.com/stretchr/testify/assert"
|
"github.com/stretchr/testify/assert"
|
||||||
|
|
||||||
"github.com/mattermost/mattermost-server/v6/server/boards/model"
|
"github.com/mattermost/mattermost-server/server/v8/boards/model"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestGetUserCategoryBoards(t *testing.T) {
|
func TestGetUserCategoryBoards(t *testing.T) {
|
||||||
|
|||||||
@@ -8,8 +8,8 @@ import (
|
|||||||
|
|
||||||
"github.com/stretchr/testify/assert"
|
"github.com/stretchr/testify/assert"
|
||||||
|
|
||||||
"github.com/mattermost/mattermost-server/v6/server/boards/model"
|
"github.com/mattermost/mattermost-server/server/v8/boards/model"
|
||||||
"github.com/mattermost/mattermost-server/v6/server/boards/utils"
|
"github.com/mattermost/mattermost-server/server/v8/boards/utils"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestCreateCategory(t *testing.T) {
|
func TestCreateCategory(t *testing.T) {
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
package app
|
package app
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/mattermost/mattermost-server/v6/server/boards/model"
|
"github.com/mattermost/mattermost-server/server/v8/boards/model"
|
||||||
)
|
)
|
||||||
|
|
||||||
func (a *App) GetClientConfig() *model.ClientConfig {
|
func (a *App) GetClientConfig() *model.ClientConfig {
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ import (
|
|||||||
|
|
||||||
"github.com/stretchr/testify/require"
|
"github.com/stretchr/testify/require"
|
||||||
|
|
||||||
"github.com/mattermost/mattermost-server/v6/server/boards/services/config"
|
"github.com/mattermost/mattermost-server/server/v8/boards/services/config"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestGetClientConfig(t *testing.T) {
|
func TestGetClientConfig(t *testing.T) {
|
||||||
|
|||||||
@@ -7,12 +7,12 @@ import (
|
|||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
"github.com/mattermost/mattermost-server/v6/server/platform/shared/mlog"
|
"github.com/mattermost/mattermost-server/server/v8/platform/shared/mlog"
|
||||||
|
|
||||||
mm_model "github.com/mattermost/mattermost-server/v6/model"
|
mm_model "github.com/mattermost/mattermost-server/server/v8/model"
|
||||||
|
|
||||||
"github.com/mattermost/mattermost-server/v6/server/boards/model"
|
"github.com/mattermost/mattermost-server/server/v8/boards/model"
|
||||||
"github.com/mattermost/mattermost-server/v6/server/boards/utils"
|
"github.com/mattermost/mattermost-server/server/v8/boards/utils"
|
||||||
)
|
)
|
||||||
|
|
||||||
var ErrNilPluginAPI = errors.New("server not running in plugin mode")
|
var ErrNilPluginAPI = errors.New("server not running in plugin mode")
|
||||||
|
|||||||
@@ -12,10 +12,10 @@ import (
|
|||||||
"github.com/golang/mock/gomock"
|
"github.com/golang/mock/gomock"
|
||||||
"github.com/stretchr/testify/require"
|
"github.com/stretchr/testify/require"
|
||||||
|
|
||||||
mm_model "github.com/mattermost/mattermost-server/v6/model"
|
mm_model "github.com/mattermost/mattermost-server/server/v8/model"
|
||||||
|
|
||||||
"github.com/mattermost/mattermost-server/v6/server/boards/model"
|
"github.com/mattermost/mattermost-server/server/v8/boards/model"
|
||||||
mockservicesapi "github.com/mattermost/mattermost-server/v6/server/boards/model/mocks"
|
mockservicesapi "github.com/mattermost/mattermost-server/server/v8/boards/model/mocks"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestIsCloud(t *testing.T) {
|
func TestIsCloud(t *testing.T) {
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
package app
|
package app
|
||||||
|
|
||||||
import "github.com/mattermost/mattermost-server/v6/server/boards/model"
|
import "github.com/mattermost/mattermost-server/server/v8/boards/model"
|
||||||
|
|
||||||
func (a *App) GetBoardsForCompliance(opts model.QueryBoardsForComplianceOptions) ([]*model.Board, bool, error) {
|
func (a *App) GetBoardsForCompliance(opts model.QueryBoardsForComplianceOptions) ([]*model.Board, bool, error) {
|
||||||
return a.store.GetBoardsForCompliance(opts)
|
return a.store.GetBoardsForCompliance(opts)
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ import (
|
|||||||
|
|
||||||
"github.com/pkg/errors"
|
"github.com/pkg/errors"
|
||||||
|
|
||||||
"github.com/mattermost/mattermost-server/v6/server/boards/model"
|
"github.com/mattermost/mattermost-server/server/v8/boards/model"
|
||||||
)
|
)
|
||||||
|
|
||||||
func (a *App) MoveContentBlock(block *model.Block, dstBlock *model.Block, where string, userID string) error {
|
func (a *App) MoveContentBlock(block *model.Block, dstBlock *model.Block, where string, userID string) error {
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ import (
|
|||||||
"github.com/pkg/errors"
|
"github.com/pkg/errors"
|
||||||
"github.com/stretchr/testify/require"
|
"github.com/stretchr/testify/require"
|
||||||
|
|
||||||
"github.com/mattermost/mattermost-server/v6/server/boards/model"
|
"github.com/mattermost/mattermost-server/server/v8/boards/model"
|
||||||
)
|
)
|
||||||
|
|
||||||
type contentOrderMatcher struct {
|
type contentOrderMatcher struct {
|
||||||
|
|||||||
@@ -11,9 +11,9 @@ import (
|
|||||||
|
|
||||||
"github.com/wiggin77/merror"
|
"github.com/wiggin77/merror"
|
||||||
|
|
||||||
"github.com/mattermost/mattermost-server/v6/server/boards/model"
|
"github.com/mattermost/mattermost-server/server/v8/boards/model"
|
||||||
|
|
||||||
"github.com/mattermost/mattermost-server/v6/server/platform/shared/mlog"
|
"github.com/mattermost/mattermost-server/server/v8/platform/shared/mlog"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
@@ -86,7 +86,7 @@ func (a *App) writeArchiveBoard(zw *zip.Writer, board model.Board, opt model.Exp
|
|||||||
var files []string
|
var files []string
|
||||||
// write the board's blocks
|
// write the board's blocks
|
||||||
// TODO: paginate this
|
// TODO: paginate this
|
||||||
blocks, err := a.GetBlocksForBoard(board.ID)
|
blocks, err := a.GetBlocks(model.QueryBlocksOptions{BoardID: board.ID})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,12 +10,12 @@ import (
|
|||||||
"path/filepath"
|
"path/filepath"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
mm_model "github.com/mattermost/mattermost-server/v6/model"
|
mm_model "github.com/mattermost/mattermost-server/server/v8/model"
|
||||||
|
|
||||||
"github.com/mattermost/mattermost-server/v6/server/boards/model"
|
"github.com/mattermost/mattermost-server/server/v8/boards/model"
|
||||||
"github.com/mattermost/mattermost-server/v6/server/boards/utils"
|
"github.com/mattermost/mattermost-server/server/v8/boards/utils"
|
||||||
"github.com/mattermost/mattermost-server/v6/server/platform/shared/filestore"
|
"github.com/mattermost/mattermost-server/server/v8/platform/shared/filestore"
|
||||||
"github.com/mattermost/mattermost-server/v6/server/platform/shared/mlog"
|
"github.com/mattermost/mattermost-server/server/v8/platform/shared/mlog"
|
||||||
)
|
)
|
||||||
|
|
||||||
const emptyString = "empty"
|
const emptyString = "empty"
|
||||||
|
|||||||
@@ -15,10 +15,10 @@ import (
|
|||||||
"github.com/golang/mock/gomock"
|
"github.com/golang/mock/gomock"
|
||||||
"github.com/stretchr/testify/assert"
|
"github.com/stretchr/testify/assert"
|
||||||
|
|
||||||
mm_model "github.com/mattermost/mattermost-server/v6/model"
|
mm_model "github.com/mattermost/mattermost-server/server/v8/model"
|
||||||
"github.com/mattermost/mattermost-server/v6/plugin/plugintest/mock"
|
"github.com/mattermost/mattermost-server/server/v8/platform/shared/filestore"
|
||||||
"github.com/mattermost/mattermost-server/v6/server/platform/shared/filestore"
|
"github.com/mattermost/mattermost-server/server/v8/platform/shared/filestore/mocks"
|
||||||
"github.com/mattermost/mattermost-server/v6/server/platform/shared/filestore/mocks"
|
"github.com/mattermost/mattermost-server/server/v8/plugin/plugintest/mock"
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
|||||||
@@ -7,18 +7,18 @@ import (
|
|||||||
|
|
||||||
"github.com/golang/mock/gomock"
|
"github.com/golang/mock/gomock"
|
||||||
|
|
||||||
"github.com/mattermost/mattermost-server/v6/server/boards/auth"
|
"github.com/mattermost/mattermost-server/server/v8/boards/auth"
|
||||||
"github.com/mattermost/mattermost-server/v6/server/boards/services/config"
|
"github.com/mattermost/mattermost-server/server/v8/boards/services/config"
|
||||||
"github.com/mattermost/mattermost-server/v6/server/boards/services/metrics"
|
"github.com/mattermost/mattermost-server/server/v8/boards/services/metrics"
|
||||||
"github.com/mattermost/mattermost-server/v6/server/boards/services/permissions/mmpermissions"
|
"github.com/mattermost/mattermost-server/server/v8/boards/services/permissions/mmpermissions"
|
||||||
mmpermissionsMocks "github.com/mattermost/mattermost-server/v6/server/boards/services/permissions/mmpermissions/mocks"
|
mmpermissionsMocks "github.com/mattermost/mattermost-server/server/v8/boards/services/permissions/mmpermissions/mocks"
|
||||||
permissionsMocks "github.com/mattermost/mattermost-server/v6/server/boards/services/permissions/mocks"
|
permissionsMocks "github.com/mattermost/mattermost-server/server/v8/boards/services/permissions/mocks"
|
||||||
"github.com/mattermost/mattermost-server/v6/server/boards/services/store/mockstore"
|
"github.com/mattermost/mattermost-server/server/v8/boards/services/store/mockstore"
|
||||||
"github.com/mattermost/mattermost-server/v6/server/boards/services/webhook"
|
"github.com/mattermost/mattermost-server/server/v8/boards/services/webhook"
|
||||||
"github.com/mattermost/mattermost-server/v6/server/boards/ws"
|
"github.com/mattermost/mattermost-server/server/v8/boards/ws"
|
||||||
|
|
||||||
"github.com/mattermost/mattermost-server/v6/server/platform/shared/filestore/mocks"
|
"github.com/mattermost/mattermost-server/server/v8/platform/shared/filestore/mocks"
|
||||||
"github.com/mattermost/mattermost-server/v6/server/platform/shared/mlog"
|
"github.com/mattermost/mattermost-server/server/v8/platform/shared/mlog"
|
||||||
)
|
)
|
||||||
|
|
||||||
type TestHelper struct {
|
type TestHelper struct {
|
||||||
|
|||||||
@@ -16,10 +16,10 @@ import (
|
|||||||
|
|
||||||
"github.com/krolaw/zipstream"
|
"github.com/krolaw/zipstream"
|
||||||
|
|
||||||
"github.com/mattermost/mattermost-server/v6/server/boards/model"
|
"github.com/mattermost/mattermost-server/server/v8/boards/model"
|
||||||
"github.com/mattermost/mattermost-server/v6/server/boards/utils"
|
"github.com/mattermost/mattermost-server/server/v8/boards/utils"
|
||||||
|
|
||||||
"github.com/mattermost/mattermost-server/v6/server/platform/shared/mlog"
|
"github.com/mattermost/mattermost-server/server/v8/platform/shared/mlog"
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
|||||||
@@ -7,12 +7,12 @@ import (
|
|||||||
"bytes"
|
"bytes"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/mattermost/mattermost-server/v6/server/boards/utils"
|
"github.com/mattermost/mattermost-server/server/v8/boards/utils"
|
||||||
|
|
||||||
"github.com/golang/mock/gomock"
|
"github.com/golang/mock/gomock"
|
||||||
"github.com/stretchr/testify/require"
|
"github.com/stretchr/testify/require"
|
||||||
|
|
||||||
"github.com/mattermost/mattermost-server/v6/server/boards/model"
|
"github.com/mattermost/mattermost-server/server/v8/boards/model"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestApp_ImportArchive(t *testing.T) {
|
func TestApp_ImportArchive(t *testing.T) {
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ package app
|
|||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
|
||||||
"github.com/mattermost/mattermost-server/v6/server/platform/shared/mlog"
|
"github.com/mattermost/mattermost-server/server/v8/platform/shared/mlog"
|
||||||
)
|
)
|
||||||
|
|
||||||
// initialize is called when the App is first created.
|
// initialize is called when the App is first created.
|
||||||
|
|||||||
@@ -6,8 +6,8 @@ package app
|
|||||||
import (
|
import (
|
||||||
"github.com/pkg/errors"
|
"github.com/pkg/errors"
|
||||||
|
|
||||||
mm_model "github.com/mattermost/mattermost-server/v6/model"
|
"github.com/mattermost/mattermost-server/server/v8/boards/model"
|
||||||
"github.com/mattermost/mattermost-server/v6/server/boards/model"
|
mm_model "github.com/mattermost/mattermost-server/server/v8/model"
|
||||||
)
|
)
|
||||||
|
|
||||||
func (a *App) GetTeamBoardsInsights(userID string, teamID string, opts *mm_model.InsightsOpts) (*model.BoardInsightsList, error) {
|
func (a *App) GetTeamBoardsInsights(userID string, teamID string, opts *mm_model.InsightsOpts) (*model.BoardInsightsList, error) {
|
||||||
|
|||||||
@@ -8,8 +8,8 @@ import (
|
|||||||
|
|
||||||
"github.com/stretchr/testify/require"
|
"github.com/stretchr/testify/require"
|
||||||
|
|
||||||
mm_model "github.com/mattermost/mattermost-server/v6/model"
|
"github.com/mattermost/mattermost-server/server/v8/boards/model"
|
||||||
"github.com/mattermost/mattermost-server/v6/server/boards/model"
|
mm_model "github.com/mattermost/mattermost-server/server/v8/model"
|
||||||
)
|
)
|
||||||
|
|
||||||
var mockInsightsBoards = []*model.Board{
|
var mockInsightsBoards = []*model.Board{
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ package app
|
|||||||
import (
|
import (
|
||||||
"errors"
|
"errors"
|
||||||
|
|
||||||
"github.com/mattermost/mattermost-server/v6/server/boards/model"
|
"github.com/mattermost/mattermost-server/server/v8/boards/model"
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
|||||||
@@ -6,11 +6,11 @@ package app
|
|||||||
import (
|
import (
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/mattermost/mattermost-server/v6/server/boards/utils"
|
"github.com/mattermost/mattermost-server/server/v8/boards/utils"
|
||||||
|
|
||||||
"github.com/stretchr/testify/assert"
|
"github.com/stretchr/testify/assert"
|
||||||
|
|
||||||
"github.com/mattermost/mattermost-server/v6/server/boards/model"
|
"github.com/mattermost/mattermost-server/server/v8/boards/model"
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
package app
|
package app
|
||||||
|
|
||||||
import (
|
import (
|
||||||
mm_model "github.com/mattermost/mattermost-server/v6/model"
|
mm_model "github.com/mattermost/mattermost-server/server/v8/model"
|
||||||
)
|
)
|
||||||
|
|
||||||
func (a *App) HasPermissionToBoard(userID, boardID string, permission *mm_model.Permission) bool {
|
func (a *App) HasPermissionToBoard(userID, boardID string, permission *mm_model.Permission) bool {
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ package app
|
|||||||
import (
|
import (
|
||||||
"runtime"
|
"runtime"
|
||||||
|
|
||||||
"github.com/mattermost/mattermost-server/v6/server/boards/model"
|
"github.com/mattermost/mattermost-server/server/v8/boards/model"
|
||||||
)
|
)
|
||||||
|
|
||||||
type ServerMetadata struct {
|
type ServerMetadata struct {
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ import (
|
|||||||
"runtime"
|
"runtime"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/mattermost/mattermost-server/v6/server/boards/model"
|
"github.com/mattermost/mattermost-server/server/v8/boards/model"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestGetServerMetadata(t *testing.T) {
|
func TestGetServerMetadata(t *testing.T) {
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
package app
|
package app
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/mattermost/mattermost-server/v6/server/boards/model"
|
"github.com/mattermost/mattermost-server/server/v8/boards/model"
|
||||||
)
|
)
|
||||||
|
|
||||||
func (a *App) GetSharing(boardID string) (*model.Sharing, error) {
|
func (a *App) GetSharing(boardID string) (*model.Sharing, error) {
|
||||||
|
|||||||
@@ -10,8 +10,8 @@ import (
|
|||||||
"github.com/pkg/errors"
|
"github.com/pkg/errors"
|
||||||
"github.com/stretchr/testify/require"
|
"github.com/stretchr/testify/require"
|
||||||
|
|
||||||
"github.com/mattermost/mattermost-server/v6/server/boards/model"
|
"github.com/mattermost/mattermost-server/server/v8/boards/model"
|
||||||
"github.com/mattermost/mattermost-server/v6/server/boards/utils"
|
"github.com/mattermost/mattermost-server/server/v8/boards/utils"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestGetSharing(t *testing.T) {
|
func TestGetSharing(t *testing.T) {
|
||||||
|
|||||||
@@ -4,10 +4,10 @@
|
|||||||
package app
|
package app
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/mattermost/mattermost-server/v6/server/boards/model"
|
"github.com/mattermost/mattermost-server/server/v8/boards/model"
|
||||||
"github.com/mattermost/mattermost-server/v6/server/boards/utils"
|
"github.com/mattermost/mattermost-server/server/v8/boards/utils"
|
||||||
|
|
||||||
"github.com/mattermost/mattermost-server/v6/server/platform/shared/mlog"
|
"github.com/mattermost/mattermost-server/server/v8/platform/shared/mlog"
|
||||||
)
|
)
|
||||||
|
|
||||||
func (a *App) CreateSubscription(sub *model.Subscription) (*model.Subscription, error) {
|
func (a *App) CreateSubscription(sub *model.Subscription) (*model.Subscription, error) {
|
||||||
|
|||||||
@@ -4,10 +4,10 @@
|
|||||||
package app
|
package app
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/mattermost/mattermost-server/v6/server/boards/model"
|
"github.com/mattermost/mattermost-server/server/v8/boards/model"
|
||||||
"github.com/mattermost/mattermost-server/v6/server/boards/utils"
|
"github.com/mattermost/mattermost-server/server/v8/boards/utils"
|
||||||
|
|
||||||
"github.com/mattermost/mattermost-server/v6/server/platform/shared/mlog"
|
"github.com/mattermost/mattermost-server/server/v8/platform/shared/mlog"
|
||||||
)
|
)
|
||||||
|
|
||||||
func (a *App) GetRootTeam() (*model.Team, error) {
|
func (a *App) GetRootTeam() (*model.Team, error) {
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ import (
|
|||||||
"github.com/stretchr/testify/assert"
|
"github.com/stretchr/testify/assert"
|
||||||
"github.com/stretchr/testify/require"
|
"github.com/stretchr/testify/require"
|
||||||
|
|
||||||
"github.com/mattermost/mattermost-server/v6/server/boards/model"
|
"github.com/mattermost/mattermost-server/server/v8/boards/model"
|
||||||
)
|
)
|
||||||
|
|
||||||
var errInvalidTeam = errors.New("invalid team id")
|
var errInvalidTeam = errors.New("invalid team id")
|
||||||
|
|||||||
@@ -8,10 +8,10 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/mattermost/mattermost-server/v6/server/boards/assets"
|
"github.com/mattermost/mattermost-server/server/v8/boards/assets"
|
||||||
"github.com/mattermost/mattermost-server/v6/server/boards/model"
|
"github.com/mattermost/mattermost-server/server/v8/boards/model"
|
||||||
|
|
||||||
"github.com/mattermost/mattermost-server/v6/server/platform/shared/mlog"
|
"github.com/mattermost/mattermost-server/server/v8/platform/shared/mlog"
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
|||||||
@@ -9,10 +9,10 @@ import (
|
|||||||
"github.com/golang/mock/gomock"
|
"github.com/golang/mock/gomock"
|
||||||
"github.com/stretchr/testify/require"
|
"github.com/stretchr/testify/require"
|
||||||
|
|
||||||
"github.com/mattermost/mattermost-server/v6/server/boards/model"
|
"github.com/mattermost/mattermost-server/server/v8/boards/model"
|
||||||
"github.com/mattermost/mattermost-server/v6/server/boards/utils"
|
"github.com/mattermost/mattermost-server/server/v8/boards/utils"
|
||||||
|
|
||||||
"github.com/mattermost/mattermost-server/v6/plugin/plugintest/mock"
|
"github.com/mattermost/mattermost-server/server/v8/plugin/plugintest/mock"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestApp_initializeTemplates(t *testing.T) {
|
func TestApp_initializeTemplates(t *testing.T) {
|
||||||
|
|||||||
@@ -4,8 +4,8 @@
|
|||||||
package app
|
package app
|
||||||
|
|
||||||
import (
|
import (
|
||||||
mm_model "github.com/mattermost/mattermost-server/v6/model"
|
"github.com/mattermost/mattermost-server/server/v8/boards/model"
|
||||||
"github.com/mattermost/mattermost-server/v6/server/boards/model"
|
mm_model "github.com/mattermost/mattermost-server/server/v8/model"
|
||||||
)
|
)
|
||||||
|
|
||||||
func (a *App) GetTeamUsers(teamID string, asGuestID string) ([]*model.User, error) {
|
func (a *App) GetTeamUsers(teamID string, asGuestID string) ([]*model.User, error) {
|
||||||
|
|||||||
@@ -8,8 +8,8 @@ import (
|
|||||||
|
|
||||||
"github.com/stretchr/testify/assert"
|
"github.com/stretchr/testify/assert"
|
||||||
|
|
||||||
mm_model "github.com/mattermost/mattermost-server/v6/model"
|
"github.com/mattermost/mattermost-server/server/v8/boards/model"
|
||||||
"github.com/mattermost/mattermost-server/v6/server/boards/model"
|
mm_model "github.com/mattermost/mattermost-server/server/v8/model"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestSearchUsers(t *testing.T) {
|
func TestSearchUsers(t *testing.T) {
|
||||||
|
|||||||
@@ -7,11 +7,11 @@ package auth
|
|||||||
import (
|
import (
|
||||||
"github.com/pkg/errors"
|
"github.com/pkg/errors"
|
||||||
|
|
||||||
"github.com/mattermost/mattermost-server/v6/server/boards/model"
|
"github.com/mattermost/mattermost-server/server/v8/boards/model"
|
||||||
"github.com/mattermost/mattermost-server/v6/server/boards/services/config"
|
"github.com/mattermost/mattermost-server/server/v8/boards/services/config"
|
||||||
"github.com/mattermost/mattermost-server/v6/server/boards/services/permissions"
|
"github.com/mattermost/mattermost-server/server/v8/boards/services/permissions"
|
||||||
"github.com/mattermost/mattermost-server/v6/server/boards/services/store"
|
"github.com/mattermost/mattermost-server/server/v8/boards/services/store"
|
||||||
"github.com/mattermost/mattermost-server/v6/server/boards/utils"
|
"github.com/mattermost/mattermost-server/server/v8/boards/utils"
|
||||||
)
|
)
|
||||||
|
|
||||||
type AuthInterface interface {
|
type AuthInterface interface {
|
||||||
@@ -58,6 +58,10 @@ func (a *Auth) IsValidReadToken(boardID string, readToken string) (bool, error)
|
|||||||
return false, err
|
return false, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if !a.config.EnablePublicSharedBoards {
|
||||||
|
return false, errors.New("public shared boards disabled")
|
||||||
|
}
|
||||||
|
|
||||||
if sharing != nil && (sharing.ID == boardID && sharing.Enabled && sharing.Token == readToken) {
|
if sharing != nil && (sharing.ID == boardID && sharing.Enabled && sharing.Token == readToken) {
|
||||||
return true, nil
|
return true, nil
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,14 +10,14 @@ import (
|
|||||||
"github.com/pkg/errors"
|
"github.com/pkg/errors"
|
||||||
"github.com/stretchr/testify/require"
|
"github.com/stretchr/testify/require"
|
||||||
|
|
||||||
"github.com/mattermost/mattermost-server/v6/server/boards/model"
|
"github.com/mattermost/mattermost-server/server/v8/boards/model"
|
||||||
"github.com/mattermost/mattermost-server/v6/server/boards/services/config"
|
"github.com/mattermost/mattermost-server/server/v8/boards/services/config"
|
||||||
"github.com/mattermost/mattermost-server/v6/server/boards/services/permissions/localpermissions"
|
"github.com/mattermost/mattermost-server/server/v8/boards/services/permissions/localpermissions"
|
||||||
mockpermissions "github.com/mattermost/mattermost-server/v6/server/boards/services/permissions/mocks"
|
mockpermissions "github.com/mattermost/mattermost-server/server/v8/boards/services/permissions/mocks"
|
||||||
"github.com/mattermost/mattermost-server/v6/server/boards/services/store/mockstore"
|
"github.com/mattermost/mattermost-server/server/v8/boards/services/store/mockstore"
|
||||||
"github.com/mattermost/mattermost-server/v6/server/boards/utils"
|
"github.com/mattermost/mattermost-server/server/v8/boards/utils"
|
||||||
|
|
||||||
"github.com/mattermost/mattermost-server/v6/server/platform/shared/mlog"
|
"github.com/mattermost/mattermost-server/server/v8/platform/shared/mlog"
|
||||||
)
|
)
|
||||||
|
|
||||||
type TestHelper struct {
|
type TestHelper struct {
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
// See LICENSE.txt for license information.
|
// See LICENSE.txt for license information.
|
||||||
|
|
||||||
// Code generated by MockGen. DO NOT EDIT.
|
// Code generated by MockGen. DO NOT EDIT.
|
||||||
// Source: github.com/mattermost/mattermost-server/v6/server/boards/auth (interfaces: AuthInterface)
|
// Source: github.com/mattermost/mattermost-server/server/v8/boards/auth (interfaces: AuthInterface)
|
||||||
|
|
||||||
// Package mocks is a generated GoMock package.
|
// Package mocks is a generated GoMock package.
|
||||||
package mocks
|
package mocks
|
||||||
@@ -11,7 +11,7 @@ import (
|
|||||||
reflect "reflect"
|
reflect "reflect"
|
||||||
|
|
||||||
gomock "github.com/golang/mock/gomock"
|
gomock "github.com/golang/mock/gomock"
|
||||||
model "github.com/mattermost/mattermost-server/v6/server/boards/model"
|
model "github.com/mattermost/mattermost-server/server/v8/boards/model"
|
||||||
)
|
)
|
||||||
|
|
||||||
// MockAuthInterface is a mock of AuthInterface interface.
|
// MockAuthInterface is a mock of AuthInterface interface.
|
||||||
|
|||||||
@@ -12,10 +12,10 @@ import (
|
|||||||
"net/http"
|
"net/http"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/mattermost/mattermost-server/v6/server/boards/api"
|
"github.com/mattermost/mattermost-server/server/v8/boards/api"
|
||||||
"github.com/mattermost/mattermost-server/v6/server/boards/model"
|
"github.com/mattermost/mattermost-server/server/v8/boards/model"
|
||||||
|
|
||||||
mm_model "github.com/mattermost/mattermost-server/v6/model"
|
mm_model "github.com/mattermost/mattermost-server/server/v8/model"
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
|||||||
@@ -7,8 +7,8 @@ import (
|
|||||||
"testing"
|
"testing"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/mattermost/mattermost-server/v6/server/boards/model"
|
"github.com/mattermost/mattermost-server/server/v8/boards/model"
|
||||||
"github.com/mattermost/mattermost-server/v6/server/boards/utils"
|
"github.com/mattermost/mattermost-server/server/v8/boards/utils"
|
||||||
|
|
||||||
"github.com/stretchr/testify/require"
|
"github.com/stretchr/testify/require"
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -9,9 +9,9 @@ import (
|
|||||||
"testing"
|
"testing"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/mattermost/mattermost-server/v6/server/boards/client"
|
"github.com/mattermost/mattermost-server/server/v8/boards/client"
|
||||||
"github.com/mattermost/mattermost-server/v6/server/boards/model"
|
"github.com/mattermost/mattermost-server/server/v8/boards/model"
|
||||||
"github.com/mattermost/mattermost-server/v6/server/boards/utils"
|
"github.com/mattermost/mattermost-server/server/v8/boards/utils"
|
||||||
|
|
||||||
"github.com/stretchr/testify/require"
|
"github.com/stretchr/testify/require"
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ package integrationtests
|
|||||||
import (
|
import (
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/mattermost/mattermost-server/v6/server/boards/model"
|
"github.com/mattermost/mattermost-server/server/v8/boards/model"
|
||||||
|
|
||||||
"github.com/stretchr/testify/require"
|
"github.com/stretchr/testify/require"
|
||||||
)
|
)
|
||||||
@@ -133,7 +133,7 @@ func TestCreateBoardsAndBlocks(t *testing.T) {
|
|||||||
require.Equal(t, "public board", board1.Title)
|
require.Equal(t, "public board", board1.Title)
|
||||||
require.Equal(t, model.BoardTypeOpen, board1.Type)
|
require.Equal(t, model.BoardTypeOpen, board1.Type)
|
||||||
require.NotEqual(t, "board-id-1", board1.ID)
|
require.NotEqual(t, "board-id-1", board1.ID)
|
||||||
blocks1, err := th.Server.App().GetBlocksForBoard(board1.ID)
|
blocks1, err := th.Server.App().GetBlocks(model.QueryBlocksOptions{BoardID: board1.ID})
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
require.Len(t, blocks1, 1)
|
require.Len(t, blocks1, 1)
|
||||||
require.Equal(t, "block 1", blocks1[0].Title)
|
require.Equal(t, "block 1", blocks1[0].Title)
|
||||||
@@ -147,7 +147,7 @@ func TestCreateBoardsAndBlocks(t *testing.T) {
|
|||||||
require.Equal(t, "private board", board2.Title)
|
require.Equal(t, "private board", board2.Title)
|
||||||
require.Equal(t, model.BoardTypePrivate, board2.Type)
|
require.Equal(t, model.BoardTypePrivate, board2.Type)
|
||||||
require.NotEqual(t, "board-id-2", board2.ID)
|
require.NotEqual(t, "board-id-2", board2.ID)
|
||||||
blocks2, err := th.Server.App().GetBlocksForBoard(board2.ID)
|
blocks2, err := th.Server.App().GetBlocks(model.QueryBlocksOptions{BoardID: board2.ID})
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
require.Len(t, blocks2, 1)
|
require.Len(t, blocks2, 1)
|
||||||
require.Equal(t, "block 2", blocks2[0].Title)
|
require.Equal(t, "block 2", blocks2[0].Title)
|
||||||
|
|||||||
@@ -11,10 +11,10 @@ import (
|
|||||||
|
|
||||||
"github.com/stretchr/testify/assert"
|
"github.com/stretchr/testify/assert"
|
||||||
|
|
||||||
"github.com/mattermost/mattermost-server/v6/server/boards/server"
|
"github.com/mattermost/mattermost-server/server/v8/boards/server"
|
||||||
|
|
||||||
"github.com/mattermost/mattermost-server/v6/model"
|
"github.com/mattermost/mattermost-server/server/v8/model"
|
||||||
"github.com/mattermost/mattermost-server/v6/server/platform/shared/mlog"
|
"github.com/mattermost/mattermost-server/server/v8/platform/shared/mlog"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestSetConfiguration(t *testing.T) {
|
func TestSetConfiguration(t *testing.T) {
|
||||||
|
|||||||
@@ -11,8 +11,8 @@ import (
|
|||||||
"github.com/stretchr/testify/assert"
|
"github.com/stretchr/testify/assert"
|
||||||
"github.com/stretchr/testify/require"
|
"github.com/stretchr/testify/require"
|
||||||
|
|
||||||
"github.com/mattermost/mattermost-server/v6/server/boards/model"
|
"github.com/mattermost/mattermost-server/server/v8/boards/model"
|
||||||
"github.com/mattermost/mattermost-server/v6/server/boards/utils"
|
"github.com/mattermost/mattermost-server/server/v8/boards/utils"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestCreateCard(t *testing.T) {
|
func TestCreateCard(t *testing.T) {
|
||||||
|
|||||||
Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше
Ссылка в новой задаче
Block a user