diff --git a/webapp/boards/i18n/en.json b/webapp/boards/i18n/en.json index b7a90daf5f..4cfcf667c3 100644 --- a/webapp/boards/i18n/en.json +++ b/webapp/boards/i18n/en.json @@ -1,5 +1,7 @@ { - "AppBar.Tooltip": "Toggle linked boards", + "AdminBadge.SystemAdmin": "Admin", + "AdminBadge.TeamAdmin": "Team Admin", + "AppBar.Tooltip": "Toggle Linked Boards", "Attachment.Attachment-title": "Attachment", "AttachmentBlock.DeleteAction": "delete", "AttachmentBlock.addElement": "add {type}", @@ -115,7 +117,6 @@ "CenterPanel.Login": "Login", "CenterPanel.Share": "Share", "ChannelIntro.CreateBoard": "Create a board", - "CloudMessage.cloud-server": "Get your own free cloud server.", "ColorOption.selectColor": "Select {color} Color", "Comment.delete": "Delete", "CommentsList.send": "Send", @@ -138,6 +139,7 @@ "ContentBlock.moveDown": "Move down", "ContentBlock.moveUp": "Move up", "ContentBlock.text": "text", + "DateFilter.empty": "Empty", "DateRange.clear": "Clear", "DateRange.empty": "Empty", "DateRange.endDate": "End date", @@ -156,10 +158,14 @@ "Filter.ends-with": "ends with", "Filter.includes": "includes", "Filter.is": "is", + "Filter.is-after": "is after", + "Filter.is-before": "is before", "Filter.is-empty": "is empty", "Filter.is-not-empty": "is not empty", "Filter.is-not-set": "is not set", "Filter.is-set": "is set", + "Filter.isafter": "is after", + "Filter.isbefore": "is before", "Filter.not-contains": "doesn't contain", "Filter.not-ends-with": "doesn't end with", "Filter.not-includes": "doesn't include", @@ -243,16 +249,11 @@ "ShareBoard.userPermissionsYouText": "(You)", "ShareTemplate.Title": "Share template", "ShareTemplate.searchPlaceholder": "Search for people", - "Sidebar.about": "About Focalboard", - "Sidebar.add-board": "+ Add board", - "Sidebar.changePassword": "Change password", "Sidebar.delete-board": "Delete board", "Sidebar.duplicate-board": "Duplicate board", "Sidebar.export-archive": "Export archive", "Sidebar.import": "Import", "Sidebar.import-archive": "Import archive", - "Sidebar.invite-users": "Invite users", - "Sidebar.logout": "Log out", "Sidebar.new-category.badge": "New", "Sidebar.new-category.drag-boards-cta": "Drag boards here...", "Sidebar.no-boards-in-category": "No boards inside", @@ -306,6 +307,7 @@ "ValueSelector.valueSelector": "Value selector", "ValueSelectorLabel.openMenu": "Open menu", "VersionMessage.help": "Check out what's new in this version.", + "VersionMessage.learn-more": "Learn more", "View.AddView": "Add view", "View.Board": "Board", "View.DeleteView": "Delete view", @@ -360,6 +362,9 @@ "WelcomePage.StartUsingIt.Text": "Start using it", "Workspace.editing-board-template": "You're editing a board template.", "badge.guest": "Guest", + "boardPage.confirm-join-button": "Join", + "boardPage.confirm-join-text": "You are about to join a private board without explicitly being added by the board admin. Are you sure you wish to join this private board?", + "boardPage.confirm-join-title": "Join private board", "boardSelector.confirm-link-board": "Link board to channel", "boardSelector.confirm-link-board-button": "Yes, link board", "boardSelector.confirm-link-board-subtext": "When you link \"{boardName}\" to the channel, all members of the channel (existing and new) will be able to edit it. This excludes members who are guests. You can unlink a board from a channel at any time.", @@ -374,7 +379,6 @@ "calendar.week": "Week", "centerPanel.undefined": "No {propertyName}", "centerPanel.unknown-user": "Unknown user", - "cloudMessage.learn-more": "Learn more", "createImageBlock.failed": "This file couldn't be uploaded as the file size limit has been reached.", "default-properties.badges": "Comments and description", "default-properties.title": "Title", diff --git a/webapp/boards/src/components/messages/__snapshots__/cloudMessage.test.tsx.snap b/webapp/boards/src/components/messages/__snapshots__/cloudMessage.test.tsx.snap deleted file mode 100644 index 3eda440654..0000000000 --- a/webapp/boards/src/components/messages/__snapshots__/cloudMessage.test.tsx.snap +++ /dev/null @@ -1,37 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`components/messages/CloudMessage plugin mode, no display 1`] = ` -
-
- - -
-
-`; diff --git a/webapp/boards/src/components/messages/cloudMessage.scss b/webapp/boards/src/components/messages/cloudMessage.scss deleted file mode 100644 index f6c86bba5f..0000000000 --- a/webapp/boards/src/components/messages/cloudMessage.scss +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. -// See LICENSE.txt for license information. -.CloudMessage { - background-color: rgb(var(--sidebar-text-active-border-rgb)); - display: flex; - flex-direction: row; - align-items: center; - text-align: center; - font-weight: 600; - - div { - width: 100%; - } - - > .banner { - display: flex; - flex-direction: row; - align-items: center; - justify-content: center; - padding: 10px; - color: #fff; - - .CompassIcon { - font-size: 18px; - margin-right: 2px; - } - - .Button { - margin-left: 8px; - background-color: rgba(255, 255, 255, 0.16); - } - } - - .IconButton { - float: right; - color: #fff; - } -} diff --git a/webapp/boards/src/components/messages/cloudMessage.test.tsx b/webapp/boards/src/components/messages/cloudMessage.test.tsx deleted file mode 100644 index 8cd14b7f70..0000000000 --- a/webapp/boards/src/components/messages/cloudMessage.test.tsx +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. -// See LICENSE.txt for license information. - -import React from 'react' -import {Provider as ReduxProvider} from 'react-redux' - -import {render} from '@testing-library/react' - -import configureStore from 'redux-mock-store' - -import {IUser} from 'src/user' - -import {wrapIntl} from 'src/testUtils' - -import CloudMessage from './cloudMessage' - -describe('components/messages/CloudMessage', () => { - beforeEach(() => { - jest.clearAllMocks() - }) - - const mockStore = configureStore([]) - - test('plugin mode, no display', () => { - const me: IUser = { - id: 'user-id-1', - username: 'username_1', - email: '', - nickname: '', - firstname: '', - lastname: '', - props: {}, - create_at: 0, - update_at: 0, - is_bot: false, - is_guest: false, - roles: 'system_user', - } - const state = { - users: { - me, - }, - } - - const store = mockStore(state) - - const component = wrapIntl( - - - , - ) - - const {container} = render(component) - expect(container).toMatchSnapshot() - }) -}) diff --git a/webapp/boards/src/components/messages/cloudMessage.tsx b/webapp/boards/src/components/messages/cloudMessage.tsx deleted file mode 100644 index a96b48a1f6..0000000000 --- a/webapp/boards/src/components/messages/cloudMessage.tsx +++ /dev/null @@ -1,113 +0,0 @@ -// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. -// See LICENSE.txt for license information. -import React from 'react' - -import {useIntl, FormattedMessage} from 'react-intl' - -import IconButton from 'src/widgets/buttons/iconButton' -import Button from 'src/widgets/buttons/button' - -import CloseIcon from 'src/widgets/icons/close' - -import {useAppSelector, useAppDispatch} from 'src/store/hooks' -import octoClient from 'src/octoClient' -import {IUser, UserConfigPatch} from 'src/user' -import {getMe, patchProps, getCloudMessageCanceled} from 'src/store/users' -import {UserSettings} from 'src/userSettings' - -import CompassIcon from 'src/widgets/icons/compassIcon' -import TelemetryClient, {TelemetryCategory, TelemetryActions} from 'src/telemetry/telemetryClient' - -import './cloudMessage.scss' -const signupURL = 'https://mattermost.com/pricing' -const displayAfter = (1000 * 60 * 60 * 24) //24 hours - -const CloudMessage = () => { - const intl = useIntl() - const dispatch = useAppDispatch() - const me = useAppSelector(getMe) - const cloudMessageCanceled = useAppSelector(getCloudMessageCanceled) - - const closeDialogText = intl.formatMessage({ - id: 'Dialog.closeDialog', - defaultMessage: 'Close dialog', - }) - - const onClose = async () => { - if (me) { - if (me.id === 'single-user') { - UserSettings.hideCloudMessage = true - dispatch(patchProps([ - { - user_id: me.id, - category: 'focalboard', - name: 'cloudMessageCanceled', - value: 'true', - }, - ])) - return - } - const patch: UserConfigPatch = { - updatedFields: { - cloudMessageCanceled: 'true', - }, - } - - const patchedProps = await octoClient.patchUserConfig(me.id, patch) - if (patchedProps) { - dispatch(patchProps(patchedProps)) - } - } - } - - if (cloudMessageCanceled) { - return null - } - - if (me) { - const installTime = Date.now() - me.create_at - if (installTime < displayAfter) { - return null - } - } - - return ( -
-
- - - - - -
- - } - title={closeDialogText} - size='small' - /> -
- ) -} -export default React.memo(CloudMessage) diff --git a/webapp/boards/src/components/messages/versionMessage.tsx b/webapp/boards/src/components/messages/versionMessage.tsx index 9a893d145d..7073a35c61 100644 --- a/webapp/boards/src/components/messages/versionMessage.tsx +++ b/webapp/boards/src/components/messages/versionMessage.tsx @@ -76,7 +76,7 @@ const VersionMessage = () => { }} > diff --git a/webapp/boards/src/pages/boardPage/boardPage.scss b/webapp/boards/src/pages/boardPage/boardPage.scss index 7b1a3c4a0a..fcf6fe9bc3 100644 --- a/webapp/boards/src/pages/boardPage/boardPage.scss +++ b/webapp/boards/src/pages/boardPage/boardPage.scss @@ -1,7 +1,6 @@ .BoardPage { position: relative; - .CloudMessage:not(:first-child), .VersionMessage:not(:first-child) { position: absolute; top: 0; diff --git a/webapp/boards/src/pages/boardPage/boardPage.tsx b/webapp/boards/src/pages/boardPage/boardPage.tsx index 99a181f924..4f7fc321ba 100644 --- a/webapp/boards/src/pages/boardPage/boardPage.tsx +++ b/webapp/boards/src/pages/boardPage/boardPage.tsx @@ -11,7 +11,6 @@ import {FormattedMessage, useIntl} from 'react-intl' import {useRouteMatch, useHistory} from 'react-router-dom' import Workspace from 'src/components/workspace' -import CloudMessage from 'src/components/messages/cloudMessage' import VersionMessage from 'src/components/messages/versionMessage' import octoClient from 'src/octoClient' import {Subscription, WSClient} from 'src/wsclient' @@ -297,7 +296,6 @@ const BoardPage = (props: Props): JSX.Element => { - {!mobileWarningClosed && diff --git a/webapp/boards/src/store/users.ts b/webapp/boards/src/store/users.ts index afd03a8c65..db0f6cc19d 100644 --- a/webapp/boards/src/store/users.ts +++ b/webapp/boards/src/store/users.ts @@ -13,10 +13,6 @@ import {IUser, parseUserProps, UserPreference} from 'src/user' import {Subscription} from 'src/wsclient' -// TODO: change this whene the initial load is complete -// import {initialLoad} from './initialLoad' -import {UserSettings} from 'src/userSettings' - import {initialLoad} from './initialLoad' import {RootState} from './index' @@ -172,20 +168,6 @@ export const getOnboardingTourCategory = createSelector( (myConfig): string => (myConfig.tourCategory ? myConfig.tourCategory.value : ''), ) -export const getCloudMessageCanceled = createSelector( - getMe, - getMyConfig, - (me, myConfig): boolean => { - if (!me) { - return false - } - if (me.id === 'single-user') { - return UserSettings.hideCloudMessage - } - return Boolean(myConfig.cloudMessageCanceled?.value) - }, -) - export const getVersionMessageCanceled = createSelector( getMe, getMyConfig, diff --git a/webapp/boards/src/userSettings.ts b/webapp/boards/src/userSettings.ts index 61d02a4a34..3b1fc504a6 100644 --- a/webapp/boards/src/userSettings.ts +++ b/webapp/boards/src/userSettings.ts @@ -17,7 +17,6 @@ export enum UserSettingKey { RandomIcons = 'randomIcons', MobileWarningClosed = 'mobileWarningClosed', WelcomePageViewed = 'welcomePageViewed', - HideCloudMessage = 'hideCloudMessage', NameFormat = 'nameFormat' } @@ -149,14 +148,6 @@ export class UserSettings { UserSettings.set(UserSettingKey.MobileWarningClosed, String(newValue)) } - static get hideCloudMessage(): boolean { - return localStorage.getItem(UserSettingKey.HideCloudMessage) === 'true' - } - - static set hideCloudMessage(newValue: boolean) { - localStorage.setItem(UserSettingKey.HideCloudMessage, JSON.stringify(newValue)) - } - static get nameFormat(): string | null { return UserSettings.get(UserSettingKey.NameFormat) }