[WEB-3788] improvement: enhance project properties related components modularity (#6882)
* improvement: work item modal data preload and parent work item details * improvement: collapsible button title * improvement: project creation form and modal * improvement: emoji helper * improvement: enhance labels component modularity * improvement: enable state group and state list components modularity * improvement: project settings feature list * improvement: common utils
This commit is contained in:
parent
670134562f
commit
1f9222065e
36 changed files with 622 additions and 381 deletions
|
|
@ -1,5 +1,6 @@
|
|||
import { clsx, type ClassValue } from "clsx";
|
||||
import { twMerge } from "tailwind-merge";
|
||||
import { CompleteOrEmpty } from "@plane/types";
|
||||
|
||||
// Support email can be configured by the application
|
||||
export const getSupportEmail = (defaultEmail: string = ""): string => defaultEmail;
|
||||
|
|
@ -39,3 +40,21 @@ export const partitionValidIds = (ids: string[], validIds: string[]): { valid: s
|
|||
|
||||
return { valid, invalid };
|
||||
};
|
||||
|
||||
/**
|
||||
* Checks if an object is complete (has properties) rather than empty.
|
||||
* This helps TypeScript narrow the type from CompleteOrEmpty<T> to T.
|
||||
*
|
||||
* @param obj The object to check, typed as CompleteOrEmpty<T>
|
||||
* @returns A boolean indicating if the object is complete (true) or empty (false)
|
||||
*/
|
||||
export const isComplete = <T>(obj: CompleteOrEmpty<T>): obj is T => {
|
||||
// Check if object is not null or undefined
|
||||
if (obj == null) return false;
|
||||
|
||||
// Check if it's an object
|
||||
if (typeof obj !== "object") return false;
|
||||
|
||||
// Check if it has any own properties
|
||||
return Object.keys(obj).length > 0;
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue