From 82a1912440232421f470460c71975dacd9d1f49f Mon Sep 17 00:00:00 2001
From: davy-c
Date: Thu, 29 Jul 2021 06:42:10 +0900
Subject: [PATCH 1/3] remove
---
src/cloud/pages/settings/index.tsx | 20 --------------------
1 file changed, 20 deletions(-)
diff --git a/src/cloud/pages/settings/index.tsx b/src/cloud/pages/settings/index.tsx
index ce791a640b..8b610e0d13 100644
--- a/src/cloud/pages/settings/index.tsx
+++ b/src/cloud/pages/settings/index.tsx
@@ -21,11 +21,6 @@ import { LoadingButton } from '../../../shared/components/atoms/Button'
import ButtonGroup from '../../../shared/components/atoms/ButtonGroup'
import styled from '../../../shared/lib/styled'
import OnboardingLayout from '../../components/organisms/Onboarding/layouts/OnboardingLayout'
-import UsageFormRow, {
- SpaceUsageIntent,
-} from '../../components/organisms/Onboarding/molecules/UsageFormRow'
-import { trackEvent } from '../../api/track'
-import { MixpanelActionTrackTypes } from '../../interfaces/analytics/mixpanel'
const SettingsPage = ({ currentUser }: SettingsPageResponseBody) => {
const [displayName, setDisplayName] = useState(
@@ -38,7 +33,6 @@ const SettingsPage = ({ currentUser }: SettingsPageResponseBody) => {
setPartialGlobalData,
} = useGlobalData()
const [iconFile, setIconFile] = useState(null)
- const [intent, setIntent] = useState()
const [fileUrl, setFileUrl] = useState(
currentUser.icon != null ? buildIconUrl(currentUser.icon.location) : null
)
@@ -79,14 +73,6 @@ const SettingsPage = ({ currentUser }: SettingsPageResponseBody) => {
? getTeamURL(teams[0])
: `/cooperate`
- if (intent != null) {
- await trackEvent(
- intent === 'personal'
- ? MixpanelActionTrackTypes.UserIntentPersonal
- : MixpanelActionTrackTypes.UserIntentTeam
- )
- }
-
push(finalRedirect)
} catch (error) {
setError(error)
@@ -94,7 +80,6 @@ const SettingsPage = ({ currentUser }: SettingsPageResponseBody) => {
setSending(false)
},
[
- intent,
currentUser,
displayName,
teams,
@@ -136,11 +121,6 @@ const SettingsPage = ({ currentUser }: SettingsPageResponseBody) => {
}}
/>
-
{error != null && }
From 5a7a97e896ba27e4942cabbc32a250c78f19ccda Mon Sep 17 00:00:00 2001
From: davy-c
Date: Thu, 29 Jul 2021 06:48:25 +0900
Subject: [PATCH 2/3] add dismiss button
---
src/cloud/components/atoms/AnnouncementAlert.tsx | 15 +++++++++++++++
1 file changed, 15 insertions(+)
diff --git a/src/cloud/components/atoms/AnnouncementAlert.tsx b/src/cloud/components/atoms/AnnouncementAlert.tsx
index 5dbdcc43e0..b97af880b5 100644
--- a/src/cloud/components/atoms/AnnouncementAlert.tsx
+++ b/src/cloud/components/atoms/AnnouncementAlert.tsx
@@ -287,6 +287,21 @@ const AnnouncementAlert = () => {
role.
)}
+
+ {
+ const newPreferences = Object.assign({}, teamPreferences)
+ delete newPreferences.showTrialAlert
+ setToLocalStorage(
+ currentUserPermissions.teamId,
+ newPreferences
+ )
+ }}
+ >
+ Dismiss
+
+
From 86b4fa8a9f2c514d18544699340eb2c270a007ee Mon Sep 17 00:00:00 2001
From: davy-c
Date: Thu, 29 Jul 2021 07:04:27 +0900
Subject: [PATCH 3/3] fix alert
---
src/cloud/components/atoms/AnnouncementAlert.tsx | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/src/cloud/components/atoms/AnnouncementAlert.tsx b/src/cloud/components/atoms/AnnouncementAlert.tsx
index b97af880b5..b589bfe5e1 100644
--- a/src/cloud/components/atoms/AnnouncementAlert.tsx
+++ b/src/cloud/components/atoms/AnnouncementAlert.tsx
@@ -221,7 +221,8 @@ const AnnouncementAlert = () => {
your plan.
- {permissions.filter((p) => p.role !== 'viewer').length >= 1 && (
+ {permissions.filter((p) => p.role !== 'viewer').length >
+ freePlanMembersLimit && (
You can continue for free if you demote your other members to
a{' '}
@@ -274,7 +275,8 @@ const AnnouncementAlert = () => {
Your space is not eligible for a free trial anymore. Please tell
your admins to upgrade your plan.
- {permissions.filter((p) => p.role !== 'viewer').length >= 1 && (
+ {permissions.filter((p) => p.role !== 'viewer').length >
+ freePlanMembersLimit && (
If you wish to continue for free, they can also demote you or
other members to a{' '}