Remove insights (#23952)
* 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>
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
e37459cd00
Коммит
26617fcbdc
@@ -1,16 +0,0 @@
|
||||
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
|
||||
// See LICENSE.txt for license information.
|
||||
|
||||
import {GlobalState} from 'types/store';
|
||||
import {get} from 'mattermost-redux/selectors/entities/preferences';
|
||||
import {Preferences} from 'mattermost-redux/constants';
|
||||
import {getIsMobileView} from 'selectors/views/browser';
|
||||
|
||||
export function showInsightsPulsatingDot(state: GlobalState): boolean {
|
||||
if (getIsMobileView(state)) {
|
||||
return false;
|
||||
}
|
||||
const insightsTutorialState = get(state, Preferences.CATEGORY_INSIGHTS, Preferences.NAME_INSIGHTS_TUTORIAL_STATE, false);
|
||||
const modalAlreadyViewed = insightsTutorialState && JSON.parse(insightsTutorialState)[Preferences.INSIGHTS_VIEWED];
|
||||
return !modalAlreadyViewed;
|
||||
}
|
||||
@@ -11,7 +11,6 @@ jest.mock('selectors/drafts', () => ({
|
||||
}));
|
||||
|
||||
jest.mock('mattermost-redux/selectors/entities/preferences', () => ({
|
||||
insightsAreEnabled: jest.fn(),
|
||||
isCollapsedThreadsEnabled: jest.fn(),
|
||||
}));
|
||||
|
||||
@@ -55,28 +54,13 @@ describe('Selectors.Lhs', () => {
|
||||
});
|
||||
|
||||
it('handles nothing enabled', () => {
|
||||
jest.spyOn(PreferencesSelectors, 'insightsAreEnabled').mockImplementationOnce(() => false);
|
||||
jest.spyOn(PreferencesSelectors, 'isCollapsedThreadsEnabled').mockImplementationOnce(() => false);
|
||||
jest.spyOn(Lhs, 'getDraftsCount').mockImplementationOnce(() => 0);
|
||||
const items = Lhs.getVisibleStaticPages(state as GlobalState);
|
||||
expect(items).toEqual([]);
|
||||
});
|
||||
|
||||
it('handles insights', () => {
|
||||
jest.spyOn(PreferencesSelectors, 'insightsAreEnabled').mockImplementation(() => true);
|
||||
jest.spyOn(PreferencesSelectors, 'isCollapsedThreadsEnabled').mockImplementation(() => false);
|
||||
jest.spyOn(Lhs, 'getDraftsCount').mockImplementationOnce(() => 0);
|
||||
const items = Lhs.getVisibleStaticPages(state as GlobalState);
|
||||
expect(items).toEqual([
|
||||
{
|
||||
id: 'activity-and-insights',
|
||||
isVisible: true,
|
||||
},
|
||||
]);
|
||||
});
|
||||
|
||||
it('handles threads - default off', () => {
|
||||
jest.spyOn(PreferencesSelectors, 'insightsAreEnabled').mockImplementation(() => false);
|
||||
jest.spyOn(PreferencesSelectors, 'isCollapsedThreadsEnabled').mockImplementation(() => true);
|
||||
jest.spyOn(Lhs, 'getDraftsCount').mockImplementationOnce(() => 0);
|
||||
const items = Lhs.getVisibleStaticPages(state as GlobalState);
|
||||
@@ -89,7 +73,6 @@ describe('Selectors.Lhs', () => {
|
||||
});
|
||||
|
||||
it('should not return drafts when empty', () => {
|
||||
jest.spyOn(PreferencesSelectors, 'insightsAreEnabled').mockImplementation(() => false);
|
||||
jest.spyOn(PreferencesSelectors, 'isCollapsedThreadsEnabled').mockImplementation(() => false);
|
||||
jest.spyOn(Lhs, 'getDraftsCount').mockImplementationOnce(() => 0);
|
||||
const items = Lhs.getVisibleStaticPages(state as GlobalState);
|
||||
@@ -97,7 +80,6 @@ describe('Selectors.Lhs', () => {
|
||||
});
|
||||
|
||||
it('should return drafts when there are available', () => {
|
||||
jest.spyOn(PreferencesSelectors, 'insightsAreEnabled').mockImplementation(() => false);
|
||||
jest.spyOn(PreferencesSelectors, 'isCollapsedThreadsEnabled').mockImplementation(() => false);
|
||||
jest.spyOn(Lhs, 'getDraftsCount').mockImplementationOnce(() => 1);
|
||||
const items = Lhs.getVisibleStaticPages(state as GlobalState);
|
||||
|
||||
@@ -7,7 +7,6 @@ import {StaticPage} from 'types/store/lhs';
|
||||
import {createSelector} from 'mattermost-redux/selectors/create_selector';
|
||||
import {makeGetDraftsCount} from 'selectors/drafts';
|
||||
import {
|
||||
insightsAreEnabled,
|
||||
isCollapsedThreadsEnabled,
|
||||
} from 'mattermost-redux/selectors/entities/preferences';
|
||||
|
||||
@@ -23,19 +22,11 @@ export const getDraftsCount = makeGetDraftsCount();
|
||||
|
||||
export const getVisibleStaticPages = createSelector(
|
||||
'getVisibleSidebarStaticPages',
|
||||
insightsAreEnabled,
|
||||
isCollapsedThreadsEnabled,
|
||||
getDraftsCount,
|
||||
(insightsEnabled, collapsedThreadsEnabled, draftsCount) => {
|
||||
(collapsedThreadsEnabled, draftsCount) => {
|
||||
const staticPages: StaticPage[] = [];
|
||||
|
||||
if (insightsEnabled) {
|
||||
staticPages.push({
|
||||
id: 'activity-and-insights',
|
||||
isVisible: true,
|
||||
});
|
||||
}
|
||||
|
||||
if (collapsedThreadsEnabled) {
|
||||
staticPages.push({
|
||||
id: 'threads',
|
||||
|
||||
Ссылка в новой задаче
Block a user