Commit 697e5475 authored by Steven's avatar Steven

fix: frontend linter

parent 83febf99
...@@ -12,7 +12,6 @@ import { generateDialog } from "./Dialog"; ...@@ -12,7 +12,6 @@ import { generateDialog } from "./Dialog";
const templateList: IdentityProvider[] = [ const templateList: IdentityProvider[] = [
{ {
name: "", name: "",
uid: "",
title: "GitHub", title: "GitHub",
type: IdentityProvider_Type.OAUTH2, type: IdentityProvider_Type.OAUTH2,
identifierFilter: "", identifierFilter: "",
...@@ -34,7 +33,6 @@ const templateList: IdentityProvider[] = [ ...@@ -34,7 +33,6 @@ const templateList: IdentityProvider[] = [
}, },
{ {
name: "", name: "",
uid: "",
title: "GitLab", title: "GitLab",
type: IdentityProvider_Type.OAUTH2, type: IdentityProvider_Type.OAUTH2,
identifierFilter: "", identifierFilter: "",
...@@ -56,7 +54,6 @@ const templateList: IdentityProvider[] = [ ...@@ -56,7 +54,6 @@ const templateList: IdentityProvider[] = [
}, },
{ {
name: "", name: "",
uid: "",
title: "Google", title: "Google",
type: IdentityProvider_Type.OAUTH2, type: IdentityProvider_Type.OAUTH2,
identifierFilter: "", identifierFilter: "",
...@@ -78,7 +75,6 @@ const templateList: IdentityProvider[] = [ ...@@ -78,7 +75,6 @@ const templateList: IdentityProvider[] = [
}, },
{ {
name: "", name: "",
uid: "",
title: "Custom", title: "Custom",
type: IdentityProvider_Type.OAUTH2, type: IdentityProvider_Type.OAUTH2,
identifierFilter: "", identifierFilter: "",
......
...@@ -2,6 +2,7 @@ import { useColorScheme } from "@mui/joy"; ...@@ -2,6 +2,7 @@ import { useColorScheme } from "@mui/joy";
import { useEffect, useRef, useState } from "react"; import { useEffect, useRef, useState } from "react";
import ForceGraph2D, { ForceGraphMethods, LinkObject, NodeObject } from "react-force-graph-2d"; import ForceGraph2D, { ForceGraphMethods, LinkObject, NodeObject } from "react-force-graph-2d";
import useNavigateTo from "@/hooks/useNavigateTo"; import useNavigateTo from "@/hooks/useNavigateTo";
import { extractMemoIdFromName } from "@/store/common";
import { Memo, MemoRelation_Type } from "@/types/proto/api/v1/memo_service"; import { Memo, MemoRelation_Type } from "@/types/proto/api/v1/memo_service";
import { cn } from "@/utils"; import { cn } from "@/utils";
import { LinkType, NodeType } from "./types"; import { LinkType, NodeType } from "./types";
...@@ -47,7 +48,7 @@ const MemoRelationForceGraph = ({ className, memo, parentPage }: Props) => { ...@@ -47,7 +48,7 @@ const MemoRelationForceGraph = ({ className, memo, parentPage }: Props) => {
cooldownTicks={0} cooldownTicks={0}
nodeColor={(node) => (node.id === memo.name ? MAIN_NODE_COLOR : DEFAULT_NODE_COLOR)} nodeColor={(node) => (node.id === memo.name ? MAIN_NODE_COLOR : DEFAULT_NODE_COLOR)}
nodeRelSize={3} nodeRelSize={3}
nodeLabel={(node) => node.memo.uid.slice(0, 6).toLowerCase()} nodeLabel={(node) => extractMemoIdFromName(node.memo.name).slice(0, 6).toLowerCase()}
linkColor={() => (mode === "light" ? "#e4e4e7" : "#3f3f46")} linkColor={() => (mode === "light" ? "#e4e4e7" : "#3f3f46")}
graphData={convertMemoRelationsToGraphData(memo.relations.filter((r) => r.type === MemoRelation_Type.REFERENCE))} graphData={convertMemoRelationsToGraphData(memo.relations.filter((r) => r.type === MemoRelation_Type.REFERENCE))}
onNodeClick={onNodeClick} onNodeClick={onNodeClick}
......
import { LinkIcon, MilestoneIcon } from "lucide-react"; import { LinkIcon, MilestoneIcon } from "lucide-react";
import { memo, useState } from "react"; import { memo, useState } from "react";
import { Link } from "react-router-dom"; import { Link } from "react-router-dom";
import { extractMemoIdFromName } from "@/store/common";
import { Memo, MemoRelation } from "@/types/proto/api/v1/memo_service"; import { Memo, MemoRelation } from "@/types/proto/api/v1/memo_service";
import { cn } from "@/utils"; import { cn } from "@/utils";
import { useTranslate } from "@/utils/i18n"; import { useTranslate } from "@/utils/i18n";
...@@ -65,14 +66,14 @@ const MemoRelationListView = (props: Props) => { ...@@ -65,14 +66,14 @@ const MemoRelationListView = (props: Props) => {
<Link <Link
key={memo.name} key={memo.name}
className="w-auto max-w-full flex flex-row justify-start items-center text-sm leading-5 text-gray-600 dark:text-gray-400 dark:border-zinc-700 dark:bg-zinc-900 hover:underline" className="w-auto max-w-full flex flex-row justify-start items-center text-sm leading-5 text-gray-600 dark:text-gray-400 dark:border-zinc-700 dark:bg-zinc-900 hover:underline"
to={`/m/${memo.uid}`} to={`/${memo.name}`}
viewTransition viewTransition
state={{ state={{
from: parentPage, from: parentPage,
}} }}
> >
<span className="text-xs opacity-60 leading-4 border border-zinc-200 font-mono px-1 rounded-full mr-1 dark:border-zinc-700"> <span className="text-xs opacity-60 leading-4 border border-zinc-200 font-mono px-1 rounded-full mr-1 dark:border-zinc-700">
{memo.uid.slice(0, 6)} {extractMemoIdFromName(memo.name).slice(0, 6)}
</span> </span>
<span className="truncate">{memo.snippet}</span> <span className="truncate">{memo.snippet}</span>
</Link> </Link>
...@@ -87,14 +88,14 @@ const MemoRelationListView = (props: Props) => { ...@@ -87,14 +88,14 @@ const MemoRelationListView = (props: Props) => {
<Link <Link
key={memo.name} key={memo.name}
className="w-auto max-w-full flex flex-row justify-start items-center text-sm leading-5 text-gray-600 dark:text-gray-400 dark:border-zinc-700 dark:bg-zinc-900 hover:underline" className="w-auto max-w-full flex flex-row justify-start items-center text-sm leading-5 text-gray-600 dark:text-gray-400 dark:border-zinc-700 dark:bg-zinc-900 hover:underline"
to={`/m/${memo.uid}`} to={`/${memo.name}`}
viewTransition viewTransition
state={{ state={{
from: parentPage, from: parentPage,
}} }}
> >
<span className="text-xs opacity-60 leading-4 border border-zinc-200 font-mono px-1 rounded-full mr-1 dark:border-zinc-700"> <span className="text-xs opacity-60 leading-4 border border-zinc-200 font-mono px-1 rounded-full mr-1 dark:border-zinc-700">
{memo.uid.slice(0, 6)} {extractMemoIdFromName(memo.name).slice(0, 6)}
</span> </span>
<span className="truncate">{memo.snippet}</span> <span className="truncate">{memo.snippet}</span>
</Link> </Link>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment