Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 0 additions & 24 deletions NOTICE.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6875,30 +6875,6 @@ Fake data generator for Go (Golang)



---

## inobounce

This product contains 'inobounce' by Larry Davis.

Stop your iOS webapp from bouncing around when scrolling

* HOMEPAGE:
* https://github.com/lazd/iNoBounce

* LICENSE: BSD-2-Clause

Copyright (c) 2013, Lawrence Davis
All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.


---

## ipaddr.js
Expand Down
3 changes: 3 additions & 0 deletions enterprise.pin
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Enterprise commit this server branch is tested against.
# Updated via: make bump-enterprise
b03e11ccf5dca59cc3ffd2ed8c73604c5a5a48b8
15 changes: 14 additions & 1 deletion server/Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.PHONY: build package run stop run-client run-server run-node run-haserver stop-haserver stop-client stop-server restart restart-server restart-client restart-haserver start-docker update-docker clean-dist clean nuke check-style check-client-style check-server-style check-unit-tests test dist run-client-tests setup-run-client-tests cleanup-run-client-tests test-client build-linux build-osx build-freebsd build-windows package-prep package-linux package-osx package-windows internal-test-web-client vet run-server-for-web-client-tests diff-config prepackaged-plugins prepackaged-binaries test-server test-server-ee test-server-elasticsearch test-server-quick test-server-race test-mmctl-unit test-mmctl-e2e test-mmctl test-mmctl-coverage mmctl-build mmctl-docs new-migration migrations-extract test-public mocks-public run-server-faketime
.PHONY: all build package run stop run-client run-server run-node run-haserver stop-haserver stop-client stop-server restart restart-server restart-client restart-haserver start-docker update-docker clean-dist clean nuke check-style check-client-style check-server-style check-unit-tests test dist run-client-tests setup-run-client-tests cleanup-run-client-tests test-client build-linux build-osx build-freebsd build-windows package-prep package-linux package-osx package-windows internal-test-web-client vet run-server-for-web-client-tests diff-config prepackaged-plugins prepackaged-binaries test-server test-server-ee test-server-elasticsearch test-server-quick test-server-race test-mmctl-unit test-mmctl-e2e test-mmctl test-mmctl-coverage mmctl-build mmctl-docs new-migration migrations-extract test-public mocks-public run-server-faketime bump-enterprise

ROOT := $(dir $(abspath $(lastword $(MAKEFILE_LIST))))

Expand Down Expand Up @@ -431,6 +431,19 @@ ifneq ($(SKIP_SETUP_GO_WORK),true)
fi
endif

bump-enterprise: ## Update enterprise.pin to the current enterprise HEAD
@if [ ! -d "$(BUILD_ENTERPRISE_DIR)" ]; then \
echo "Enterprise directory not found at $(BUILD_ENTERPRISE_DIR)"; \
exit 1; \
fi
@set -e; \
SHA=$$(cd "$(BUILD_ENTERPRISE_DIR)" && git rev-parse HEAD); \
PIN_FILE="$(ROOT)/../enterprise.pin"; \
echo "# Enterprise commit this server branch is tested against." > "$$PIN_FILE"; \
echo "# Updated via: make bump-enterprise" >> "$$PIN_FILE"; \
echo "$$SHA" >> "$$PIN_FILE"; \
echo "Updated enterprise.pin to $$SHA"

check-style: plugin-checker vet golangci-lint ## Runs style/lint checks

