Skip to content

Commit 269fbe5

Browse files
committed
[TOOL-3691] Dashbaord: Keep project settings submit button always enabled (#6467)
<!-- start pr-codex --> ## PR-Codex overview This PR focuses on simplifying the logic for determining if form fields are "dirty" before enabling the save button in the `ProjectGeneralSettingsPage`. It removes checks for dirty states, allowing the save button to be enabled regardless of whether the fields have been modified. ### Detailed summary - Removed `isNameDirty` check for the `name` field in `ProjectNameSetting`. - Removed `isDomainsDirty` check for the `domains` field in `AllowedDomainsSetting`. - Removed `isBundleIdsDirty` check for the `bundleIds` field in `AllowedBundleIDsSetting`. - Updated save button to always have `disabled: false` for all settings. - Kept `isPending` functionality unchanged based on `props.isUpdatingProject`. > ✨ Ask PR-Codex anything about this PR by commenting with `/codex {your question}` <!-- end pr-codex -->
1 parent 7ed8fc2 commit 269fbe5

File tree

1 file changed

+7
-12
lines changed

1 file changed

+7
-12
lines changed

apps/dashboard/src/app/team/[team_slug]/[project_slug]/settings/ProjectGeneralSettingsPage.tsx

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -406,7 +406,6 @@ function ProjectNameSetting(props: {
406406
handleSubmit: () => void;
407407
}) {
408408
const { form, handleSubmit } = props;
409-
const isNameDirty = form.getFieldState("name").isDirty;
410409

411410
return (
412411
<SettingsCard
@@ -419,8 +418,8 @@ function ProjectNameSetting(props: {
419418
errorText={form.getFieldState("name").error?.message}
420419
saveButton={{
421420
onClick: handleSubmit,
422-
disabled: !isNameDirty,
423-
isPending: props.isUpdatingProject && isNameDirty,
421+
disabled: false,
422+
isPending: props.isUpdatingProject,
424423
}}
425424
bottomText="Please use 64 characters at maximum"
426425
>
@@ -501,7 +500,6 @@ function AllowedDomainsSetting(props: {
501500
handleSubmit: () => void;
502501
}) {
503502
const { form, handleSubmit } = props;
504-
const isDomainsDirty = form.getFieldState("domains").isDirty;
505503

506504
const helperText = (
507505
<ul className="flex list-disc flex-col gap-1.5 py-1 pl-3 text-muted-foreground text-sm [&>li]:pl-1">
@@ -544,8 +542,8 @@ function AllowedDomainsSetting(props: {
544542
errorText={form.getFieldState("domains", form.formState).error?.message}
545543
saveButton={{
546544
onClick: handleSubmit,
547-
disabled: !isDomainsDirty,
548-
isPending: props.isUpdatingProject && isDomainsDirty,
545+
disabled: false,
546+
isPending: props.isUpdatingProject,
549547
}}
550548
bottomText="This is only applicable for web applications"
551549
>
@@ -606,13 +604,12 @@ function AllowedBundleIDsSetting(props: {
606604
handleSubmit: () => void;
607605
}) {
608606
const { form, handleSubmit } = props;
609-
const isBundleIdsDirty = form.getFieldState("bundleIds").isDirty;
610607
return (
611608
<SettingsCard
612609
saveButton={{
613610
onClick: handleSubmit,
614-
disabled: !isBundleIdsDirty,
615-
isPending: props.isUpdatingProject && isBundleIdsDirty,
611+
disabled: false,
612+
isPending: props.isUpdatingProject,
616613
}}
617614
noPermissionText={undefined}
618615
header={{
@@ -715,7 +712,7 @@ function EnabledServicesSetting(props: {
715712
errorText={undefined}
716713
saveButton={{
717714
onClick: handleSubmit,
718-
disabled: !form.formState.isDirty,
715+
disabled: false,
719716
isPending: props.isUpdatingProject,
720717
}}
721718
bottomText=""
@@ -1219,8 +1216,6 @@ function TransferProject(props: {
12191216
selectedTeamId === props.currentTeamId ||
12201217
!props.isOwnerAccount;
12211218

1222-
console.log({ selectedTeam: selectedTeamWithRole, isDisabled });
1223-
12241219
const handleTransfer = () => {
12251220
if (!hasOwnerRole) {
12261221
return;

0 commit comments

Comments
 (0)