Replace shouldSyncNameAndLabel with isLabelSyncedWithName (#8067)

For consistency. 
This was not deployed yet so allowing myself just to rename everything,
meaning developers will need to reset their db.
This commit is contained in:
Marie 2024-10-25 18:28:58 +02:00 committed by GitHub
parent e5175194ac
commit d51a797d91
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
22 changed files with 80 additions and 80 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1,5 +1,5 @@
import * as Apollo from '@apollo/client';
import { gql } from '@apollo/client';
import * as Apollo from '@apollo/client';
export type Maybe<T> = T | null;
export type InputMaybe<T> = Maybe<T>;
export type Exact<T extends { [key: string]: unknown }> = { [K in keyof T]: T[K] };
@ -1155,13 +1155,13 @@ export type UpdateObjectPayload = {
icon?: InputMaybe<Scalars['String']>;
imageIdentifierFieldMetadataId?: InputMaybe<Scalars['String']>;
isActive?: InputMaybe<Scalars['Boolean']>;
isLabelSyncedWithName?: InputMaybe<Scalars['Boolean']>;
labelIdentifierFieldMetadataId?: InputMaybe<Scalars['String']>;
labelPlural?: InputMaybe<Scalars['String']>;
labelSingular?: InputMaybe<Scalars['String']>;
namePlural?: InputMaybe<Scalars['String']>;
nameSingular?: InputMaybe<Scalars['String']>;
shortcut?: InputMaybe<Scalars['String']>;
shouldSyncLabelAndName?: InputMaybe<Scalars['Boolean']>;
};
export type UpdateOneObjectInput = {
@ -1471,6 +1471,7 @@ export type Object = {
indexMetadatas: ObjectIndexMetadatasConnection;
isActive: Scalars['Boolean'];
isCustom: Scalars['Boolean'];
isLabelSyncedWithName: Scalars['Boolean'];
isRemote: Scalars['Boolean'];
isSystem: Scalars['Boolean'];
labelIdentifierFieldMetadataId?: Maybe<Scalars['String']>;
@ -1479,7 +1480,6 @@ export type Object = {
namePlural: Scalars['String'];
nameSingular: Scalars['String'];
shortcut?: Maybe<Scalars['String']>;
shouldSyncLabelAndName: Scalars['Boolean'];
updatedAt: Scalars['DateTime'];
};

View File

@ -124,7 +124,7 @@ describe('useCommandMenu', () => {
namePlural: 'tasks',
labelSingular: 'Task',
labelPlural: 'Tasks',
shouldSyncLabelAndName: true,
isLabelSyncedWithName: true,
shortcut: 'T',
description: 'A task',
icon: 'IconCheckbox',

View File

@ -25,7 +25,7 @@ export const FIND_MANY_OBJECT_METADATA_ITEMS = gql`
labelIdentifierFieldMetadataId
imageIdentifierFieldMetadataId
shortcut
shouldSyncLabelAndName
isLabelSyncedWithName
indexMetadatas(paging: { first: 100 }) {
edges {
node {

View File

@ -25,7 +25,7 @@ export const query = gql`
labelIdentifierFieldMetadataId
imageIdentifierFieldMetadataId
shortcut
shouldSyncLabelAndName
isLabelSyncedWithName
fields(paging: { first: 1000 }, filter: $fieldFilter) {
edges {
node {

View File

@ -30,7 +30,7 @@ describe('objectMetadataItemSchema', () => {
namePlural: 'notCamelCase',
nameSingular: 'notCamelCase',
updatedAt: 'invalid date',
shouldSyncLabelAndName: 'not a boolean',
isLabelSyncedWithName: 'not a boolean',
};
// When

View File

@ -27,5 +27,5 @@ export const objectMetadataItemSchema = z.object({
nameSingular: camelCaseStringSchema,
updatedAt: z.string().datetime(),
shortcut: z.string().nullable().optional(),
shouldSyncLabelAndName: z.boolean(),
isLabelSyncedWithName: z.boolean(),
}) satisfies z.ZodType<ObjectMetadataItem>;

View File

@ -25,7 +25,7 @@ const objectMetadataItem: ObjectMetadataItem = {
isRemote: false,
labelPlural: 'object1s',
labelSingular: 'object1',
shouldSyncLabelAndName: true,
isLabelSyncedWithName: true,
};
describe('turnSortsIntoOrderBy', () => {

View File

@ -26,7 +26,7 @@ describe('useLimitPerMetadataItem', () => {
namePlural: 'namePlural',
nameSingular: 'nameSingular',
updatedAt: 'updatedAt',
shouldSyncLabelAndName: false,
isLabelSyncedWithName: false,
fields: [],
indexMetadatas: [],
},

View File

@ -34,7 +34,7 @@ const objectData: ObjectMetadataItem[] = [
labelSingular: 'labelSingular',
namePlural: 'namePlural',
nameSingular: 'nameSingular',
shouldSyncLabelAndName: false,
isLabelSyncedWithName: false,
updatedAt: 'updatedAt',
fields: [
{

View File

@ -36,7 +36,7 @@ export const settingsDataModelObjectAboutFormSchema = objectMetadataItemSchema
.pick({
nameSingular: true,
namePlural: true,
shouldSyncLabelAndName: true,
isLabelSyncedWithName: true,
})
.partial(),
);
@ -115,10 +115,10 @@ export const SettingsDataModelObjectAboutForm = ({
isAdvancedModeEnabled,
);
const shouldSyncLabelAndName = watch('shouldSyncLabelAndName');
const isLabelSyncedWithName = watch('isLabelSyncedWithName');
const labelSingular = watch('labelSingular');
const labelPlural = watch('labelPlural');
const apiNameTooltipText = shouldSyncLabelAndName
const apiNameTooltipText = isLabelSyncedWithName
? 'Deactivate "Synchronize Objects Labels and API Names" to set a custom API name'
: 'Input must be in camel case and cannot start with a number';
@ -129,7 +129,7 @@ export const SettingsDataModelObjectAboutForm = ({
setValue('labelPlural', newLabelPluralValue, {
shouldDirty: isDefined(labelSingular) ? true : false,
});
if (shouldSyncLabelAndName === true) {
if (isLabelSyncedWithName === true) {
fillNamePluralFromLabelPlural(newLabelPluralValue);
}
};
@ -182,7 +182,7 @@ export const SettingsDataModelObjectAboutForm = ({
onChange={(value) => {
onChange(value);
fillLabelPlural(value);
if (shouldSyncLabelAndName === true) {
if (isLabelSyncedWithName === true) {
fillNameSingularFromLabelSingular(value);
}
}}
@ -204,7 +204,7 @@ export const SettingsDataModelObjectAboutForm = ({
value={value}
onChange={(value) => {
onChange(value);
if (shouldSyncLabelAndName === true) {
if (isLabelSyncedWithName === true) {
fillNamePluralFromLabelPlural(value);
}
}}
@ -251,7 +251,7 @@ export const SettingsDataModelObjectAboutForm = ({
placeholder: 'listing',
defaultValue: objectMetadataItem?.nameSingular,
disabled:
disabled || disableNameEdit || shouldSyncLabelAndName,
disabled || disableNameEdit || isLabelSyncedWithName,
tooltip: apiNameTooltipText,
},
{
@ -260,7 +260,7 @@ export const SettingsDataModelObjectAboutForm = ({
placeholder: 'listings',
defaultValue: objectMetadataItem?.namePlural,
disabled:
disabled || disableNameEdit || shouldSyncLabelAndName,
disabled || disableNameEdit || isLabelSyncedWithName,
tooltip: apiNameTooltipText,
},
].map(
@ -318,10 +318,10 @@ export const SettingsDataModelObjectAboutForm = ({
),
)}
<Controller
name="shouldSyncLabelAndName"
name="isLabelSyncedWithName"
control={control}
defaultValue={
objectMetadataItem?.shouldSyncLabelAndName ?? true
objectMetadataItem?.isLabelSyncedWithName ?? true
}
render={({ field: { onChange, value } }) => (
<SyncObjectLabelAndNameToggle

View File

@ -14,7 +14,7 @@ describe('settingsCreateObjectInputSchema', () => {
labelSingular: 'Label ',
namePlural: 'namePlural',
nameSingular: 'nameSingular',
shouldSyncLabelAndName: false,
isLabelSyncedWithName: false,
};
// When
@ -29,7 +29,7 @@ describe('settingsCreateObjectInputSchema', () => {
labelSingular: 'Label',
namePlural: 'namePlural',
nameSingular: 'nameSingular',
shouldSyncLabelAndName: false,
isLabelSyncedWithName: false,
});
});

View File

@ -12,6 +12,6 @@ export const settingsCreateObjectInputSchema =
namePlural:
values.namePlural ??
computeMetadataNameFromLabelOrThrow(values.labelPlural),
shouldSyncLabelAndName: values.shouldSyncLabelAndName ?? true,
isLabelSyncedWithName: values.isLabelSyncedWithName ?? true,
}),
);

View File

@ -82,8 +82,8 @@ export const SettingsObjectEdit = () => {
) => {
let values = formValues;
if (
formValues.shouldSyncLabelAndName === true ||
activeObjectMetadataItem.shouldSyncLabelAndName === true
formValues.isLabelSyncedWithName === true ||
activeObjectMetadataItem.isLabelSyncedWithName === true
) {
values = {
...values,

View File

@ -20,7 +20,7 @@ export const mockedStandardObjectMetadataQueryResult: ObjectMetadataItemsQuery =
"__typename": "objectEdge",
"node": {
"__typename": "object",
"shouldSyncLabelAndName": true,
"isLabelSyncedWithName": true,
"id": "fd99213f-1b50-4d72-8708-75ba80097736",
"dataSourceId": "d8a38ce6-6ac9-4c10-b55f-408386f86290",
"nameSingular": "noteTarget",
@ -646,7 +646,7 @@ export const mockedStandardObjectMetadataQueryResult: ObjectMetadataItemsQuery =
"__typename": "objectEdge",
"node": {
"__typename": "object",
"shouldSyncLabelAndName": true,
"isLabelSyncedWithName": true,
"id": "f98ea433-1b70-46d3-aefa-43eb369925d2",
"dataSourceId": "d8a38ce6-6ac9-4c10-b55f-408386f86290",
"nameSingular": "messageThread",
@ -832,7 +832,7 @@ export const mockedStandardObjectMetadataQueryResult: ObjectMetadataItemsQuery =
"__typename": "objectEdge",
"node": {
"__typename": "object",
"shouldSyncLabelAndName": true,
"isLabelSyncedWithName": true,
"id": "f2414140-86ea-4fa3-bc63-ca5dab9f9044",
"dataSourceId": "d8a38ce6-6ac9-4c10-b55f-408386f86290",
"nameSingular": "workspaceMember",
@ -1867,7 +1867,7 @@ export const mockedStandardObjectMetadataQueryResult: ObjectMetadataItemsQuery =
"__typename": "objectEdge",
"node": {
"__typename": "object",
"shouldSyncLabelAndName": true,
"isLabelSyncedWithName": true,
"id": "f04a7171-564a-44ec-a061-63938e29f0c5",
"dataSourceId": "d8a38ce6-6ac9-4c10-b55f-408386f86290",
"nameSingular": "apiKey",
@ -2073,7 +2073,7 @@ export const mockedStandardObjectMetadataQueryResult: ObjectMetadataItemsQuery =
"__typename": "objectEdge",
"node": {
"__typename": "object",
"shouldSyncLabelAndName": true,
"isLabelSyncedWithName": true,
"id": "edfd2da3-26e4-4e84-b490-c0790848dc23",
"dataSourceId": "d8a38ce6-6ac9-4c10-b55f-408386f86290",
"nameSingular": "taskTarget",
@ -2711,7 +2711,7 @@ export const mockedStandardObjectMetadataQueryResult: ObjectMetadataItemsQuery =
"__typename": "objectEdge",
"node": {
"__typename": "object",
"shouldSyncLabelAndName": true,
"isLabelSyncedWithName": true,
"id": "eda936a5-97b9-4b9f-986a-d8e19e8ea882",
"dataSourceId": "d8a38ce6-6ac9-4c10-b55f-408386f86290",
"nameSingular": "comment",
@ -3085,7 +3085,7 @@ export const mockedStandardObjectMetadataQueryResult: ObjectMetadataItemsQuery =
"__typename": "objectEdge",
"node": {
"__typename": "object",
"shouldSyncLabelAndName": true,
"isLabelSyncedWithName": true,
"id": "e5915d30-4425-4c4c-a9c4-1b4bff20c469",
"dataSourceId": "d8a38ce6-6ac9-4c10-b55f-408386f86290",
"nameSingular": "workflowVersion",
@ -3528,7 +3528,7 @@ export const mockedStandardObjectMetadataQueryResult: ObjectMetadataItemsQuery =
"__typename": "objectEdge",
"node": {
"__typename": "object",
"shouldSyncLabelAndName": true,
"isLabelSyncedWithName": true,
"id": "d828bda6-68e2-47f0-b0aa-b810b1f33981",
"dataSourceId": "d8a38ce6-6ac9-4c10-b55f-408386f86290",
"nameSingular": "connectedAccount",
@ -4060,7 +4060,7 @@ export const mockedStandardObjectMetadataQueryResult: ObjectMetadataItemsQuery =
"__typename": "objectEdge",
"node": {
"__typename": "object",
"shouldSyncLabelAndName": true,
"isLabelSyncedWithName": true,
"id": "d00ff1e9-774a-4b08-87fb-03d37c24f174",
"dataSourceId": "d8a38ce6-6ac9-4c10-b55f-408386f86290",
"nameSingular": "attachment",
@ -5091,7 +5091,7 @@ export const mockedStandardObjectMetadataQueryResult: ObjectMetadataItemsQuery =
"__typename": "objectEdge",
"node": {
"__typename": "object",
"shouldSyncLabelAndName": true,
"isLabelSyncedWithName": true,
"id": "cb8c8d67-16c0-4a38-a919-b375845abf42",
"dataSourceId": "d8a38ce6-6ac9-4c10-b55f-408386f86290",
"nameSingular": "favorite",
@ -6167,7 +6167,7 @@ export const mockedStandardObjectMetadataQueryResult: ObjectMetadataItemsQuery =
"__typename": "objectEdge",
"node": {
"__typename": "object",
"shouldSyncLabelAndName": true,
"isLabelSyncedWithName": true,
"id": "c55193eb-042d-42d5-a6a7-8263fd1433a2",
"dataSourceId": "d8a38ce6-6ac9-4c10-b55f-408386f86290",
"nameSingular": "viewSort",
@ -6503,7 +6503,7 @@ export const mockedStandardObjectMetadataQueryResult: ObjectMetadataItemsQuery =
"__typename": "objectEdge",
"node": {
"__typename": "object",
"shouldSyncLabelAndName": true,
"isLabelSyncedWithName": true,
"id": "c46916fc-0528-4331-9766-6ac2247a70fb",
"dataSourceId": "d8a38ce6-6ac9-4c10-b55f-408386f86290",
"nameSingular": "view",
@ -7028,7 +7028,7 @@ export const mockedStandardObjectMetadataQueryResult: ObjectMetadataItemsQuery =
"__typename": "objectEdge",
"node": {
"__typename": "object",
"shouldSyncLabelAndName": true,
"isLabelSyncedWithName": true,
"id": "be13cda6-aff5-4003-8fe9-e936011b3325",
"dataSourceId": "d8a38ce6-6ac9-4c10-b55f-408386f86290",
"nameSingular": "opportunity",
@ -7921,7 +7921,7 @@ export const mockedStandardObjectMetadataQueryResult: ObjectMetadataItemsQuery =
"__typename": "objectEdge",
"node": {
"__typename": "object",
"shouldSyncLabelAndName": true,
"isLabelSyncedWithName": true,
"id": "b74e80b0-7132-469f-bbd9-6e6fc12f04f8",
"dataSourceId": "d8a38ce6-6ac9-4c10-b55f-408386f86290",
"nameSingular": "person",
@ -9072,7 +9072,7 @@ export const mockedStandardObjectMetadataQueryResult: ObjectMetadataItemsQuery =
"__typename": "objectEdge",
"node": {
"__typename": "object",
"shouldSyncLabelAndName": true,
"isLabelSyncedWithName": true,
"id": "b6e22795-68e7-4d18-a242-545afea5a8a9",
"dataSourceId": "d8a38ce6-6ac9-4c10-b55f-408386f86290",
"nameSingular": "timelineActivity",
@ -10083,7 +10083,7 @@ export const mockedStandardObjectMetadataQueryResult: ObjectMetadataItemsQuery =
"__typename": "objectEdge",
"node": {
"__typename": "object",
"shouldSyncLabelAndName": true,
"isLabelSyncedWithName": true,
"id": "af56ee43-5666-482f-a980-434fefac00c7",
"dataSourceId": "d8a38ce6-6ac9-4c10-b55f-408386f86290",
"nameSingular": "calendarEventParticipant",
@ -10656,7 +10656,7 @@ export const mockedStandardObjectMetadataQueryResult: ObjectMetadataItemsQuery =
"__typename": "objectEdge",
"node": {
"__typename": "object",
"shouldSyncLabelAndName": true,
"isLabelSyncedWithName": true,
"id": "981fd8a9-37a2-4742-98c1-08509d995bd3",
"dataSourceId": "d8a38ce6-6ac9-4c10-b55f-408386f86290",
"nameSingular": "calendarEvent",
@ -11171,7 +11171,7 @@ export const mockedStandardObjectMetadataQueryResult: ObjectMetadataItemsQuery =
"__typename": "objectEdge",
"node": {
"__typename": "object",
"shouldSyncLabelAndName": true,
"isLabelSyncedWithName": true,
"id": "92b529f1-b82b-4352-a0d5-18f32f8e47ab",
"dataSourceId": "d8a38ce6-6ac9-4c10-b55f-408386f86290",
"nameSingular": "messageChannel",
@ -11919,7 +11919,7 @@ export const mockedStandardObjectMetadataQueryResult: ObjectMetadataItemsQuery =
"__typename": "objectEdge",
"node": {
"__typename": "object",
"shouldSyncLabelAndName": true,
"isLabelSyncedWithName": true,
"id": "8cceadc4-de6b-4ecf-8324-82c6b4eec077",
"dataSourceId": "d8a38ce6-6ac9-4c10-b55f-408386f86290",
"nameSingular": "calendarChannel",
@ -12594,7 +12594,7 @@ export const mockedStandardObjectMetadataQueryResult: ObjectMetadataItemsQuery =
"__typename": "objectEdge",
"node": {
"__typename": "object",
"shouldSyncLabelAndName": true,
"isLabelSyncedWithName": true,
"id": "8ae98b12-2ef6-4c20-adc6-240857dd7343",
"dataSourceId": "d8a38ce6-6ac9-4c10-b55f-408386f86290",
"nameSingular": "blocklist",
@ -12856,7 +12856,7 @@ export const mockedStandardObjectMetadataQueryResult: ObjectMetadataItemsQuery =
"__typename": "objectEdge",
"node": {
"__typename": "object",
"shouldSyncLabelAndName": true,
"isLabelSyncedWithName": true,
"id": "88f29168-a15b-4330-89a1-680581a2e86b",
"dataSourceId": "d8a38ce6-6ac9-4c10-b55f-408386f86290",
"nameSingular": "viewFilter",
@ -13187,7 +13187,7 @@ export const mockedStandardObjectMetadataQueryResult: ObjectMetadataItemsQuery =
"__typename": "objectEdge",
"node": {
"__typename": "object",
"shouldSyncLabelAndName": true,
"isLabelSyncedWithName": true,
"id": "823e8b9d-1947-48f9-9f43-116a2cbceba3",
"dataSourceId": "d8a38ce6-6ac9-4c10-b55f-408386f86290",
"nameSingular": "webhook",
@ -13393,7 +13393,7 @@ export const mockedStandardObjectMetadataQueryResult: ObjectMetadataItemsQuery =
"__typename": "objectEdge",
"node": {
"__typename": "object",
"shouldSyncLabelAndName": true,
"isLabelSyncedWithName": true,
"id": "7cab9c82-929f-4ea3-98e1-5c221a12263d",
"dataSourceId": "d8a38ce6-6ac9-4c10-b55f-408386f86290",
"nameSingular": "workflow",
@ -13837,7 +13837,7 @@ export const mockedStandardObjectMetadataQueryResult: ObjectMetadataItemsQuery =
"__typename": "objectEdge",
"node": {
"__typename": "object",
"shouldSyncLabelAndName": true,
"isLabelSyncedWithName": true,
"id": "6edf5dd8-ee31-42ec-80f9-728b01c50ff4",
"dataSourceId": "d8a38ce6-6ac9-4c10-b55f-408386f86290",
"nameSingular": "messageParticipant",
@ -14364,7 +14364,7 @@ export const mockedStandardObjectMetadataQueryResult: ObjectMetadataItemsQuery =
"__typename": "objectEdge",
"node": {
"__typename": "object",
"shouldSyncLabelAndName": true,
"isLabelSyncedWithName": true,
"id": "6a09bc08-33ae-4321-868a-30064279097f",
"dataSourceId": "d8a38ce6-6ac9-4c10-b55f-408386f86290",
"nameSingular": "note",
@ -14792,7 +14792,7 @@ export const mockedStandardObjectMetadataQueryResult: ObjectMetadataItemsQuery =
"__typename": "objectEdge",
"node": {
"__typename": "object",
"shouldSyncLabelAndName": true,
"isLabelSyncedWithName": true,
"id": "681f89d7-0581-42b0-b97d-870e3b2a8359",
"dataSourceId": "d8a38ce6-6ac9-4c10-b55f-408386f86290",
"nameSingular": "task",
@ -15401,7 +15401,7 @@ export const mockedStandardObjectMetadataQueryResult: ObjectMetadataItemsQuery =
"__typename": "objectEdge",
"node": {
"__typename": "object",
"shouldSyncLabelAndName": true,
"isLabelSyncedWithName": true,
"id": "673b8cb8-44c1-4c20-9834-7c35d44fd180",
"dataSourceId": "d8a38ce6-6ac9-4c10-b55f-408386f86290",
"nameSingular": "message",
@ -15830,7 +15830,7 @@ export const mockedStandardObjectMetadataQueryResult: ObjectMetadataItemsQuery =
"__typename": "objectEdge",
"node": {
"__typename": "object",
"shouldSyncLabelAndName": true,
"isLabelSyncedWithName": true,
"id": "65cce76e-0f4c-4de1-a68a-6cadce4d000e",
"dataSourceId": "d8a38ce6-6ac9-4c10-b55f-408386f86290",
"nameSingular": "workflowEventListener",
@ -16092,7 +16092,7 @@ export const mockedStandardObjectMetadataQueryResult: ObjectMetadataItemsQuery =
"__typename": "objectEdge",
"node": {
"__typename": "object",
"shouldSyncLabelAndName": true,
"isLabelSyncedWithName": true,
"id": "631882fd-28e8-4a87-8ceb-f8217006a620",
"dataSourceId": "d8a38ce6-6ac9-4c10-b55f-408386f86290",
"nameSingular": "messageChannelMessageAssociation",
@ -16538,7 +16538,7 @@ export const mockedStandardObjectMetadataQueryResult: ObjectMetadataItemsQuery =
"__typename": "objectEdge",
"node": {
"__typename": "object",
"shouldSyncLabelAndName": true,
"isLabelSyncedWithName": true,
"id": "5a1aa92b-1ee9-4a7e-ab08-ca8c1e462d16",
"dataSourceId": "d8a38ce6-6ac9-4c10-b55f-408386f86290",
"nameSingular": "activity",
@ -17174,7 +17174,7 @@ export const mockedStandardObjectMetadataQueryResult: ObjectMetadataItemsQuery =
"__typename": "objectEdge",
"node": {
"__typename": "object",
"shouldSyncLabelAndName": true,
"isLabelSyncedWithName": true,
"id": "50f61b05-868d-425b-ab3f-c085e1652d82",
"dataSourceId": "d8a38ce6-6ac9-4c10-b55f-408386f86290",
"nameSingular": "viewField",
@ -17533,7 +17533,7 @@ export const mockedStandardObjectMetadataQueryResult: ObjectMetadataItemsQuery =
"__typename": "objectEdge",
"node": {
"__typename": "object",
"shouldSyncLabelAndName": true,
"isLabelSyncedWithName": true,
"id": "45b7e1cf-792c-45fa-8d6a-0d5e67e1fa42",
"dataSourceId": "d8a38ce6-6ac9-4c10-b55f-408386f86290",
"nameSingular": "workflowRun",
@ -18066,7 +18066,7 @@ export const mockedStandardObjectMetadataQueryResult: ObjectMetadataItemsQuery =
"__typename": "objectEdge",
"node": {
"__typename": "object",
"shouldSyncLabelAndName": true,
"isLabelSyncedWithName": true,
"id": "43fe0e45-b323-4b6e-ab98-1d9fe30c9af9",
"dataSourceId": "d8a38ce6-6ac9-4c10-b55f-408386f86290",
"nameSingular": "activityTarget",
@ -18704,7 +18704,7 @@ export const mockedStandardObjectMetadataQueryResult: ObjectMetadataItemsQuery =
"__typename": "objectEdge",
"node": {
"__typename": "object",
"shouldSyncLabelAndName": true,
"isLabelSyncedWithName": true,
"id": "39d5f2b7-03ce-41e7-afe9-7710aeb766a2",
"dataSourceId": "d8a38ce6-6ac9-4c10-b55f-408386f86290",
"nameSingular": "company",
@ -19791,7 +19791,7 @@ export const mockedStandardObjectMetadataQueryResult: ObjectMetadataItemsQuery =
"__typename": "objectEdge",
"node": {
"__typename": "object",
"shouldSyncLabelAndName": true,
"isLabelSyncedWithName": true,
"id": "2590029a-05d7-4908-8b7a-a253967068a1",
"dataSourceId": "d8a38ce6-6ac9-4c10-b55f-408386f86290",
"nameSingular": "auditLog",
@ -20168,7 +20168,7 @@ export const mockedStandardObjectMetadataQueryResult: ObjectMetadataItemsQuery =
"__typename": "objectEdge",
"node": {
"__typename": "object",
"shouldSyncLabelAndName": true,
"isLabelSyncedWithName": true,
"id": "1e5ee6b2-67e5-4549-bebc-8d35bc6bc649",
"dataSourceId": "d8a38ce6-6ac9-4c10-b55f-408386f86290",
"nameSingular": "rocket",
@ -20718,7 +20718,7 @@ export const mockedStandardObjectMetadataQueryResult: ObjectMetadataItemsQuery =
"__typename": "objectEdge",
"node": {
"__typename": "object",
"shouldSyncLabelAndName": true,
"isLabelSyncedWithName": true,
"id": "149f1a0d-f528-48a3-a3f8-0203926d07f5",
"dataSourceId": "d8a38ce6-6ac9-4c10-b55f-408386f86290",
"nameSingular": "calendarChannelEventAssociation",

View File

@ -1,19 +1,19 @@
import { MigrationInterface, QueryRunner } from 'typeorm';
export class AddShouldSyncLabelAndName1728579416430
export class AddIsLabelSyncedWithName1728579416430
implements MigrationInterface
{
name = 'AddShouldSyncLabelAndName1728579416430';
name = 'AddIsLabelSyncedWithName1728579416430';
public async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(
`ALTER TABLE "metadata"."objectMetadata" ADD "shouldSyncLabelAndName" boolean NOT NULL DEFAULT false`,
`ALTER TABLE "metadata"."objectMetadata" ADD "isLabelSyncedWithName" boolean NOT NULL DEFAULT false`,
);
}
public async down(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(
`ALTER TABLE "metadata"."objectMetadata" DROP COLUMN "shouldSyncLabelAndName"`,
`ALTER TABLE "metadata"."objectMetadata" DROP COLUMN "isLabelSyncedWithName"`,
);
}
}

View File

@ -90,5 +90,5 @@ export class CreateObjectInput {
@IsBoolean()
@IsOptional()
@Field({ nullable: true })
shouldSyncLabelAndName?: boolean;
isLabelSyncedWithName?: boolean;
}

View File

@ -84,5 +84,5 @@ export class ObjectMetadataDTO {
imageIdentifierFieldMetadataId?: string | null;
@Field()
shouldSyncLabelAndName: boolean;
isLabelSyncedWithName: boolean;
}

View File

@ -70,7 +70,7 @@ export class UpdateObjectPayload {
@IsBoolean()
@IsOptional()
@Field({ nullable: true })
shouldSyncLabelAndName?: boolean;
isLabelSyncedWithName?: boolean;
}
@InputType()

View File

@ -79,7 +79,7 @@ export class ObjectMetadataEntity implements ObjectMetadataInterface {
imageIdentifierFieldMetadataId?: string | null;
@Column({ default: true })
shouldSyncLabelAndName: boolean;
isLabelSyncedWithName: boolean;
@Column({ nullable: false, type: 'uuid' })
workspaceId: string;

View File

@ -204,7 +204,7 @@ export class ObjectMetadataService extends TypeOrmQueryService<ObjectMetadataEnt
);
}
if (objectMetadataInput.shouldSyncLabelAndName === true) {
if (objectMetadataInput.isLabelSyncedWithName === true) {
validateNameAndLabelAreSyncOrThrow(
objectMetadataInput.labelSingular,
objectMetadataInput.nameSingular,
@ -436,7 +436,7 @@ export class ObjectMetadataService extends TypeOrmQueryService<ObjectMetadataEnt
existingObjectMetadataId: fullObjectMetadataAfterUpdate.id,
});
if (fullObjectMetadataAfterUpdate.shouldSyncLabelAndName) {
if (fullObjectMetadataAfterUpdate.isLabelSyncedWithName) {
validateNameAndLabelAreSyncOrThrow(
fullObjectMetadataAfterUpdate.labelSingular,
fullObjectMetadataAfterUpdate.nameSingular,