gotestsum:
Expand Down
1 change: 1 addition & 0 deletions webapp/channels/jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ const config = {
'^@mattermost/(components)$': '<rootDir>/../platform/$1/src',
'^@mattermost/(client)$': '<rootDir>/../platform/$1/src',
'^@mattermost/(types)/(.*)$': '<rootDir>/../platform/$1/src/$2',
'^@mattermost/shared/(.*)$': '<rootDir>/../platform/shared/src/$1',
'^mattermost-redux/test/(.*)$':
'<rootDir>/src/packages/mattermost-redux/test/$1',
'^mattermost-redux/(.*)$': '<rootDir>/src/packages/mattermost-redux/src/$1',
Expand Down
1 change: 0 additions & 1 deletion webapp/channels/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@
"history": "4.10.1",
"hoist-non-react-statics": "3.3.2",
"html-to-react": "1.6.0",
"inobounce": "0.2.1",
"ipaddr.js": "2.1.0",
"katex": "0.16.21",
"localforage": "1.10.0",
Expand Down
15 changes: 9 additions & 6 deletions webapp/channels/src/actions/command.test.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.

import * as UserAgent from '@mattermost/shared/utils/user_agent';

import {Client4} from 'mattermost-redux/client';
import {Permissions} from 'mattermost-redux/constants';
import {AppCallResponseTypes} from 'mattermost-redux/constants/apps';
Expand All @@ -13,7 +15,6 @@ import UserSettingsModal from 'components/user_settings/modal';

import mockStore from 'tests/test_store';
import {ActionTypes, Constants, ModalIdentifiers} from 'utils/constants';
import * as UserAgent from 'utils/user_agent';
import * as Utils from 'utils/utils';

import {executeCommand} from './command';
Expand Down Expand Up @@ -132,7 +133,11 @@ const initialState = {
},
};

jest.mock('utils/user_agent');
const isMobileMock = jest.mocked(UserAgent.isMobile);
jest.mock('@mattermost/shared/utils/user_agent', () => ({
isDesktopApp: jest.fn(),
isMobile: jest.fn(),
}));
jest.mock('actions/global_actions');

