Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions apps/admin/app/(all)/(dashboard)/general/intercom.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -73,7 +71,7 @@ export const IntercomConfig = observer(function IntercomConfig(props: TIntercomC

<div className="ml-auto">
<ToggleSwitch
value={isIntercomEnabled ? true : false}
value={!!isIntercomEnabled}
onChange={enableIntercomConfig}
size="sm"
disabled={!isTelemetryEnabled || isSubmitting || initialLoader}
Expand Down
2 changes: 1 addition & 1 deletion apps/admin/app/(all)/(home)/sign-in-form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ export function InstanceSignInForm() {
}, [errorCode, errorMessage]);

const isButtonDisabled = useMemo(
() => (!isSubmitting && formData.email && formData.password ? false : true),
() => !(!isSubmitting && formData.email && formData.password),
[formData.email, formData.password, isSubmitting]
);

Expand Down
22 changes: 11 additions & 11 deletions apps/admin/components/instance/setup-form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Comment on lines +67 to 68
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

Restore three-state parsing for is_telemetry_enabled.

searchParams?.get("is_telemetry_enabled") === "True" || true is always true, so this setup flow can no longer honor is_telemetry_enabled=False from the query string. Because Lines 97-98 then copy that value into formData, the hidden field at Line 161 will always submit "True". That is a real behavior change in a telemetry opt-out path, and it diverges from apps/admin/app/(all)/(dashboard)/general/form.tsx:45-68, where telemetry is treated as a real boolean.

Proposed fix
-  const isTelemetryEnabledParam = searchParams?.get("is_telemetry_enabled") === "True" || true;
+  const isTelemetryEnabledParam = searchParams?.get("is_telemetry_enabled");
@@
-    if (isTelemetryEnabledParam) setFormData((prev) => ({ ...prev, is_telemetry_enabled: isTelemetryEnabledParam }));
+    if (isTelemetryEnabledParam !== null) {
+      setFormData((prev) => ({
+        ...prev,
+        is_telemetry_enabled: isTelemetryEnabledParam === "True",
+      }));
+    }

Also applies to: 92-98

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@apps/admin/components/instance/setup-form.tsx` around lines 67 - 68, The
value for isTelemetryEnabledParam is forced true by the `... === "True" || true`
expression, so restore three-state parsing by reading
`searchParams.get("is_telemetry_enabled")` and mapping `"True" -> true`,
`"False" -> false`, and anything else -> undefined (or null) before copying into
`formData`; update the variable `isTelemetryEnabledParam` in setup-form.tsx and
any subsequent code that copies it into `formData` (and the analogous block
around the later copy) so the hidden telemetry field will submit the actual
parsed boolean or no value when unset.

const errorMessage = searchParams?.get("error_message") || undefined;
// state
Expand Down Expand Up @@ -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]
);

Expand Down Expand Up @@ -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 && (
Expand Down Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion apps/admin/providers/user.provider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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]);

Expand Down
2 changes: 1 addition & 1 deletion apps/space/components/account/auth-forms/auth-root.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ export const AuthRoot = observer(function AuthRoot() {
}}
/>
)}
<TermsAndConditions isSignUp={authMode === EAuthModes.SIGN_UP ? true : false} />
<TermsAndConditions isSignUp={authMode === EAuthModes.SIGN_UP} />
</div>
</div>
);
Expand Down
16 changes: 8 additions & 8 deletions apps/space/components/account/auth-forms/password.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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]
);

Expand Down
2 changes: 1 addition & 1 deletion apps/space/components/issues/filters/labels.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ export function FilterLabels(props: Props) {
{filteredOptions.slice(0, itemsToRender).map((label) => (
<FilterOption
key={label?.id}
isChecked={appliedFilters?.includes(label?.id) ? true : false}
isChecked={!!appliedFilters?.includes(label?.id)}
onClick={() => handleUpdate(label?.id)}
icon={<LabelIcons color={label.color} />}
title={label.name}
Expand Down
2 changes: 1 addition & 1 deletion apps/space/components/issues/filters/priority.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export const FilterPriority = observer(function FilterPriority(props: Props) {
filteredOptions.map((priority) => (
<FilterOption
key={priority.key}
isChecked={appliedFilters?.includes(priority.key) ? true : false}
isChecked={!!appliedFilters?.includes(priority.key)}
onClick={() => handleUpdate(priority.key)}
icon={<PriorityIcon priority={priority.key} className="h-3.5 w-3.5" />}
title={t(priority.titleTranslationKey)}
Expand Down
2 changes: 1 addition & 1 deletion apps/space/components/issues/filters/state.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ export const FilterState = observer(function FilterState(props: Props) {
{filteredOptions.slice(0, itemsToRender).map((state) => (
<FilterOption
key={state.id}
isChecked={appliedFilters?.includes(state.id) ? true : false}
isChecked={!!appliedFilters?.includes(state.id)}
onClick={() => handleUpdate(state.id)}
icon={<StateGroupIcon stateGroup={state.group} color={state.color} size={EIconSize.MD} />}
title={state.name}
Expand Down
6 changes: 3 additions & 3 deletions apps/space/store/cycle.store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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,
Expand Down
4 changes: 2 additions & 2 deletions apps/space/store/helpers/base-issues.store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -81,7 +81,7 @@ export abstract class BaseIssuesStore implements IBaseIssuesStore {
// root store
rootIssueStore;

constructor(_rootStore: CoreRootStore) {
constructor(_rootStore: RootStore) {
makeObservable(this, {
// observable
loader: observable,
Expand Down
4 changes: 2 additions & 2 deletions apps/space/store/instance.store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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,
Expand Down
6 changes: 3 additions & 3 deletions apps/space/store/issue-detail.store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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";

Expand Down Expand Up @@ -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,
Expand Down
4 changes: 2 additions & 2 deletions apps/space/store/issue-filters.store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down
6 changes: 3 additions & 3 deletions apps/space/store/issue.store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand All @@ -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
Expand Down
6 changes: 3 additions & 3 deletions apps/space/store/label.store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -25,9 +25,9 @@ export interface IIssueLabelStore {
export class LabelStore implements IIssueLabelStore {
labelMap: Record<string, IIssueLabel> = {};
labelService: SitesLabelService;
rootStore: CoreRootStore;
rootStore: RootStore;

constructor(_rootStore: CoreRootStore) {
constructor(_rootStore: RootStore) {
makeObservable(this, {
// observables
labelMap: observable,
Expand Down
6 changes: 3 additions & 3 deletions apps/space/store/members.store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -24,9 +24,9 @@ export interface IIssueMemberStore {
export class MemberStore implements IIssueMemberStore {
memberMap: Record<string, TPublicMember> = {};
memberService: SitesMemberService;
rootStore: CoreRootStore;
rootStore: RootStore;

constructor(_rootStore: CoreRootStore) {
constructor(_rootStore: RootStore) {
makeObservable(this, {
// observables
memberMap: observable,
Expand Down
6 changes: 3 additions & 3 deletions apps/space/store/module.store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -26,9 +26,9 @@ export interface IIssueModuleStore {
export class ModuleStore implements IIssueModuleStore {
moduleMap: Record<string, TPublicModule> = {};
moduleService: SitesModuleService;
rootStore: CoreRootStore;
rootStore: RootStore;

constructor(_rootStore: CoreRootStore) {
constructor(_rootStore: RootStore) {
makeObservable(this, {
// observables
moduleMap: observable,
Expand Down
4 changes: 2 additions & 2 deletions apps/space/store/profile.store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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,
Expand Down
4 changes: 2 additions & 2 deletions apps/space/store/publish/publish.store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions apps/space/store/publish/publish_list.store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -26,7 +26,7 @@ export class PublishListStore implements IPublishListStore {
// service
publishService;

constructor(private rootStore: CoreRootStore) {
constructor(private rootStore: RootStore) {
makeObservable(this, {
// observables
publishMap: observable,
Expand Down
Loading
Loading