mirror of
https://github.com/overleaf/overleaf.git
synced 2025-04-11 03:17:18 +00:00
Merge pull request #20389 from overleaf/jdt-add-writefull-commons-to-v1
Add writefull commons to v1 GitOrigin-RevId: 36d1022f41b4db3701c6b8fa2120b035b05b38ba
This commit is contained in:
parent
e039d020a3
commit
aca9466c49
5 changed files with 14 additions and 1 deletions
services/web
frontend/js/features/project-list/components/notifications
test/frontend/features/settings
components/emails
fixtures
types
|
@ -4,6 +4,7 @@ import { sendMB } from '@/infrastructure/event-tracking'
|
|||
import customLocalStorage from '@/infrastructure/local-storage'
|
||||
import WritefullLogo from '@/shared/svgs/writefull-logo'
|
||||
import OLButton from '@/features/ui/components/ol/ol-button'
|
||||
import getMeta from '@/utils/meta'
|
||||
|
||||
const eventSegmentation = {
|
||||
location: 'dashboard-banner',
|
||||
|
@ -20,6 +21,11 @@ function WritefullPremiumPromoBanner({
|
|||
setShow: (value: boolean) => void
|
||||
onDismiss: () => void
|
||||
}) {
|
||||
// dont show the add to WF commons users since their license already includes it
|
||||
const userAffiliations = getMeta('ol-userAffiliations') || []
|
||||
const hasWritefullCommons = userAffiliations.some(
|
||||
affil => affil.institution?.writefullCommonsAccount
|
||||
)
|
||||
const handleClose = useCallback(() => {
|
||||
customLocalStorage.setItem('has_dismissed_writefull_promo_banner', true)
|
||||
setShow(false)
|
||||
|
@ -27,7 +33,7 @@ function WritefullPremiumPromoBanner({
|
|||
onDismiss()
|
||||
}, [setShow, onDismiss])
|
||||
|
||||
if (!show) {
|
||||
if (!show || hasWritefullCommons) {
|
||||
return null
|
||||
}
|
||||
|
||||
|
|
|
@ -23,6 +23,7 @@ const userEmailData: UserEmailData & { affiliation: Affiliation } = {
|
|||
department: 'Art History',
|
||||
institution: {
|
||||
commonsAccount: false,
|
||||
writefullCommonsAccount: false,
|
||||
confirmed: true,
|
||||
id: 1,
|
||||
isUniversity: true,
|
||||
|
|
|
@ -23,6 +23,7 @@ const userData1: UserEmailData & { affiliation: Affiliation } = {
|
|||
department: null,
|
||||
institution: {
|
||||
commonsAccount: false,
|
||||
writefullCommonsAccount: false,
|
||||
confirmed: true,
|
||||
id: 1,
|
||||
isUniversity: false,
|
||||
|
@ -53,6 +54,7 @@ const userData2: UserEmailData & { affiliation: Affiliation } = {
|
|||
department: 'Art History',
|
||||
institution: {
|
||||
commonsAccount: false,
|
||||
writefullCommonsAccount: false,
|
||||
confirmed: true,
|
||||
id: 1,
|
||||
isUniversity: false,
|
||||
|
|
|
@ -24,6 +24,7 @@ export const professionalUserData: UserEmailData & {
|
|||
department: 'Art History',
|
||||
institution: {
|
||||
commonsAccount: false,
|
||||
writefullCommonsAccount: false,
|
||||
confirmed: true,
|
||||
id: 1,
|
||||
isUniversity: false,
|
||||
|
@ -56,6 +57,7 @@ export const unconfirmedCommonsUserData: UserEmailData & {
|
|||
department: 'Art History',
|
||||
institution: {
|
||||
commonsAccount: true,
|
||||
writefullCommonsAccount: false,
|
||||
confirmed: true,
|
||||
id: 1,
|
||||
isUniversity: false,
|
||||
|
@ -85,6 +87,7 @@ export const ssoUserData: UserEmailData = {
|
|||
department: 'Art History',
|
||||
institution: {
|
||||
commonsAccount: true,
|
||||
writefullCommonsAccount: false,
|
||||
confirmed: true,
|
||||
id: 2,
|
||||
isUniversity: true,
|
||||
|
|
|
@ -2,6 +2,7 @@ import { Nullable } from './utils'
|
|||
|
||||
export type Institution = {
|
||||
commonsAccount: boolean
|
||||
writefullCommonsAccount: boolean
|
||||
confirmed: boolean
|
||||
id: number
|
||||
isUniversity: boolean
|
||||
|
|
Loading…
Add table
Reference in a new issue