Skip to content

Commit 7279b72

Browse files
committed
hide deleted properties
1 parent 89979e9 commit 7279b72

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

components/common/DatabaseEditor/components/cardDetail/cardDetailProperties.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -270,11 +270,13 @@ function CardDetailProperties(props: Props) {
270270
[mutator, props.boardType, board, activeView, isSmallScreen]
271271
);
272272

273-
let boardProperties = board.fields.cardProperties || [];
273+
let boardProperties = (board.fields.cardProperties || [])
274+
// hide deleted properties unless they were deleted before the card was created
275+
.filter((p) => !p.deletedAt || new Date(p.deletedAt) > new Date(card.createdAt));
274276

275277
if (board.fields.sourceType === 'proposals') {
276278
// remove properties that belong to a different template
277-
boardProperties = board.fields?.cardProperties.filter(
279+
boardProperties = boardProperties.filter(
278280
(property) => !property.templateId || card.fields.properties[property.id] !== undefined
279281
);
280282
}

lib/databases/board.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ export type IPropertyTemplate<T extends PropertyType = PropertyType> = {
7272
id: string;
7373
name: string;
7474
type: T;
75+
deletedAt?: string; // ISODate. If set, the property will be visible based on when the page was created
7576
options: IPropertyOption[];
7677
description?: string;
7778
tooltip?: string;

0 commit comments

Comments
 (0)