-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add field isLabelSyncedWithName (#8829)
## Context The recent addition of object renaming introduced issues with enum names. Enum names should follow the pattern `${schemaName}.${tableName}_${columnName}_enum`. To address this, and to allow users to customize the API name (which is included in the enum name, columnName), this PR implements behavior similar to object renaming by introducing a `isLabelSyncedWithName` boolean. <img width="624" alt="Screenshot 2024-12-02 at 11 58 49" src="https://github.com/user-attachments/assets/690fb71c-83f0-4922-80c0-946c92dacc30"> <img width="596" alt="Screenshot 2024-12-02 at 11 58 39" src="https://github.com/user-attachments/assets/af9a0037-7cf5-40c3-9ed5-d51b340c8087">
- Loading branch information
Showing
27 changed files
with
1,118 additions
and
125 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,27 +6,22 @@ export const FIELD_RELATION_METADATA_ID = | |
'4da0302d-358a-45cd-9973-9f92723ed3c1'; | ||
export const RELATION_METADATA_ID = 'f81d4fae-7dec-11d0-a765-00a0c91e6bf6'; | ||
|
||
const baseFields = ` | ||
id | ||
type | ||
name | ||
label | ||
description | ||
icon | ||
isCustom | ||
isActive | ||
isNullable | ||
createdAt | ||
updatedAt | ||
settings | ||
`; | ||
|
||
|
||
export const queries = { | ||
deleteMetadataField: gql` | ||
mutation DeleteOneFieldMetadataItem($idToDelete: UUID!) { | ||
deleteOneField(input: { id: $idToDelete }) { | ||
${baseFields} | ||
id | ||
type | ||
name | ||
label | ||
description | ||
icon | ||
isCustom | ||
isActive | ||
isNullable | ||
createdAt | ||
updatedAt | ||
settings | ||
} | ||
} | ||
`, | ||
|
@@ -74,7 +69,19 @@ export const queries = { | |
$updatePayload: UpdateFieldInput! | ||
) { | ||
updateOneField(input: { id: $idToUpdate, update: $updatePayload }) { | ||
${baseFields} | ||
id | ||
type | ||
name | ||
label | ||
description | ||
icon | ||
isCustom | ||
isActive | ||
isNullable | ||
createdAt | ||
updatedAt | ||
settings | ||
isLabelSyncedWithName | ||
} | ||
} | ||
`, | ||
|
@@ -98,6 +105,84 @@ export const queries = { | |
} | ||
} | ||
`, | ||
getCurrentUser: gql` | ||
query GetCurrentUser { | ||
currentUser { | ||
...UserQueryFragment | ||
} | ||
} | ||
fragment UserQueryFragment on User { | ||
id | ||
firstName | ||
lastName | ||
canImpersonate | ||
supportUserHash | ||
analyticsTinybirdJwts { | ||
getWebhookAnalytics | ||
getPageviewsAnalytics | ||
getUsersAnalytics | ||
getServerlessFunctionDuration | ||
getServerlessFunctionSuccessRate | ||
getServerlessFunctionErrorCount | ||
} | ||
onboardingStatus | ||
workspaceMember { | ||
...WorkspaceMemberQueryFragment | ||
} | ||
workspaceMembers { | ||
...WorkspaceMemberQueryFragment | ||
} | ||
defaultWorkspace { | ||
id | ||
displayName | ||
logo | ||
domainName | ||
inviteHash | ||
allowImpersonation | ||
activationStatus | ||
isPublicInviteLinkEnabled | ||
hasValidEntrepriseKey | ||
featureFlags { | ||
id | ||
key | ||
value | ||
workspaceId | ||
} | ||
metadataVersion | ||
currentBillingSubscription { | ||
id | ||
status | ||
interval | ||
} | ||
workspaceMembersCount | ||
} | ||
workspaces { | ||
workspace { | ||
id | ||
logo | ||
displayName | ||
domainName | ||
} | ||
} | ||
userVars | ||
} | ||
fragment WorkspaceMemberQueryFragment on WorkspaceMember { | ||
id | ||
name { | ||
firstName | ||
lastName | ||
} | ||
colorScheme | ||
avatarUrl | ||
locale | ||
timeZone | ||
dateFormat | ||
timeFormat | ||
} | ||
`, | ||
}; | ||
|
||
export const objectMetadataId = '25611fce-6637-4089-b0ca-91afeec95784'; | ||
|
@@ -107,7 +192,7 @@ export const variables = { | |
deleteMetadataFieldRelation: { idToDelete: RELATION_METADATA_ID }, | ||
activateMetadataField: { | ||
idToUpdate: FIELD_METADATA_ID, | ||
updatePayload: { isActive: true, label: undefined }, | ||
updatePayload: { isActive: true }, | ||
}, | ||
createMetadataField: { | ||
input: { | ||
|
@@ -116,9 +201,10 @@ export const variables = { | |
description: null, | ||
icon: undefined, | ||
label: 'fieldLabel', | ||
name: 'fieldlabel', | ||
name: 'fieldName', | ||
options: undefined, | ||
settings: undefined, | ||
isLabelSyncedWithName: true, | ||
objectMetadataId, | ||
type: 'TEXT', | ||
}, | ||
|
@@ -159,4 +245,54 @@ export const responseData = { | |
defaultValue: '', | ||
options: [], | ||
}, | ||
getCurrentUser: { | ||
currentUser: { | ||
id: 'test-user-id', | ||
firstName: 'Test', | ||
lastName: 'User', | ||
email: '[email protected]', | ||
canImpersonate: false, | ||
supportUserHash: null, | ||
analyticsTinybirdJwts: { | ||
getWebhookAnalytics: null, | ||
getPageviewsAnalytics: null, | ||
getUsersAnalytics: null, | ||
getServerlessFunctionDuration: null, | ||
getServerlessFunctionSuccessRate: null, | ||
getServerlessFunctionErrorCount: null, | ||
}, | ||
onboardingStatus: 'completed', | ||
workspaceMember: { | ||
id: 'test-workspace-member-id', | ||
name: { | ||
firstName: 'Test', | ||
lastName: 'User', | ||
}, | ||
colorScheme: 'light', | ||
avatarUrl: null, | ||
locale: 'en', | ||
timeZone: 'UTC', | ||
dateFormat: 'MM/DD/YYYY', | ||
timeFormat: '24', | ||
}, | ||
workspaceMembers: [], | ||
defaultWorkspace: { | ||
id: 'test-workspace-id', | ||
displayName: 'Test Workspace', | ||
logo: null, | ||
domainName: 'test', | ||
inviteHash: 'test-hash', | ||
allowImpersonation: false, | ||
activationStatus: 'active', | ||
isPublicInviteLinkEnabled: false, | ||
hasValidEntrepriseKey: false, | ||
featureFlags: [], | ||
metadataVersion: 1, | ||
currentBillingSubscription: null, | ||
workspaceMembersCount: 1, | ||
}, | ||
workspaces: [], | ||
userVars: null, | ||
}, | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.