Skip to content

Commit

Permalink
[MM-24300/MM-28305] Upgrade dependencies 5.28 (mattermost#5901)
Browse files Browse the repository at this point in the history
* upgrade react-intl, fix breaking changes

* upgrade react-intl, fix breaking changes

* upgrade dependencies; many changes to support

* undo maxConcurrency

* bump minor types

* update pkg lock

* fix test

* add ImportThemeModal unit test

* reinstate intl fail test

* upgrade minor deps

* i18n escape: admin.cluster.OverrideHostnameDesc

* escape remaining strings

keys:
- admin.gitlab.enableDescription
- admin.gitlab.EnableMarkdownDesc
- admin.saml.serviceProviderIdentifierEx
- admin.permissions.inherited_from
- admin.saml.assertionConsumerServiceURLEx
- edit_post.time_limit_modal.description
- marketplace_modal.list.update_confirmation.message.current_with_release_notes
- marketplace_modal.list.update_confirmation.message.warning_major_version_with_release_notes

* eslint config; nbsp

* typing consistency

* auto-detect react version

* intl-compat. LocalizedIcon

* restore func names

* use same action types

* fix typing

* convert conflicting icons to funcs w/useIntl

* review typing corrections; remove unneeded setup

* disable wrapRichTextChunksInFragment for now

* remove leaking [object Object] attrs

* bump mattermost-redux

* [sec] bump pdfjs-dist

* fix typo

* use fixed p-queue; update package-lock; (fixes ci)

* destructure to avoid naming convention conflicts

* fix linting+typing after merge from master

* update snapshots

* fix lint/type

* test ci fix

* Upgrade build docker image (mattermost#6287)

* Upgrade build docker image

* Use node 10.22

* patch upgrades

* keep in sync with MM-27497 / PR 6308

* fix linting/type issues

* update snapshots

* update package lock

* fix lint

* re-sync package lock

* re-fix: linting/snapshots

* minor-upgrade pdf.js

Co-authored-by: Elisabeth Kulzer <[email protected]>
Co-authored-by: Mattermod <[email protected]>
  • Loading branch information
3 people committed Sep 9, 2020
1 parent 990879f commit 7fa9226
Show file tree
Hide file tree
Showing 459 changed files with 8,713 additions and 11,917 deletions.
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ orbs:
executors:
default:
docker:
- image: mattermost/mattermost-build-webapp:oct-2-2018
- image: mattermost/mattermost-build-webapp:20200829_node-10.22
resource_class: "xlarge"

aliases:
Expand Down
37 changes: 28 additions & 9 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,14 @@
"plugin:jquery/deprecated"
],
"plugins": [
"babel",
"mattermost",
"import",
"cypress",
"jquery",
"no-only-tests"
],
"parser": "@typescript-eslint/parser",
"env": {
"jest": true,
"cypress/globals": true
Expand All @@ -19,14 +21,16 @@
"import/resolver": "webpack",
"react": {
"pragma": "React",
"version": "16.4"
"version": "detect"
}
},
"rules": {
"no-unused-expressions": 0,
"babel/no-unused-expressions": 2,
"eol-last": ["error", "always"],
"import/no-unresolved": 2,
"import/order": [
"error",
2,
{
"newlines-between": "always-and-inside-groups",
"groups": [
Expand Down Expand Up @@ -63,13 +67,26 @@
"plugin:@typescript-eslint/recommended"
],
"rules": {
"comma-dangle": 0,
"no-unused-expressions": 0,
"@typescript-eslint/no-unused-expressions": 2,
"@typescript-eslint/camelcase": [
"import/no-unresolved": 0, // ts handles this better
"camelcase": 0,
"@typescript-eslint/naming-convention": [
2,
{
"properties": "never"
"selector": "function",
"format": ["camelCase", "PascalCase"]
},
{
"selector": "variable",
"format": ["camelCase", "PascalCase", "UPPER_CASE"]
},
{
"selector": "parameter",
"format": ["camelCase", "PascalCase"],
"leadingUnderscore": "allow"
},
{
"selector": "typeLike",
"format": ["PascalCase"]
}
],
"@typescript-eslint/no-non-null-assertion": 0,
Expand Down Expand Up @@ -103,15 +120,16 @@
}
},
{
"files": ["tests/**"],
"files": ["tests/**", "**/*.test.*"],
"env": {
"jest": true
},
"rules": {
"func-names": 0,
"global-require": 0,
"new-cap": 0,
"prefer-arrow-callback": 0
"prefer-arrow-callback": 0,
"no-import-assign": 0
}
},
{
Expand All @@ -121,6 +139,7 @@
"import/no-unresolved": 0,
"max-nested-callbacks": 0,
"no-process-env": 0,
"babel/no-unused-expressions": 0,
"no-unused-expressions": 0,
"jquery/no-ajax": 0,
"jquery/no-ajax-events": 0,
Expand Down
1 change: 1 addition & 0 deletions actions/user_actions.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// See LICENSE.txt for license information.

import PQueue from 'p-queue';

import {getChannelAndMyMember, getChannelMembersByIds} from 'mattermost-redux/actions/channels';
import {savePreferences} from 'mattermost-redux/actions/preferences';
import {getTeamMembersByIds} from 'mattermost-redux/actions/teams';
Expand Down
8 changes: 4 additions & 4 deletions actions/user_actions.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jest.mock('mattermost-redux/actions/users', () => {
});

jest.mock('mattermost-redux/selectors/entities/channels', () => {
const GeneralTypes = require.requireActual('mattermost-redux/constants').General;
const GeneralTypes = jest.requireActual('mattermost-redux/constants').General;
const original = jest.requireActual('mattermost-redux/selectors/entities/channels');
const mockDmGmUsersInLhs = [{id: 'gmChannel', type: GeneralTypes.GM_CHANNEL}, {id: 'dmChannel', type: GeneralTypes.DM_CHANNEL}];

Expand All @@ -42,8 +42,8 @@ jest.mock('mattermost-redux/selectors/entities/channels', () => {
});

jest.mock('mattermost-redux/selectors/entities/channel_categories', () => {
const GeneralTypes = require.requireActual('mattermost-redux/constants').General;
const original = require.requireActual('mattermost-redux/selectors/entities/channel_categories');
const GeneralTypes = jest.requireActual('mattermost-redux/constants').General;
const original = jest.requireActual('mattermost-redux/selectors/entities/channel_categories');

const mockChannelsObj = [{id: 'gmChannel', type: GeneralTypes.GM_CHANNEL}];
const mockFunc = jest.fn();
Expand Down Expand Up @@ -88,7 +88,7 @@ jest.mock('stores/redux_store', () => {
});

jest.mock('actions/diagnostics_actions.jsx', () => {
const original = require.requireActual('actions/diagnostics_actions.jsx');
const original = jest.requireActual('actions/diagnostics_actions.jsx');
return {
...original,
trackEvent: jest.fn(),
Expand Down
3 changes: 0 additions & 3 deletions babel.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,9 @@ const config = {
],
plugins: [
'@babel/plugin-proposal-class-properties',
'@babel/plugin-syntax-dynamic-import',
'@babel/proposal-object-rest-spread',
'react-hot-loader/babel',
'babel-plugin-typescript-to-proptypes',
'@babel/plugin-proposal-optional-chaining',
'@babel/plugin-proposal-nullish-coalescing-operator',
],
};

Expand Down
2 changes: 1 addition & 1 deletion build/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
FROM node:10
FROM node:10.22
RUN apt-get update && apt-get install -y make gcc nasm libpng-dev
CMD [ "node" ]
6 changes: 0 additions & 6 deletions components/__snapshots__/file_upload_overlay.test.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,12 @@ exports[`components/FileUploadOverlay should match snapshot when file upload is
<FormattedMessage
defaultMessage="Upload Icon"
id="generic_icons.upload"
values={Object {}}
>
<Component />
</FormattedMessage>
<FormattedMessage
defaultMessage="Drop a file to upload it."
id="upload_overlay.info"
values={Object {}}
/>
</span>
<img
Expand Down Expand Up @@ -59,14 +57,12 @@ exports[`components/FileUploadOverlay should match snapshot when file upload is
<FormattedMessage
defaultMessage="Upload Icon"
id="generic_icons.upload"
values={Object {}}
>
<Component />
</FormattedMessage>
<FormattedMessage
defaultMessage="Drop a file to upload it."
id="upload_overlay.info"
values={Object {}}
/>
</span>
<img
Expand Down Expand Up @@ -99,14 +95,12 @@ exports[`components/FileUploadOverlay should match snapshot when file upload is
<FormattedMessage
defaultMessage="Upload Icon"
id="generic_icons.upload"
values={Object {}}
>
<Component />
</FormattedMessage>
<FormattedMessage
defaultMessage="Drop a file to upload it."
id="upload_overlay.info"
values={Object {}}
/>
</span>
<img
Expand Down
34 changes: 28 additions & 6 deletions components/__snapshots__/formatted_markdown_message.test.jsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ exports[`components/FormattedMarkdownMessage should allow to disable links 1`] =
"defaultLocale": "en",
"formatDate": [Function],
"formatDateToParts": [Function],
"formatHTMLMessage": [Function],
"formatDisplayName": [Function],
"formatList": [Function],
"formatMessage": [Function],
"formatNumber": [Function],
Expand All @@ -48,6 +48,7 @@ exports[`components/FormattedMarkdownMessage should allow to disable links 1`] =
"formats": Object {},
"formatters": Object {
"getDateTimeFormat": [Function],
"getDisplayNames": [Function],
"getListFormat": [Function],
"getMessageFormat": [Function],
"getNumberFormat": [Function],
Expand All @@ -63,6 +64,7 @@ exports[`components/FormattedMarkdownMessage should allow to disable links 1`] =
"onError": [Function],
"textComponent": Symbol(react.fragment),
"timeZone": undefined,
"wrapRichTextChunksInFragment": undefined,
}
}
values={
Expand Down Expand Up @@ -113,7 +115,7 @@ exports[`components/FormattedMarkdownMessage should backup to default 1`] = `
"defaultLocale": "en",
"formatDate": [Function],
"formatDateToParts": [Function],
"formatHTMLMessage": [Function],
"formatDisplayName": [Function],
"formatList": [Function],
"formatMessage": [Function],
"formatNumber": [Function],
Expand All @@ -125,6 +127,7 @@ exports[`components/FormattedMarkdownMessage should backup to default 1`] = `
"formats": Object {},
"formatters": Object {
"getDateTimeFormat": [Function],
"getDisplayNames": [Function],
"getListFormat": [Function],
"getMessageFormat": [Function],
"getNumberFormat": [Function],
Expand All @@ -140,6 +143,7 @@ exports[`components/FormattedMarkdownMessage should backup to default 1`] = `
"onError": [Function],
"textComponent": Symbol(react.fragment),
"timeZone": undefined,
"wrapRichTextChunksInFragment": undefined,
}
}
>
Expand Down Expand Up @@ -174,6 +178,12 @@ exports[`components/FormattedMarkdownMessage should escape non-BR 1`] = `
<injectIntl(FormattedMarkdownMessage)
defaultMessage=""
id="test.bar"
values={
Object {
"b": [Function],
"script": [Function],
}
}
>
<FormattedMarkdownMessage
defaultMessage=""
Expand All @@ -185,7 +195,7 @@ exports[`components/FormattedMarkdownMessage should escape non-BR 1`] = `
"defaultLocale": "en",
"formatDate": [Function],
"formatDateToParts": [Function],
"formatHTMLMessage": [Function],
"formatDisplayName": [Function],
"formatList": [Function],
"formatMessage": [Function],
"formatNumber": [Function],
Expand All @@ -197,6 +207,7 @@ exports[`components/FormattedMarkdownMessage should escape non-BR 1`] = `
"formats": Object {},
"formatters": Object {
"getDateTimeFormat": [Function],
"getDisplayNames": [Function],
"getListFormat": [Function],
"getMessageFormat": [Function],
"getNumberFormat": [Function],
Expand All @@ -212,6 +223,13 @@ exports[`components/FormattedMarkdownMessage should escape non-BR 1`] = `
"onError": [Function],
"textComponent": Symbol(react.fragment),
"timeZone": undefined,
"wrapRichTextChunksInFragment": undefined,
}
}
values={
Object {
"b": [Function],
"script": [Function],
}
}
>
Expand Down Expand Up @@ -257,7 +275,7 @@ exports[`components/FormattedMarkdownMessage should render message 1`] = `
"defaultLocale": "en",
"formatDate": [Function],
"formatDateToParts": [Function],
"formatHTMLMessage": [Function],
"formatDisplayName": [Function],
"formatList": [Function],
"formatMessage": [Function],
"formatNumber": [Function],
Expand All @@ -269,6 +287,7 @@ exports[`components/FormattedMarkdownMessage should render message 1`] = `
"formats": Object {},
"formatters": Object {
"getDateTimeFormat": [Function],
"getDisplayNames": [Function],
"getListFormat": [Function],
"getMessageFormat": [Function],
"getNumberFormat": [Function],
Expand All @@ -284,13 +303,14 @@ exports[`components/FormattedMarkdownMessage should render message 1`] = `
"onError": [Function],
"textComponent": Symbol(react.fragment),
"timeZone": undefined,
"wrapRichTextChunksInFragment": undefined,
}
}
>
<span
dangerouslySetInnerHTML={
Object {
"__html": "<strong>bold</strong> <em>italic</em> <a href=\\"https://mattermost.com/\\">link</a> &lt;br/&gt; <a href=\\"https://mattermost.com/\\" rel=\\"noreferrer\\" target=\\"_blank\\">link target blank</a>",
"__html": "<strong>bold</strong> <em>italic</em> <a href=\\"https://mattermost.com/\\">link</a> &lt;br/&gt; <a href=\\"https://mattermost.com/\\" rel=\\"noopener noreferrer\\" target=\\"_blank\\">link target blank</a>",
}
}
/>
Expand Down Expand Up @@ -334,7 +354,7 @@ exports[`components/FormattedMarkdownMessage values should work 1`] = `
"defaultLocale": "en",
"formatDate": [Function],
"formatDateToParts": [Function],
"formatHTMLMessage": [Function],
"formatDisplayName": [Function],
"formatList": [Function],
"formatMessage": [Function],
"formatNumber": [Function],
Expand All @@ -346,6 +366,7 @@ exports[`components/FormattedMarkdownMessage values should work 1`] = `
"formats": Object {},
"formatters": Object {
"getDateTimeFormat": [Function],
"getDisplayNames": [Function],
"getListFormat": [Function],
"getMessageFormat": [Function],
"getNumberFormat": [Function],
Expand All @@ -361,6 +382,7 @@ exports[`components/FormattedMarkdownMessage values should work 1`] = `
"onError": [Function],
"textComponent": Symbol(react.fragment),
"timeZone": undefined,
"wrapRichTextChunksInFragment": undefined,
}
}
values={
Expand Down
3 changes: 0 additions & 3 deletions components/__snapshots__/generic_modal.test.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,6 @@ exports[`components/GenericModal should match snapshot with both buttons 1`] = `
<FormattedMessage
defaultMessage="Cancel"
id="generic_modal.cancel"
values={Object {}}
/>
</button>
<button
Expand All @@ -137,7 +136,6 @@ exports[`components/GenericModal should match snapshot with both buttons 1`] = `
<FormattedMessage
defaultMessage="Confirm"
id="generic_modal.confirm"
values={Object {}}
/>
</button>
</ModalFooter>
Expand Down Expand Up @@ -211,7 +209,6 @@ exports[`components/GenericModal should match snapshot with disabled confirm but
<FormattedMessage
defaultMessage="Confirm"
id="generic_modal.confirm"
values={Object {}}
/>
</button>
</ModalFooter>
Expand Down
Loading

0 comments on commit 7fa9226

Please sign in to comment.