describe('executeCommand', () => {
Expand All @@ -159,10 +164,8 @@ describe('executeCommand', () => {
});

describe('shortcuts', () => {
UserAgent.isMobile = jest.fn();

test('should return error in case of mobile', async () => {
UserAgent.isMobile.mockReturnValueOnce(true);
isMobileMock.mockReturnValueOnce(true);

const result = await store.dispatch(executeCommand('/shortcuts', []));

Expand All @@ -174,7 +177,7 @@ describe('executeCommand', () => {
});

test('should open shortcut modal in case of no mobile', async () => {
UserAgent.isMobile.mockReturnValueOnce(false);
isMobileMock.mockReturnValueOnce(false);

const result = await store.dispatch(executeCommand('/shortcuts', []));

Expand Down
2 changes: 1 addition & 1 deletion webapp/channels/src/actions/command.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.

import * as UserAgent from '@mattermost/shared/utils/user_agent';
import type {AppCallResponse} from '@mattermost/types/apps';
import type {CommandArgs, CommandResponse} from '@mattermost/types/integrations';

Expand Down Expand Up @@ -31,7 +32,6 @@ import {getHistory} from 'utils/browser_history';
import {Constants, ModalIdentifiers} from 'utils/constants';
import {getIntl} from 'utils/i18n';
import {isUrlSafe, getSiteURL} from 'utils/url';
import * as UserAgent from 'utils/user_agent';
import {getUserIdFromChannelName} from 'utils/utils';

import type {ActionFuncAsync} from 'types/store';
Expand Down
4 changes: 2 additions & 2 deletions webapp/channels/src/actions/notification_actions.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.

import {isDesktopApp, isMobile} from '@mattermost/shared/utils/user_agent';
import type {Channel, ChannelMembership} from '@mattermost/types/channels';
import type {ServerError} from '@mattermost/types/errors';
import {isMessageAttachmentArray} from '@mattermost/types/message_attachments';
Expand Down Expand Up @@ -33,7 +34,6 @@ import {DesktopNotificationSounds, ding} from 'utils/notification_sounds';
import {showNotification} from 'utils/notifications';
import {getFocusedPopoutInfo} from 'utils/popouts/focus';
import {cjkrPattern} from 'utils/text_formatting';
import {isDesktopApp, isMobileApp} from 'utils/user_agent';
import * as Utils from 'utils/utils';

import type {ActionFuncAsync, GlobalState} from 'types/store';
Expand Down Expand Up @@ -166,7 +166,7 @@ export function sendDesktopNotification(post: Post, msgProps: NewPostMessageProp
const result = dispatch(notifyMe(argsAfterHooks.title, argsAfterHooks.body, channel.id, teamId, argsAfterHooks.silent, argsAfterHooks.soundName, argsAfterHooks.url));

//Don't add extra sounds on native desktop clients
if (desktopSoundEnabled && !isDesktopApp() && !isMobileApp()) {
if (desktopSoundEnabled && !isDesktopApp() && !isMobile()) {
ding(soundName);
}

Expand Down
3 changes: 1 addition & 2 deletions webapp/channels/src/actions/post_actions.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,7 @@ jest.mock('actions/storage', () => {
};
});

jest.mock('utils/user_agent', () => ({
isIosClassic: jest.fn().mockReturnValueOnce(true).mockReturnValue(false),
jest.mock('@mattermost/shared/utils/user_agent', () => ({
isDesktopApp: jest.fn().mockReturnValue(false),
}));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import React, {useState, useEffect} from 'react';
import {Modal} from 'react-bootstrap';
import {FormattedMessage, useIntl} from 'react-intl';

import {getDesktopVersion, isDesktopApp} from '@mattermost/shared/utils/user_agent';
import type {ClientConfig, ClientLicense} from '@mattermost/types/config';

import {Client4} from 'mattermost-redux/client';
Expand All @@ -16,7 +17,6 @@ import MattermostLogo from 'components/widgets/icons/mattermost_logo';

import {AboutLinks} from 'utils/constants';
import {getSkuDisplayName} from 'utils/subscription';
import {getDesktopVersion, isDesktopApp} from 'utils/user_agent';

import AboutBuildModalCloud from './about_build_modal_cloud/about_build_modal_cloud';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@ import UnifiedLabelsWrapper from './unified_labels_wrapper';
import useBurnOnRead from './use_burn_on_read';
import useEditorEmojiPicker from './use_editor_emoji_picker';
import useKeyHandler from './use_key_handler';
import useOrientationHandler from './use_orientation_handler';
import usePluginItems from './use_plugin_items';
import usePriority from './use_priority';
import useRewrite from './use_rewrite';
Expand Down Expand Up @@ -312,7 +311,6 @@ const AdvancedTextEditor = ({
}]));
}, [dispatch, currentUserId, getFormattingBarPreferenceName, isFormattingBarHidden]);

useOrientationHandler(textboxRef, rootId);
const pluginItems = usePluginItems(draft, textboxRef, handleDraftChange, channelId);
const focusTextbox = useTextboxFocus(textboxRef, channelId, isRHS, canPost);
const {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ import React from 'react';
import {FormattedMessage} from 'react-intl';
import {useDispatch, useSelector} from 'react-redux';

import {isMac} from '@mattermost/shared/utils/user_agent';

import {unsetEditingPost} from 'actions/post_actions';
import {isSendOnCtrlEnter} from 'selectors/preferences';

import {isMac} from 'utils/user_agent';

type Props = {
onSave: () => void;
onCancel?: () => void;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import type React from 'react';
import {useCallback, useEffect, useRef} from 'react';
import {useDispatch, useSelector} from 'react-redux';

import * as UserAgent from '@mattermost/shared/utils/user_agent';
import type {SchedulingInfo} from '@mattermost/types/schedule_post';

import {getBool} from 'mattermost-redux/selectors/entities/preferences';
Expand All @@ -22,7 +23,6 @@ import * as Keyboard from 'utils/keyboard';
import {type ApplyMarkdownOptions} from 'utils/markdown/apply_markdown';
import {pasteHandler} from 'utils/paste';
import {isWithinCodeBlock, postMessageOnKeyPress} from 'utils/post_utils';
import * as UserAgent from 'utils/user_agent';
import * as Utils from 'utils/utils';

import type {GlobalState} from 'types/store';
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ import type React from 'react';
import {useCallback, useEffect, useRef} from 'react';
import {useDispatch, useSelector} from 'react-redux';

import * as UserAgent from '@mattermost/shared/utils/user_agent';

import {focusedRHS} from 'actions/views/rhs';
import {getIsRhsExpanded, getIsRhsOpen} from 'selectors/rhs';
import {getShouldFocusRHS} from 'selectors/views/rhs';
Expand All @@ -13,7 +15,6 @@ import useDidUpdate from 'components/common/hooks/useDidUpdate';
import type TextboxClass from 'components/textbox/textbox';

import {shouldFocusMainTextbox} from 'utils/post_utils';
import * as UserAgent from 'utils/user_agent';

const useTextboxFocus = (
textboxRef: React.RefObject<TextboxClass>,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
import React from 'react';
import {useSelector} from 'react-redux';

import * as UserAgent from '@mattermost/shared/utils/user_agent';

import {getCloudSubscription} from 'mattermost-redux/selectors/entities/cloud';
import {getCurrentUserId} from 'mattermost-redux/selectors/entities/users';

Expand All @@ -17,7 +19,6 @@ import {
NotificationPermissionNeverGranted,
getNotificationPermission,
} from 'utils/notifications';
import * as UserAgent from 'utils/user_agent';

export default function NotificationPermissionBar() {
const isLoggedIn = Boolean(useSelector(getCurrentUserId));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import React, {useEffect} from 'react';
import {useDispatch, useSelector} from 'react-redux';
import {useParams} from 'react-router-dom';

import {isDesktopApp} from '@mattermost/shared/utils/user_agent';
import type {ChannelType} from '@mattermost/types/channels';

import {fetchMyCategories} from 'mattermost-redux/actions/channel_categories';
Expand All @@ -25,7 +26,6 @@ import UnreadsStatusHandler from 'components/unreads_status_handler';
import Constants from 'utils/constants';
import usePopoutFocus from 'utils/popouts/use_popout_focus';
import usePopoutTitle from 'utils/popouts/use_popout_title';
import {isDesktopApp} from 'utils/user_agent';

import './channel_popout.scss';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@

import {useCallback, useEffect, useState} from 'react';

import {isDesktopApp} from '@mattermost/shared/utils/user_agent';

import type {NotificationPermissionNeverGranted} from 'utils/notifications';
import {isNotificationAPISupported} from 'utils/notifications';
import {isDesktopApp} from 'utils/user_agent';

export type DesktopNotificationPermission = Exclude<NotificationPermission, typeof NotificationPermissionNeverGranted> | undefined;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@ import {Modal} from 'react-bootstrap';
import {FormattedMessage, useIntl} from 'react-intl';
import {matchPath} from 'react-router-dom';

import * as UserAgent from '@mattermost/shared/utils/user_agent';
import type {Post} from '@mattermost/types/posts';

import type {ActionResult} from 'mattermost-redux/types/actions';

import SectionNotice from 'components/section_notice';

import {getHistory} from 'utils/browser_history';
import * as UserAgent from 'utils/user_agent';

const urlFormatForDMGMPermalink = '/:teamName/messages/:username/:postid';
const urlFormatForChannelPermalink = '/:teamName/channels/:channelname/:postid';
Expand Down
3 changes: 2 additions & 1 deletion webapp/channels/src/components/desktop_auth_token.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,14 @@ import {FormattedMessage} from 'react-intl';
import {useDispatch, useSelector} from 'react-redux';
import {useHistory, useLocation} from 'react-router-dom';

import {isDesktopApp} from '@mattermost/shared/utils/user_agent';

import {getCurrentUser} from 'mattermost-redux/selectors/entities/users';

import {redirectUserToDefaultTeam} from 'actions/global_actions';
import {loginWithDesktopToken} from 'actions/views/login';

import DesktopApp from 'utils/desktop_api';
import {isDesktopApp} from 'utils/user_agent';

import './desktop_auth_token.scss';

Expand Down
Loading
Loading