mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-11-14 22:23:42 +01:00
Merge pull request #35906 from overleaf/dk-library-references-trashed
Soft-delete library references (move to trash) GitOrigin-RevId: 908a4d41724300c70d56e850cdb519b7a274ad5a
This commit is contained in:
+19
-3
@@ -15,12 +15,26 @@ import { useProjectListContext } from '@/features/project-list/context/project-l
|
||||
import importOverleafModules from '../../../../../macros/import-overleaf-module.macro'
|
||||
import { ActivePage } from '../../util/navigation-state'
|
||||
|
||||
function SidebarDsNav({ activePage }: { activePage: ActivePage }) {
|
||||
function SidebarDsNav({
|
||||
activePage,
|
||||
trashActive = false,
|
||||
}: {
|
||||
activePage: ActivePage
|
||||
|
||||
/**
|
||||
* Whether the trash is active. This is only relevant when the active page is
|
||||
* "library" as which project page is active is determined by the selected filter.
|
||||
*/
|
||||
trashActive?: boolean
|
||||
}) {
|
||||
const { t } = useTranslation()
|
||||
const { show: showAddAffiliationWidget } = useAddAffiliation()
|
||||
const isLibraryEnabled = isSplitTestEnabled('overleaf-library')
|
||||
const { filter, selectedTagId, selectFilter } = useProjectListContext()
|
||||
const isTrashActive = selectedTagId === undefined && filter === 'trashed'
|
||||
const isTrashActive =
|
||||
activePage === 'library'
|
||||
? trashActive
|
||||
: selectedTagId === undefined && filter === 'trashed'
|
||||
const [dsNavLibraryLinkModule] = importOverleafModules('dsNavLibraryLink')
|
||||
const DsNavLibraryLink: JSXElementConstructor<{ active?: boolean }> =
|
||||
dsNavLibraryLinkModule?.import.default
|
||||
@@ -69,7 +83,9 @@ function SidebarDsNav({ activePage }: { activePage: ActivePage }) {
|
||||
{isLibraryEnabled && (
|
||||
<>
|
||||
{DsNavLibraryLink && (
|
||||
<DsNavLibraryLink active={activePage === 'library'} />
|
||||
<DsNavLibraryLink
|
||||
active={activePage === 'library' && !trashActive}
|
||||
/>
|
||||
)}
|
||||
<button
|
||||
type="button"
|
||||
|
||||
@@ -211,6 +211,7 @@ export interface Meta {
|
||||
'ol-languages': SpellCheckLanguage[]
|
||||
'ol-learnedWords': string[]
|
||||
'ol-legacyEditorThemes': { name: string; dark: boolean }[]
|
||||
'ol-libraryView': 'library' | 'trashed'
|
||||
'ol-licenseQuantity'?: number
|
||||
'ol-loadingText': string
|
||||
'ol-localIndividualPlans': LocalIndividualPlans
|
||||
|
||||
Reference in New Issue
Block a user