Skip to content

Commit

Permalink
[Fix] Move save button to top on field edit (#6739)
Browse files Browse the repository at this point in the history
Before
<img width="802" alt="image"
src="https://github.com/user-attachments/assets/2a9d9501-6bd4-4dc2-b8d7-98a29816caab">

After
<img width="871" alt="Capture d’écran 2024-08-26 à 12 17 29"
src="https://github.com/user-attachments/assets/b6cb688c-fdcd-4b10-8d91-197245f7dd56">
  • Loading branch information
ijreilly authored Aug 26, 2024
1 parent c4f0292 commit d622803
Showing 1 changed file with 10 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import { isLabelIdentifierField } from '@/object-metadata/utils/isLabelIdentifie
import { useFindManyRecordsQuery } from '@/object-record/hooks/useFindManyRecordsQuery';
import { RecordFieldValueSelectorContextProvider } from '@/object-record/record-store/contexts/RecordFieldValueSelectorContext';
import { SaveAndCancelButtons } from '@/settings/components/SaveAndCancelButtons/SaveAndCancelButtons';
import { SettingsHeaderContainer } from '@/settings/components/SettingsHeaderContainer';
import { SettingsPageContainer } from '@/settings/components/SettingsPageContainer';
import { FIELD_NAME_MAXIMUM_LENGTH } from '@/settings/data-model/constants/FieldNameMaximumLength';
import { SettingsDataModelFieldAboutForm } from '@/settings/data-model/fields/forms/components/SettingsDataModelFieldAboutForm';
Expand Down Expand Up @@ -186,18 +185,18 @@ export const SettingsObjectFieldEdit = () => {
]}
/>
}
actionButton={
shouldDisplaySaveAndCancel && (
<SaveAndCancelButtons
isSaveDisabled={!canSave}
isCancelDisabled={isSubmitting}
onCancel={() => navigate(`/settings/objects/${objectSlug}`)}
onSave={formConfig.handleSubmit(handleSave)}
/>
)
}
>
<SettingsPageContainer>
<SettingsHeaderContainer>
{shouldDisplaySaveAndCancel && (
<SaveAndCancelButtons
isSaveDisabled={!canSave}
isCancelDisabled={isSubmitting}
onCancel={() => navigate(`/settings/objects/${objectSlug}`)}
onSave={formConfig.handleSubmit(handleSave)}
/>
)}
</SettingsHeaderContainer>
<Section>
<H2Title
title="Name and description"
Expand Down

0 comments on commit d622803

Please sign in to comment.