* removed server side

* Updated store layer

* unused import

* Updated autogenerated code template

* Updated tests

* lint fix

* unused translations

* webapp side

* Updated i18n

* lint fix:

* type fix

* Updated snapshots

* Removed insights from API specs

* updated e2e

* Updated e2e tests

* Updated e2e tests

* Removed insights tests

* Removed Insights as possible channel to load in sidebar from test

* Removed more insights tests

* More e2e fixed

* More cleanup

* Lint

* More cleanup in client4 and boards api

* More cleanup

* Fixes

* lint fix

---------

Co-authored-by: maria.nunez <maria.nunez@mattermost.com>
Co-authored-by: Mattermost Build <build@mattermost.com>
Этот коммит содержится в:
Harshil Sharma
2023-07-25 12:34:38 +05:30
коммит произвёл GitHub
родитель e37459cd00
Коммит 26617fcbdc
192 изменённых файлов: 47 добавлений и 19885 удалений

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

@@ -27,7 +27,6 @@ services:
MM_SERVICESETTINGS_ENABLEONBOARDINGFLOW: "false"
MM_FEATUREFLAGS_ONBOARDINGTOURTIPS: "false"
MM_SERVICEENVIRONMENT: "test"
MM_FEATUREFLAGS_INSIGHTSENABLED: "true"
volumes:
- "server-config:/mattermost/config"
ports:

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

