mirror of
https://github.com/usememos/memos.git
synced 2025-10-25 05:46:03 +08:00
refactor: move memo property
This commit is contained in:
parent
3401def442
commit
90119c1af8
4 changed files with 511 additions and 511 deletions
|
|
@ -163,7 +163,7 @@ message Memo {
|
|||
|
||||
repeated Reaction reactions = 16 [(google.api.field_behavior) = OUTPUT_ONLY];
|
||||
|
||||
MemoProperty property = 17 [(google.api.field_behavior) = OUTPUT_ONLY];
|
||||
Property property = 17 [(google.api.field_behavior) = OUTPUT_ONLY];
|
||||
|
||||
// The name of the parent memo.
|
||||
// Format: memos/{id}
|
||||
|
|
@ -174,13 +174,13 @@ message Memo {
|
|||
|
||||
// The location of the memo.
|
||||
optional Location location = 20;
|
||||
}
|
||||
|
||||
message MemoProperty {
|
||||
bool has_link = 1;
|
||||
bool has_task_list = 2;
|
||||
bool has_code = 3;
|
||||
bool has_incomplete_tasks = 4;
|
||||
message Property {
|
||||
bool has_link = 1;
|
||||
bool has_task_list = 2;
|
||||
bool has_code = 3;
|
||||
bool has_incomplete_tasks = 4;
|
||||
}
|
||||
}
|
||||
|
||||
message Location {
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
|
|
@ -88,11 +88,11 @@ func (s *APIV1Service) convertMemoFromStore(ctx context.Context, memo *store.Mem
|
|||
return memoMessage, nil
|
||||
}
|
||||
|
||||
func convertMemoPropertyFromStore(property *storepb.MemoPayload_Property) *v1pb.MemoProperty {
|
||||
func convertMemoPropertyFromStore(property *storepb.MemoPayload_Property) *v1pb.Memo_Property {
|
||||
if property == nil {
|
||||
return nil
|
||||
}
|
||||
return &v1pb.MemoProperty{
|
||||
return &v1pb.Memo_Property{
|
||||
HasLink: property.HasLink,
|
||||
HasTaskList: property.HasTaskList,
|
||||
HasCode: property.HasCode,
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
import { isEqual } from "lodash-es";
|
||||
import { CheckCircleIcon, Code2Icon, HashIcon, LinkIcon } from "lucide-react";
|
||||
import { Memo, MemoRelation_Type, MemoProperty } from "@/types/proto/api/v1/memo_service";
|
||||
import { Memo, MemoRelation_Type, Memo_Property } from "@/types/proto/api/v1/memo_service";
|
||||
import { cn } from "@/utils";
|
||||
import { useTranslate } from "@/utils/i18n";
|
||||
import MemoRelationForceGraph from "../MemoRelationForceGraph";
|
||||
|
|
@ -13,7 +13,7 @@ interface Props {
|
|||
|
||||
const MemoDetailSidebar = ({ memo, className, parentPage }: Props) => {
|
||||
const t = useTranslate();
|
||||
const property = MemoProperty.fromPartial(memo.property || {});
|
||||
const property = Memo_Property.fromPartial(memo.property || {});
|
||||
const hasSpecialProperty = property.hasLink || property.hasTaskList || property.hasCode || property.hasIncompleteTasks;
|
||||
const shouldShowRelationGraph = memo.relations.filter((r) => r.type === MemoRelation_Type.REFERENCE).length > 0;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue