Skip to content
This repository has been archived by the owner on Mar 13, 2024. It is now read-only.

Commit

Permalink
[Cloud Sync] Merge remote-tracking branch 'origin/master' 2021-06-07 (#…
Browse files Browse the repository at this point in the history
…8218)

* [MM-35780] - Update add users to channel modal test case (#8146)

* [MM-35780] - Update add users to channel modal test cas

* fix lint error

Co-authored-by: Nevyana Angelova <nevyangelova@Nevyanas-MacBook-Pro.local>
Co-authored-by: Mattermod <mattermod@users.noreply.github.com>

* [MM-34169] Data retention cypress tests (#8039)

* adding cypress tests for data retention

Co-authored-by: Benjamin Cooke <benjamincooke@Benjamins-MacBook-Pro.local>
Co-authored-by: Mattermod <mattermod@users.noreply.github.com>

* WIP ci/test: add NODE_OPTIONS max_old_space_size=500 (#8163)

* ci/test: add NODE_OPTIONS max_old_space_size=500

* update gitlab to use the same

* [MM-34303] Add team ID to response when linking a channel to a group (#8071)

* delete channels when a team is removed from group

Co-authored-by: Benjamin Cooke <benjamincooke@Benjamins-MacBook-Pro.local>

* Use Node 16 for CI (#8154)

* Re-add cross-env to set test timezone

* Update package-lock.json again

* Update CI to Node 16

* Add workspaces section to package.json

* Update package-lock.json

* Close empty brackets

* MM-34758 Collapsed Reply Threads without mobile support (#7933)

Summary
Update webapp to pass collapsed_threads_supported parameters to the server API to indicate that the webapp supports collapsed reply threads.
Update webapp to correctly mark channels and threads as unread/read.

Ticket Link
https://mattermost.atlassian.net/browse/MM-34758

Related Pull Requests
Has server changes: mattermost/mattermost#17424

* MM-35435 - add multiple SKU options to purchase modal (#8119)

* MM-35435 -  add multiple sku options to purchase modal

* MM-35435 - add multiple sku options to purchase modal

* add initial logic to update the subscription price

* dictionary changes

* refactor the api endpoint call

* add the right api call

* linter changes

* remove unnecessary code

* add the right productId

* fix types problems

* first fixes to MR comments

* add unit test to radio button group

* remove unnecessary space, organize styles

* fix linter and types problem, use the current subscription product id

* fix snapshots

* Revert "fix snapshots"

This reverts commit f7dbe85.

* improve the findProduct function

* reorganize return value

* style improvements based on UX feedback

Co-authored-by: Pablo Velez Vidal <pablo.velez@mattermost.com>
Co-authored-by: Mattermod <mattermod@users.noreply.github.com>

* MM-35838/MM-35923 Fix memoization of selectors (#8143)

* Remove max-lines warning in test files

* MM-35838/MM-35923 Fix memoization of makeGetChannelIdsForCategory when channel order changes

* MM-35838/MM-35923 Fix memoization of getChannelsNameMapInCurrentTeam when channels change

* Clarify memoization pattern

* Add getChannelNameToDisplayNameMap for channel linking in Markdown

* Remove unused type

* MM-32801 : Webapp: In mention autocomplete, remove (Nickname) when (you) is present  (#7984)

* to ts

* added the fix

* revert 1

* revert 2

* rvert 3

* revr 4

* rever 5

* req changes

* added tests

* String update: Clarify Add Member to Channel hint text (#8077)

* Clarify Add Member to Channel Hint Text

When adding members to a channel, the existing hint text ambiguously suggests that a maximum of 20 members can be added to a given channel. Updated hint text to note that users can add up to 20 members at a time to the channel.

* Update MultiSelect to support new text

Co-authored-by: Harrison Healey <harrisonmhealey@gmail.com>

* CRT: removes comment count (#8134)

Removes comment count from post info component.
Justification: we show it in root post's thread footer.

* Cypress/E2E: Apply temp fix to dnd e2e (#8158)

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>

* MM-T2369 : Aspect Ratio is preserved in RHS (#8165)

* test

* Update e2e/cypress/integration/scroll/image_aspect_ratio_spec.js

Co-authored-by: Saturnino Abril <saturnino.abril@gmail.com>

* Translations update from Weblate (#8184)

* Translated using Weblate (French)

Currently translated at 90.9% (4307 of 4737 strings)

Translation: mattermost-languages-shipped/mattermost-webapp
Translate-URL: https://translate.mattermost.com/projects/mattermost/mattermost-webapp_master/fr/

* Translated using Weblate (Turkish)

Currently translated at 100.0% (4757 of 4757 strings)

Translation: mattermost-languages-shipped/mattermost-webapp
Translate-URL: https://translate.mattermost.com/projects/mattermost/mattermost-webapp_master/tr/

Translated using Weblate (Turkish)

Currently translated at 100.0% (4756 of 4756 strings)

Translation: mattermost-languages-shipped/mattermost-webapp
Translate-URL: https://translate.mattermost.com/projects/mattermost/mattermost-webapp_master/tr/

Translated using Weblate (Turkish)

Currently translated at 100.0% (4737 of 4737 strings)

Translation: mattermost-languages-shipped/mattermost-webapp
Translate-URL: https://translate.mattermost.com/projects/mattermost/mattermost-webapp_master/tr/

* Translated using Weblate (Swedish)

Currently translated at 100.0% (4757 of 4757 strings)

Translation: mattermost-languages-shipped/mattermost-webapp
Translate-URL: https://translate.mattermost.com/projects/mattermost/mattermost-webapp_master/sv/

Translated using Weblate (Swedish)

Currently translated at 100.0% (4737 of 4737 strings)

Translation: mattermost-languages-shipped/mattermost-webapp
Translate-URL: https://translate.mattermost.com/projects/mattermost/mattermost-webapp_master/sv/

* Translated using Weblate (Hungarian)

Currently translated at 99.2% (4701 of 4737 strings)

Translation: mattermost-languages-shipped/mattermost-webapp
Translate-URL: https://translate.mattermost.com/projects/mattermost/mattermost-webapp_master/hu/

* Translated using Weblate (German)

Currently translated at 83.0% (3949 of 4757 strings)

Translation: mattermost-languages-shipped/mattermost-webapp
Translate-URL: https://translate.mattermost.com/projects/mattermost/mattermost-webapp_master/de/

Translated using Weblate (German)

Currently translated at 83.0% (3952 of 4756 strings)

Translation: mattermost-languages-shipped/mattermost-webapp
Translate-URL: https://translate.mattermost.com/projects/mattermost/mattermost-webapp_master/de/

* Update translation files

Updated by "Cleanup translation files" hook in Weblate.

Translation: mattermost-languages-shipped/mattermost-webapp
Translate-URL: https://translate.mattermost.com/projects/mattermost/mattermost-webapp_master/

* Translated using Weblate (Dutch)

Currently translated at 100.0% (4757 of 4757 strings)

Translation: mattermost-languages-shipped/mattermost-webapp
Translate-URL: https://translate.mattermost.com/projects/mattermost/mattermost-webapp_master/nl/

Translated using Weblate (Dutch)

Currently translated at 99.4% (4732 of 4757 strings)

Translation: mattermost-languages-shipped/mattermost-webapp
Translate-URL: https://translate.mattermost.com/projects/mattermost/mattermost-webapp_master/nl/

* Translated using Weblate (Polish)

Currently translated at 77.3% (3679 of 4757 strings)

Translation: mattermost-languages-shipped/mattermost-webapp
Translate-URL: https://translate.mattermost.com/projects/mattermost/mattermost-webapp_master/pl/

* Translated using Weblate (Bulgarian)

Currently translated at 100.0% (4757 of 4757 strings)

Translation: mattermost-languages-shipped/mattermost-webapp
Translate-URL: https://translate.mattermost.com/projects/mattermost/mattermost-webapp_master/bg/

* Translated using Weblate (French)

Currently translated at 90.4% (4305 of 4757 strings)

Translation: mattermost-languages-shipped/mattermost-webapp
Translate-URL: https://translate.mattermost.com/projects/mattermost/mattermost-webapp_master/fr/

Co-authored-by: wget <william@gathoye.be>
Co-authored-by: Kaya Zeren <kayazeren@gmail.com>
Co-authored-by: MArtin Johnson <martinjohnson@bahnhof.se>
Co-authored-by: Zsolt Godó <zsolttokio@gmail.com>
Co-authored-by: Elisabeth Kulzer <elisabeth.kulzer@mattermost.com>
Co-authored-by: Tom De Moor <tom@controlaltdieliet.be>
Co-authored-by: Michał Sobkiewicz <perceptron8@gmail.com>
Co-authored-by: Nikolai Zahariev <nikolaiz@yahoo.com>
Co-authored-by: Pierre JENICOT <pierre.jenicot@ac-lille.fr>

* Fixes: position of clear custom status icon (#8173)

* ref: migrate announcement_bar to ts (#8133)

Co-authored-by: Maria A Nunez <maria.nunez@mattermost.com>

* Update PULL_REQUEST_TEMPLATE.md (#8138)

* [MM-35922] Fixed a couple style issues with the sidebar category headers on drag (#8157)

Automatic Merge

* Fixed custom status issues (#8177)

Automatic Merge

* MM - 35835 show cc info in purchase modal (#8155)

* MM-35435 -  add multiple sku options to purchase modal

* MM-35435 - add multiple sku options to purchase modal

* add initial logic to update the subscription price

* dictionary changes

* refactor the api endpoint call

* add the right api call

* linter changes

* remove unnecessary code

* add the right productId

* fix types problems

* first fixes to MR comments

* add unit test to radio button group

* remove unnecessary space, organize styles

* fix linter and types problem, use the current subscription product id

* fix snapshots

* Revert "fix snapshots"

This reverts commit f7dbe85.

* improve the findProduct function

* reorganize return value

* style improvements based on UX feedback

* MM-35835 - show cc info in purchase modal

* fix i18n texts

* show the billing address information in the purchase form

* add the badge and select the next upgrade product

* fix styles and translations

* add PR review comments

* add space between title and checkboxes

* rename the selectedProduct variable

Co-authored-by: Pablo Velez Vidal <pablo.velez@mattermost.com>
Co-authored-by: Mattermod <mattermod@users.noreply.github.com>

* prevent  purchase modal Object.keys invocation with null value (#8188)

Co-authored-by: Pablo Velez Vidal <pablo.velez@mattermost.com>

* Translations update from Weblate (#8194)

* Translated using Weblate (Dutch)

Currently translated at 100.0% (4760 of 4760 strings)

Translation: mattermost-languages-shipped/mattermost-webapp
Translate-URL: https://translate.mattermost.com/projects/mattermost/mattermost-webapp_master/nl/

Translated using Weblate (French)

Currently translated at 90.4% (4305 of 4757 strings)

Translation: mattermost-languages-shipped/mattermost-webapp
Translate-URL: https://translate.mattermost.com/projects/mattermost/mattermost-webapp_master/fr/

* Added translation using Weblate (English (Australia))

* Translated using Weblate (Turkish)

Currently translated at 100.0% (4760 of 4760 strings)

Translation: mattermost-languages-shipped/mattermost-webapp
Translate-URL: https://translate.mattermost.com/projects/mattermost/mattermost-webapp_master/tr/

* Translated using Weblate (Swedish)

Currently translated at 100.0% (4760 of 4760 strings)

Translation: mattermost-languages-shipped/mattermost-webapp
Translate-URL: https://translate.mattermost.com/projects/mattermost/mattermost-webapp_master/sv/

* Translated using Weblate (English (Australia))

Currently translated at 100.0% (4760 of 4760 strings)

Translation: mattermost-languages-shipped/mattermost-webapp
Translate-URL: https://translate.mattermost.com/projects/mattermost/mattermost-webapp_master/en_AU/

Co-authored-by: Tom De Moor <tom@controlaltdieliet.be>
Co-authored-by: Kaya Zeren <kayazeren@gmail.com>
Co-authored-by: MArtin Johnson <martinjohnson@bahnhof.se>
Co-authored-by: matthew-w <matthew-w@somehting.au>

* Changed the api call for the remove recent custom status action (#7751)

Co-authored-by: Manoj <manoj@brightscout.com>

* added `align-items: center` and increased `line-height` on the `span` (#8190)

* MM-36172 - purchase modal empty address issue (#8195)

* MM-36172 - purchase modal empty address issue

* remove redundant isValid function

* remove unnecessary import

Co-authored-by: Pablo Velez Vidal <pablo.velez@mattermost.com>

* Cleanup store initialization (#8156)

* assume enableThunk is never false

* drop unused clientOptions

* inline createMiddleware

* collapse prod/dev configureStore

* typescript magic

* redux-devtools-extension/developmentOnly

* fix linting

* MM-T2372 Deleting: Thread does not move when deleting post (#8176)

* Add Cypress test for MM-T3080

* MM-T3080 fix lint issues

* Login smoke test codereview fixes

* Update e2e/cypress/integration/signin_authentication/login_logout_smoke_spec.js

Co-authored-by: Saturnino Abril <saturnino.abril@gmail.com>

* Update e2e/cypress/integration/signin_authentication/login_logout_smoke_spec.js

Co-authored-by: Saturnino Abril <saturnino.abril@gmail.com>

* Update e2e/cypress/integration/signin_authentication/login_logout_smoke_spec.js

Co-authored-by: Saturnino Abril <saturnino.abril@gmail.com>

* Update e2e/cypress/integration/signin_authentication/login_logout_smoke_spec.js

Co-authored-by: Saturnino Abril <saturnino.abril@gmail.com>

* Remove extra spaces

* Update e2e/cypress/integration/signin_authentication/login_logout_smoke_spec.js

Co-authored-by: Saturnino Abril <saturnino.abril@gmail.com>

* Update e2e/cypress/integration/signin_authentication/login_logout_smoke_spec.js

Co-authored-by: Saturnino Abril <saturnino.abril@gmail.com>

* Update e2e/cypress/integration/signin_authentication/login_logout_smoke_spec.js

Co-authored-by: Saturnino Abril <saturnino.abril@gmail.com>

* Update e2e/cypress/integration/signin_authentication/login_logout_smoke_spec.js

Co-authored-by: Saturnino Abril <saturnino.abril@gmail.com>

* Adding test for MM-T2372 Deleting

* Update e2e/cypress/integration/scroll/deleting_scroll_spec.js

Co-authored-by: Joseph Baylon <joseph.baylon@mattermost.com>

* Update e2e/cypress/integration/scroll/deleting_scroll_spec.js

Co-authored-by: Joseph Baylon <joseph.baylon@mattermost.com>

* Update e2e/cypress/integration/scroll/deleting_scroll_spec.js

Co-authored-by: Joseph Baylon <joseph.baylon@mattermost.com>

* Update e2e/cypress/integration/scroll/deleting_scroll_spec.js

Co-authored-by: Joseph Baylon <joseph.baylon@mattermost.com>

* Update e2e/cypress/integration/scroll/deleting_scroll_spec.js

Co-authored-by: Joseph Baylon <joseph.baylon@mattermost.com>

* Update e2e/cypress/integration/scroll/deleting_scroll_spec.js

Co-authored-by: Joseph Baylon <joseph.baylon@mattermost.com>

* Update e2e/cypress/integration/scroll/deleting_scroll_spec.js

Co-authored-by: Joseph Baylon <joseph.baylon@mattermost.com>

* resolve conflicts

Co-authored-by: Yulyana <yulyana@phntms.com>
Co-authored-by: Saturnino Abril <saturnino.abril@gmail.com>
Co-authored-by: Joseph Baylon <joseph.baylon@mattermost.com>

* tests/MM-T947 : When deactivating users in the System Console, email address should not disappear (#8175)

* test

* rewrote the test

* Update e2e/cypress/integration/system_console/user_management/users_deactivation_spec.js

Co-authored-by: Joseph Baylon <joseph.baylon@mattermost.com>

Co-authored-by: Joseph Baylon <joseph.baylon@mattermost.com>

* tests/MM-T1321 : WebApp: Truncated Numbered List on Chat History Panel (#8178)

* test

* Update e2e/cypress/integration/messaging/message_bullets_spec.js

Co-authored-by: Saturnino Abril <saturnino.abril@gmail.com>

Co-authored-by: Saturnino Abril <saturnino.abril@gmail.com>

* Fixed Test Case (#8202)

* [MM-T1282] Add e2e test coverage for default behaviour when an empty site name is configured (#8179)

* [MM-T1282] Add e2e test coverage for default behaviour when an empty site name is configured

* [MM-T1282] Ensure that the system 'about' link and model render the expected site name

* Capitalize action verb in e2e test step

Co-authored-by: Saturnino Abril <saturnino.abril@gmail.com>

* lint fixup: remove padding blank line from function block

Co-authored-by: Saturnino Abril <saturnino.abril@gmail.com>

* MM-36035 - Removing status from bot posts (#8182)

Automatic Merge

* tests/MM-T1128 : Announcement Banner - Dismissible banner shows long text truncated (#8168)

* test

* live link

* enter big text

* Update e2e/cypress/integration/system_console/site_configuration/announcement_banner_spec.js

Co-authored-by: Saturnino Abril <saturnino.abril@gmail.com>

* Update e2e/cypress/integration/system_console/site_configuration/announcement_banner_spec.js

Co-authored-by: Saturnino Abril <saturnino.abril@gmail.com>

* Update e2e/cypress/integration/system_console/site_configuration/announcement_banner_spec.js

Co-authored-by: Saturnino Abril <saturnino.abril@gmail.com>

* rev

Co-authored-by: Saturnino Abril <saturnino.abril@gmail.com>

* remove cy.clearLocalStorage that probably causing to hold test and eventually timeout error (#8214)

* test (#8181)

* tests/CTRL+CMD+K : Unread Channels and input field focus (#8185)

* test

* few improvments

* fix

* Translations update from Weblate (#8217)

* Translated using Weblate (Bulgarian)

Currently translated at 100.0% (4760 of 4760 strings)

Translation: mattermost-languages-shipped/mattermost-webapp
Translate-URL: https://translate.mattermost.com/projects/mattermost/mattermost-webapp_master/bg/

* Translated using Weblate (Turkish)

Currently translated at 100.0% (4760 of 4760 strings)

Translation: mattermost-languages-shipped/mattermost-webapp
Translate-URL: https://translate.mattermost.com/projects/mattermost/mattermost-webapp_master/tr/

* Translated using Weblate (Japanese)

Currently translated at 100.0% (4760 of 4760 strings)

Translation: mattermost-languages-shipped/mattermost-webapp
Translate-URL: https://translate.mattermost.com/projects/mattermost/mattermost-webapp_master/ja/

* Translated using Weblate (Dutch)

Currently translated at 100.0% (4760 of 4760 strings)

Translation: mattermost-languages-shipped/mattermost-webapp
Translate-URL: https://translate.mattermost.com/projects/mattermost/mattermost-webapp_master/nl/

Co-authored-by: Nikolai Zahariev <nikolaiz@yahoo.com>
Co-authored-by: Kaya Zeren <kayazeren@gmail.com>
Co-authored-by: kaakaa <stooner.hoe@gmail.com>
Co-authored-by: Tom De Moor <tom@controlaltdieliet.be>

Co-authored-by: Nev Angelova <nevy.angelova@gmail.com>
Co-authored-by: Nevyana Angelova <nevyangelova@Nevyanas-MacBook-Pro.local>
Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
Co-authored-by: Ben Cooke <benkcooke@gmail.com>
Co-authored-by: Benjamin Cooke <benjamincooke@Benjamins-MacBook-Pro.local>
Co-authored-by: Carlos Tadeu Panato Junior <carlos@mattermost.com>
Co-authored-by: Harrison Healey <harrisonmhealey@gmail.com>
Co-authored-by: Eli Yukelzon <reflog@gmail.com>
Co-authored-by: Pablo Andrés Vélez Vidal <pablovv2012@gmail.com>
Co-authored-by: Pablo Velez Vidal <pablo.velez@mattermost.com>
Co-authored-by: Md_ZubairAhmed <m-zubairahmed@protonmail.com>
Co-authored-by: Carrie Warner (Mattermost) <74422101+cwarnermm@users.noreply.github.com>
Co-authored-by: Kyriakos Z <3829551+koox00@users.noreply.github.com>
Co-authored-by: Joseph Baylon <joseph.baylon@mattermost.com>
Co-authored-by: Saturnino Abril <saturnino.abril@gmail.com>
Co-authored-by: Weblate (bot) <hosted@weblate.org>
Co-authored-by: wget <william@gathoye.be>
Co-authored-by: Kaya Zeren <kayazeren@gmail.com>
Co-authored-by: MArtin Johnson <martinjohnson@bahnhof.se>
Co-authored-by: Zsolt Godó <zsolttokio@gmail.com>
Co-authored-by: Elisabeth Kulzer <elisabeth.kulzer@mattermost.com>
Co-authored-by: Tom De Moor <tom@controlaltdieliet.be>
Co-authored-by: Michał Sobkiewicz <perceptron8@gmail.com>
Co-authored-by: Nikolai Zahariev <nikolaiz@yahoo.com>
Co-authored-by: Pierre JENICOT <pierre.jenicot@ac-lille.fr>
Co-authored-by: defectivepixel <majidsajadi93@gmail.com>
Co-authored-by: Maria A Nunez <maria.nunez@mattermost.com>
Co-authored-by: Chetanya Kandhari <chetanya.kandhari@brightscout.com>
Co-authored-by: Devin Binnie <52460000+devinbinnie@users.noreply.github.com>
Co-authored-by: Manoj Malik <77336594+manojmalik20@users.noreply.github.com>
Co-authored-by: Weblate (bot) <noreply@weblate.org>
Co-authored-by: matthew-w <matthew-w@somehting.au>
Co-authored-by: Manoj <manoj@brightscout.com>
Co-authored-by: Michel Engelen <32863416+michelengelen@users.noreply.github.com>
Co-authored-by: Jesse Hallam <jesse.hallam@gmail.com>
Co-authored-by: Yulyana <44195797+yulyanaR@users.noreply.github.com>
Co-authored-by: Yulyana <yulyana@phntms.com>
Co-authored-by: Malik <furqan.malik@mattermost.com>
Co-authored-by: James Addison <james.addison@collabora.com>
Co-authored-by: Asaad Mahmood <asaadmahmood@users.noreply.github.com>
Co-authored-by: kaakaa <stooner.hoe@gmail.com>
  • Loading branch information
1 parent 0d32081 commit 2d70a4b
Show file tree
Hide file tree
Showing 105 changed files with 43,104 additions and 1,406 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:20210518_node-14.16-1
- image: mattermost/mattermost-build-webapp:20210524_node-16
resource_class: "xlarge"

aliases:
Expand Down
1 change: 0 additions & 1 deletion .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ Otherwise, link the JIRA ticket.
List all PRs related to resolving a ticket. For instance, if you submitted a PR to `mattermost/mattermost-server`, please include it here.
-->
- Has server changes (please link here)
- Has redux changes (please link here)
- Has mobile changes (please link here)

#### Screenshots
Expand Down
4 changes: 2 additions & 2 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ empty:

test: #todo check on how to create junit.xml, there currently is none
stage: test
image: $CI_REGISTRY/mattermost/ci/images/mattermost-build-webapp:20210518_node-14.16-1
image: $CI_REGISTRY/mattermost/ci/images/mattermost-build-webapp:20210524_node-16
cache:
key:
files:
Expand Down Expand Up @@ -59,7 +59,7 @@ test: #todo check on how to create junit.xml, there currently is none
- npm run check

# unit tests
- npm run test-ci-gitlab
- npm run test-ci
timeout: 3 hours
rules:
- if: '$CI_COMMIT_REF_NAME == "master" && $TEST == "yes"'
17 changes: 16 additions & 1 deletion actions/cloud.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,11 @@ import {getConfirmCardSetup} from 'components/payment_form/stripe';
import {StripeSetupIntent, BillingDetails} from 'types/cloud/sku';

// Returns true for success, and false for any error
export function completeStripeAddPaymentMethod(stripe: Stripe, billingDetails: BillingDetails, isDevMode: boolean) {
export function completeStripeAddPaymentMethod(
stripe: Stripe,
billingDetails: BillingDetails,
isDevMode: boolean,
) {
return async () => {
let paymentSetupIntent: StripeSetupIntent;
try {
Expand Down Expand Up @@ -69,3 +73,14 @@ export function completeStripeAddPaymentMethod(stripe: Stripe, billingDetails: B
return true;
};
}

export function subscribeCloudSubscription(productId: string) {
return async () => {
try {
await Client4.subscribeCloudProduct(productId);
} catch (error) {
return error;
}
return true;
};
}
5 changes: 5 additions & 0 deletions actions/websocket_actions.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ import {
handleReadChanged,
handleFollowChanged,
handleThreadArrived,
handleAllThreadsInChannelMarkedRead,
} from 'mattermost-redux/actions/threads';

import {setServerVersion} from 'mattermost-redux/actions/general';
Expand Down Expand Up @@ -678,7 +679,9 @@ export function handlePostUnreadEvent(msg) {
lastViewedAt: msg.data.last_viewed_at,
channelId: msg.broadcast.channel_id,
msgCount: msg.data.msg_count,
msgCountRoot: msg.data.msg_count_root,
mentionCount: msg.data.mention_count,
mentionCountRoot: msg.data.mention_count_root,
},
},
);
Expand Down Expand Up @@ -1432,6 +1435,8 @@ function handleThreadReadChanged(msg) {
},
);
}
} else if (msg.broadcast.channel_id) {
handleAllThreadsInChannelMarkedRead(doDispatch, doGetState, msg.broadcast.channel_id, msg.data.timestamp);
} else {
handleAllMarkedRead(doDispatch, msg.broadcast.team_id);
}
Expand Down
63 changes: 63 additions & 0 deletions components/admin_console/billing/payment_details.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.

import React from 'react';
import {FormattedMessage} from 'react-intl';
import {useSelector} from 'react-redux';

import FormattedMarkdownMessage from 'components/formatted_markdown_message';
import CardImage from 'components/payment_form/card_image';
import {GlobalState} from 'types/store';

export interface PaymentDetailsProps {
children?: React.ReactNode;
}

const PaymentDetails: React.FC<PaymentDetailsProps> = ({children}: PaymentDetailsProps) => {
const customerPaymentInfo = useSelector((state: GlobalState) => state.entities.cloud.customer);

if (!customerPaymentInfo?.payment_method && !customerPaymentInfo?.billing_address) {
return null;
}
const address = customerPaymentInfo.billing_address;

return (
<div className='PaymentInfoDisplay__paymentInfo-text'>
<CardImage brand={customerPaymentInfo.payment_method.card_brand}/>
<div className='PaymentInfoDisplay__paymentInfo-cardInfo'>
<FormattedMarkdownMessage
id='admin.billing.payment_info.cardBrandAndDigits'
defaultMessage='{brand} ending in {digits}'
values={{
brand: customerPaymentInfo.payment_method.card_brand,
digits: customerPaymentInfo.payment_method.last_four,
}}
/>
<br/>
<FormattedMarkdownMessage
id='admin.billing.payment_info.cardExpiry'
defaultMessage='Expires {month}/{year}'
values={{
month: String(customerPaymentInfo.payment_method.exp_month).padStart(2, '0'),
year: String(customerPaymentInfo.payment_method.exp_year).padStart(2, '0'),
}}
/>
</div>
<div className='PaymentInfoDisplay__paymentInfo-addressTitle'>
<FormattedMessage
id='admin.billing.payment_info.billingAddress'
defaultMessage='Billing Address'
/>
</div>
<div className='PaymentInfoDisplay__paymentInfo-address'>
<div>{address.line1}</div>
{address.line2 && <div>{address.line2}</div>}
<div>{`${address.city}, ${address.state}, ${address.postal_code}`}</div>
<div>{address.country}</div>
</div>
{children}
</div>
);
};

export default PaymentDetails;
39 changes: 2 additions & 37 deletions components/admin_console/billing/payment_info_display.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,11 @@ import {useSelector} from 'react-redux';

import {trackEvent} from 'actions/telemetry_actions';
import BlockableLink from 'components/admin_console/blockable_link';
import FormattedMarkdownMessage from 'components/formatted_markdown_message';
import CardImage from 'components/payment_form/card_image';
import noPaymentInfoGraphic from 'images/no_payment_info_graphic.svg';
import {GlobalState} from 'types/store';

import './payment_info_display.scss';
import PaymentDetails from './payment_details';

const addInfoButton = (
<div className='PaymentInfoDisplay__addInfo'>
Expand Down Expand Up @@ -65,43 +64,9 @@ const PaymentInfoDisplay: React.FC = () => {
let body = noPaymentInfoSection;

if (paymentInfo?.payment_method && paymentInfo?.billing_address) {
const address = paymentInfo.billing_address;
body = (
<div className='PaymentInfoDisplay__paymentInfo'>
<div className='PaymentInfoDisplay__paymentInfo-text'>
<CardImage brand={paymentInfo.payment_method.card_brand}/>
<div className='PaymentInfoDisplay__paymentInfo-cardInfo'>
<FormattedMarkdownMessage
id='admin.billing.payment_info.cardBrandAndDigits'
defaultMessage='{brand} ending in {digits}'
values={{
brand: paymentInfo.payment_method.card_brand,
digits: paymentInfo.payment_method.last_four,
}}
/>
<br/>
<FormattedMarkdownMessage
id='admin.billing.payment_info.cardExpiry'
defaultMessage='Expires {month}/{year}'
values={{
month: String(paymentInfo.payment_method.exp_month).padStart(2, '0'),
year: String(paymentInfo.payment_method.exp_year).padStart(2, '0'),
}}
/>
</div>
<div className='PaymentInfoDisplay__paymentInfo-addressTitle'>
<FormattedMessage
id='admin.billing.payment_info.billingAddress'
defaultMessage='Billing Address'
/>
</div>
<div className='PaymentInfoDisplay__paymentInfo-address'>
<div>{address.line1}</div>
{address.line2 && <div>{address.line2}</div>}
<div>{`${address.city}, ${address.state}, ${address.postal_code}`}</div>
<div>{address.country}</div>
</div>
</div>
<PaymentDetails/>
<div className='PaymentInfoDisplay__paymentInfo-edit'>
{ // TODO: remove payment info?
/* <a
Expand Down
Loading

0 comments on commit 2d70a4b

Please sign in to comment.