@@ -76,9 +76,6 @@ describe('Verify Accessibility Support in Channel Sidebar Navigation', () => {
cy.findByRole('button', {name: 'Find Channels'}).should('be.focused');
cy.focused().tab();
// * Verify if Insights has focus
cy.focused().should('have.text', 'Insights').tab();
// * Verify if focus changes to different channels in Unread section
cy.get('.SidebarChannel.unread').each((el) => {
cy.wrap(el).find('.unread-title').should('be.focused');
@@ -99,7 +96,7 @@ describe('Verify Accessibility Support in Channel Sidebar Navigation', () => {
it('MM-T1473 Verify Tab Support in Unreads section', () => {
// # Press tab from the Main Menu button
cy.uiGetLHSAddChannelButton().focus().tab().tab().tab();
cy.uiGetLHSAddChannelButton().focus().tab().tab();
// * Verify if focus changes to different channels in Unread section
cy.get('.SidebarChannel.unread').each((el) => {
@@ -114,7 +111,7 @@ describe('Verify Accessibility Support in Channel Sidebar Navigation', () => {
markAsFavorite(testChannel.name);
// # Press tab from the add channel button down to all unread channels
cy.uiGetLHSAddChannelButton().focus().tab().tab().tab();
cy.uiGetLHSAddChannelButton().focus().tab().tab();
cy.get('.SidebarChannel.unread').each(() => {
cy.focused().tab().tab();
});

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

@@ -1,48 +0,0 @@
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
// ***************************************************************
// - [#] indicates a test step (e.g. # Go to a page)
// - [*] indicates an assertion (e.g. * Check the title)
// - Use element ID when selecting an element. Create one if none.
// ***************************************************************
// Stage: @prod
describe('Insights', () => {
let teamA;
before(() => {
cy.shouldHaveFeatureFlag('InsightsEnabled', true);
cy.apiInitSetup().then(({team}) => {
teamA = team;
});
});
it('Check all the cards exist', () => {
cy.apiAdminLogin();
// # Go to the Insights view
cy.visit(`/${teamA.name}/activity-and-insights`);
// * Check top channels exists
cy.get('.top-channels-card').should('exist');
// * Check top threads exists
cy.get('.top-threads-card').should('exist');
// * Check top boards exists because product mode is enabled
cy.get('.top-boards-card').should('exist');
// * Check top reactions exists
cy.get('.top-reactions-card').should('exist');
// * Check top dms exists
cy.get('.top-dms-card').should('exist');
// * Check least active channels exists
cy.get('.least-active-channels-card').should('exist');
// * Check top playbooks exists because product mode is enabled
cy.get('.top-playbooks-card').should('exist');
});
});

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

@@ -1,79 +0,0 @@
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
// ***************************************************************
// - [#] indicates a test step (e.g. # Go to a page)
// - [*] indicates an assertion (e.g. * Check the title)
// - Use element ID when selecting an element. Create one if none.
// ***************************************************************
// Stage: @prod
import * as TIMEOUTS from '../../../fixtures/timeouts';
describe('Insights as last viewed channel', () => {
let userA; // Member of team A and B
let teamA;
let teamB;
let offTopicUrlA;
let testChannel;
before(() => {
cy.shouldHaveFeatureFlag('InsightsEnabled', true);
cy.apiInitSetup().then(({team, user, offTopicUrl: url}) => {
userA = user;
teamA = team;
offTopicUrlA = url;
cy.apiCreateUser().then(() => {
return cy.apiCreateTeam('team', 'Team');
}).then(({team: otherTeam}) => {
teamB = otherTeam;
return cy.apiAddUserToTeam(teamB.id, userA.id);
}).then(() => {
return cy.apiCreateChannel(teamA.id, 'test', 'Test');
}).then(({channel}) => {
testChannel = channel;
return cy.apiAddUserToChannel(testChannel.id, userA.id);
});
});
});
beforeEach(() => {
// # Log in to Team A with an account that has joined multiple teams.
cy.apiLogin(userA);
// # On an account on two teams, view Team A
cy.visit(offTopicUrlA);
});
it('MM-T4902_1 Should go to insights view when switching a team if that was the last view on that team', () => {
// # Go to the Insights view on Team A
cy.uiGetSidebarInsightsButton().click().wait(TIMEOUTS.FIVE_SEC);
// # Switch to Team B
cy.get(`#${teamB.name}TeamButton`, {timeout: TIMEOUTS.ONE_MIN}).should('be.visible').click();
// * Verify team display name changes correctly.
cy.uiGetLHSHeader().findByText(teamB.display_name);
// # Switch back to Team A
cy.get(`#${teamA.name}TeamButton`, {timeout: TIMEOUTS.ONE_MIN}).should('be.visible').click();
// * Verify url is set up for insights view
cy.url().should('include', `${teamA.name}/activity-and-insights`);
});
it('MM-T4902_2 Should go to insights view when insights view is the penultimate view and leave the current channel', () => {
// # Go to the Insights view on Team A
cy.uiGetSidebarInsightsButton().click().wait(TIMEOUTS.FIVE_SEC);
// # Switch to Test Channel
cy.uiClickSidebarItem(testChannel.name);
// # Leave the current channel
cy.uiLeaveChannel();
// * Verify url is set up for insights view when insights view is the penultimate view
cy.url().should('include', `${teamA.name}/activity-and-insights`);
});
});

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

@@ -20,8 +20,6 @@ describe('Keyboard Shortcuts', () => {
let testTeam;
let publicChannel;
let privateChannel;
const insights = 'Insights';
const insightsSidebar = {name: insights};
before(() => {
cy.apiGetMe().then(({user: adminUser}) => {
@@ -63,11 +61,8 @@ describe('Keyboard Shortcuts', () => {
verifyChannelSwitch(testTeam.name, offTopic, privateChannel, '{uparrow}');
verifyChannelSwitch(testTeam.name, publicChannel, offTopic, '{uparrow}');
// * Should switch to Insights
verifyChannelSwitch(testTeam.name, insightsSidebar, publicChannel, '{uparrow}');
// * Should switch to bottom of channel list when current channel is at the very top
verifyChannelSwitch(testTeam.name, dmWithSysadmin, insightsSidebar, '{uparrow}');
verifyChannelSwitch(testTeam.name, dmWithSysadmin, publicChannel, '{uparrow}');
});
it('MM-T1230 Alt/Option + Down', () => {
@@ -81,10 +76,6 @@ describe('Keyboard Shortcuts', () => {
verifyChannelSwitch(testTeam.name, privateChannel, offTopic, '{downarrow}');
verifyChannelSwitch(testTeam.name, townSquare, privateChannel, '{downarrow}');
verifyChannelSwitch(testTeam.name, dmWithSysadmin, townSquare, '{downarrow}');
// * Should switch to top (Insights) when current channel is at the very bottom
verifyChannelSwitch(testTeam.name, insightsSidebar, dmWithSysadmin, '{downarrow}');
verifyChannelSwitch(testTeam.name, publicChannel, insightsSidebar, '{downarrow}');
});
function verifyChannelSwitch(teamName, toChannel, fromChannel, arrowKey) {
@@ -94,8 +85,6 @@ describe('Keyboard Shortcuts', () => {
// * Verify that it redirects into expected URL
if (toChannel.type === 'D') {
cy.url().should('include', `/${teamName}/messages/@${toChannel.name}`);
} else if (toChannel.name === insights) {
cy.url().should('include', `/${teamName}/activity-and-insights`);
} else {
cy.url().should('include', `/${teamName}/channels/${toChannel.name}`);
}
@@ -109,21 +98,16 @@ describe('Keyboard Shortcuts', () => {
});
function verifyClass(channel, assertion) {
if (channel.type) {
let label;
if (channel.type === 'O') {
label = channel.display_name.toLowerCase() + ' public channel';
} else if (channel.type === 'P') {
label = channel.display_name.toLowerCase() + ' private channel';
} else if (channel.type === 'D') {
label = channel.display_name.toLowerCase();
}
cy.findByLabelText(label).parent().should(assertion, 'active');
} else {
// For Insights
cy.findByText(channel.name).parent().parent().parent().should(assertion, 'active');
let label;
if (channel.type === 'O') {
label = channel.display_name.toLowerCase() + ' public channel';
} else if (channel.type === 'P') {
label = channel.display_name.toLowerCase() + ' private channel';
} else if (channel.type === 'D') {
label = channel.display_name.toLowerCase();
}
cy.findByLabelText(label).parent().should(assertion, 'active');
}
}
});

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

@@ -25,10 +25,6 @@ describe('Forward Message', () => {
const commentMessage = 'Comment for the forwarded message';
before(() => {
// # Testing Forwarding from Insights view requires a license
cy.apiRequireLicense();
cy.shouldHaveFeatureFlag('InsightsEnabled', true);
cy.apiUpdateConfig({
ServiceSettings: {
ThreadAutoFollow: true,

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

@@ -27,10 +27,6 @@ describe('Forward Message', () => {
const commentMessage = 'Comment for the forwarded message';
before(() => {
// # Testing Forwarding from Insights view requires a license
cy.apiRequireLicense();
cy.shouldHaveFeatureFlag('InsightsEnabled', true);
cy.apiUpdateConfig({
ServiceSettings: {
ThreadAutoFollow: true,

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

@@ -23,9 +23,7 @@ describe('Forward Message', () => {
const replyMessage = 'Forward this reply';
before(() => {
// # Testing Forwarding from Insights view requires a license
cy.apiRequireLicense();
cy.shouldHaveFeatureFlag('InsightsEnabled', true);
cy.apiUpdateConfig({
ServiceSettings: {

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

@@ -30,10 +30,6 @@ describe('Forward Message', () => {
const replyMessage = 'Forward this reply';
before(() => {
// # Testing Forwarding from Insights view requires a license
cy.apiRequireLicense();
cy.shouldHaveFeatureFlag('InsightsEnabled', true);
cy.apiUpdateConfig({
ServiceSettings: {
ThreadAutoFollow: true,
@@ -201,32 +197,6 @@ describe('Forward Message', () => {
verifyForwardedMessage({post: replyPost});
});
it('MM-T4934_5 Forward public channel post while viewing Insights', () => {
// # Open the RHS with replies to the root post
cy.uiClickPostDropdownMenu(testPost.id, 'Reply', 'CENTER');
// * Assert RHS is open
cy.get('#rhsContainer').should('be.visible');
// # Visit global threads
cy.uiClickSidebarItem('insights');
// # Click on ... button of reply post
cy.clickPostDotMenu(replyPost.id, 'RHS_COMMENT');
// * Assert availability of the Forward menu-item
cy.findByText('Forward').click();
// * Forward Post
forwardPost({channelId: privateChannel.id});
// * Assert switch to testchannel
cy.get('#channelHeaderTitle', {timeout: TIMEOUTS.HALF_MIN}).should('be.visible').should('contain', privateChannel.display_name);
// * Assert post has been forwarded
verifyForwardedMessage({post: replyPost});
});
it('MM-T4934_6 Forward public channel post to Private channel', () => {
// # Check if ... button is visible in last post right side
cy.get(`#CENTER_button_${testPost.id}`).should('not.be.visible');

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

@@ -426,12 +426,6 @@ Cypress.Commands.add('apiDisableTutorials', (userId) => {
name: 'actions_menu_tutorial_state',
value: '{"actions_menu_modal_viewed":true}',
},
{
user_id: userId,
category: 'insights',
name: 'insights_tutorial_state',
value: '{"insights_modal_viewed":true}',
},
{
user_id: userId,
category: 'drafts',

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

@@ -116,11 +116,6 @@ function uiGetSidebarThreadsButton(): ChainableT<JQuery> {
}
Cypress.Commands.add('uiGetSidebarThreadsButton', uiGetSidebarThreadsButton);
function uiGetSidebarInsightsButton(): ChainableT<JQuery> {
return cy.get('#sidebar-insights-button').should('be.visible');
}
Cypress.Commands.add('uiGetSidebarInsightsButton', uiGetSidebarInsightsButton);
Cypress.Commands.add('uiGetChannelSidebarMenu', (channelName, isChannelId = false) => {
cy.uiGetLHS().within(() => {
if (isChannelId) {
@@ -273,8 +268,6 @@ declare global {
uiGetSystemConsoleMenu: typeof uiGetSystemConsoleMenu;
uiGetSidebarThreadsButton: typeof uiGetSidebarThreadsButton;
uiGetSidebarInsightsButton: typeof uiGetSidebarInsightsButton;
}
}
}

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

@@ -672,7 +672,6 @@ const defaultServerConfig: AdminConfig = {
BoardsDataRetention: false,
NormalizeLdapDNs: false,
GraphQL: false,
InsightsEnabled: true,
CommandPalette: false,
SendWelcomePost: true,
PostPriority: true,