refactor: move memo property

pull/4474/head^2
Johnny 2 months ago
parent 3401def442
commit 90119c1af8

@ -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,14 +174,14 @@ message Memo {
// The location of the memo.
optional Location location = 20;
}
message MemoProperty {
message Property {
bool has_link = 1;
bool has_task_list = 2;
bool has_code = 3;
bool has_incomplete_tasks = 4;
}
}
message Location {
string placeholder = 1;

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…
Cancel
Save