-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix support custom object renaming #8089
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM @ijreilly, thank you for the quick fix. I left some comments that can be addressed in another PR
@@ -102,6 +102,8 @@ const StyledLabel = styled.span` | |||
|
|||
const infoCircleElementId = 'info-circle-id'; | |||
|
|||
export const IS_LABEL_SYNCED_WITH_NAME_LABEL = 'isLabelSyncedWithName'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
export const IS_LABEL_SYNCED_WITH_NAME_LABEL = 'isLabelSyncedWithName'; | |
export const IS_LABEL_SYNCED_WITH_NAME = 'isLabelSyncedWithName'; |
const shouldComputeNamesFromLabels: boolean = dirtyFieldKeys.includes( | ||
IS_LABEL_SYNCED_WITH_NAME_LABEL, | ||
) | ||
? (formValues.isLabelSyncedWithName as boolean) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
? (formValues.isLabelSyncedWithName as boolean) | |
? !!formValues.isLabelSyncedWithName |
or
? (formValues.isLabelSyncedWithName as boolean) | |
? (formValues.isLabelSyncedWithName ?? false) |
would be better than type assertion imho
@@ -16,6 +16,7 @@ import { RecordFieldValueSelectorContextProvider } from '@/object-record/record- | |||
import { SaveAndCancelButtons } from '@/settings/components/SaveAndCancelButtons/SaveAndCancelButtons'; | |||
import { SettingsPageContainer } from '@/settings/components/SettingsPageContainer'; | |||
import { | |||
IS_LABEL_SYNCED_WITH_NAME_LABEL, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not 100% sure this const should be specifically owned by this component? Should we move to a constants folder instead?
@@ -1641,4 +1635,18 @@ export class ObjectMetadataService extends TypeOrmQueryService<ObjectMetadataEnt | |||
); | |||
} | |||
}; | |||
|
|||
private validateNameSingularAndNamePluralAreDifferentOrThrow = ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could reuse this in the create
In this PR