mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-11-12 13:13:45 +01:00
Admin tools: remove themed pages env var; style admin header
- themed pages now is enabled by default upstream - make the header background red on admin manage urers/projects pages - fix minor bug
This commit is contained in:
@@ -1243,9 +1243,6 @@ module.exports = {
|
|||||||
},
|
},
|
||||||
|
|
||||||
splitTestOverrides: {
|
splitTestOverrides: {
|
||||||
...(process.env.OVERLEAF_THEMED_DASHBOARD?.toLowerCase() === 'true' ? {
|
|
||||||
'themed-project-dashboard': 'enabled',
|
|
||||||
} : {}),
|
|
||||||
...(process.env.OVERLEAF_HISTORY_RESTORE?.toLowerCase() === 'true' ? {
|
...(process.env.OVERLEAF_HISTORY_RESTORE?.toLowerCase() === 'true' ? {
|
||||||
'history-ranges-support': 'enabled',
|
'history-ranges-support': 'enabled',
|
||||||
'revert-file': 'enabled',
|
'revert-file': 'enabled',
|
||||||
|
|||||||
@@ -16,7 +16,6 @@ import { Project } from '../../../../app/src/models/Project.mjs'
|
|||||||
import { DeletedProject } from '../../../../app/src/models/DeletedProject.mjs'
|
import { DeletedProject } from '../../../../app/src/models/DeletedProject.mjs'
|
||||||
import { OError } from '../../../../app/src/Features/Errors/Errors.js'
|
import { OError } from '../../../../app/src/Features/Errors/Errors.js'
|
||||||
import HttpErrorHandler from '../../../../app/src/Features/Errors/HttpErrorHandler.mjs'
|
import HttpErrorHandler from '../../../../app/src/Features/Errors/HttpErrorHandler.mjs'
|
||||||
import SplitTestHandler from '../../../../app/src/Features/SplitTests/SplitTestHandler.mjs'
|
|
||||||
|
|
||||||
const __dirname = Path.dirname(fileURLToPath(import.meta.url))
|
const __dirname = Path.dirname(fileURLToPath(import.meta.url))
|
||||||
|
|
||||||
@@ -50,12 +49,6 @@ async function manageProjectsPage(req, res, next) {
|
|||||||
user
|
user
|
||||||
)
|
)
|
||||||
|
|
||||||
await SplitTestHandler.promises.getAssignment(
|
|
||||||
req,
|
|
||||||
res,
|
|
||||||
'themed-project-dashboard'
|
|
||||||
)
|
|
||||||
|
|
||||||
res.render(Path.resolve(__dirname, '../views/manage-projects-react'), {
|
res.render(Path.resolve(__dirname, '../views/manage-projects-react'), {
|
||||||
title: 'Manage Projects',
|
title: 'Manage Projects',
|
||||||
userSettings,
|
userSettings,
|
||||||
|
|||||||
@@ -23,7 +23,6 @@ import HttpErrorHandler from '../../../../app/src/Features/Errors/HttpErrorHandl
|
|||||||
import ErrorController from '../../../../app/src/Features/Errors/ErrorController.mjs'
|
import ErrorController from '../../../../app/src/Features/Errors/ErrorController.mjs'
|
||||||
import Errors, { OError } from '../../../../app/src/Features/Errors/Errors.js'
|
import Errors, { OError } from '../../../../app/src/Features/Errors/Errors.js'
|
||||||
import { db } from '../../../../app/src/infrastructure/mongodb.mjs'
|
import { db } from '../../../../app/src/infrastructure/mongodb.mjs'
|
||||||
import SplitTestHandler from '../../../../app/src/Features/SplitTests/SplitTestHandler.mjs'
|
|
||||||
|
|
||||||
const __dirname = Path.dirname(fileURLToPath(import.meta.url))
|
const __dirname = Path.dirname(fileURLToPath(import.meta.url))
|
||||||
|
|
||||||
@@ -84,12 +83,6 @@ async function manageUsersPage(req, res, next) {
|
|||||||
status: prefetchedUsersBlob ? 'success' : 'error',
|
status: prefetchedUsersBlob ? 'success' : 'error',
|
||||||
})
|
})
|
||||||
|
|
||||||
await SplitTestHandler.promises.getAssignment(
|
|
||||||
req,
|
|
||||||
res,
|
|
||||||
'themed-project-dashboard'
|
|
||||||
)
|
|
||||||
|
|
||||||
const userId = SessionManager.getLoggedInUserId(req.session)
|
const userId = SessionManager.getLoggedInUserId(req.session)
|
||||||
const user = await User.findById(userId, 'ace')
|
const user = await User.findById(userId, 'ace')
|
||||||
|
|
||||||
@@ -429,7 +422,7 @@ async function purgeDeletedUser(req, res, next) {
|
|||||||
|
|
||||||
logger.debug({ deleterUserId, userId }, 'admin is trying to purge deleted user account')
|
logger.debug({ deleterUserId, userId }, 'admin is trying to purge deleted user account')
|
||||||
try {
|
try {
|
||||||
UserDeleter.promises.expireDeletedUser(userId)
|
await UserDeleter.promises.expireDeletedUser(userId)
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
logger.warn({ restorerId, userId }, err.message)
|
logger.warn({ restorerId, userId }, err.message)
|
||||||
const message = 'Something went wrong. The user is already deleted?'
|
const message = 'Something went wrong. The user is already deleted?'
|
||||||
|
|||||||
+2
-2
@@ -41,7 +41,7 @@ export function ProjectListDsNav() {
|
|||||||
totalPages,
|
totalPages,
|
||||||
} = useProjectListContext()
|
} = useProjectListContext()
|
||||||
const { getUserNameById } = useUserIdentityContext()
|
const { getUserNameById } = useUserIdentityContext()
|
||||||
const activeOverallTheme = useActiveOverallTheme('themed-project-dashboard')
|
const activeOverallTheme = useActiveOverallTheme()
|
||||||
|
|
||||||
const userName = projectsOwnerId ? getUserNameById(projectsOwnerId) : t('all_users')
|
const userName = projectsOwnerId ? getUserNameById(projectsOwnerId) : t('all_users')
|
||||||
const tableTopArea = (
|
const tableTopArea = (
|
||||||
@@ -58,7 +58,7 @@ export function ProjectListDsNav() {
|
|||||||
)
|
)
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="project-ds-nav-page website-redesign">
|
<div className="project-ds-nav-page website-redesign red-nav-bar-for-admins">
|
||||||
<div className="manage-projects-page">
|
<div className="manage-projects-page">
|
||||||
<DefaultNavbar
|
<DefaultNavbar
|
||||||
{...navbarProps}
|
{...navbarProps}
|
||||||
|
|||||||
+1
-1
@@ -12,7 +12,7 @@ import useThemedPage from '@/shared/hooks/use-themed-page'
|
|||||||
|
|
||||||
export default function ProjectListRoot() {
|
export default function ProjectListRoot() {
|
||||||
|
|
||||||
useThemedPage('themed-project-dashboard')
|
useThemedPage()
|
||||||
const { isLoading, loadProgress } = useProjectListContext()
|
const { isLoading, loadProgress } = useProjectListContext()
|
||||||
|
|
||||||
const { t } = useTranslation()
|
const { t } = useTranslation()
|
||||||
|
|||||||
+1
-4
@@ -7,12 +7,10 @@ import { usePersistedResize } from '@/shared/hooks/use-resize'
|
|||||||
import getMeta from '@/utils/meta'
|
import getMeta from '@/utils/meta'
|
||||||
import OLTooltip from '@/shared/components/ol/ol-tooltip'
|
import OLTooltip from '@/shared/components/ol/ol-tooltip'
|
||||||
import { AccountMenuItems } from '@/shared/components/navbar/account-menu-items'
|
import { AccountMenuItems } from '@/shared/components/navbar/account-menu-items'
|
||||||
import { useFeatureFlag } from '@/shared/context/split-test-context'
|
|
||||||
import SidebarFilters from './sidebar-filters'
|
import SidebarFilters from './sidebar-filters'
|
||||||
import { getUserName } from '../../util/user'
|
import { getUserName } from '../../util/user'
|
||||||
import { useUserIdentityContext } from '../../../user-list/context/user-identity-context'
|
import { useUserIdentityContext } from '../../../user-list/context/user-identity-context'
|
||||||
import { useProjectListContext } from '../../context/project-list-context'
|
import { useProjectListContext } from '../../context/project-list-context'
|
||||||
|
|
||||||
import { useScrolled } from '@/features/project-list/components/sidebar/use-scroll'
|
import { useScrolled } from '@/features/project-list/components/sidebar/use-scroll'
|
||||||
import { useSendProjectListMB } from '@/features/project-list/components/project-list-events'
|
import { useSendProjectListMB } from '@/features/project-list/components/project-list-events'
|
||||||
|
|
||||||
@@ -26,7 +24,6 @@ function SidebarDsNav() {
|
|||||||
const sendMB = useSendProjectListMB()
|
const sendMB = useSendProjectListMB()
|
||||||
const { sessionUser } = getMeta('ol-navbar')
|
const { sessionUser } = getMeta('ol-navbar')
|
||||||
const { containerRef, scrolledUp } = useScrolled()
|
const { containerRef, scrolledUp } = useScrolled()
|
||||||
const themedDsNav = useFeatureFlag('themed-project-dashboard')
|
|
||||||
|
|
||||||
const { getUserNameById } = useUserIdentityContext()
|
const { getUserNameById } = useUserIdentityContext()
|
||||||
const { projectsOwnerId } = useProjectListContext()
|
const { projectsOwnerId } = useProjectListContext()
|
||||||
@@ -128,7 +125,7 @@ function SidebarDsNav() {
|
|||||||
<AccountMenuItems
|
<AccountMenuItems
|
||||||
sessionUser={sessionUser}
|
sessionUser={sessionUser}
|
||||||
showSubscriptionLink={false}
|
showSubscriptionLink={false}
|
||||||
showThemeToggle={themedDsNav}
|
showThemeToggle={true}
|
||||||
/>
|
/>
|
||||||
</Dropdown.Menu>
|
</Dropdown.Menu>
|
||||||
</Dropdown>
|
</Dropdown>
|
||||||
|
|||||||
+1
-3
@@ -7,7 +7,6 @@ import { usePersistedResize } from '@/shared/hooks/use-resize'
|
|||||||
import getMeta from '@/utils/meta'
|
import getMeta from '@/utils/meta'
|
||||||
import OLTooltip from '@/shared/components/ol/ol-tooltip'
|
import OLTooltip from '@/shared/components/ol/ol-tooltip'
|
||||||
import { AccountMenuItems } from '@/shared/components/navbar/account-menu-items'
|
import { AccountMenuItems } from '@/shared/components/navbar/account-menu-items'
|
||||||
import { useFeatureFlag } from '@/shared/context/split-test-context'
|
|
||||||
import SidebarFilters from './sidebar-filters'
|
import SidebarFilters from './sidebar-filters'
|
||||||
import CreateAccountButton from '../create-account-button'
|
import CreateAccountButton from '../create-account-button'
|
||||||
import { useSendUserListMB } from '../user-list-events'
|
import { useSendUserListMB } from '../user-list-events'
|
||||||
@@ -22,7 +21,6 @@ function SidebarDsNav() {
|
|||||||
const sendMB = useSendUserListMB()
|
const sendMB = useSendUserListMB()
|
||||||
const { sessionUser } = getMeta('ol-navbar')
|
const { sessionUser } = getMeta('ol-navbar')
|
||||||
const { containerRef, scrolledUp, scrolledDown } = useScrolled()
|
const { containerRef, scrolledUp, scrolledDown } = useScrolled()
|
||||||
const themedDsNav = useFeatureFlag('themed-project-dashboard')
|
|
||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
className="user-list-sidebar-wrapper-react d-none d-md-flex"
|
className="user-list-sidebar-wrapper-react d-none d-md-flex"
|
||||||
@@ -100,7 +98,7 @@ function SidebarDsNav() {
|
|||||||
<AccountMenuItems
|
<AccountMenuItems
|
||||||
sessionUser={sessionUser}
|
sessionUser={sessionUser}
|
||||||
showSubscriptionLink={false}
|
showSubscriptionLink={false}
|
||||||
showThemeToggle={themedDsNav}
|
showThemeToggle={true}
|
||||||
/>
|
/>
|
||||||
</Dropdown.Menu>
|
</Dropdown.Menu>
|
||||||
</Dropdown>
|
</Dropdown>
|
||||||
|
|||||||
+2
-2
@@ -38,7 +38,7 @@ export function UserListDsNav() {
|
|||||||
setCurrentPage,
|
setCurrentPage,
|
||||||
totalPages,
|
totalPages,
|
||||||
} = useUserListContext()
|
} = useUserListContext()
|
||||||
const activeOverallTheme = useActiveOverallTheme('themed-project-dashboard')
|
const activeOverallTheme = useActiveOverallTheme()
|
||||||
|
|
||||||
const tableTopArea = (
|
const tableTopArea = (
|
||||||
<div className="pt-2 pb-3 d-md-none d-flex gap-2">
|
<div className="pt-2 pb-3 d-md-none d-flex gap-2">
|
||||||
@@ -54,7 +54,7 @@ export function UserListDsNav() {
|
|||||||
)
|
)
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="user-ds-nav-page website-redesign">
|
<div className="user-ds-nav-page website-redesign red-nav-bar-for-admins">
|
||||||
<DefaultNavbar
|
<DefaultNavbar
|
||||||
{...navbarProps}
|
{...navbarProps}
|
||||||
overleafLogo={
|
overleafLogo={
|
||||||
|
|||||||
+1
-1
@@ -10,7 +10,7 @@ import useThemedPage from '@/shared/hooks/use-themed-page'
|
|||||||
import { UserListDsNav } from './user-list-ds-nav'
|
import { UserListDsNav } from './user-list-ds-nav'
|
||||||
|
|
||||||
export default function UserListRoot() {
|
export default function UserListRoot() {
|
||||||
useThemedPage('themed-project-dashboard')
|
useThemedPage()
|
||||||
const { isLoading, loadProgress } = useUserListContext()
|
const { isLoading, loadProgress } = useUserListContext()
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
|||||||
Reference in New Issue
Block a user