mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-11-14 22:23:42 +01:00
Merge pull request #23131 from overleaf/kh-teardown-link-sharing-split-tests
[web] tear down link sharing split tests GitOrigin-RevId: 449e9f368405aea1500035269428e7ae0c37d8fb
This commit is contained in:
@@ -42,7 +42,6 @@
|
||||
"accept_selected_changes": "",
|
||||
"accept_terms_and_conditions": "",
|
||||
"accepted_invite": "",
|
||||
"accepting_invite_as": "",
|
||||
"access_denied": "",
|
||||
"access_edit_your_projects": "",
|
||||
"access_levels_changed": "",
|
||||
@@ -795,7 +794,6 @@
|
||||
"invite_resend_limit_hit": "",
|
||||
"invited_to_group": "",
|
||||
"invited_to_group_have_individual_subcription": "",
|
||||
"invited_to_join": "",
|
||||
"inviting": "",
|
||||
"ip_address": "",
|
||||
"is_email_affiliated": "",
|
||||
@@ -1830,7 +1828,6 @@
|
||||
"upgrade_my_plan": "",
|
||||
"upgrade_now": "",
|
||||
"upgrade_summary": "",
|
||||
"upgrade_to_add_more_editors": "",
|
||||
"upgrade_to_add_more_editors_and_access_collaboration_features": "",
|
||||
"upgrade_to_get_feature": "",
|
||||
"upgrade_to_track_changes": "",
|
||||
@@ -1964,8 +1961,6 @@
|
||||
"you_can_manage_your_reference_manager_integrations_from_your_account_settings_page": "",
|
||||
"you_can_now_enable_sso": "",
|
||||
"you_can_now_log_in_sso": "",
|
||||
"you_can_only_add_n_people_to_edit_a_project": "",
|
||||
"you_can_only_add_n_people_to_edit_a_project_plural": "",
|
||||
"you_can_request_a_maximum_of_limit_fixes_per_day": "",
|
||||
"you_can_select_or_invite": "",
|
||||
"you_can_select_or_invite_plural": "",
|
||||
|
||||
+8
-21
@@ -3,11 +3,9 @@ import { useOnlineUsersContext } from '@/features/ide-react/context/online-users
|
||||
import { useEditorManagerContext } from '@/features/ide-react/context/editor-manager-context'
|
||||
import * as eventTracking from '@/infrastructure/event-tracking'
|
||||
import EditorNavigationToolbarRoot from '@/features/editor-navigation-toolbar/components/editor-navigation-toolbar-root'
|
||||
import NewShareProjectModal from '@/features/share-project-modal/components/restricted-link-sharing/share-project-modal'
|
||||
import ShareProjectModal from '@/features/share-project-modal/components/share-project-modal'
|
||||
import ShareProjectModal from '@/features/share-project-modal/components/restricted-link-sharing/share-project-modal'
|
||||
import EditorOverLimitModal from '@/features/share-project-modal/components/restricted-link-sharing/editor-over-limit-modal'
|
||||
import ViewOnlyAccessModal from '@/features/share-project-modal/components/restricted-link-sharing/view-only-access-modal'
|
||||
import getMeta from '@/utils/meta'
|
||||
|
||||
function EditorNavigationToolbar() {
|
||||
const [showShareModal, setShowShareModal] = useState(false)
|
||||
@@ -23,8 +21,6 @@ function EditorNavigationToolbar() {
|
||||
setShowShareModal(false)
|
||||
}, [])
|
||||
|
||||
const showNewShareModal = getMeta('ol-linkSharingWarning')
|
||||
|
||||
return (
|
||||
<>
|
||||
<EditorNavigationToolbarRoot
|
||||
@@ -32,22 +28,13 @@ function EditorNavigationToolbar() {
|
||||
openDoc={openDoc}
|
||||
openShareProjectModal={handleOpenShareModal}
|
||||
/>
|
||||
{showNewShareModal ? (
|
||||
<>
|
||||
<EditorOverLimitModal />
|
||||
<ViewOnlyAccessModal />
|
||||
<NewShareProjectModal
|
||||
show={showShareModal}
|
||||
handleOpen={handleOpenShareModal}
|
||||
handleHide={handleHideShareModal}
|
||||
/>
|
||||
</>
|
||||
) : (
|
||||
<ShareProjectModal
|
||||
show={showShareModal}
|
||||
handleHide={handleHideShareModal}
|
||||
/>
|
||||
)}
|
||||
<EditorOverLimitModal />
|
||||
<ViewOnlyAccessModal />
|
||||
<ShareProjectModal
|
||||
show={showShareModal}
|
||||
handleOpen={handleOpenShareModal}
|
||||
handleHide={handleHideShareModal}
|
||||
/>
|
||||
</>
|
||||
)
|
||||
}
|
||||
|
||||
+37
-79
@@ -1,95 +1,53 @@
|
||||
import { useTranslation } from 'react-i18next'
|
||||
import Notification from '@/shared/components/notification'
|
||||
import { upgradePlan } from '@/main/account-upgrade'
|
||||
import { useProjectContext } from '@/shared/context/project-context'
|
||||
import { useUserContext } from '@/shared/context/user-context'
|
||||
import StartFreeTrialButton from '@/shared/components/start-free-trial-button'
|
||||
import getMeta from '@/utils/meta'
|
||||
import OLButton from '@/features/ui/components/ol/ol-button'
|
||||
|
||||
export default function CollaboratorsLimitUpgrade() {
|
||||
const { t } = useTranslation()
|
||||
const { features } = useProjectContext()
|
||||
const user = useUserContext()
|
||||
const linkSharingEnforcement = getMeta('ol-linkSharingEnforcement')
|
||||
|
||||
return (
|
||||
<div className="invite-warning">
|
||||
{linkSharingEnforcement ? (
|
||||
<Notification
|
||||
type="info"
|
||||
customIcon={
|
||||
<img
|
||||
src="/img/share-modal/add-more-editors.svg"
|
||||
alt=""
|
||||
aria-hidden="true"
|
||||
/>
|
||||
}
|
||||
title={t('add_more_editors')}
|
||||
content={
|
||||
<p>
|
||||
{t(
|
||||
'upgrade_to_add_more_editors_and_access_collaboration_features'
|
||||
)}
|
||||
</p>
|
||||
}
|
||||
isActionBelowContent
|
||||
action={
|
||||
user.allowedFreeTrial ? (
|
||||
<StartFreeTrialButton
|
||||
buttonProps={{ variant: 'premium' }}
|
||||
source="project-sharing"
|
||||
variant="limit"
|
||||
>
|
||||
{t('upgrade')}
|
||||
</StartFreeTrialButton>
|
||||
) : (
|
||||
<OLButton
|
||||
variant="premium"
|
||||
onClick={() => {
|
||||
upgradePlan('project-sharing')
|
||||
}}
|
||||
>
|
||||
{t('upgrade')}
|
||||
</OLButton>
|
||||
)
|
||||
}
|
||||
/>
|
||||
) : (
|
||||
<Notification
|
||||
type="info"
|
||||
customIcon={<div />}
|
||||
title={t('upgrade_to_add_more_editors')}
|
||||
content={
|
||||
<p>
|
||||
{t('you_can_only_add_n_people_to_edit_a_project', {
|
||||
count: features.collaborators,
|
||||
})}
|
||||
</p>
|
||||
}
|
||||
action={
|
||||
user.allowedFreeTrial ? (
|
||||
<StartFreeTrialButton
|
||||
buttonProps={{ variant: 'secondary', size: 'sm' }}
|
||||
source="project-sharing"
|
||||
variant="limit"
|
||||
>
|
||||
{t('upgrade')}
|
||||
</StartFreeTrialButton>
|
||||
) : (
|
||||
<OLButton
|
||||
size="sm"
|
||||
variant="secondary"
|
||||
onClick={() => {
|
||||
upgradePlan('project-sharing')
|
||||
}}
|
||||
>
|
||||
{t('upgrade')}
|
||||
</OLButton>
|
||||
)
|
||||
}
|
||||
/>
|
||||
)}
|
||||
<Notification
|
||||
type="info"
|
||||
customIcon={
|
||||
<img
|
||||
src="/img/share-modal/add-more-editors.svg"
|
||||
alt=""
|
||||
aria-hidden="true"
|
||||
/>
|
||||
}
|
||||
title={t('add_more_editors')}
|
||||
content={
|
||||
<p>
|
||||
{t('upgrade_to_add_more_editors_and_access_collaboration_features')}
|
||||
</p>
|
||||
}
|
||||
isActionBelowContent
|
||||
action={
|
||||
user.allowedFreeTrial ? (
|
||||
<StartFreeTrialButton
|
||||
buttonProps={{ variant: 'premium' }}
|
||||
source="project-sharing"
|
||||
variant="limit"
|
||||
>
|
||||
{t('upgrade')}
|
||||
</StartFreeTrialButton>
|
||||
) : (
|
||||
<OLButton
|
||||
variant="premium"
|
||||
onClick={() => {
|
||||
upgradePlan('project-sharing')
|
||||
}}
|
||||
>
|
||||
{t('upgrade')}
|
||||
</OLButton>
|
||||
)
|
||||
}
|
||||
/>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
-1
@@ -16,7 +16,6 @@ const EditorOverLimitModal = () => {
|
||||
setShow(false)
|
||||
}
|
||||
|
||||
// split test: link-sharing-warning
|
||||
// show the over-limit warning if user
|
||||
// is editor on a project over
|
||||
// collaborator limit (once every 24 hours)
|
||||
|
||||
-1
@@ -66,7 +66,6 @@ const ShareProjectModal = React.memo(function ShareProjectModal({
|
||||
|
||||
const { splitTestVariants } = useSplitTestContext()
|
||||
|
||||
// split test: link-sharing-warning
|
||||
// show the new share modal if project owner
|
||||
// is over collaborator limit or has pending editors (once every 24 hours)
|
||||
useEffect(() => {
|
||||
|
||||
-1
@@ -17,7 +17,6 @@ const ViewOnlyAccessModal = () => {
|
||||
setShow(false)
|
||||
}
|
||||
|
||||
// split test: link-sharing-enforcement
|
||||
// show the view-only access modal if
|
||||
// is editor on a project over
|
||||
// collaborator limit (once every week)
|
||||
|
||||
+39
-84
@@ -4,7 +4,6 @@ import getMeta from '@/utils/meta'
|
||||
|
||||
export type RequireAcceptData = {
|
||||
projectName?: string
|
||||
linkSharingChanges: boolean
|
||||
}
|
||||
|
||||
export const RequireAcceptScreen: FC<{
|
||||
@@ -14,94 +13,50 @@ export const RequireAcceptScreen: FC<{
|
||||
const { t } = useTranslation()
|
||||
const user = getMeta('ol-user')
|
||||
|
||||
if (requireAcceptData.linkSharingChanges) {
|
||||
return (
|
||||
<div className="container">
|
||||
<div className="row">
|
||||
<div className="col-md-12">
|
||||
<div className="card">
|
||||
<div className="text-centered link-sharing-invite">
|
||||
<div className="link-sharing-invite-header">
|
||||
<p>
|
||||
{t('youre_joining')}
|
||||
<br />
|
||||
<em>
|
||||
<strong>
|
||||
{requireAcceptData.projectName || 'This project'}
|
||||
</strong>
|
||||
</em>
|
||||
{user && (
|
||||
<>
|
||||
<br />
|
||||
{t('as_email', { email: user.email })}
|
||||
</>
|
||||
)}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="row row-spaced text-center">
|
||||
<div className="col-md-12">
|
||||
<p>
|
||||
{t(
|
||||
'your_name_and_email_address_will_be_visible_to_the_project_owner_and_other_editors'
|
||||
)}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="row row-spaced text-center">
|
||||
<div className="col-md-12">
|
||||
<button
|
||||
className="btn btn-lg btn-primary"
|
||||
type="submit"
|
||||
onClick={() => sendPostRequest(true)}
|
||||
>
|
||||
{t('ok_join_project')}
|
||||
</button>
|
||||
</div>
|
||||
return (
|
||||
<div className="container">
|
||||
<div className="row">
|
||||
<div className="col-md-12">
|
||||
<div className="card">
|
||||
<div className="text-centered link-sharing-invite">
|
||||
<div className="link-sharing-invite-header">
|
||||
<p>
|
||||
{t('youre_joining')}
|
||||
<br />
|
||||
<em>
|
||||
<strong>
|
||||
{requireAcceptData.projectName || 'This project'}
|
||||
</strong>
|
||||
</em>
|
||||
{user && (
|
||||
<>
|
||||
<br />
|
||||
{t('as_email', { email: user.email })}
|
||||
</>
|
||||
)}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="loading-screen">
|
||||
<div className="container">
|
||||
<div className="row">
|
||||
<div className="col-md-8 col-md-offset-2">
|
||||
<div className="card">
|
||||
<div className="page-header text-centered">
|
||||
<h1>
|
||||
{t('invited_to_join')}
|
||||
<br />
|
||||
<em>{requireAcceptData.projectName || 'This project'}</em>
|
||||
</h1>
|
||||
<div className="row row-spaced text-center">
|
||||
<div className="col-md-12">
|
||||
<p>
|
||||
{t(
|
||||
'your_name_and_email_address_will_be_visible_to_the_project_owner_and_other_editors'
|
||||
)}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{user && (
|
||||
<div className="row text-center">
|
||||
<div className="col-md-12">
|
||||
<p>
|
||||
{t('accepting_invite_as')} <em>{user.email}</em>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
|
||||
<div className="row text-center">
|
||||
<div className="col-md-12">
|
||||
<button
|
||||
className="btn btn-lg btn-primary"
|
||||
type="submit"
|
||||
onClick={() => sendPostRequest(true)}
|
||||
>
|
||||
{t('join_project')}
|
||||
</button>
|
||||
</div>
|
||||
<div className="row row-spaced text-center">
|
||||
<div className="col-md-12">
|
||||
<button
|
||||
className="btn btn-lg btn-primary"
|
||||
type="submit"
|
||||
onClick={() => sendPostRequest(true)}
|
||||
>
|
||||
{t('ok_join_project')}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -99,13 +99,9 @@ function TokenAccessRoot() {
|
||||
|
||||
// We don't want the full-size div and back link(?) on
|
||||
// the new page, but we do this so the original page
|
||||
// doesn't change. When tearing down we can clean up
|
||||
// the DOM in the main return
|
||||
if (
|
||||
mode === 'requireAccept' &&
|
||||
requireAcceptData &&
|
||||
requireAcceptData.linkSharingChanges
|
||||
) {
|
||||
// doesn't change.
|
||||
// TODO: clean up the DOM in the main return
|
||||
if (mode === 'requireAccept' && requireAcceptData) {
|
||||
return (
|
||||
<RequireAcceptScreen
|
||||
requireAcceptData={requireAcceptData}
|
||||
@@ -137,13 +133,6 @@ function TokenAccessRoot() {
|
||||
{V1ImportDataScreen && mode === 'v1Import' && v1ImportData && (
|
||||
<V1ImportDataScreen v1ImportData={v1ImportData} />
|
||||
)}
|
||||
|
||||
{mode === 'requireAccept' && requireAcceptData && (
|
||||
<RequireAcceptScreen
|
||||
requireAcceptData={requireAcceptData}
|
||||
sendPostRequest={sendPostRequest}
|
||||
/>
|
||||
)}
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
@@ -1,12 +1,8 @@
|
||||
import { useEditorContext } from '../context/editor-context'
|
||||
import getMeta from '@/utils/meta'
|
||||
|
||||
function useViewerPermissions() {
|
||||
const { permissionsLevel } = useEditorContext()
|
||||
|
||||
const hasViewerPermissions =
|
||||
getMeta('ol-linkSharingWarning') && permissionsLevel === 'readOnly'
|
||||
return hasViewerPermissions
|
||||
return permissionsLevel === 'readOnly'
|
||||
}
|
||||
|
||||
export default useViewerPermissions
|
||||
|
||||
@@ -136,8 +136,6 @@ export interface Meta {
|
||||
'ol-learnedWords': string[]
|
||||
'ol-legacyEditorThemes': string[]
|
||||
'ol-licenseQuantity': number | undefined
|
||||
'ol-linkSharingEnforcement': boolean
|
||||
'ol-linkSharingWarning': boolean
|
||||
'ol-loadingText': string
|
||||
'ol-managedGroupSubscriptions': ManagedGroupSubscription[]
|
||||
'ol-managedInstitutions': ManagedInstitution[]
|
||||
|
||||
Reference in New Issue
Block a user