Skip to content

Commit

Permalink
hide deleted properties
Browse files Browse the repository at this point in the history
  • Loading branch information
mattcasey committed Feb 3, 2025
1 parent 89979e9 commit 7279b72
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -270,11 +270,13 @@ function CardDetailProperties(props: Props) {
[mutator, props.boardType, board, activeView, isSmallScreen]

Check warning on line 270 in components/common/DatabaseEditor/components/cardDetail/cardDetailProperties.tsx

View workflow job for this annotation

GitHub Actions / Test apps

React Hook useMemo has missing dependencies: 'addPropertyPopupState', 'intl', and 'syncRelationProperty'. Either include them or remove the dependency array

Check warning on line 270 in components/common/DatabaseEditor/components/cardDetail/cardDetailProperties.tsx

View workflow job for this annotation

GitHub Actions / Test apps

React Hook useMemo has missing dependencies: 'addPropertyPopupState', 'intl', and 'syncRelationProperty'. Either include them or remove the dependency array

Check warning on line 270 in components/common/DatabaseEditor/components/cardDetail/cardDetailProperties.tsx

View workflow job for this annotation

GitHub Actions / Test app

React Hook useMemo has missing dependencies: 'addPropertyPopupState', 'intl', and 'syncRelationProperty'. Either include them or remove the dependency array

Check warning on line 270 in components/common/DatabaseEditor/components/cardDetail/cardDetailProperties.tsx

View workflow job for this annotation

GitHub Actions / Validate code

React Hook useMemo has missing dependencies: 'addPropertyPopupState', 'intl', and 'syncRelationProperty'. Either include them or remove the dependency array
);

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

if (board.fields.sourceType === 'proposals') {
// remove properties that belong to a different template
boardProperties = board.fields?.cardProperties.filter(
boardProperties = boardProperties.filter(
(property) => !property.templateId || card.fields.properties[property.id] !== undefined
);
}
Expand Down
1 change: 1 addition & 0 deletions lib/databases/board.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ export type IPropertyTemplate<T extends PropertyType = PropertyType> = {
id: string;
name: string;
type: T;
deletedAt?: string; // ISODate. If set, the property will be visible based on when the page was created
options: IPropertyOption[];
description?: string;
tooltip?: string;
Expand Down

0 comments on commit 7279b72

Please sign in to comment.