Merge pull request #14786 from overleaf/td-git-bridge-modal-paywall

Show paywall in Git bridge dialog when appropriate

GitOrigin-RevId: c6056c2a24fe5f2026448cd6cef2449057803cea
This commit is contained in:
Mathias Jakobsen 2023-09-13 10:07:11 +01:00 committed by Copybot
parent 96ba8a92f4
commit f4ebe98d91
4 changed files with 38 additions and 0 deletions

View file

@ -26,6 +26,7 @@ export const projectShape = {
mendeley: PropTypes.bool,
zotero: PropTypes.bool,
versioning: PropTypes.bool,
gitBridge: PropTypes.bool,
}),
publicAccessLevel: PropTypes.string,
owner: PropTypes.shape({

View file

@ -23,6 +23,7 @@ UserContext.Provider.propTypes = {
zotero: PropTypes.boolean,
references: PropTypes.boolean,
compileTimeout: PropTypes.number,
gitBridge: PropTypes.boolean,
}),
refProviders: PropTypes.shape({
mendeley: PropTypes.boolean,

View file

@ -244,6 +244,14 @@ describe('<EditorLeftMenu />', function () {
ui: {
leftMenuShown: true,
},
project: {
owner: {
_id: '123',
},
features: {
gitBridge: true,
},
},
})
cy.mount(
@ -257,6 +265,31 @@ describe('<EditorLeftMenu />', function () {
cy.findByText(/your project using the link displayed below/)
})
it('shows git modal paywall correctly', function () {
const scope = mockScope({
ui: {
leftMenuShown: true,
},
project: {
owner: {
_id: '123',
},
features: {
gitBridge: false,
},
},
})
cy.mount(
<EditorProviders scope={scope}>
<EditorLeftMenu />
</EditorProviders>
)
cy.findByRole('button', { name: 'Git' }).click()
cy.findByText('Collaborate online and offline, using your own workflow')
})
it('shows github modal correctly', function () {
cy.intercept('GET', '/user/github-sync/status', {
available: false,

View file

@ -23,6 +23,9 @@ type Scope = {
owner: {
_id: string
}
features?: {
gitBridge?: boolean
}
}
user?: {
features?: {