diff --git a/apps/admin/app/(all)/(dashboard)/general/intercom.tsx b/apps/admin/app/(all)/(dashboard)/general/intercom.tsx index 656e2d69022..3aeb099e87c 100644 --- a/apps/admin/app/(all)/(dashboard)/general/intercom.tsx +++ b/apps/admin/app/(all)/(dashboard)/general/intercom.tsx @@ -28,8 +28,6 @@ export const IntercomConfig = observer(function IntercomConfig(props: TIntercomC const isIntercomEnabled = isTelemetryEnabled ? instanceConfigurations ? instanceConfigurations?.find((config) => config.key === "IS_INTERCOM_ENABLED")?.value === "1" - ? true - : false : undefined : false; @@ -73,7 +71,7 @@ export const IntercomConfig = observer(function IntercomConfig(props: TIntercomC
(!isSubmitting && formData.email && formData.password ? false : true), + () => !(!isSubmitting && formData.email && formData.password), [formData.email, formData.password, isSubmitting] ); diff --git a/apps/admin/components/instance/setup-form.tsx b/apps/admin/components/instance/setup-form.tsx index 74e80db45b6..2cb53e78a27 100644 --- a/apps/admin/components/instance/setup-form.tsx +++ b/apps/admin/components/instance/setup-form.tsx @@ -64,7 +64,7 @@ export function InstanceSetupForm() { const lastNameParam = searchParams?.get("last_name") || undefined; const companyParam = searchParams?.get("company") || undefined; const emailParam = searchParams?.get("email") || undefined; - const isTelemetryEnabledParam = (searchParams?.get("is_telemetry_enabled") === "True" ? true : false) || true; + const isTelemetryEnabledParam = searchParams?.get("is_telemetry_enabled") === "True" || true; const errorCode = searchParams?.get("error_code") || undefined; const errorMessage = searchParams?.get("error_message") || undefined; // state @@ -121,14 +121,14 @@ export function InstanceSetupForm() { const isButtonDisabled = useMemo( () => - !isSubmitting && - formData.first_name && - formData.email && - formData.password && - getPasswordStrength(formData.password) === E_PASSWORD_STRENGTH.STRENGTH_VALID && - formData.password === formData.confirm_password - ? false - : true, + !( + !isSubmitting && + formData.first_name && + formData.email && + formData.password && + getPasswordStrength(formData.password) === E_PASSWORD_STRENGTH.STRENGTH_VALID && + formData.password === formData.confirm_password + ), [formData.confirm_password, formData.email, formData.first_name, formData.password, isSubmitting] ); @@ -221,7 +221,7 @@ export function InstanceSetupForm() { placeholder="name@company.com" value={formData.email} onChange={(e) => handleFormChange("email", e.target.value)} - hasError={errorData.type && errorData.type === EErrorCodes.INVALID_EMAIL ? true : false} + hasError={errorData.type && errorData.type === EErrorCodes.INVALID_EMAIL} autoComplete="off" /> {errorData.type && errorData.type === EErrorCodes.INVALID_EMAIL && errorData.message && ( @@ -265,7 +265,7 @@ export function InstanceSetupForm() { placeholder="New password" value={formData.password} onChange={(e) => handleFormChange("password", e.target.value)} - hasError={errorData.type && errorData.type === EErrorCodes.INVALID_PASSWORD ? true : false} + hasError={errorData.type && errorData.type === EErrorCodes.INVALID_PASSWORD} onFocus={() => setIsPasswordInputFocused(true)} onBlur={() => setIsPasswordInputFocused(false)} autoComplete="new-password" diff --git a/apps/admin/providers/user.provider.tsx b/apps/admin/providers/user.provider.tsx index 3a840c18650..cc93c765f60 100644 --- a/apps/admin/providers/user.provider.tsx +++ b/apps/admin/providers/user.provider.tsx @@ -24,7 +24,7 @@ export const UserProvider = observer(function UserProvider({ children }: React.P useEffect(() => { const localValue = localStorage && localStorage.getItem("god_mode_sidebar_collapsed"); - const localBoolValue = localValue ? (localValue === "true" ? true : false) : false; + const localBoolValue = localValue ? localValue === "true" : false; if (isSidebarCollapsed === undefined && localBoolValue != isSidebarCollapsed) toggleSidebar(localBoolValue); }, [isSidebarCollapsed, currentUser, toggleSidebar]); diff --git a/apps/space/components/account/auth-forms/auth-root.tsx b/apps/space/components/account/auth-forms/auth-root.tsx index d31649f789e..2ab7f6b2c00 100644 --- a/apps/space/components/account/auth-forms/auth-root.tsx +++ b/apps/space/components/account/auth-forms/auth-root.tsx @@ -185,7 +185,7 @@ export const AuthRoot = observer(function AuthRoot() { }} /> )} - +
); diff --git a/apps/space/components/account/auth-forms/password.tsx b/apps/space/components/account/auth-forms/password.tsx index 7bf8971fa4a..0b1612c4e6a 100644 --- a/apps/space/components/account/auth-forms/password.tsx +++ b/apps/space/components/account/auth-forms/password.tsx @@ -79,14 +79,14 @@ export const AuthPasswordForm = observer(function AuthPasswordForm(props: Props) const isButtonDisabled = useMemo( () => - !isSubmitting && - !!passwordFormData.password && - (mode === EAuthModes.SIGN_UP - ? getPasswordStrength(passwordFormData.password) === E_PASSWORD_STRENGTH.STRENGTH_VALID && - passwordFormData.password === passwordFormData.confirm_password - : true) - ? false - : true, + !( + !isSubmitting && + !!passwordFormData.password && + (mode === EAuthModes.SIGN_UP + ? getPasswordStrength(passwordFormData.password) === E_PASSWORD_STRENGTH.STRENGTH_VALID && + passwordFormData.password === passwordFormData.confirm_password + : true) + ), [isSubmitting, mode, passwordFormData.confirm_password, passwordFormData.password] ); diff --git a/apps/space/components/issues/filters/labels.tsx b/apps/space/components/issues/filters/labels.tsx index db235c5b798..1db42937c32 100644 --- a/apps/space/components/issues/filters/labels.tsx +++ b/apps/space/components/issues/filters/labels.tsx @@ -56,7 +56,7 @@ export function FilterLabels(props: Props) { {filteredOptions.slice(0, itemsToRender).map((label) => ( handleUpdate(label?.id)} icon={} title={label.name} diff --git a/apps/space/components/issues/filters/priority.tsx b/apps/space/components/issues/filters/priority.tsx index 06e4a532a81..06420db5557 100644 --- a/apps/space/components/issues/filters/priority.tsx +++ b/apps/space/components/issues/filters/priority.tsx @@ -45,7 +45,7 @@ export const FilterPriority = observer(function FilterPriority(props: Props) { filteredOptions.map((priority) => ( handleUpdate(priority.key)} icon={} title={t(priority.titleTranslationKey)} diff --git a/apps/space/components/issues/filters/state.tsx b/apps/space/components/issues/filters/state.tsx index f9275a2d24e..94e643931d5 100644 --- a/apps/space/components/issues/filters/state.tsx +++ b/apps/space/components/issues/filters/state.tsx @@ -56,7 +56,7 @@ export const FilterState = observer(function FilterState(props: Props) { {filteredOptions.slice(0, itemsToRender).map((state) => ( handleUpdate(state.id)} icon={} title={state.name} diff --git a/apps/space/store/cycle.store.ts b/apps/space/store/cycle.store.ts index 41ef8d0d436..13cb6950a5b 100644 --- a/apps/space/store/cycle.store.ts +++ b/apps/space/store/cycle.store.ts @@ -9,7 +9,7 @@ import { action, makeObservable, observable, runInAction } from "mobx"; import { SitesCycleService } from "@plane/services"; import type { TPublicCycle } from "@/types/cycle"; // store -import type { CoreRootStore } from "./root.store"; +import type { RootStore } from "./root.store"; export interface ICycleStore { // observables @@ -23,9 +23,9 @@ export interface ICycleStore { export class CycleStore implements ICycleStore { cycles: TPublicCycle[] | undefined = undefined; cycleService: SitesCycleService; - rootStore: CoreRootStore; + rootStore: RootStore; - constructor(_rootStore: CoreRootStore) { + constructor(_rootStore: RootStore) { makeObservable(this, { // observables cycles: observable, diff --git a/apps/space/store/helpers/base-issues.store.ts b/apps/space/store/helpers/base-issues.store.ts index b1c342308e8..e0fdb564c60 100644 --- a/apps/space/store/helpers/base-issues.store.ts +++ b/apps/space/store/helpers/base-issues.store.ts @@ -23,7 +23,7 @@ import type { } from "@plane/types"; // types import type { IIssue, TIssuesResponse } from "@/types/issue"; -import type { CoreRootStore } from "../root.store"; +import type { RootStore } from "../root.store"; // constants // helpers @@ -81,7 +81,7 @@ export abstract class BaseIssuesStore implements IBaseIssuesStore { // root store rootIssueStore; - constructor(_rootStore: CoreRootStore) { + constructor(_rootStore: RootStore) { makeObservable(this, { // observable loader: observable, diff --git a/apps/space/store/instance.store.ts b/apps/space/store/instance.store.ts index 3672c5f0081..37dc9318eac 100644 --- a/apps/space/store/instance.store.ts +++ b/apps/space/store/instance.store.ts @@ -10,7 +10,7 @@ import { observable, action, makeObservable, runInAction } from "mobx"; import { InstanceService } from "@plane/services"; import type { IInstance, IInstanceConfig } from "@plane/types"; // store -import type { CoreRootStore } from "@/store/root.store"; +import type { RootStore } from "@/store/root.store"; type TError = { status: string; @@ -40,7 +40,7 @@ export class InstanceStore implements IInstanceStore { // services instanceService; - constructor(private store: CoreRootStore) { + constructor(private store: RootStore) { makeObservable(this, { // observable isLoading: observable.ref, diff --git a/apps/space/store/issue-detail.store.ts b/apps/space/store/issue-detail.store.ts index 0840e70c00a..6cbb6c867b3 100644 --- a/apps/space/store/issue-detail.store.ts +++ b/apps/space/store/issue-detail.store.ts @@ -13,7 +13,7 @@ import { SitesFileService, SitesIssueService } from "@plane/services"; import type { TFileSignedURLResponse, TIssuePublicComment } from "@plane/types"; import { EFileAssetType } from "@plane/types"; // store -import type { CoreRootStore } from "@/store/root.store"; +import type { RootStore } from "@/store/root.store"; // types import type { IIssue, IPeekMode, IVote } from "@/types/issue"; @@ -60,12 +60,12 @@ export class IssueDetailStore implements IIssueDetailStore { [key: string]: IIssue; } = {}; // root store - rootStore: CoreRootStore; + rootStore: RootStore; // services issueService: SitesIssueService; fileService: SitesFileService; - constructor(_rootStore: CoreRootStore) { + constructor(_rootStore: RootStore) { makeObservable(this, { loader: observable.ref, error: observable.ref, diff --git a/apps/space/store/issue-filters.store.ts b/apps/space/store/issue-filters.store.ts index 1632a0b3ea2..e2cb514dead 100644 --- a/apps/space/store/issue-filters.store.ts +++ b/apps/space/store/issue-filters.store.ts @@ -11,7 +11,7 @@ import { computedFn } from "mobx-utils"; import { ISSUE_DISPLAY_FILTERS_BY_LAYOUT } from "@plane/constants"; import type { IssuePaginationOptions, TIssueParams } from "@plane/types"; // store -import type { CoreRootStore } from "@/store/root.store"; +import type { RootStore } from "@/store/root.store"; // types import type { TIssueLayoutOptions, @@ -60,7 +60,7 @@ export class IssueFilterStore implements IIssueFilterStore { }; filters: { [anchor: string]: TIssueFilters } | undefined = undefined; - constructor(private store: CoreRootStore) { + constructor(private store: RootStore) { makeObservable(this, { // observables layoutOptions: observable, diff --git a/apps/space/store/issue.store.ts b/apps/space/store/issue.store.ts index 27ed2ad8951..93556bc8068 100644 --- a/apps/space/store/issue.store.ts +++ b/apps/space/store/issue.store.ts @@ -9,7 +9,7 @@ import { action, makeObservable, runInAction } from "mobx"; import { SitesIssueService } from "@plane/services"; import type { IssuePaginationOptions, TLoader } from "@plane/types"; // store -import type { CoreRootStore } from "@/store/root.store"; +import type { RootStore } from "@/store/root.store"; // types import { BaseIssuesStore } from "./helpers/base-issues.store"; import type { IBaseIssuesStore } from "./helpers/base-issues.store"; @@ -28,11 +28,11 @@ export interface IIssueStore extends IBaseIssuesStore { export class IssueStore extends BaseIssuesStore implements IIssueStore { // root store - rootStore: CoreRootStore; + rootStore: RootStore; // services issueService: SitesIssueService; - constructor(_rootStore: CoreRootStore) { + constructor(_rootStore: RootStore) { super(_rootStore); makeObservable(this, { // actions diff --git a/apps/space/store/label.store.ts b/apps/space/store/label.store.ts index b720816cf13..b1c229f0ae9 100644 --- a/apps/space/store/label.store.ts +++ b/apps/space/store/label.store.ts @@ -10,7 +10,7 @@ import { action, computed, makeObservable, observable, runInAction } from "mobx" import { SitesLabelService } from "@plane/services"; import type { IIssueLabel } from "@plane/types"; // store -import type { CoreRootStore } from "./root.store"; +import type { RootStore } from "./root.store"; export interface IIssueLabelStore { // observables @@ -25,9 +25,9 @@ export interface IIssueLabelStore { export class LabelStore implements IIssueLabelStore { labelMap: Record = {}; labelService: SitesLabelService; - rootStore: CoreRootStore; + rootStore: RootStore; - constructor(_rootStore: CoreRootStore) { + constructor(_rootStore: RootStore) { makeObservable(this, { // observables labelMap: observable, diff --git a/apps/space/store/members.store.ts b/apps/space/store/members.store.ts index 5c429b0037e..a06d0055049 100644 --- a/apps/space/store/members.store.ts +++ b/apps/space/store/members.store.ts @@ -9,7 +9,7 @@ import { action, computed, makeObservable, observable, runInAction } from "mobx" // plane imports import { SitesMemberService } from "@plane/services"; import type { TPublicMember } from "@/types/member"; -import type { CoreRootStore } from "./root.store"; +import type { RootStore } from "./root.store"; export interface IIssueMemberStore { // observables @@ -24,9 +24,9 @@ export interface IIssueMemberStore { export class MemberStore implements IIssueMemberStore { memberMap: Record = {}; memberService: SitesMemberService; - rootStore: CoreRootStore; + rootStore: RootStore; - constructor(_rootStore: CoreRootStore) { + constructor(_rootStore: RootStore) { makeObservable(this, { // observables memberMap: observable, diff --git a/apps/space/store/module.store.ts b/apps/space/store/module.store.ts index 1f2dd2d54a6..c539846efc0 100644 --- a/apps/space/store/module.store.ts +++ b/apps/space/store/module.store.ts @@ -11,7 +11,7 @@ import { SitesModuleService } from "@plane/services"; // types import type { TPublicModule } from "@/types/modules"; // root store -import type { CoreRootStore } from "./root.store"; +import type { RootStore } from "./root.store"; export interface IIssueModuleStore { // observables @@ -26,9 +26,9 @@ export interface IIssueModuleStore { export class ModuleStore implements IIssueModuleStore { moduleMap: Record = {}; moduleService: SitesModuleService; - rootStore: CoreRootStore; + rootStore: RootStore; - constructor(_rootStore: CoreRootStore) { + constructor(_rootStore: RootStore) { makeObservable(this, { // observables moduleMap: observable, diff --git a/apps/space/store/profile.store.ts b/apps/space/store/profile.store.ts index 0dee248dda5..d62d1d37a38 100644 --- a/apps/space/store/profile.store.ts +++ b/apps/space/store/profile.store.ts @@ -11,7 +11,7 @@ import { UserService } from "@plane/services"; import type { TUserProfile } from "@plane/types"; import { EStartOfTheWeek } from "@plane/types"; // store -import type { CoreRootStore } from "@/store/root.store"; +import type { RootStore } from "@/store/root.store"; type TError = { status: string; @@ -64,7 +64,7 @@ export class ProfileStore implements IProfileStore { // services userService: UserService; - constructor(public store: CoreRootStore) { + constructor(public store: RootStore) { makeObservable(this, { // observables isLoading: observable.ref, diff --git a/apps/space/store/publish/publish.store.ts b/apps/space/store/publish/publish.store.ts index b59ff2be230..973ea86e589 100644 --- a/apps/space/store/publish/publish.store.ts +++ b/apps/space/store/publish/publish.store.ts @@ -14,7 +14,7 @@ import type { TProjectPublishViewProps, } from "@plane/types"; // store -import type { CoreRootStore } from "../root.store"; +import type { RootStore } from "../root.store"; export interface IPublishStore extends TProjectPublishSettings { // computed @@ -45,7 +45,7 @@ export class PublishStore implements IPublishStore { workspace_detail: IWorkspaceLite | undefined; constructor( - private store: CoreRootStore, + private store: RootStore, publishSettings: TProjectPublishSettings ) { this.anchor = publishSettings.anchor; diff --git a/apps/space/store/publish/publish_list.store.ts b/apps/space/store/publish/publish_list.store.ts index 29a09dca17e..eeebe97e70a 100644 --- a/apps/space/store/publish/publish_list.store.ts +++ b/apps/space/store/publish/publish_list.store.ts @@ -11,7 +11,7 @@ import { SitesProjectPublishService } from "@plane/services"; import type { TProjectPublishSettings } from "@plane/types"; // store import { PublishStore } from "@/store/publish/publish.store"; -import type { CoreRootStore } from "@/store/root.store"; +import type { RootStore } from "@/store/root.store"; export interface IPublishListStore { // observables @@ -26,7 +26,7 @@ export class PublishListStore implements IPublishListStore { // service publishService; - constructor(private rootStore: CoreRootStore) { + constructor(private rootStore: RootStore) { makeObservable(this, { // observables publishMap: observable, diff --git a/apps/space/store/state.store.ts b/apps/space/store/state.store.ts index f900c5105f7..3ecf78d1592 100644 --- a/apps/space/store/state.store.ts +++ b/apps/space/store/state.store.ts @@ -12,7 +12,7 @@ import type { IState } from "@plane/types"; // helpers import { sortStates } from "@/helpers/state.helper"; // store -import type { CoreRootStore } from "./root.store"; +import type { RootStore } from "./root.store"; export interface IStateStore { // observables @@ -28,9 +28,9 @@ export interface IStateStore { export class StateStore implements IStateStore { states: IState[] | undefined = undefined; stateService: SitesStateService; - rootStore: CoreRootStore; + rootStore: RootStore; - constructor(_rootStore: CoreRootStore) { + constructor(_rootStore: RootStore) { makeObservable(this, { // observables states: observable, diff --git a/apps/space/store/user.store.ts b/apps/space/store/user.store.ts index fac64281ead..f2a3c7dbc20 100644 --- a/apps/space/store/user.store.ts +++ b/apps/space/store/user.store.ts @@ -14,7 +14,7 @@ import type { ActorDetail, IUser } from "@plane/types"; import type { IProfileStore } from "@/store/profile.store"; import { ProfileStore } from "@/store/profile.store"; // store -import type { CoreRootStore } from "@/store/root.store"; +import type { RootStore } from "@/store/root.store"; type TUserErrorStatus = { status: string; @@ -50,7 +50,7 @@ export class UserStore implements IUserStore { // service userService: UserService; - constructor(private store: CoreRootStore) { + constructor(private store: RootStore) { // stores this.profile = new ProfileStore(store); // service diff --git a/apps/web/app/(all)/[workspaceSlug]/(projects)/extended-sidebar.tsx b/apps/web/app/(all)/[workspaceSlug]/(projects)/extended-sidebar.tsx index 0b8ad77aae3..13b5cd10e8e 100644 --- a/apps/web/app/(all)/[workspaceSlug]/(projects)/extended-sidebar.tsx +++ b/apps/web/app/(all)/[workspaceSlug]/(projects)/extended-sidebar.tsx @@ -42,11 +42,10 @@ export const ExtendedAppSidebar = observer(function ExtendedAppSidebar() { }) .map((item) => { const preference = currentWorkspaceNavigationPreferences?.[item.key]; - return { - ...item, + return Object.assign({}, item, { sort_order: preference?.sort_order ?? 0, is_pinned: preference?.is_pinned ?? false, - }; + }); }) .sort((a, b) => { // First sort by pinned status (pinned items first) diff --git a/apps/web/app/(all)/[workspaceSlug]/(projects)/projects/(detail)/[projectId]/cycles/(detail)/[cycleId]/page.tsx b/apps/web/app/(all)/[workspaceSlug]/(projects)/projects/(detail)/[projectId]/cycles/(detail)/[cycleId]/page.tsx index 49e6479aded..b86d7ba5f23 100644 --- a/apps/web/app/(all)/[workspaceSlug]/(projects)/projects/(detail)/[projectId]/cycles/(detail)/[cycleId]/page.tsx +++ b/apps/web/app/(all)/[workspaceSlug]/(projects)/projects/(detail)/[projectId]/cycles/(detail)/[cycleId]/page.tsx @@ -39,7 +39,7 @@ function CycleDetailPage({ params }: Route.ComponentProps) { cycleId, }); // derived values - const isSidebarCollapsed = storedValue ? (storedValue === true ? true : false) : false; + const isSidebarCollapsed = storedValue ? storedValue === true : false; const cycle = getCycleById(cycleId); const project = getProjectById(projectId); const pageTitle = project?.name && cycle?.name ? `${project?.name} - ${cycle?.name}` : undefined; diff --git a/apps/web/app/(all)/[workspaceSlug]/(projects)/projects/(detail)/[projectId]/cycles/(detail)/header.tsx b/apps/web/app/(all)/[workspaceSlug]/(projects)/projects/(detail)/[projectId]/cycles/(detail)/header.tsx index 05f4cca2d0a..b76dafdc655 100644 --- a/apps/web/app/(all)/[workspaceSlug]/(projects)/projects/(detail)/[projectId]/cycles/(detail)/header.tsx +++ b/apps/web/app/(all)/[workspaceSlug]/(projects)/projects/(detail)/[projectId]/cycles/(detail)/header.tsx @@ -75,7 +75,7 @@ export const CycleIssuesHeader = observer(function CycleIssuesHeader() { const { setValue, storedValue } = useLocalStorage("cycle_sidebar_collapsed", false); - const isSidebarCollapsed = storedValue ? (storedValue === true ? true : false) : false; + const isSidebarCollapsed = storedValue ? storedValue === true : false; const toggleSidebar = () => { setValue(!isSidebarCollapsed); }; diff --git a/apps/web/app/(all)/[workspaceSlug]/(projects)/projects/(detail)/[projectId]/modules/(detail)/[moduleId]/page.tsx b/apps/web/app/(all)/[workspaceSlug]/(projects)/projects/(detail)/[projectId]/modules/(detail)/[moduleId]/page.tsx index 1066ed4e2ce..9bb414bb394 100644 --- a/apps/web/app/(all)/[workspaceSlug]/(projects)/projects/(detail)/[projectId]/modules/(detail)/[moduleId]/page.tsx +++ b/apps/web/app/(all)/[workspaceSlug]/(projects)/projects/(detail)/[projectId]/modules/(detail)/[moduleId]/page.tsx @@ -32,7 +32,7 @@ function ModuleIssuesPage({ params }: Route.ComponentProps) { // const { issuesFilter } = useIssues(EIssuesStoreType.MODULE); // local storage const { setValue, storedValue } = useLocalStorage("module_sidebar_collapsed", "false"); - const isSidebarCollapsed = storedValue ? (storedValue === "true" ? true : false) : false; + const isSidebarCollapsed = storedValue ? storedValue === "true" : false; // fetching module details const { error } = useSWR(`CURRENT_MODULE_DETAILS_${moduleId}`, () => fetchModuleDetails(workspaceSlug, projectId, moduleId) diff --git a/apps/web/app/(all)/[workspaceSlug]/(projects)/projects/(detail)/[projectId]/modules/(detail)/header.tsx b/apps/web/app/(all)/[workspaceSlug]/(projects)/projects/(detail)/[projectId]/modules/(detail)/header.tsx index 5524626e04d..b7f0d4928fb 100644 --- a/apps/web/app/(all)/[workspaceSlug]/(projects)/projects/(detail)/[projectId]/modules/(detail)/header.tsx +++ b/apps/web/app/(all)/[workspaceSlug]/(projects)/projects/(detail)/[projectId]/modules/(detail)/header.tsx @@ -74,7 +74,7 @@ export const ModuleIssuesHeader = observer(function ModuleIssuesHeader() { // local storage const { setValue, storedValue } = useLocalStorage("module_sidebar_collapsed", "false"); // derived values - const isSidebarCollapsed = storedValue ? (storedValue === "true" ? true : false) : false; + const isSidebarCollapsed = storedValue ? storedValue === "true" : false; const activeLayout = issueFilters?.displayFilters?.layout; const moduleDetails = moduleId ? getModuleById(moduleId) : undefined; const canUserCreateIssue = allowPermissions( diff --git a/apps/web/core/components/account/auth-forms/password.tsx b/apps/web/core/components/account/auth-forms/password.tsx index 6fed9e88893..a284353e124 100644 --- a/apps/web/core/components/account/auth-forms/password.tsx +++ b/apps/web/core/components/account/auth-forms/password.tsx @@ -105,11 +105,11 @@ export const AuthPasswordForm = observer(function AuthPasswordForm(props: Props) const isButtonDisabled = useMemo( () => - !isSubmitting && - !!passwordFormData.password && - (mode === EAuthModes.SIGN_UP ? passwordFormData.password === passwordFormData.confirm_password : true) - ? false - : true, + !( + !isSubmitting && + !!passwordFormData.password && + (mode === EAuthModes.SIGN_UP ? passwordFormData.password === passwordFormData.confirm_password : true) + ), [isSubmitting, mode, passwordFormData.confirm_password, passwordFormData.password] ); diff --git a/apps/web/core/components/account/auth-forms/reset-password.tsx b/apps/web/core/components/account/auth-forms/reset-password.tsx index 98283d35054..b96a4c63f2b 100644 --- a/apps/web/core/components/account/auth-forms/reset-password.tsx +++ b/apps/web/core/components/account/auth-forms/reset-password.tsx @@ -76,11 +76,11 @@ export const ResetPasswordForm = observer(function ResetPasswordForm() { const isButtonDisabled = useMemo( () => - !!resetFormData.password && - getPasswordStrength(resetFormData.password) === E_PASSWORD_STRENGTH.STRENGTH_VALID && - resetFormData.password === resetFormData.confirm_password - ? false - : true, + !( + !!resetFormData.password && + getPasswordStrength(resetFormData.password) === E_PASSWORD_STRENGTH.STRENGTH_VALID && + resetFormData.password === resetFormData.confirm_password + ), [resetFormData] ); diff --git a/apps/web/core/components/account/auth-forms/set-password.tsx b/apps/web/core/components/account/auth-forms/set-password.tsx index f16db6650bb..ed07d1b6488 100644 --- a/apps/web/core/components/account/auth-forms/set-password.tsx +++ b/apps/web/core/components/account/auth-forms/set-password.tsx @@ -77,11 +77,11 @@ export const SetPasswordForm = observer(function SetPasswordForm() { const isButtonDisabled = useMemo( () => - !!passwordFormData.password && - getPasswordStrength(passwordFormData.password) === E_PASSWORD_STRENGTH.STRENGTH_VALID && - passwordFormData.password === passwordFormData.confirm_password - ? false - : true, + !( + !!passwordFormData.password && + getPasswordStrength(passwordFormData.password) === E_PASSWORD_STRENGTH.STRENGTH_VALID && + passwordFormData.password === passwordFormData.confirm_password + ), [passwordFormData] ); diff --git a/apps/web/core/components/chart/utils.ts b/apps/web/core/components/chart/utils.ts index e7055a96d42..fe5aa3193bb 100644 --- a/apps/web/core/components/chart/utils.ts +++ b/apps/web/core/components/chart/utils.ts @@ -87,10 +87,7 @@ export const parseChartData = ( } } - return { - ...datum, - ...missingValues, - }; + return Object.assign({}, datum, missingValues); }); // capitalize first letter if groupByProperty is in TO_CAPITALIZE_PROPERTIES diff --git a/apps/web/core/components/common/filters/created-at.tsx b/apps/web/core/components/common/filters/created-at.tsx index 7e298fa007a..cc0fb4102fa 100644 --- a/apps/web/core/components/common/filters/created-at.tsx +++ b/apps/web/core/components/common/filters/created-at.tsx @@ -33,7 +33,7 @@ export const FilterCreatedDate = observer(function FilterCreatedDate(props: Prop const isCustomDateSelected = () => { const isValidDateSelected = appliedFilters?.filter((f) => isInDateFormat(f.split(";")[0])) || []; - return isValidDateSelected.length > 0 ? true : false; + return isValidDateSelected.length > 0; }; const handleCustomDate = () => { if (isCustomDateSelected()) { @@ -64,7 +64,7 @@ export const FilterCreatedDate = observer(function FilterCreatedDate(props: Prop {filteredOptions.map((option) => ( handleUpdate(option.value)} title={option.name} multiple diff --git a/apps/web/core/components/common/filters/created-by.tsx b/apps/web/core/components/common/filters/created-by.tsx index 0009496db0f..af1a4092294 100644 --- a/apps/web/core/components/common/filters/created-by.tsx +++ b/apps/web/core/components/common/filters/created-by.tsx @@ -74,7 +74,7 @@ export const FilterCreatedBy = observer(function FilterCreatedBy(props: Props) { return ( handleUpdate(member.id)} icon={ { if (isSearchOpen && archivedCyclesSearchQuery.trim() === "") setIsSearchOpen(false); diff --git a/apps/web/core/components/cycles/cycles-view-header.tsx b/apps/web/core/components/cycles/cycles-view-header.tsx index 8c3cd0a0c9b..c871ea6b4c0 100644 --- a/apps/web/core/components/cycles/cycles-view-header.tsx +++ b/apps/web/core/components/cycles/cycles-view-header.tsx @@ -33,7 +33,7 @@ export const CyclesViewHeader = observer(function CyclesViewHeader(props: Props) const { currentProjectFilters, searchQuery, updateFilters, updateSearchQuery } = useCycleFilter(); const { t } = useTranslation(); // states - const [isSearchOpen, setIsSearchOpen] = useState(searchQuery !== "" ? true : false); + const [isSearchOpen, setIsSearchOpen] = useState(searchQuery !== ""); // outside click detector hook useOutsideClickDetector(inputRef, () => { if (isSearchOpen && searchQuery.trim() === "") setIsSearchOpen(false); diff --git a/apps/web/core/components/cycles/dropdowns/estimate-type-dropdown.tsx b/apps/web/core/components/cycles/dropdowns/estimate-type-dropdown.tsx index 510457097d3..a542cd95224 100644 --- a/apps/web/core/components/cycles/dropdowns/estimate-type-dropdown.tsx +++ b/apps/web/core/components/cycles/dropdowns/estimate-type-dropdown.tsx @@ -26,7 +26,7 @@ export const EstimateTypeDropdown = observer(function EstimateTypeDropdown(props const { value, onChange, projectId, cycleId, showDefault = false } = props; const { getIsPointsDataAvailable } = useCycle(); const { areEstimateEnabledByProjectId, currentProjectEstimateType } = useProjectEstimates(); - const isCurrentProjectEstimateEnabled = projectId && areEstimateEnabledByProjectId(projectId) ? true : false; + const isCurrentProjectEstimateEnabled = !!(projectId && areEstimateEnabledByProjectId(projectId)); return (getIsPointsDataAvailable(cycleId) || isCurrentProjectEstimateEnabled) && currentProjectEstimateType !== EEstimateSystem.CATEGORIES ? (
diff --git a/apps/web/core/components/cycles/dropdowns/filters/end-date.tsx b/apps/web/core/components/cycles/dropdowns/filters/end-date.tsx index b405b78649f..26aff9c352a 100644 --- a/apps/web/core/components/cycles/dropdowns/filters/end-date.tsx +++ b/apps/web/core/components/cycles/dropdowns/filters/end-date.tsx @@ -33,7 +33,7 @@ export const FilterEndDate = observer(function FilterEndDate(props: Props) { const isCustomDateSelected = () => { const isValidDateSelected = appliedFilters?.filter((f) => isInDateFormat(f.split(";")[0])) || []; - return isValidDateSelected.length > 0 ? true : false; + return isValidDateSelected.length > 0; }; const handleCustomDate = () => { if (isCustomDateSelected()) { @@ -64,7 +64,7 @@ export const FilterEndDate = observer(function FilterEndDate(props: Props) { {filteredOptions.map((option) => ( handleUpdate(option.value)} title={option.name} multiple diff --git a/apps/web/core/components/cycles/dropdowns/filters/start-date.tsx b/apps/web/core/components/cycles/dropdowns/filters/start-date.tsx index 911feb7ab47..12c2fc9d01f 100644 --- a/apps/web/core/components/cycles/dropdowns/filters/start-date.tsx +++ b/apps/web/core/components/cycles/dropdowns/filters/start-date.tsx @@ -34,7 +34,7 @@ export const FilterStartDate = observer(function FilterStartDate(props: Props) { const isCustomDateSelected = () => { const isValidDateSelected = appliedFilters?.filter((f) => isInDateFormat(f.split(";")[0])) || []; - return isValidDateSelected.length > 0 ? true : false; + return isValidDateSelected.length > 0; }; const handleCustomDate = () => { if (isCustomDateSelected()) { @@ -65,7 +65,7 @@ export const FilterStartDate = observer(function FilterStartDate(props: Props) { {filteredOptions.map((option) => ( handleUpdate(option.value)} title={option.name} multiple diff --git a/apps/web/core/components/cycles/dropdowns/filters/status.tsx b/apps/web/core/components/cycles/dropdowns/filters/status.tsx index 4de895c0a2f..99320a8bb8e 100644 --- a/apps/web/core/components/cycles/dropdowns/filters/status.tsx +++ b/apps/web/core/components/cycles/dropdowns/filters/status.tsx @@ -42,7 +42,7 @@ export const FilterStatus = observer(function FilterStatus(props: Props) { filteredOptions.map((status) => ( handleUpdate(status.value)} title={t(status.i18n_title)} /> diff --git a/apps/web/core/components/dropdowns/cycle/cycle-options.tsx b/apps/web/core/components/dropdowns/cycle/cycle-options.tsx index 7d12cbc0b26..6bddde90329 100644 --- a/apps/web/core/components/dropdowns/cycle/cycle-options.tsx +++ b/apps/web/core/components/dropdowns/cycle/cycle-options.tsx @@ -77,7 +77,7 @@ export const CycleOptions = observer(function CycleOptions(props: CycleOptionsPr const cycleIds = (getProjectCycleIds(projectId) ?? [])?.filter((cycleId) => { const cycleDetails = getCycleById(cycleId); if (currentCycleId && currentCycleId === cycleId) return false; - return cycleDetails?.status ? (cycleDetails?.status.toLowerCase() != "completed" ? true : false) : true; + return cycleDetails?.status ? cycleDetails?.status.toLowerCase() != "completed" : true; }); const onOpen = () => { diff --git a/apps/web/core/components/estimates/root.tsx b/apps/web/core/components/estimates/root.tsx index 85d18cf5bf2..1d3453c0d1e 100644 --- a/apps/web/core/components/estimates/root.tsx +++ b/apps/web/core/components/estimates/root.tsx @@ -138,14 +138,14 @@ export const EstimateRoot = observer(function EstimateRoot(props: TEstimateRoot) workspaceSlug={workspaceSlug} projectId={projectId} estimateId={estimateToUpdate ? estimateToUpdate : undefined} - isOpen={estimateToUpdate ? true : false} + isOpen={!!estimateToUpdate} handleClose={() => setEstimateToUpdate(undefined)} /> setEstimateToDelete(undefined)} /> diff --git a/apps/web/core/components/gantt-chart/views/week-view.ts b/apps/web/core/components/gantt-chart/views/week-view.ts index a94ffab14e6..fef7d9f91a0 100644 --- a/apps/web/core/components/gantt-chart/views/week-view.ts +++ b/apps/web/core/components/gantt-chart/views/week-view.ts @@ -173,7 +173,7 @@ export const getWeeksBetweenTwoDates = ( endYear: yearAtEndOfTheWeek, startDate: weekStartDate, endDate: weekEndDate, - today: today >= weekStartDate && today <= weekEndDate ? true : false, + today: today >= weekStartDate && today <= weekEndDate, }); currentDate.setDate(currentDate.getDate() + 7); diff --git a/apps/web/core/components/inbox/inbox-filter/filters/date.tsx b/apps/web/core/components/inbox/inbox-filter/filters/date.tsx index 84ae0ffdef0..cd8170d61d0 100644 --- a/apps/web/core/components/inbox/inbox-filter/filters/date.tsx +++ b/apps/web/core/components/inbox/inbox-filter/filters/date.tsx @@ -46,7 +46,7 @@ export const FilterDate = observer(function FilterDate(props: Props) { const isCustomDateSelected = () => { const isValidDateSelected = filterValue?.filter((f) => isDate(f.split(";")[0])) || []; - return isValidDateSelected.length > 0 ? true : false; + return isValidDateSelected.length > 0; }; const handleCustomDate = () => { @@ -80,7 +80,7 @@ export const FilterDate = observer(function FilterDate(props: Props) { {filteredOptions.map((option) => ( handleInboxIssueFilters(filterKey, handleFilterValue(option.value))} title={option.name} multiple={false} diff --git a/apps/web/core/components/inbox/inbox-filter/filters/labels.tsx b/apps/web/core/components/inbox/inbox-filter/filters/labels.tsx index e45dae656b6..37c6b722a19 100644 --- a/apps/web/core/components/inbox/inbox-filter/filters/labels.tsx +++ b/apps/web/core/components/inbox/inbox-filter/filters/labels.tsx @@ -62,7 +62,7 @@ export const FilterLabels = observer(function FilterLabels(props: Props) { {filteredOptions.slice(0, itemsToRender).map((label) => ( handleInboxIssueFilters("labels", handleFilterValue(label.id))} icon={} title={label.name} diff --git a/apps/web/core/components/inbox/inbox-filter/filters/members.tsx b/apps/web/core/components/inbox/inbox-filter/filters/members.tsx index c6ff9a57198..55cf842f762 100644 --- a/apps/web/core/components/inbox/inbox-filter/filters/members.tsx +++ b/apps/web/core/components/inbox/inbox-filter/filters/members.tsx @@ -83,7 +83,7 @@ export const FilterMember = observer(function FilterMember(props: Props) { return ( handleInboxIssueFilters(filterKey, handleFilterValue(member.id))} icon={ ( handleInboxIssueFilters("priority", handleFilterValue(priority.key))} icon={} title={priority.title} diff --git a/apps/web/core/components/inbox/inbox-filter/filters/state.tsx b/apps/web/core/components/inbox/inbox-filter/filters/state.tsx index 08d125f645e..cf8223d321a 100644 --- a/apps/web/core/components/inbox/inbox-filter/filters/state.tsx +++ b/apps/web/core/components/inbox/inbox-filter/filters/state.tsx @@ -60,7 +60,7 @@ export const FilterState = observer(function FilterState(props: Props) { {filteredOptions.slice(0, itemsToRender).map((state) => ( handleInboxIssueFilters("state", handleFilterValue(state.id))} icon={ ( handleStatusFilterSelect(status.status)} icon={} title={t(status.i18n_title)} diff --git a/apps/web/core/components/issues/issue-layouts/filters/header/display-filters/display-properties.tsx b/apps/web/core/components/issues/issue-layouts/filters/header/display-filters/display-properties.tsx index 3eeccb58bee..0f1cf9070e7 100644 --- a/apps/web/core/components/issues/issue-layouts/filters/header/display-filters/display-properties.tsx +++ b/apps/web/core/components/issues/issue-layouts/filters/header/display-filters/display-properties.tsx @@ -52,7 +52,7 @@ export const FilterDisplayProperties = observer(function FilterDisplayProperties } }).map((property) => { if (isEpic && property.key === "sub_issue_count") { - return { ...property, titleTranslationKey: "issue.display.properties.work_item_count" }; + return Object.assign({}, property, { titleTranslationKey: "issue.display.properties.work_item_count" }); } return property; }); diff --git a/apps/web/core/components/issues/issue-layouts/filters/header/display-filters/extra-options.tsx b/apps/web/core/components/issues/issue-layouts/filters/header/display-filters/extra-options.tsx index 7daaec7aea5..a1e3b73da17 100644 --- a/apps/web/core/components/issues/issue-layouts/filters/header/display-filters/extra-options.tsx +++ b/apps/web/core/components/issues/issue-layouts/filters/header/display-filters/extra-options.tsx @@ -49,7 +49,7 @@ export const FilterExtraOptions = observer(function FilterExtraOptions(props: Pr return ( handleUpdate(option.key, !selectedExtraOptions?.[option.key])} title={t(option.titleTranslationKey)} /> diff --git a/apps/web/core/components/issues/issue-layouts/filters/header/display-filters/group-by.tsx b/apps/web/core/components/issues/issue-layouts/filters/header/display-filters/group-by.tsx index a15d80c0ea1..5bd92b50252 100644 --- a/apps/web/core/components/issues/issue-layouts/filters/header/display-filters/group-by.tsx +++ b/apps/web/core/components/issues/issue-layouts/filters/header/display-filters/group-by.tsx @@ -51,7 +51,7 @@ export const FilterGroupBy = observer(function FilterGroupBy(props: Props) { return ( handleUpdate(groupBy.key)} title={t(groupBy.titleTranslationKey)} multiple={false} diff --git a/apps/web/core/components/issues/issue-layouts/filters/header/display-filters/order-by.tsx b/apps/web/core/components/issues/issue-layouts/filters/header/display-filters/order-by.tsx index 8905f85565d..bd58152790f 100644 --- a/apps/web/core/components/issues/issue-layouts/filters/header/display-filters/order-by.tsx +++ b/apps/web/core/components/issues/issue-layouts/filters/header/display-filters/order-by.tsx @@ -40,7 +40,7 @@ export const FilterOrderBy = observer(function FilterOrderBy(props: Props) { {ISSUE_ORDER_BY_OPTIONS.filter((option) => orderByOptions.includes(option.key)).map((orderBy) => ( handleUpdate(orderBy.key)} title={t(orderBy.titleTranslationKey)} multiple={false} diff --git a/apps/web/core/components/issues/issue-layouts/filters/header/display-filters/sub-group-by.tsx b/apps/web/core/components/issues/issue-layouts/filters/header/display-filters/sub-group-by.tsx index c367b6f6260..43245613500 100644 --- a/apps/web/core/components/issues/issue-layouts/filters/header/display-filters/sub-group-by.tsx +++ b/apps/web/core/components/issues/issue-layouts/filters/header/display-filters/sub-group-by.tsx @@ -47,7 +47,7 @@ export const FilterSubGroupBy = observer(function FilterSubGroupBy(props: Props) return ( handleUpdate(subGroupBy.key)} title={t(subGroupBy.titleTranslationKey)} multiple={false} diff --git a/apps/web/core/components/issues/issue-layouts/filters/header/filters/assignee.tsx b/apps/web/core/components/issues/issue-layouts/filters/header/filters/assignee.tsx index e75eb406b53..d2796ffa120 100644 --- a/apps/web/core/components/issues/issue-layouts/filters/header/filters/assignee.tsx +++ b/apps/web/core/components/issues/issue-layouts/filters/header/filters/assignee.tsx @@ -74,7 +74,7 @@ export const FilterAssignees = observer(function FilterAssignees(props: Props) { return ( handleUpdate(member.id)} icon={ handleUpdate(member.id)} icon={} title={currentUser?.id === member.id ? "You" : member?.display_name} diff --git a/apps/web/core/components/issues/issue-layouts/filters/header/filters/cycle.tsx b/apps/web/core/components/issues/issue-layouts/filters/header/filters/cycle.tsx index 1368fee3f1d..29b6334a0eb 100644 --- a/apps/web/core/components/issues/issue-layouts/filters/header/filters/cycle.tsx +++ b/apps/web/core/components/issues/issue-layouts/filters/header/filters/cycle.tsx @@ -75,13 +75,13 @@ export const FilterCycle = observer(function FilterCycle(props: Props) { {sortedOptions.slice(0, itemsToRender).map((cycle) => ( handleUpdate(cycle.id)} icon={ } title={cycle.name} - activePulse={cycleStatus(cycle?.status) === "current" ? true : false} + activePulse={cycleStatus(cycle?.status) === "current"} /> ))} {sortedOptions.length > 5 && ( diff --git a/apps/web/core/components/issues/issue-layouts/filters/header/filters/due-date.tsx b/apps/web/core/components/issues/issue-layouts/filters/header/filters/due-date.tsx index 1079c559f1f..09dd157fae0 100644 --- a/apps/web/core/components/issues/issue-layouts/filters/header/filters/due-date.tsx +++ b/apps/web/core/components/issues/issue-layouts/filters/header/filters/due-date.tsx @@ -32,7 +32,7 @@ export const FilterDueDate = observer(function FilterDueDate(props: Props) { const isCustomDateSelected = () => { const isCustomFateApplied = appliedFilters?.filter((f) => f.includes("-")) || []; - return isCustomFateApplied.length > 0 ? true : false; + return isCustomFateApplied.length > 0; }; const handleCustomDate = () => { if (isCustomDateSelected()) { @@ -63,7 +63,7 @@ export const FilterDueDate = observer(function FilterDueDate(props: Props) { {filteredOptions.map((option) => ( handleUpdate(option.value)} title={option.name} multiple diff --git a/apps/web/core/components/issues/issue-layouts/filters/header/filters/labels.tsx b/apps/web/core/components/issues/issue-layouts/filters/header/filters/labels.tsx index f68b7755c6a..ae3b52fe493 100644 --- a/apps/web/core/components/issues/issue-layouts/filters/header/filters/labels.tsx +++ b/apps/web/core/components/issues/issue-layouts/filters/header/filters/labels.tsx @@ -68,7 +68,7 @@ export const FilterLabels = observer(function FilterLabels(props: Props) { {sortedOptions.slice(0, itemsToRender).map((label) => ( handleUpdate(label?.id)} icon={} title={label.name} diff --git a/apps/web/core/components/issues/issue-layouts/filters/header/filters/mentions.tsx b/apps/web/core/components/issues/issue-layouts/filters/header/filters/mentions.tsx index 6aa1d881efb..e0dda78934b 100644 --- a/apps/web/core/components/issues/issue-layouts/filters/header/filters/mentions.tsx +++ b/apps/web/core/components/issues/issue-layouts/filters/header/filters/mentions.tsx @@ -74,7 +74,7 @@ export const FilterMentions = observer(function FilterMentions(props: Props) { return ( handleUpdate(member.id)} icon={ ( handleUpdate(cycle.id)} icon={} title={cycle.name} diff --git a/apps/web/core/components/issues/issue-layouts/filters/header/filters/priority.tsx b/apps/web/core/components/issues/issue-layouts/filters/header/filters/priority.tsx index e3325d580d8..94d0db629be 100644 --- a/apps/web/core/components/issues/issue-layouts/filters/header/filters/priority.tsx +++ b/apps/web/core/components/issues/issue-layouts/filters/header/filters/priority.tsx @@ -42,7 +42,7 @@ export const FilterPriority = observer(function FilterPriority(props: Props) { filteredOptions.map((priority) => ( handleUpdate(priority.key)} icon={} title={priority.title} diff --git a/apps/web/core/components/issues/issue-layouts/filters/header/filters/project.tsx b/apps/web/core/components/issues/issue-layouts/filters/header/filters/project.tsx index 843ac016e86..0828fd02c98 100644 --- a/apps/web/core/components/issues/issue-layouts/filters/header/filters/project.tsx +++ b/apps/web/core/components/issues/issue-layouts/filters/header/filters/project.tsx @@ -65,7 +65,7 @@ export const FilterProjects = observer(function FilterProjects(props: Props) { {sortedOptions.slice(0, itemsToRender).map((project) => ( handleUpdate(project.id)} icon={ diff --git a/apps/web/core/components/issues/issue-layouts/filters/header/filters/start-date.tsx b/apps/web/core/components/issues/issue-layouts/filters/header/filters/start-date.tsx index 4adbe7fec97..f0d338c79e5 100644 --- a/apps/web/core/components/issues/issue-layouts/filters/header/filters/start-date.tsx +++ b/apps/web/core/components/issues/issue-layouts/filters/header/filters/start-date.tsx @@ -31,7 +31,7 @@ export const FilterStartDate = observer(function FilterStartDate(props: Props) { const isCustomDateSelected = () => { const isCustomFateApplied = appliedFilters?.filter((f) => f.includes("-")) || []; - return isCustomFateApplied.length > 0 ? true : false; + return isCustomFateApplied.length > 0; }; const handleCustomDate = () => { if (isCustomDateSelected()) { @@ -62,7 +62,7 @@ export const FilterStartDate = observer(function FilterStartDate(props: Props) { {filteredOptions.map((option) => ( handleUpdate(option.value)} title={option.name} multiple diff --git a/apps/web/core/components/issues/issue-layouts/filters/header/filters/state-group.tsx b/apps/web/core/components/issues/issue-layouts/filters/header/filters/state-group.tsx index 99e8c1dafcd..c0a0a4105d8 100644 --- a/apps/web/core/components/issues/issue-layouts/filters/header/filters/state-group.tsx +++ b/apps/web/core/components/issues/issue-layouts/filters/header/filters/state-group.tsx @@ -49,7 +49,7 @@ export const FilterStateGroup = observer(function FilterStateGroup(props: Props) {filteredOptions.slice(0, itemsToRender).map((stateGroup) => ( handleUpdate(stateGroup.key)} icon={} title={stateGroup.label} diff --git a/apps/web/core/components/issues/issue-layouts/filters/header/filters/state.tsx b/apps/web/core/components/issues/issue-layouts/filters/header/filters/state.tsx index 825a15a1819..b05fbbc81cf 100644 --- a/apps/web/core/components/issues/issue-layouts/filters/header/filters/state.tsx +++ b/apps/web/core/components/issues/issue-layouts/filters/header/filters/state.tsx @@ -60,7 +60,7 @@ export const FilterState = observer(function FilterState(props: Props) { {sortedOptions.slice(0, itemsToRender).map((state) => ( handleUpdate(state.id)} icon={ groups.findIndex(({ id }) => id === groupId); - const is_list = group_by === null ? true : false; + const is_list = group_by === null; // create groupIds array and entities object for bulk ops const groupIds = groups.map((g) => g.id); diff --git a/apps/web/core/components/issues/issue-layouts/quick-action-dropdowns/issue-detail.tsx b/apps/web/core/components/issues/issue-layouts/quick-action-dropdowns/issue-detail.tsx index 82e65dd0278..caf04a7107d 100644 --- a/apps/web/core/components/issues/issue-layouts/quick-action-dropdowns/issue-detail.tsx +++ b/apps/web/core/components/issues/issue-layouts/quick-action-dropdowns/issue-detail.tsx @@ -156,23 +156,19 @@ export const WorkItemDetailQuickActions = observer(function WorkItemDetailQuickA .map((item) => { // Customize edit action for work item if (item.key === "edit") { - return { - ...item, + return Object.assign({}, item, { shouldRender: isEditingAllowed && !isPeekMode, - }; + }); } // Customize delete action for work item if (item.key === "delete") { - return { - ...item, - }; + return item; } // Hide copy link in peek mode if (item.key === "copy-link") { - return { - ...item, + return Object.assign({}, item, { shouldRender: !isPeekMode, - }; + }); } return item; }) diff --git a/apps/web/core/components/issues/issue-layouts/quick-add/root.tsx b/apps/web/core/components/issues/issue-layouts/quick-add/root.tsx index 4d0f784159d..d7ba050191e 100644 --- a/apps/web/core/components/issues/issue-layouts/quick-add/root.tsx +++ b/apps/web/core/components/issues/issue-layouts/quick-add/root.tsx @@ -149,7 +149,7 @@ export const QuickAddIssueRoot = observer(function QuickAddIssueRoot(props: TQui layout={layout} prePopulatedData={prePopulatedData} projectId={projectId?.toString()} - hasError={errors && errors?.name && errors?.name?.message ? true : false} + hasError={!!(errors && errors?.name && errors?.name?.message)} setFocus={setFocus} register={register} onSubmit={handleSubmit(onSubmitHandler)} diff --git a/apps/web/core/components/issues/issue-layouts/utils.tsx b/apps/web/core/components/issues/issue-layouts/utils.tsx index c1a1a89f358..cea1eef4b72 100644 --- a/apps/web/core/components/issues/issue-layouts/utils.tsx +++ b/apps/web/core/components/issues/issue-layouts/utils.tsx @@ -70,9 +70,7 @@ export const isWorkspaceLevel = (type: EIssuesStoreType) => EIssuesStoreType.TEAM_VIEW, EIssuesStoreType.TEAM_PROJECT_WORK_ITEMS, EIssuesStoreType.WORKSPACE_DRAFT, - ].includes(type) - ? true - : false; + ].includes(type); type TGetGroupByColumns = { groupBy: GroupByColumnTypes | null; diff --git a/apps/web/core/components/modules/analytics-sidebar/issue-progress.tsx b/apps/web/core/components/modules/analytics-sidebar/issue-progress.tsx index 3feecffeba6..1f5b877fefa 100644 --- a/apps/web/core/components/modules/analytics-sidebar/issue-progress.tsx +++ b/apps/web/core/components/modules/analytics-sidebar/issue-progress.tsx @@ -60,7 +60,7 @@ export const ModuleAnalyticsProgress = observer(function ModuleAnalyticsProgress const selectedStateGroups = moduleFilter?.findFirstConditionByPropertyAndOperator("state_group", "in"); const moduleDetails = getModuleById(moduleId); const plotType: TModulePlotType = getPlotTypeByModuleId(moduleId); - const isCurrentProjectEstimateEnabled = projectId && areEstimateEnabledByProjectId(projectId) ? true : false; + const isCurrentProjectEstimateEnabled = !!(projectId && areEstimateEnabledByProjectId(projectId)); const estimateDetails = isCurrentProjectEstimateEnabled && currentActiveEstimateId && estimateById(currentActiveEstimateId); const isCurrentEstimateTypeIsPoints = estimateDetails && estimateDetails?.type === EEstimateSystem.POINTS; @@ -121,7 +121,7 @@ export const ModuleAnalyticsProgress = observer(function ModuleAnalyticsProgress if (!moduleDetails) return <>; return (
- + {({ open }) => (
{/* progress bar header */} diff --git a/apps/web/core/components/modules/analytics-sidebar/root.tsx b/apps/web/core/components/modules/analytics-sidebar/root.tsx index d5844e6a0eb..75cb8ccb0a4 100644 --- a/apps/web/core/components/modules/analytics-sidebar/root.tsx +++ b/apps/web/core/components/modules/analytics-sidebar/root.tsx @@ -71,7 +71,7 @@ export const ModuleAnalyticsSidebar = observer(function ModuleAnalyticsSidebar(p const moduleDetails = getModuleById(moduleId); const areEstimateEnabled = projectId && areEstimateEnabledByProjectId(projectId.toString()); const estimateType = areEstimateEnabled && currentActiveEstimateId && estimateById(currentActiveEstimateId); - const isEstimatePointValid = estimateType && estimateType?.type == EEstimateSystem.POINTS ? true : false; + const isEstimatePointValid = estimateType && estimateType?.type == EEstimateSystem.POINTS; const { reset, control } = useForm({ defaultValues, diff --git a/apps/web/core/components/modules/archived-modules/header.tsx b/apps/web/core/components/modules/archived-modules/header.tsx index 4b58e4bb920..840b34ff4fd 100644 --- a/apps/web/core/components/modules/archived-modules/header.tsx +++ b/apps/web/core/components/modules/archived-modules/header.tsx @@ -43,7 +43,7 @@ export const ArchivedModulesHeader = observer(function ArchivedModulesHeader() { workspace: { workspaceMemberIds }, } = useMember(); // states - const [isSearchOpen, setIsSearchOpen] = useState(archivedModulesSearchQuery !== "" ? true : false); + const [isSearchOpen, setIsSearchOpen] = useState(archivedModulesSearchQuery !== ""); // outside click detector hook useOutsideClickDetector(inputRef, () => { if (isSearchOpen && archivedModulesSearchQuery.trim() === "") setIsSearchOpen(false); diff --git a/apps/web/core/components/modules/dropdowns/filters/lead.tsx b/apps/web/core/components/modules/dropdowns/filters/lead.tsx index 286759dd22a..e1c6dc9e7f8 100644 --- a/apps/web/core/components/modules/dropdowns/filters/lead.tsx +++ b/apps/web/core/components/modules/dropdowns/filters/lead.tsx @@ -74,7 +74,7 @@ export const FilterLead = observer(function FilterLead(props: Props) { return ( handleUpdate(member.id)} icon={ handleUpdate(member.id)} icon={ { const isValidDateSelected = appliedFilters?.filter((f) => isInDateFormat(f.split(";")[0])) || []; - return isValidDateSelected.length > 0 ? true : false; + return isValidDateSelected.length > 0; }; const handleCustomDate = () => { if (isCustomDateSelected()) { @@ -66,7 +66,7 @@ export const FilterStartDate = observer(function FilterStartDate(props: Props) { {filteredOptions.map((option) => ( handleUpdate(option.value)} title={option.name} multiple diff --git a/apps/web/core/components/modules/dropdowns/filters/status.tsx b/apps/web/core/components/modules/dropdowns/filters/status.tsx index c6759089fd9..2188640c90e 100644 --- a/apps/web/core/components/modules/dropdowns/filters/status.tsx +++ b/apps/web/core/components/modules/dropdowns/filters/status.tsx @@ -41,7 +41,7 @@ export const FilterStatus = observer(function FilterStatus(props: Props) { filteredOptions.map((status) => ( handleUpdate(status.value)} icon={} title={t(status.i18n_label)} diff --git a/apps/web/core/components/modules/dropdowns/filters/target-date.tsx b/apps/web/core/components/modules/dropdowns/filters/target-date.tsx index 20654bef8b3..58d98605fe9 100644 --- a/apps/web/core/components/modules/dropdowns/filters/target-date.tsx +++ b/apps/web/core/components/modules/dropdowns/filters/target-date.tsx @@ -34,7 +34,7 @@ export const FilterTargetDate = observer(function FilterTargetDate(props: Props) const isCustomDateSelected = () => { const isValidDateSelected = appliedFilters?.filter((f) => isInDateFormat(f.split(";")[0])) || []; - return isValidDateSelected.length > 0 ? true : false; + return isValidDateSelected.length > 0; }; const handleCustomDate = () => { if (isCustomDateSelected()) { @@ -65,7 +65,7 @@ export const FilterTargetDate = observer(function FilterTargetDate(props: Props) {filteredOptions.map((option) => ( handleUpdate(option.value)} title={option.name} multiple diff --git a/apps/web/core/components/modules/modal.tsx b/apps/web/core/components/modules/modal.tsx index b85d9b48903..61ff8a3c619 100644 --- a/apps/web/core/components/modules/modal.tsx +++ b/apps/web/core/components/modules/modal.tsx @@ -138,7 +138,7 @@ export const CreateUpdateModuleModal = observer(function CreateUpdateModuleModal @@ -418,7 +417,7 @@ export const ProfileSetup = observer(function ProfileSetup(props: Props) { control={control} name="confirm_password" rules={{ - required: watch("password") ? true : false, + required: !!watch("password"), validate: (value) => watch("password") ? (value === watch("password") ? true : "Passwords don't match") : true, }} diff --git a/apps/web/core/components/onboarding/steps/profile/root.tsx b/apps/web/core/components/onboarding/steps/profile/root.tsx index 5e71c802f3b..3c75f721616 100644 --- a/apps/web/core/components/onboarding/steps/profile/root.tsx +++ b/apps/web/core/components/onboarding/steps/profile/root.tsx @@ -141,8 +141,7 @@ export const ProfileSetupStep = observer(function ProfileSetupStep({ handleStepC // Check for all available fields validation and if password field is available, then checks for password validation (strength + confirmation). // Also handles the condition for optional password i.e if password field is optional it only checks for above validation if it's not empty. - const isButtonDisabled = - !isSubmitting && isValid ? (isPasswordAlreadySetup ? false : isValidPassword ? false : true) : true; + const isButtonDisabled = !(!isSubmitting && isValid) || (!isPasswordAlreadySetup && !isValidPassword); return (
diff --git a/apps/web/core/components/onboarding/steps/role/root.tsx b/apps/web/core/components/onboarding/steps/role/root.tsx index 43029d1cfdb..1b3a7488c0f 100644 --- a/apps/web/core/components/onboarding/steps/role/root.tsx +++ b/apps/web/core/components/onboarding/steps/role/root.tsx @@ -87,7 +87,7 @@ export const RoleSetupStep = observer(function RoleSetupStep({ handleStepChange handleStepChange(EOnboardingSteps.ROLE_SETUP); }; - const isButtonDisabled = !isSubmitting && isValid ? false : true; + const isButtonDisabled = !(!isSubmitting && isValid); return ( diff --git a/apps/web/core/components/onboarding/steps/usecase/root.tsx b/apps/web/core/components/onboarding/steps/usecase/root.tsx index 8908adaf3b4..e5c1e2f2060 100644 --- a/apps/web/core/components/onboarding/steps/usecase/root.tsx +++ b/apps/web/core/components/onboarding/steps/usecase/root.tsx @@ -81,7 +81,7 @@ export const UseCaseSetupStep = observer(function UseCaseSetupStep({ handleStepC }; // derived values - const isButtonDisabled = !isSubmitting && isValid ? false : true; + const isButtonDisabled = !(!isSubmitting && isValid); return ( diff --git a/apps/web/core/components/power-k/ui/pages/open-entity/project-settings-menu.tsx b/apps/web/core/components/power-k/ui/pages/open-entity/project-settings-menu.tsx index 5a1be462b44..ff2a40fcc68 100644 --- a/apps/web/core/components/power-k/ui/pages/open-entity/project-settings-menu.tsx +++ b/apps/web/core/components/power-k/ui/pages/open-entity/project-settings-menu.tsx @@ -38,11 +38,12 @@ export const PowerKOpenProjectSettingsMenu = observer(function PowerKOpenProject context.params.projectId?.toString() ) ); - const settingsListWithIcons = settingsList.map((setting) => ({ - ...setting, - label: t(setting.i18n_label), - icon: PROJECT_SETTINGS_ICONS[setting.key], - })); + const settingsListWithIcons = settingsList.map((setting) => + Object.assign({}, setting, { + label: t(setting.i18n_label), + icon: PROJECT_SETTINGS_ICONS[setting.key], + }) + ); return handleSelect(setting.href)} />; }); diff --git a/apps/web/core/components/power-k/ui/pages/open-entity/workspace-settings-menu.tsx b/apps/web/core/components/power-k/ui/pages/open-entity/workspace-settings-menu.tsx index 7dc8805b95b..8c76fd9987a 100644 --- a/apps/web/core/components/power-k/ui/pages/open-entity/workspace-settings-menu.tsx +++ b/apps/web/core/components/power-k/ui/pages/open-entity/workspace-settings-menu.tsx @@ -32,11 +32,12 @@ export const PowerKOpenWorkspaceSettingsMenu = observer(function PowerKOpenWorks context.params.workspaceSlug && allowPermissions(setting.access, EUserPermissionsLevel.WORKSPACE, context.params.workspaceSlug?.toString()) ); - const settingsListWithIcons = settingsList.map((setting) => ({ - ...setting, - label: t(setting.i18n_label), - icon: WORKSPACE_SETTINGS_ICONS[setting.key], - })); + const settingsListWithIcons = settingsList.map((setting) => + Object.assign({}, setting, { + label: t(setting.i18n_label), + icon: WORKSPACE_SETTINGS_ICONS[setting.key], + }) + ); return handleSelect(setting.href)} />; }); diff --git a/apps/web/core/components/project-states/options/delete.tsx b/apps/web/core/components/project-states/options/delete.tsx index 65f4b4125c8..044eadbf068 100644 --- a/apps/web/core/components/project-states/options/delete.tsx +++ b/apps/web/core/components/project-states/options/delete.tsx @@ -32,7 +32,7 @@ export const StateDelete = observer(function StateDelete(props: TStateDelete) { const [isDeleteModal, setIsDeleteModal] = useState(false); const [isDelete, setIsDelete] = useState(false); // derived values - const isDeleteDisabled = state.default ? true : totalStates === 1 ? true : false; + const isDeleteDisabled = state.default ? true : totalStates === 1; const handleDeleteState = async () => { if (isDeleteDisabled) return; diff --git a/apps/web/core/components/project-states/state-item-title.tsx b/apps/web/core/components/project-states/state-item-title.tsx index b3fce44d710..f2179eab9e5 100644 --- a/apps/web/core/components/project-states/state-item-title.tsx +++ b/apps/web/core/components/project-states/state-item-title.tsx @@ -67,7 +67,7 @@ export const StateItemTitle = observer(function StateItemTitle(props: TStateItem
diff --git a/apps/web/core/components/project-states/state-item.tsx b/apps/web/core/components/project-states/state-item.tsx index 9caeef1f862..047ce4db470 100644 --- a/apps/web/core/components/project-states/state-item.tsx +++ b/apps/web/core/components/project-states/state-item.tsx @@ -47,7 +47,7 @@ export const StateItem = observer(function StateItem(props: TStateItem) { const [isDraggedOver, setIsDraggedOver] = useState(false); const [closestEdge, setClosestEdge] = useState(null); // derived values - const isDraggable = totalStates === 1 ? false : true; + const isDraggable = totalStates !== 1; const commonStateItemListProps = { stateCount: totalStates, state: state, diff --git a/apps/web/core/components/project/dropdowns/filters/access.tsx b/apps/web/core/components/project/dropdowns/filters/access.tsx index 32a5648a3e9..fb28ac73446 100644 --- a/apps/web/core/components/project/dropdowns/filters/access.tsx +++ b/apps/web/core/components/project/dropdowns/filters/access.tsx @@ -42,7 +42,7 @@ export const FilterAccess = observer(function FilterAccess(props: Props) { filteredOptions.map((access) => ( handleUpdate(`${access.key}`)} icon={} title={t(access.i18n_label)} diff --git a/apps/web/core/components/project/dropdowns/filters/created-at.tsx b/apps/web/core/components/project/dropdowns/filters/created-at.tsx index 4ce2bf045fc..52573c35790 100644 --- a/apps/web/core/components/project/dropdowns/filters/created-at.tsx +++ b/apps/web/core/components/project/dropdowns/filters/created-at.tsx @@ -34,7 +34,7 @@ export const FilterCreatedDate = observer(function FilterCreatedDate(props: Prop const isCustomDateSelected = () => { const isValidDateSelected = appliedFilters?.filter((f) => isInDateFormat(f.split(";")[0])) || []; - return isValidDateSelected.length > 0 ? true : false; + return isValidDateSelected.length > 0; }; const handleCustomDate = () => { if (isCustomDateSelected()) { @@ -65,7 +65,7 @@ export const FilterCreatedDate = observer(function FilterCreatedDate(props: Prop {filteredOptions.map((option) => ( handleUpdate(option.value)} title={option.name} multiple={false} diff --git a/apps/web/core/components/project/dropdowns/filters/lead.tsx b/apps/web/core/components/project/dropdowns/filters/lead.tsx index 286759dd22a..e1c6dc9e7f8 100644 --- a/apps/web/core/components/project/dropdowns/filters/lead.tsx +++ b/apps/web/core/components/project/dropdowns/filters/lead.tsx @@ -74,7 +74,7 @@ export const FilterLead = observer(function FilterLead(props: Props) { return ( handleUpdate(member.id)} icon={ handleUpdate(member.id)} icon={ 0 ? true : false; + const isMentionsEnabled = unreadNotificationsCount.mention_unread_notifications_count > 0; const totalNotifications = isMentionsEnabled ? unreadNotificationsCount.mention_unread_notifications_count : unreadNotificationsCount.total_unread_notifications_count; diff --git a/apps/web/core/components/workspace-notifications/sidebar/filters/menu/root.tsx b/apps/web/core/components/workspace-notifications/sidebar/filters/menu/root.tsx index 12e8ada0556..4ba1833bb64 100644 --- a/apps/web/core/components/workspace-notifications/sidebar/filters/menu/root.tsx +++ b/apps/web/core/components/workspace-notifications/sidebar/filters/menu/root.tsx @@ -23,10 +23,9 @@ export const NotificationFilter = observer(function NotificationFilter() { const { isMobile } = usePlatformOS(); const { t } = useTranslation(); - const translatedFilterTypeOptions = FILTER_TYPE_OPTIONS.map((filter) => ({ - ...filter, - label: t(filter.i18n_label), - })); + const translatedFilterTypeOptions = FILTER_TYPE_OPTIONS.map((filter) => + Object.assign({}, filter, { label: t(filter.i18n_label) }) + ); return ( WORKSPACE_SIDEBAR_DYNAMIC_NAVIGATION_ITEMS_LINKS.map((item) => { const preference = workspacePreferences.items[item.key]; - return { - ...item, + return Object.assign({}, item, { sort_order: preference ? preference.sort_order : 0, - }; + }); }).sort((a, b) => a.sort_order - b.sort_order), [workspacePreferences] ); diff --git a/apps/web/core/lib/wrappers/store-wrapper.tsx b/apps/web/core/lib/wrappers/store-wrapper.tsx index 64c09400588..e811831d0a8 100644 --- a/apps/web/core/lib/wrappers/store-wrapper.tsx +++ b/apps/web/core/lib/wrappers/store-wrapper.tsx @@ -46,7 +46,7 @@ function StoreWrapper(props: TStoreWrapper) { */ useEffect(() => { const localValue = localStorage && localStorage.getItem("app_sidebar_collapsed"); - const localBoolValue = localValue ? (localValue === "true" ? true : false) : false; + const localBoolValue = localValue ? localValue === "true" : false; if (localValue && sidebarCollapsed === undefined) toggleSidebar(localBoolValue); }, [sidebarCollapsed, setTheme, toggleSidebar]); diff --git a/apps/web/core/store/notifications/workspace-notifications.store.ts b/apps/web/core/store/notifications/workspace-notifications.store.ts index b11f563b293..9b2247cbf77 100644 --- a/apps/web/core/store/notifications/workspace-notifications.store.ts +++ b/apps/web/core/store/notifications/workspace-notifications.store.ts @@ -141,9 +141,9 @@ export class WorkspaceNotificationStore implements IWorkspaceNotificationStore { } } else { if (this.filters.snoozed) { - return n.snoozed_till ? true : false; + return !!n.snoozed_till; } else if (this.filters.archived) { - return n.archived_at ? true : false; + return !!n.archived_at; } else { return true; } diff --git a/apps/web/helpers/views.helper.ts b/apps/web/helpers/views.helper.ts index 5b91810c9bb..713faa8455a 100644 --- a/apps/web/helpers/views.helper.ts +++ b/apps/web/helpers/views.helper.ts @@ -20,7 +20,8 @@ export const VIEW_ACCESS_SPECIFIERS: { key: EViewAccess; i18n_label: string; icon: LucideIcon | React.FC; -}[] = VIEW_ACCESS_SPECIFIERS_CONSTANTS.map((option) => ({ - ...option, - icon: VIEW_ACCESS_ICONS[option.key as keyof typeof VIEW_ACCESS_ICONS], -})); +}[] = VIEW_ACCESS_SPECIFIERS_CONSTANTS.map((option) => + Object.assign({}, option, { + icon: VIEW_ACCESS_ICONS[option.key as keyof typeof VIEW_ACCESS_ICONS], + }) +); diff --git a/packages/editor/src/core/extensions/custom-link/helpers/autolink.ts b/packages/editor/src/core/extensions/custom-link/helpers/autolink.ts index 38a452c0b9c..2f9aa37332f 100644 --- a/packages/editor/src/core/extensions/custom-link/helpers/autolink.ts +++ b/packages/editor/src/core/extensions/custom-link/helpers/autolink.ts @@ -72,11 +72,12 @@ export function autolink(options: AutolinkOptions): Plugin { find(lastWordBeforeSpace) .filter((link) => link.isLink) // Calculate link position. - .map((link) => ({ - ...link, - from: lastWordAndBlockOffset + link.start + 1, - to: lastWordAndBlockOffset + link.end + 1, - })) + .map((link) => + Object.assign({}, link, { + from: lastWordAndBlockOffset + link.start + 1, + to: lastWordAndBlockOffset + link.end + 1, + }) + ) // ignore link inside code mark .filter((link) => { if (!newState.schema.marks.code) { diff --git a/packages/editor/src/core/extensions/slash-commands/command-items-list.tsx b/packages/editor/src/core/extensions/slash-commands/command-items-list.tsx index 154887fb609..e49936e3f2c 100644 --- a/packages/editor/src/core/extensions/slash-commands/command-items-list.tsx +++ b/packages/editor/src/core/extensions/slash-commands/command-items-list.tsx @@ -319,19 +319,20 @@ export const getSlashCommandFilteredSections = } }); - const filteredSlashSections = SLASH_COMMAND_SECTIONS.map((section) => ({ - ...section, - items: section.items.filter((item) => { - if (typeof query !== "string") return; + const filteredSlashSections = SLASH_COMMAND_SECTIONS.map((section) => + Object.assign({}, section, { + items: section.items.filter((item) => { + if (typeof query !== "string") return; - const lowercaseQuery = query.toLowerCase(); - return ( - item.title.toLowerCase().includes(lowercaseQuery) || - item.description.toLowerCase().includes(lowercaseQuery) || - item.searchTerms.some((t) => t.includes(lowercaseQuery)) - ); - }), - })); + const lowercaseQuery = query.toLowerCase(); + return ( + item.title.toLowerCase().includes(lowercaseQuery) || + item.description.toLowerCase().includes(lowercaseQuery) || + item.searchTerms.some((t) => t.includes(lowercaseQuery)) + ); + }), + }) + ); return filteredSlashSections.filter((s) => s.items.length !== 0); }; diff --git a/packages/propel/src/button/helper.tsx b/packages/propel/src/button/helper.tsx index 9e332d55f0b..18130b113c9 100644 --- a/packages/propel/src/button/helper.tsx +++ b/packages/propel/src/button/helper.tsx @@ -17,9 +17,9 @@ export const buttonVariants = cva( "error-fill": "bg-danger-primary text-on-color hover:bg-danger-primary-hover active:bg-danger-primary-active disabled:bg-layer-disabled disabled:text-disabled", "error-outline": - "bg-layer-2 hover:bg-danger-subtle active:bg-danger-subtle-hover disabled:bg-layer-2 text-danger-secondary disabled:text-disabled border border-danger-strong disabled:border-subtle-1", + "border border-danger-strong bg-layer-2 text-danger-secondary hover:bg-danger-subtle active:bg-danger-subtle-hover disabled:border-subtle-1 disabled:bg-layer-2 disabled:text-disabled", secondary: - "bg-layer-2 hover:bg-layer-2-hover active:bg-layer-2-active disabled:bg-layer-transparent text-secondary disabled:text-disabled border border-strong disabled:border-subtle-1 shadow-raised-100", + "border border-strong bg-layer-2 text-secondary shadow-raised-100 hover:bg-layer-2-hover active:bg-layer-2-active disabled:border-subtle-1 disabled:bg-layer-transparent disabled:text-disabled", tertiary: "bg-layer-3 text-secondary hover:bg-layer-3-hover active:bg-layer-3-active disabled:bg-layer-transparent disabled:text-disabled", ghost: diff --git a/packages/ui/src/collapsible/collapsible.tsx b/packages/ui/src/collapsible/collapsible.tsx index 0831db3bb1a..fa1ff114054 100644 --- a/packages/ui/src/collapsible/collapsible.tsx +++ b/packages/ui/src/collapsible/collapsible.tsx @@ -21,7 +21,7 @@ export type TCollapsibleProps = { export function Collapsible(props: TCollapsibleProps) { const { title, children, buttonRef, className, buttonClassName, isOpen, onToggle, defaultOpen } = props; // state - const [localIsOpen, setLocalIsOpen] = useState(isOpen || defaultOpen ? true : false); + const [localIsOpen, setLocalIsOpen] = useState(!!(isOpen || defaultOpen)); useEffect(() => { if (isOpen !== undefined) { diff --git a/packages/ui/src/form-fields/password/indicator.tsx b/packages/ui/src/form-fields/password/indicator.tsx index 21e2dc80d11..021fed59b52 100644 --- a/packages/ui/src/form-fields/password/indicator.tsx +++ b/packages/ui/src/form-fields/password/indicator.tsx @@ -25,7 +25,7 @@ export function PasswordStrengthIndicator({ const criteria = getPasswordCriteria(password); const strengthInfo = getStrengthInfo(strength); - const isPasswordMeterVisible = isFocused ? true : strength === E_PASSWORD_STRENGTH.STRENGTH_VALID ? false : true; + const isPasswordMeterVisible = isFocused || strength !== E_PASSWORD_STRENGTH.STRENGTH_VALID; if ((!password && !showCriteria) || !isPasswordMeterVisible) { return null; diff --git a/packages/utils/src/rich-filters/operations/traversal/core.ts b/packages/utils/src/rich-filters/operations/traversal/core.ts index edcfc20de88..3c2d9b5d22c 100644 --- a/packages/utils/src/rich-filters/operations/traversal/core.ts +++ b/packages/utils/src/rich-filters/operations/traversal/core.ts @@ -188,10 +188,9 @@ export const extractConditionsWithDisplayOperators =

// Transform operators using the extended helper return rawConditions.map((condition) => { const displayOperator = getDisplayOperator(condition.operator, expression, condition.id); - return { - ...condition, + return Object.assign({}, condition, { operator: displayOperator, - }; + }); }); };