mirror of
https://github.com/usememos/memos.git
synced 2025-06-05 22:09:59 +02:00
refactor: move memo property
This commit is contained in:
@@ -163,7 +163,7 @@ message Memo {
|
|||||||
|
|
||||||
repeated Reaction reactions = 16 [(google.api.field_behavior) = OUTPUT_ONLY];
|
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.
|
// The name of the parent memo.
|
||||||
// Format: memos/{id}
|
// Format: memos/{id}
|
||||||
@@ -174,13 +174,13 @@ message Memo {
|
|||||||
|
|
||||||
// The location of the memo.
|
// The location of the memo.
|
||||||
optional Location location = 20;
|
optional Location location = 20;
|
||||||
}
|
|
||||||
|
|
||||||
message MemoProperty {
|
message Property {
|
||||||
bool has_link = 1;
|
bool has_link = 1;
|
||||||
bool has_task_list = 2;
|
bool has_task_list = 2;
|
||||||
bool has_code = 3;
|
bool has_code = 3;
|
||||||
bool has_incomplete_tasks = 4;
|
bool has_incomplete_tasks = 4;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
message Location {
|
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
|
return memoMessage, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func convertMemoPropertyFromStore(property *storepb.MemoPayload_Property) *v1pb.MemoProperty {
|
func convertMemoPropertyFromStore(property *storepb.MemoPayload_Property) *v1pb.Memo_Property {
|
||||||
if property == nil {
|
if property == nil {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
return &v1pb.MemoProperty{
|
return &v1pb.Memo_Property{
|
||||||
HasLink: property.HasLink,
|
HasLink: property.HasLink,
|
||||||
HasTaskList: property.HasTaskList,
|
HasTaskList: property.HasTaskList,
|
||||||
HasCode: property.HasCode,
|
HasCode: property.HasCode,
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
import { isEqual } from "lodash-es";
|
import { isEqual } from "lodash-es";
|
||||||
import { CheckCircleIcon, Code2Icon, HashIcon, LinkIcon } from "lucide-react";
|
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 { cn } from "@/utils";
|
||||||
import { useTranslate } from "@/utils/i18n";
|
import { useTranslate } from "@/utils/i18n";
|
||||||
import MemoRelationForceGraph from "../MemoRelationForceGraph";
|
import MemoRelationForceGraph from "../MemoRelationForceGraph";
|
||||||
@@ -13,7 +13,7 @@ interface Props {
|
|||||||
|
|
||||||
const MemoDetailSidebar = ({ memo, className, parentPage }: Props) => {
|
const MemoDetailSidebar = ({ memo, className, parentPage }: Props) => {
|
||||||
const t = useTranslate();
|
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 hasSpecialProperty = property.hasLink || property.hasTaskList || property.hasCode || property.hasIncompleteTasks;
|
||||||
const shouldShowRelationGraph = memo.relations.filter((r) => r.type === MemoRelation_Type.REFERENCE).length > 0;
|
const shouldShowRelationGraph = memo.relations.filter((r) => r.type === MemoRelation_Type.REFERENCE).length > 0;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user