mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
revert documentation-on-editor split test implementation
GitOrigin-RevId: dacdd0eca50a14525366d55f1c4cc12f7b54c0de
This commit is contained in:
parent
71a8c69a30
commit
2b4d3dcb20
4 changed files with 0 additions and 87 deletions
|
@ -647,21 +647,6 @@ const ProjectController = {
|
|||
}
|
||||
)
|
||||
},
|
||||
editorDocumentationButton(cb) {
|
||||
SplitTestHandler.getAssignment(
|
||||
req,
|
||||
res,
|
||||
'documentation-on-editor',
|
||||
(error, assignment) => {
|
||||
// do not fail editor load if assignment fails
|
||||
if (error) {
|
||||
cb(null, { variant: 'default' })
|
||||
} else {
|
||||
cb(null, assignment)
|
||||
}
|
||||
}
|
||||
)
|
||||
},
|
||||
// this is only needed until the survey link is removed from the toolbar
|
||||
richTextAssignment(cb) {
|
||||
SplitTestHandler.getAssignment(
|
||||
|
|
|
@ -1,62 +0,0 @@
|
|||
import { useState } from 'react'
|
||||
import Icon from '../../../shared/components/icon'
|
||||
import { useSplitTestContext } from '../../../shared/context/split-test-context'
|
||||
import { sendMB } from '../../../infrastructure/event-tracking'
|
||||
import PropTypes from 'prop-types'
|
||||
import { Button } from 'react-bootstrap'
|
||||
|
||||
function DocumentationButton() {
|
||||
const { splitTestVariants } = useSplitTestContext({
|
||||
splitTestVariants: PropTypes.object,
|
||||
})
|
||||
const documentationButtonVariant =
|
||||
splitTestVariants['documentation-on-editor']
|
||||
|
||||
let documentationButtonText = ''
|
||||
|
||||
if (documentationButtonVariant === 'latex-help')
|
||||
documentationButtonText = 'LaTeX help'
|
||||
else if (documentationButtonVariant === 'documentation')
|
||||
documentationButtonText = 'Documentation'
|
||||
else if (documentationButtonVariant === 'help-guides')
|
||||
documentationButtonText = 'Help guides'
|
||||
const [showDocumentationButton, setShowDocumentationButton] = useState(
|
||||
!(documentationButtonVariant === 'default')
|
||||
)
|
||||
|
||||
function handleCloseClick() {
|
||||
sendMB('file-tree-documentation-click')
|
||||
|
||||
setShowDocumentationButton(false)
|
||||
}
|
||||
|
||||
function handleDocumentationLinkClick() {
|
||||
sendMB('file-tree-documentation-click')
|
||||
}
|
||||
|
||||
if (!showDocumentationButton) return null
|
||||
|
||||
return (
|
||||
<div className="documentation-btn-container">
|
||||
<a
|
||||
href="/learn"
|
||||
target="_blank"
|
||||
rel="noreferrer"
|
||||
className="documentation-link"
|
||||
onClick={handleDocumentationLinkClick}
|
||||
>
|
||||
<Icon type="question-circle" className="outline-caret-icon" />
|
||||
<h4 className="outline-header-name">{documentationButtonText}</h4>
|
||||
</a>
|
||||
<Button bsStyle="link" className="documentation-close">
|
||||
<Icon
|
||||
type="times"
|
||||
onClick={handleCloseClick}
|
||||
className="outline-caret-icon "
|
||||
/>
|
||||
</Button>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
export default DocumentationButton
|
|
@ -1,9 +0,0 @@
|
|||
import { react2angular } from 'react2angular'
|
||||
import DocumentationButton from '../components/documentation-button'
|
||||
import { rootContext } from '../../../../../frontend/js/shared/context/root-context'
|
||||
import App from '../../../../../frontend/js/base'
|
||||
|
||||
App.component(
|
||||
'documentationButton',
|
||||
react2angular(rootContext.use(DocumentationButton), [])
|
||||
)
|
|
@ -66,7 +66,6 @@ import './features/share-project-modal/controllers/react-share-project-modal-con
|
|||
import './features/source-editor/controllers/editor-switch-controller'
|
||||
import './features/source-editor/controllers/cm6-switch-away-survey-controller'
|
||||
import './features/source-editor/controllers/legacy-editor-warning-controller'
|
||||
import './features/outline/controllers/documentation-button-controller'
|
||||
import './features/history/controllers/history-controller'
|
||||
import './features/history/controllers/history-file-tree-controller'
|
||||
import { cleanupServiceWorker } from './utils/service-worker-cleanup'
|
||||
|
|
Loading…
Reference in a new issue