feat: item linking (#1779)
This commit is contained in:
@@ -3,17 +3,17 @@ import { FunctionComponent, useCallback, useRef, useState } from 'react'
|
||||
import Icon from '@/Components/Icon/Icon'
|
||||
import { NavigationController } from '@/Controllers/Navigation/NavigationController'
|
||||
import { NotesController } from '@/Controllers/NotesController'
|
||||
import { NoteTagsController } from '@/Controllers/NoteTagsController'
|
||||
import { KeyboardKey } from '@standardnotes/ui-services'
|
||||
import Popover from '../Popover/Popover'
|
||||
import { LinkingController } from '@/Controllers/LinkingController'
|
||||
|
||||
type Props = {
|
||||
navigationController: NavigationController
|
||||
notesController: NotesController
|
||||
noteTagsController: NoteTagsController
|
||||
linkingController: LinkingController
|
||||
}
|
||||
|
||||
const AddTagOption: FunctionComponent<Props> = ({ navigationController, notesController, noteTagsController }) => {
|
||||
const AddTagOption: FunctionComponent<Props> = ({ navigationController, notesController, linkingController }) => {
|
||||
const menuContainerRef = useRef<HTMLDivElement>(null)
|
||||
const buttonRef = useRef<HTMLButtonElement>(null)
|
||||
|
||||
@@ -63,7 +63,7 @@ const AddTagOption: FunctionComponent<Props> = ({ navigationController, notesCon
|
||||
className={`overflow-hidden overflow-ellipsis whitespace-nowrap
|
||||
${notesController.isTagInSelectedNotes(tag) ? 'font-bold' : ''}`}
|
||||
>
|
||||
{noteTagsController.getLongTitle(tag)}
|
||||
{linkingController.getTitleForLinkedTag(tag)?.longTitle}
|
||||
</span>
|
||||
</button>
|
||||
))}
|
||||
|
||||
@@ -178,7 +178,7 @@ const NotesOptions = ({
|
||||
application,
|
||||
navigationController,
|
||||
notesController,
|
||||
noteTagsController,
|
||||
linkingController,
|
||||
historyModalController,
|
||||
closeMenu,
|
||||
}: NotesOptionsProps) => {
|
||||
@@ -327,7 +327,7 @@ const NotesOptions = ({
|
||||
<AddTagOption
|
||||
navigationController={navigationController}
|
||||
notesController={notesController}
|
||||
noteTagsController={noteTagsController}
|
||||
linkingController={linkingController}
|
||||
/>
|
||||
)}
|
||||
{unpinned && (
|
||||
|
||||
@@ -5,15 +5,15 @@ import NotesOptions from './NotesOptions'
|
||||
import { WebApplication } from '@/Application/Application'
|
||||
import { NotesController } from '@/Controllers/NotesController'
|
||||
import { NavigationController } from '@/Controllers/Navigation/NavigationController'
|
||||
import { NoteTagsController } from '@/Controllers/NoteTagsController'
|
||||
import { HistoryModalController } from '@/Controllers/NoteHistory/HistoryModalController'
|
||||
import Popover from '../Popover/Popover'
|
||||
import { LinkingController } from '@/Controllers/LinkingController'
|
||||
|
||||
type Props = {
|
||||
application: WebApplication
|
||||
navigationController: NavigationController
|
||||
notesController: NotesController
|
||||
noteTagsController: NoteTagsController
|
||||
linkingController: LinkingController
|
||||
historyModalController: HistoryModalController
|
||||
onClickPreprocessing?: () => Promise<void>
|
||||
}
|
||||
@@ -22,7 +22,7 @@ const NotesOptionsPanel = ({
|
||||
application,
|
||||
navigationController,
|
||||
notesController,
|
||||
noteTagsController,
|
||||
linkingController,
|
||||
historyModalController,
|
||||
onClickPreprocessing,
|
||||
}: Props) => {
|
||||
@@ -53,7 +53,7 @@ const NotesOptionsPanel = ({
|
||||
application={application}
|
||||
navigationController={navigationController}
|
||||
notesController={notesController}
|
||||
noteTagsController={noteTagsController}
|
||||
linkingController={linkingController}
|
||||
historyModalController={historyModalController}
|
||||
closeMenu={toggleMenu}
|
||||
/>
|
||||
|
||||
@@ -2,13 +2,13 @@ import { WebApplication } from '@/Application/Application'
|
||||
import { HistoryModalController } from '@/Controllers/NoteHistory/HistoryModalController'
|
||||
import { NavigationController } from '@/Controllers/Navigation/NavigationController'
|
||||
import { NotesController } from '@/Controllers/NotesController'
|
||||
import { NoteTagsController } from '@/Controllers/NoteTagsController'
|
||||
import { LinkingController } from '@/Controllers/LinkingController'
|
||||
|
||||
export type NotesOptionsProps = {
|
||||
application: WebApplication
|
||||
navigationController: NavigationController
|
||||
notesController: NotesController
|
||||
noteTagsController: NoteTagsController
|
||||
linkingController: LinkingController
|
||||
historyModalController: HistoryModalController
|
||||
closeMenu: () => void
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user