* remove cloud banner and associations

* update language file

* revert changes to number.tsx

* revert changes to number.tsx

* remove unused import
Этот коммит содержится в:
Scott Bishel
2023-03-30 10:44:46 -06:00
коммит произвёл GitHub
родитель 64051134b8
Коммит 81fdb976ba
10 изменённых файлов: 13 добавлений и 283 удалений

Просмотреть файл

@@ -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",

Просмотреть файл

@@ -1,37 +0,0 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`components/messages/CloudMessage plugin mode, no display 1`] = `
<div>
<div
class="CloudMessage"
>
<div
class="banner"
>
<i
class="CompassIcon icon-information-outline CompassIcon"
/>
Get your own free cloud server.
<button
class="Button emphasis--primary size--xsmall"
title="Learn more"
type="button"
>
<span>
Learn more
</span>
</button>
</div>
<button
aria-label="Close dialog"
class="IconButton margin-right size--small"
title="Close dialog"
type="button"
>
<i
class="CompassIcon icon-close CloseIcon"
/>
</button>
</div>
</div>
`;

Просмотреть файл

@@ -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;
}
}

Просмотреть файл

@@ -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(
<ReduxProvider store={store}>
<CloudMessage/>
</ReduxProvider>,
)
const {container} = render(component)
expect(container).toMatchSnapshot()
})
})

Просмотреть файл

@@ -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<IUser|null>(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 (
<div className='CloudMessage'>
<div className='banner'>
<CompassIcon
icon='information-outline'
className='CompassIcon'
/>
<FormattedMessage
id='CloudMessage.cloud-server'
defaultMessage='Get your own free cloud server.'
/>
<Button
title='Learn more'
size='xsmall'
emphasis='primary'
onClick={() => {
TelemetryClient.trackEvent(TelemetryCategory, TelemetryActions.CloudMoreInfo)
window.open(signupURL)
}}
>
<FormattedMessage
id='cloudMessage.learn-more'
defaultMessage='Learn more'
/>
</Button>
</div>
<IconButton
className='margin-right'
onClick={onClose}
icon={<CloseIcon/>}
title={closeDialogText}
size='small'
/>
</div>
)
}
export default React.memo(CloudMessage)

Просмотреть файл

@@ -76,7 +76,7 @@ const VersionMessage = () => {
}}
>
<FormattedMessage
id='cloudMessage.learn-more'
id='VersionMessage.learn-more'
defaultMessage='Learn more'
/>
</Button>

Просмотреть файл

@@ -1,7 +1,6 @@
.BoardPage {
position: relative;
.CloudMessage:not(:first-child),
.VersionMessage:not(:first-child) {
position: absolute;
top: 0;

Просмотреть файл

@@ -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 => {
<SetWindowTitleAndIcon/>
<UndoRedoHotKeys/>
<WebsocketConnection/>
<CloudMessage/>
<VersionMessage/>
{!mobileWarningClosed &&

Просмотреть файл

@@ -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,

Просмотреть файл

@@ -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)
}