Compare commits
20
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
941f8ede2d | ||
|
|
3041ed3b6e | ||
|
|
6d550611d2 | ||
|
|
3c97d9648b | ||
|
|
3afdabb93e | ||
|
|
25b0e0d091 | ||
|
|
a43e5c3fb3 | ||
|
|
996cdaf3ff | ||
|
|
1d84695fb0 | ||
|
|
64e0b76d00 | ||
|
|
8a74ea8829 | ||
|
|
f4ead89956 | ||
|
|
865ca697ca | ||
|
|
0cc463c7de | ||
|
|
e863318f1c | ||
|
|
9842038f0f | ||
|
|
bf02a9b5d4 | ||
|
|
b83214cb94 | ||
|
|
ddf657669f | ||
|
|
ebb5758810 |
Binary file not shown.
|
After Width: | Height: | Size: 173 KiB |
+1
-1
@@ -28,7 +28,7 @@
|
||||
"resolutions": {
|
||||
"graphql": "16.8.1",
|
||||
"type-fest": "4.10.1",
|
||||
"typescript": "5.9.2",
|
||||
"typescript": "5.9.3",
|
||||
"nodemailer": "8.0.4",
|
||||
"graphql-redis-subscriptions/ioredis": "^5.6.0",
|
||||
"@lingui/core": "5.1.2",
|
||||
|
||||
@@ -50,7 +50,7 @@
|
||||
"jest": "29.7.0",
|
||||
"jest-environment-node": "^29.4.1",
|
||||
"twenty-shared": "workspace:*",
|
||||
"typescript": "^5.9.2",
|
||||
"typescript": "^5.9.3",
|
||||
"vite": "^7.0.0",
|
||||
"vite-plugin-dts": "^4.5.4",
|
||||
"vite-tsconfig-paths": "^4.2.1"
|
||||
|
||||
+67
@@ -0,0 +1,67 @@
|
||||
import { defineLogicFunction } from 'twenty-sdk/define';
|
||||
import {
|
||||
FieldPermissionLevel,
|
||||
getPermissionContext,
|
||||
ObjectPermissionLevel,
|
||||
type RoutePayload,
|
||||
} from 'twenty-sdk/logic-function';
|
||||
|
||||
type PermissionContextDemoBody = {
|
||||
objectUniversalIdentifier?: string;
|
||||
fieldUniversalIdentifier?: string;
|
||||
permissionFlagUniversalIdentifier?: string;
|
||||
};
|
||||
|
||||
export const main = async (
|
||||
params: RoutePayload<PermissionContextDemoBody>,
|
||||
): Promise<object> => {
|
||||
const {
|
||||
objectUniversalIdentifier,
|
||||
fieldUniversalIdentifier,
|
||||
permissionFlagUniversalIdentifier,
|
||||
} = params.body || {};
|
||||
|
||||
const permissions = getPermissionContext();
|
||||
|
||||
return {
|
||||
canReadAllObjectRecords: permissions.canReadAllObjectRecords,
|
||||
canUpdateAllObjectRecords: permissions.canUpdateAllObjectRecords,
|
||||
canAccessAllTools: permissions.canAccessAllTools,
|
||||
canUpdateAllSettings: permissions.canUpdateAllSettings,
|
||||
canReadObject: objectUniversalIdentifier
|
||||
? permissions.hasObjectPermission(
|
||||
objectUniversalIdentifier,
|
||||
ObjectPermissionLevel.READ,
|
||||
)
|
||||
: null,
|
||||
canUpdateObject: objectUniversalIdentifier
|
||||
? permissions.hasObjectPermission(
|
||||
objectUniversalIdentifier,
|
||||
ObjectPermissionLevel.UPDATE,
|
||||
)
|
||||
: null,
|
||||
canReadField:
|
||||
objectUniversalIdentifier && fieldUniversalIdentifier
|
||||
? permissions.hasFieldPermission(
|
||||
objectUniversalIdentifier,
|
||||
fieldUniversalIdentifier,
|
||||
FieldPermissionLevel.READ,
|
||||
)
|
||||
: null,
|
||||
hasPermissionFlag: permissionFlagUniversalIdentifier
|
||||
? permissions.hasPermissionFlag(permissionFlagUniversalIdentifier)
|
||||
: null,
|
||||
};
|
||||
};
|
||||
|
||||
export default defineLogicFunction({
|
||||
universalIdentifier: '0ef6d1e4-1a89-4b30-9c43-703fec036c89',
|
||||
name: 'permission-context-demo',
|
||||
timeoutSeconds: 10,
|
||||
handler: main,
|
||||
httpRouteTriggerSettings: {
|
||||
path: '/webhook/permission-context-demo',
|
||||
httpMethod: 'POST',
|
||||
isAuthRequired: true,
|
||||
},
|
||||
});
|
||||
@@ -49,7 +49,7 @@
|
||||
"@typescript/native-preview": "^7.0.0-dev.20260116.1",
|
||||
"tsc-alias": "^1.8.16",
|
||||
"twenty-shared": "workspace:*",
|
||||
"typescript": "^5.9.2",
|
||||
"typescript": "^5.9.3",
|
||||
"vite": "^7.0.0",
|
||||
"vite-plugin-dts": "^4.5.4",
|
||||
"vite-tsconfig-paths": "^4.2.1",
|
||||
|
||||
@@ -3537,6 +3537,11 @@ msgstr "Kode-redigeerder"
|
||||
msgid "Code Execution"
|
||||
msgstr "Uitvoering van kode"
|
||||
|
||||
#. js-lingui-id: T9qjpu
|
||||
#: src/modules/settings/roles/role-permissions/permission-flags/hooks/useActionRolePermissionFlagConfig.ts
|
||||
msgid "Code Interpreter"
|
||||
msgstr ""
|
||||
|
||||
#. js-lingui-id: bKJYIa
|
||||
#: src/modules/settings/logic-functions/components/tabs/SettingsLogicFunctionCodeEditorTab.tsx
|
||||
msgid "Code your function"
|
||||
@@ -13393,6 +13398,11 @@ msgstr ""
|
||||
msgid "Run a workflow and return here to view its executions"
|
||||
msgstr "Voer 'n werkstroom uit en keer hier terug om die uitvoerings te sien"
|
||||
|
||||
#. js-lingui-id: rRyKdg
|
||||
#: src/modules/settings/roles/role-permissions/permission-flags/hooks/useActionRolePermissionFlagConfig.ts
|
||||
msgid "Run code to analyze files and data"
|
||||
msgstr ""
|
||||
|
||||
#. js-lingui-id: UPaWvi
|
||||
#: src/modules/settings/logic-functions/components/tabs/SettingsLogicFunctionTestTab.tsx
|
||||
msgid "Run Function"
|
||||
|
||||
@@ -3537,6 +3537,11 @@ msgstr "محرر الشفرات"
|
||||
msgid "Code Execution"
|
||||
msgstr "تنفيذ التعليمات البرمجية"
|
||||
|
||||
#. js-lingui-id: T9qjpu
|
||||
#: src/modules/settings/roles/role-permissions/permission-flags/hooks/useActionRolePermissionFlagConfig.ts
|
||||
msgid "Code Interpreter"
|
||||
msgstr ""
|
||||
|
||||
#. js-lingui-id: bKJYIa
|
||||
#: src/modules/settings/logic-functions/components/tabs/SettingsLogicFunctionCodeEditorTab.tsx
|
||||
msgid "Code your function"
|
||||
@@ -13393,6 +13398,11 @@ msgstr ""
|
||||
msgid "Run a workflow and return here to view its executions"
|
||||
msgstr "\\\\"
|
||||
|
||||
#. js-lingui-id: rRyKdg
|
||||
#: src/modules/settings/roles/role-permissions/permission-flags/hooks/useActionRolePermissionFlagConfig.ts
|
||||
msgid "Run code to analyze files and data"
|
||||
msgstr ""
|
||||
|
||||
#. js-lingui-id: UPaWvi
|
||||
#: src/modules/settings/logic-functions/components/tabs/SettingsLogicFunctionTestTab.tsx
|
||||
msgid "Run Function"
|
||||
|
||||
@@ -3537,6 +3537,11 @@ msgstr "Editor de codi"
|
||||
msgid "Code Execution"
|
||||
msgstr "Execució de codi"
|
||||
|
||||
#. js-lingui-id: T9qjpu
|
||||
#: src/modules/settings/roles/role-permissions/permission-flags/hooks/useActionRolePermissionFlagConfig.ts
|
||||
msgid "Code Interpreter"
|
||||
msgstr ""
|
||||
|
||||
#. js-lingui-id: bKJYIa
|
||||
#: src/modules/settings/logic-functions/components/tabs/SettingsLogicFunctionCodeEditorTab.tsx
|
||||
msgid "Code your function"
|
||||
@@ -13393,6 +13398,11 @@ msgstr ""
|
||||
msgid "Run a workflow and return here to view its executions"
|
||||
msgstr "Executa un workflow i torna aquí per veure les seves execucions"
|
||||
|
||||
#. js-lingui-id: rRyKdg
|
||||
#: src/modules/settings/roles/role-permissions/permission-flags/hooks/useActionRolePermissionFlagConfig.ts
|
||||
msgid "Run code to analyze files and data"
|
||||
msgstr ""
|
||||
|
||||
#. js-lingui-id: UPaWvi
|
||||
#: src/modules/settings/logic-functions/components/tabs/SettingsLogicFunctionTestTab.tsx
|
||||
msgid "Run Function"
|
||||
|
||||
@@ -3537,6 +3537,11 @@ msgstr "Editor kódu"
|
||||
msgid "Code Execution"
|
||||
msgstr "Spuštění kódu"
|
||||
|
||||
#. js-lingui-id: T9qjpu
|
||||
#: src/modules/settings/roles/role-permissions/permission-flags/hooks/useActionRolePermissionFlagConfig.ts
|
||||
msgid "Code Interpreter"
|
||||
msgstr ""
|
||||
|
||||
#. js-lingui-id: bKJYIa
|
||||
#: src/modules/settings/logic-functions/components/tabs/SettingsLogicFunctionCodeEditorTab.tsx
|
||||
msgid "Code your function"
|
||||
@@ -13393,6 +13398,11 @@ msgstr ""
|
||||
msgid "Run a workflow and return here to view its executions"
|
||||
msgstr "Spusťte pracovní postup a vraťte se sem pro zobrazení jeho provedení"
|
||||
|
||||
#. js-lingui-id: rRyKdg
|
||||
#: src/modules/settings/roles/role-permissions/permission-flags/hooks/useActionRolePermissionFlagConfig.ts
|
||||
msgid "Run code to analyze files and data"
|
||||
msgstr ""
|
||||
|
||||
#. js-lingui-id: UPaWvi
|
||||
#: src/modules/settings/logic-functions/components/tabs/SettingsLogicFunctionTestTab.tsx
|
||||
msgid "Run Function"
|
||||
|
||||
@@ -3537,6 +3537,11 @@ msgstr "Kodeeditor"
|
||||
msgid "Code Execution"
|
||||
msgstr "Kørsel af kode"
|
||||
|
||||
#. js-lingui-id: T9qjpu
|
||||
#: src/modules/settings/roles/role-permissions/permission-flags/hooks/useActionRolePermissionFlagConfig.ts
|
||||
msgid "Code Interpreter"
|
||||
msgstr ""
|
||||
|
||||
#. js-lingui-id: bKJYIa
|
||||
#: src/modules/settings/logic-functions/components/tabs/SettingsLogicFunctionCodeEditorTab.tsx
|
||||
msgid "Code your function"
|
||||
@@ -13393,6 +13398,11 @@ msgstr ""
|
||||
msgid "Run a workflow and return here to view its executions"
|
||||
msgstr "Kør en arbejdsproces og vend tilbage hertil for at se dens eksekveringer"
|
||||
|
||||
#. js-lingui-id: rRyKdg
|
||||
#: src/modules/settings/roles/role-permissions/permission-flags/hooks/useActionRolePermissionFlagConfig.ts
|
||||
msgid "Run code to analyze files and data"
|
||||
msgstr ""
|
||||
|
||||
#. js-lingui-id: UPaWvi
|
||||
#: src/modules/settings/logic-functions/components/tabs/SettingsLogicFunctionTestTab.tsx
|
||||
msgid "Run Function"
|
||||
|
||||
@@ -3537,6 +3537,11 @@ msgstr "Code-Editor"
|
||||
msgid "Code Execution"
|
||||
msgstr "Codeausführung"
|
||||
|
||||
#. js-lingui-id: T9qjpu
|
||||
#: src/modules/settings/roles/role-permissions/permission-flags/hooks/useActionRolePermissionFlagConfig.ts
|
||||
msgid "Code Interpreter"
|
||||
msgstr ""
|
||||
|
||||
#. js-lingui-id: bKJYIa
|
||||
#: src/modules/settings/logic-functions/components/tabs/SettingsLogicFunctionCodeEditorTab.tsx
|
||||
msgid "Code your function"
|
||||
@@ -13393,6 +13398,11 @@ msgstr ""
|
||||
msgid "Run a workflow and return here to view its executions"
|
||||
msgstr "Führen Sie einen Workflow aus und kehren Sie zurück, um die Ausführungen anzuzeigen"
|
||||
|
||||
#. js-lingui-id: rRyKdg
|
||||
#: src/modules/settings/roles/role-permissions/permission-flags/hooks/useActionRolePermissionFlagConfig.ts
|
||||
msgid "Run code to analyze files and data"
|
||||
msgstr ""
|
||||
|
||||
#. js-lingui-id: UPaWvi
|
||||
#: src/modules/settings/logic-functions/components/tabs/SettingsLogicFunctionTestTab.tsx
|
||||
msgid "Run Function"
|
||||
|
||||
@@ -3537,6 +3537,11 @@ msgstr "Επεξεργαστής Κώδικα"
|
||||
msgid "Code Execution"
|
||||
msgstr "Εκτέλεση κώδικα"
|
||||
|
||||
#. js-lingui-id: T9qjpu
|
||||
#: src/modules/settings/roles/role-permissions/permission-flags/hooks/useActionRolePermissionFlagConfig.ts
|
||||
msgid "Code Interpreter"
|
||||
msgstr ""
|
||||
|
||||
#. js-lingui-id: bKJYIa
|
||||
#: src/modules/settings/logic-functions/components/tabs/SettingsLogicFunctionCodeEditorTab.tsx
|
||||
msgid "Code your function"
|
||||
@@ -13393,6 +13398,11 @@ msgstr ""
|
||||
msgid "Run a workflow and return here to view its executions"
|
||||
msgstr "Εκτελέστε ένα workflow και επιστρέψτε εδώ για να δείτε τις εκτελέσεις του"
|
||||
|
||||
#. js-lingui-id: rRyKdg
|
||||
#: src/modules/settings/roles/role-permissions/permission-flags/hooks/useActionRolePermissionFlagConfig.ts
|
||||
msgid "Run code to analyze files and data"
|
||||
msgstr ""
|
||||
|
||||
#. js-lingui-id: UPaWvi
|
||||
#: src/modules/settings/logic-functions/components/tabs/SettingsLogicFunctionTestTab.tsx
|
||||
msgid "Run Function"
|
||||
|
||||
@@ -3532,6 +3532,11 @@ msgstr "Code Editor"
|
||||
msgid "Code Execution"
|
||||
msgstr "Code Execution"
|
||||
|
||||
#. js-lingui-id: T9qjpu
|
||||
#: src/modules/settings/roles/role-permissions/permission-flags/hooks/useActionRolePermissionFlagConfig.ts
|
||||
msgid "Code Interpreter"
|
||||
msgstr "Code Interpreter"
|
||||
|
||||
#. js-lingui-id: bKJYIa
|
||||
#: src/modules/settings/logic-functions/components/tabs/SettingsLogicFunctionCodeEditorTab.tsx
|
||||
msgid "Code your function"
|
||||
@@ -13411,6 +13416,11 @@ msgstr "Run"
|
||||
msgid "Run a workflow and return here to view its executions"
|
||||
msgstr "Run a workflow and return here to view its executions"
|
||||
|
||||
#. js-lingui-id: rRyKdg
|
||||
#: src/modules/settings/roles/role-permissions/permission-flags/hooks/useActionRolePermissionFlagConfig.ts
|
||||
msgid "Run code to analyze files and data"
|
||||
msgstr "Run code to analyze files and data"
|
||||
|
||||
#. js-lingui-id: UPaWvi
|
||||
#: src/modules/settings/logic-functions/components/tabs/SettingsLogicFunctionTestTab.tsx
|
||||
msgid "Run Function"
|
||||
|
||||
@@ -3537,6 +3537,11 @@ msgstr "Editor de Código"
|
||||
msgid "Code Execution"
|
||||
msgstr "Ejecución de código"
|
||||
|
||||
#. js-lingui-id: T9qjpu
|
||||
#: src/modules/settings/roles/role-permissions/permission-flags/hooks/useActionRolePermissionFlagConfig.ts
|
||||
msgid "Code Interpreter"
|
||||
msgstr ""
|
||||
|
||||
#. js-lingui-id: bKJYIa
|
||||
#: src/modules/settings/logic-functions/components/tabs/SettingsLogicFunctionCodeEditorTab.tsx
|
||||
msgid "Code your function"
|
||||
@@ -13393,6 +13398,11 @@ msgstr ""
|
||||
msgid "Run a workflow and return here to view its executions"
|
||||
msgstr "Ejecuta un workflow y vuelve aquí para ver sus ejecuciones"
|
||||
|
||||
#. js-lingui-id: rRyKdg
|
||||
#: src/modules/settings/roles/role-permissions/permission-flags/hooks/useActionRolePermissionFlagConfig.ts
|
||||
msgid "Run code to analyze files and data"
|
||||
msgstr ""
|
||||
|
||||
#. js-lingui-id: UPaWvi
|
||||
#: src/modules/settings/logic-functions/components/tabs/SettingsLogicFunctionTestTab.tsx
|
||||
msgid "Run Function"
|
||||
|
||||
@@ -3537,6 +3537,11 @@ msgstr "Koodieditori"
|
||||
msgid "Code Execution"
|
||||
msgstr "Koodin suoritus"
|
||||
|
||||
#. js-lingui-id: T9qjpu
|
||||
#: src/modules/settings/roles/role-permissions/permission-flags/hooks/useActionRolePermissionFlagConfig.ts
|
||||
msgid "Code Interpreter"
|
||||
msgstr ""
|
||||
|
||||
#. js-lingui-id: bKJYIa
|
||||
#: src/modules/settings/logic-functions/components/tabs/SettingsLogicFunctionCodeEditorTab.tsx
|
||||
msgid "Code your function"
|
||||
@@ -13393,6 +13398,11 @@ msgstr ""
|
||||
msgid "Run a workflow and return here to view its executions"
|
||||
msgstr "Suorita työnkulku ja palaa tänne nähdäksesi sen suoritukset"
|
||||
|
||||
#. js-lingui-id: rRyKdg
|
||||
#: src/modules/settings/roles/role-permissions/permission-flags/hooks/useActionRolePermissionFlagConfig.ts
|
||||
msgid "Run code to analyze files and data"
|
||||
msgstr ""
|
||||
|
||||
#. js-lingui-id: UPaWvi
|
||||
#: src/modules/settings/logic-functions/components/tabs/SettingsLogicFunctionTestTab.tsx
|
||||
msgid "Run Function"
|
||||
|
||||
@@ -3537,6 +3537,11 @@ msgstr "Éditeur de code"
|
||||
msgid "Code Execution"
|
||||
msgstr "Exécution de code"
|
||||
|
||||
#. js-lingui-id: T9qjpu
|
||||
#: src/modules/settings/roles/role-permissions/permission-flags/hooks/useActionRolePermissionFlagConfig.ts
|
||||
msgid "Code Interpreter"
|
||||
msgstr ""
|
||||
|
||||
#. js-lingui-id: bKJYIa
|
||||
#: src/modules/settings/logic-functions/components/tabs/SettingsLogicFunctionCodeEditorTab.tsx
|
||||
msgid "Code your function"
|
||||
@@ -13393,6 +13398,11 @@ msgstr ""
|
||||
msgid "Run a workflow and return here to view its executions"
|
||||
msgstr "Exécutez un workflow et revenez ici pour voir ses exécutions"
|
||||
|
||||
#. js-lingui-id: rRyKdg
|
||||
#: src/modules/settings/roles/role-permissions/permission-flags/hooks/useActionRolePermissionFlagConfig.ts
|
||||
msgid "Run code to analyze files and data"
|
||||
msgstr ""
|
||||
|
||||
#. js-lingui-id: UPaWvi
|
||||
#: src/modules/settings/logic-functions/components/tabs/SettingsLogicFunctionTestTab.tsx
|
||||
msgid "Run Function"
|
||||
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -3537,6 +3537,11 @@ msgstr "עורך קוד"
|
||||
msgid "Code Execution"
|
||||
msgstr "ביצוע קוד"
|
||||
|
||||
#. js-lingui-id: T9qjpu
|
||||
#: src/modules/settings/roles/role-permissions/permission-flags/hooks/useActionRolePermissionFlagConfig.ts
|
||||
msgid "Code Interpreter"
|
||||
msgstr ""
|
||||
|
||||
#. js-lingui-id: bKJYIa
|
||||
#: src/modules/settings/logic-functions/components/tabs/SettingsLogicFunctionCodeEditorTab.tsx
|
||||
msgid "Code your function"
|
||||
@@ -13393,6 +13398,11 @@ msgstr ""
|
||||
msgid "Run a workflow and return here to view its executions"
|
||||
msgstr "\\"
|
||||
|
||||
#. js-lingui-id: rRyKdg
|
||||
#: src/modules/settings/roles/role-permissions/permission-flags/hooks/useActionRolePermissionFlagConfig.ts
|
||||
msgid "Run code to analyze files and data"
|
||||
msgstr ""
|
||||
|
||||
#. js-lingui-id: UPaWvi
|
||||
#: src/modules/settings/logic-functions/components/tabs/SettingsLogicFunctionTestTab.tsx
|
||||
msgid "Run Function"
|
||||
|
||||
@@ -3537,6 +3537,11 @@ msgstr "Kódszerkesztő"
|
||||
msgid "Code Execution"
|
||||
msgstr "Kódvégrehajtás"
|
||||
|
||||
#. js-lingui-id: T9qjpu
|
||||
#: src/modules/settings/roles/role-permissions/permission-flags/hooks/useActionRolePermissionFlagConfig.ts
|
||||
msgid "Code Interpreter"
|
||||
msgstr ""
|
||||
|
||||
#. js-lingui-id: bKJYIa
|
||||
#: src/modules/settings/logic-functions/components/tabs/SettingsLogicFunctionCodeEditorTab.tsx
|
||||
msgid "Code your function"
|
||||
@@ -13393,6 +13398,11 @@ msgstr ""
|
||||
msgid "Run a workflow and return here to view its executions"
|
||||
msgstr "Futtasson egy munkafolyamatot, és térjen vissza ide a végrehajtások megtekintéséhez"
|
||||
|
||||
#. js-lingui-id: rRyKdg
|
||||
#: src/modules/settings/roles/role-permissions/permission-flags/hooks/useActionRolePermissionFlagConfig.ts
|
||||
msgid "Run code to analyze files and data"
|
||||
msgstr ""
|
||||
|
||||
#. js-lingui-id: UPaWvi
|
||||
#: src/modules/settings/logic-functions/components/tabs/SettingsLogicFunctionTestTab.tsx
|
||||
msgid "Run Function"
|
||||
|
||||
@@ -3537,6 +3537,11 @@ msgstr "Editor di Codice"
|
||||
msgid "Code Execution"
|
||||
msgstr "Esecuzione del codice"
|
||||
|
||||
#. js-lingui-id: T9qjpu
|
||||
#: src/modules/settings/roles/role-permissions/permission-flags/hooks/useActionRolePermissionFlagConfig.ts
|
||||
msgid "Code Interpreter"
|
||||
msgstr ""
|
||||
|
||||
#. js-lingui-id: bKJYIa
|
||||
#: src/modules/settings/logic-functions/components/tabs/SettingsLogicFunctionCodeEditorTab.tsx
|
||||
msgid "Code your function"
|
||||
@@ -13393,6 +13398,11 @@ msgstr ""
|
||||
msgid "Run a workflow and return here to view its executions"
|
||||
msgstr "Esegui un workflow e torna qui per visualizzare le esecuzioni"
|
||||
|
||||
#. js-lingui-id: rRyKdg
|
||||
#: src/modules/settings/roles/role-permissions/permission-flags/hooks/useActionRolePermissionFlagConfig.ts
|
||||
msgid "Run code to analyze files and data"
|
||||
msgstr ""
|
||||
|
||||
#. js-lingui-id: UPaWvi
|
||||
#: src/modules/settings/logic-functions/components/tabs/SettingsLogicFunctionTestTab.tsx
|
||||
msgid "Run Function"
|
||||
|
||||
@@ -3537,6 +3537,11 @@ msgstr "コードエディタ"
|
||||
msgid "Code Execution"
|
||||
msgstr "コード実行"
|
||||
|
||||
#. js-lingui-id: T9qjpu
|
||||
#: src/modules/settings/roles/role-permissions/permission-flags/hooks/useActionRolePermissionFlagConfig.ts
|
||||
msgid "Code Interpreter"
|
||||
msgstr ""
|
||||
|
||||
#. js-lingui-id: bKJYIa
|
||||
#: src/modules/settings/logic-functions/components/tabs/SettingsLogicFunctionCodeEditorTab.tsx
|
||||
msgid "Code your function"
|
||||
@@ -13393,6 +13398,11 @@ msgstr ""
|
||||
msgid "Run a workflow and return here to view its executions"
|
||||
msgstr "ワークフローを実行し、その実行内容を見るためにここに戻る"
|
||||
|
||||
#. js-lingui-id: rRyKdg
|
||||
#: src/modules/settings/roles/role-permissions/permission-flags/hooks/useActionRolePermissionFlagConfig.ts
|
||||
msgid "Run code to analyze files and data"
|
||||
msgstr ""
|
||||
|
||||
#. js-lingui-id: UPaWvi
|
||||
#: src/modules/settings/logic-functions/components/tabs/SettingsLogicFunctionTestTab.tsx
|
||||
msgid "Run Function"
|
||||
|
||||
@@ -3537,6 +3537,11 @@ msgstr "코드 편집기"
|
||||
msgid "Code Execution"
|
||||
msgstr "코드 실행"
|
||||
|
||||
#. js-lingui-id: T9qjpu
|
||||
#: src/modules/settings/roles/role-permissions/permission-flags/hooks/useActionRolePermissionFlagConfig.ts
|
||||
msgid "Code Interpreter"
|
||||
msgstr ""
|
||||
|
||||
#. js-lingui-id: bKJYIa
|
||||
#: src/modules/settings/logic-functions/components/tabs/SettingsLogicFunctionCodeEditorTab.tsx
|
||||
msgid "Code your function"
|
||||
@@ -13393,6 +13398,11 @@ msgstr ""
|
||||
msgid "Run a workflow and return here to view its executions"
|
||||
msgstr "워크플로를 실행하고 여기로 돌아와 실행 결과를 확인하세요"
|
||||
|
||||
#. js-lingui-id: rRyKdg
|
||||
#: src/modules/settings/roles/role-permissions/permission-flags/hooks/useActionRolePermissionFlagConfig.ts
|
||||
msgid "Run code to analyze files and data"
|
||||
msgstr ""
|
||||
|
||||
#. js-lingui-id: UPaWvi
|
||||
#: src/modules/settings/logic-functions/components/tabs/SettingsLogicFunctionTestTab.tsx
|
||||
msgid "Run Function"
|
||||
|
||||
@@ -3537,6 +3537,11 @@ msgstr "Codebewerkingsprogramma"
|
||||
msgid "Code Execution"
|
||||
msgstr "Code-uitvoering"
|
||||
|
||||
#. js-lingui-id: T9qjpu
|
||||
#: src/modules/settings/roles/role-permissions/permission-flags/hooks/useActionRolePermissionFlagConfig.ts
|
||||
msgid "Code Interpreter"
|
||||
msgstr ""
|
||||
|
||||
#. js-lingui-id: bKJYIa
|
||||
#: src/modules/settings/logic-functions/components/tabs/SettingsLogicFunctionCodeEditorTab.tsx
|
||||
msgid "Code your function"
|
||||
@@ -13393,6 +13398,11 @@ msgstr ""
|
||||
msgid "Run a workflow and return here to view its executions"
|
||||
msgstr "Voer een workflow uit en keer hier terug om de uitvoeringen te bekijken"
|
||||
|
||||
#. js-lingui-id: rRyKdg
|
||||
#: src/modules/settings/roles/role-permissions/permission-flags/hooks/useActionRolePermissionFlagConfig.ts
|
||||
msgid "Run code to analyze files and data"
|
||||
msgstr ""
|
||||
|
||||
#. js-lingui-id: UPaWvi
|
||||
#: src/modules/settings/logic-functions/components/tabs/SettingsLogicFunctionTestTab.tsx
|
||||
msgid "Run Function"
|
||||
|
||||
@@ -3537,6 +3537,11 @@ msgstr "Koderedigerer"
|
||||
msgid "Code Execution"
|
||||
msgstr "Kodekjøring"
|
||||
|
||||
#. js-lingui-id: T9qjpu
|
||||
#: src/modules/settings/roles/role-permissions/permission-flags/hooks/useActionRolePermissionFlagConfig.ts
|
||||
msgid "Code Interpreter"
|
||||
msgstr ""
|
||||
|
||||
#. js-lingui-id: bKJYIa
|
||||
#: src/modules/settings/logic-functions/components/tabs/SettingsLogicFunctionCodeEditorTab.tsx
|
||||
msgid "Code your function"
|
||||
@@ -13393,6 +13398,11 @@ msgstr ""
|
||||
msgid "Run a workflow and return here to view its executions"
|
||||
msgstr "Kjør en arbeidsflyt og kom tilbake her for å se på kjøringene"
|
||||
|
||||
#. js-lingui-id: rRyKdg
|
||||
#: src/modules/settings/roles/role-permissions/permission-flags/hooks/useActionRolePermissionFlagConfig.ts
|
||||
msgid "Run code to analyze files and data"
|
||||
msgstr ""
|
||||
|
||||
#. js-lingui-id: UPaWvi
|
||||
#: src/modules/settings/logic-functions/components/tabs/SettingsLogicFunctionTestTab.tsx
|
||||
msgid "Run Function"
|
||||
|
||||
@@ -3537,6 +3537,11 @@ msgstr "Edytor kodu"
|
||||
msgid "Code Execution"
|
||||
msgstr "Wykonywanie kodu"
|
||||
|
||||
#. js-lingui-id: T9qjpu
|
||||
#: src/modules/settings/roles/role-permissions/permission-flags/hooks/useActionRolePermissionFlagConfig.ts
|
||||
msgid "Code Interpreter"
|
||||
msgstr ""
|
||||
|
||||
#. js-lingui-id: bKJYIa
|
||||
#: src/modules/settings/logic-functions/components/tabs/SettingsLogicFunctionCodeEditorTab.tsx
|
||||
msgid "Code your function"
|
||||
@@ -13393,6 +13398,11 @@ msgstr ""
|
||||
msgid "Run a workflow and return here to view its executions"
|
||||
msgstr "Uruchom workflow i wróć tutaj, aby zobaczyć jego wykonania"
|
||||
|
||||
#. js-lingui-id: rRyKdg
|
||||
#: src/modules/settings/roles/role-permissions/permission-flags/hooks/useActionRolePermissionFlagConfig.ts
|
||||
msgid "Run code to analyze files and data"
|
||||
msgstr ""
|
||||
|
||||
#. js-lingui-id: UPaWvi
|
||||
#: src/modules/settings/logic-functions/components/tabs/SettingsLogicFunctionTestTab.tsx
|
||||
msgid "Run Function"
|
||||
|
||||
@@ -3532,6 +3532,11 @@ msgstr ""
|
||||
msgid "Code Execution"
|
||||
msgstr ""
|
||||
|
||||
#. js-lingui-id: T9qjpu
|
||||
#: src/modules/settings/roles/role-permissions/permission-flags/hooks/useActionRolePermissionFlagConfig.ts
|
||||
msgid "Code Interpreter"
|
||||
msgstr ""
|
||||
|
||||
#. js-lingui-id: bKJYIa
|
||||
#: src/modules/settings/logic-functions/components/tabs/SettingsLogicFunctionCodeEditorTab.tsx
|
||||
msgid "Code your function"
|
||||
@@ -13388,6 +13393,11 @@ msgstr ""
|
||||
msgid "Run a workflow and return here to view its executions"
|
||||
msgstr ""
|
||||
|
||||
#. js-lingui-id: rRyKdg
|
||||
#: src/modules/settings/roles/role-permissions/permission-flags/hooks/useActionRolePermissionFlagConfig.ts
|
||||
msgid "Run code to analyze files and data"
|
||||
msgstr ""
|
||||
|
||||
#. js-lingui-id: UPaWvi
|
||||
#: src/modules/settings/logic-functions/components/tabs/SettingsLogicFunctionTestTab.tsx
|
||||
msgid "Run Function"
|
||||
|
||||
@@ -3537,6 +3537,11 @@ msgstr "Editor de Código"
|
||||
msgid "Code Execution"
|
||||
msgstr "Execução de código"
|
||||
|
||||
#. js-lingui-id: T9qjpu
|
||||
#: src/modules/settings/roles/role-permissions/permission-flags/hooks/useActionRolePermissionFlagConfig.ts
|
||||
msgid "Code Interpreter"
|
||||
msgstr ""
|
||||
|
||||
#. js-lingui-id: bKJYIa
|
||||
#: src/modules/settings/logic-functions/components/tabs/SettingsLogicFunctionCodeEditorTab.tsx
|
||||
msgid "Code your function"
|
||||
@@ -13393,6 +13398,11 @@ msgstr ""
|
||||
msgid "Run a workflow and return here to view its executions"
|
||||
msgstr "Execute um workflow e retorne aqui para visualizar suas execuções"
|
||||
|
||||
#. js-lingui-id: rRyKdg
|
||||
#: src/modules/settings/roles/role-permissions/permission-flags/hooks/useActionRolePermissionFlagConfig.ts
|
||||
msgid "Run code to analyze files and data"
|
||||
msgstr ""
|
||||
|
||||
#. js-lingui-id: UPaWvi
|
||||
#: src/modules/settings/logic-functions/components/tabs/SettingsLogicFunctionTestTab.tsx
|
||||
msgid "Run Function"
|
||||
|
||||
@@ -3537,6 +3537,11 @@ msgstr "Editor de Código"
|
||||
msgid "Code Execution"
|
||||
msgstr "Execução de Código"
|
||||
|
||||
#. js-lingui-id: T9qjpu
|
||||
#: src/modules/settings/roles/role-permissions/permission-flags/hooks/useActionRolePermissionFlagConfig.ts
|
||||
msgid "Code Interpreter"
|
||||
msgstr ""
|
||||
|
||||
#. js-lingui-id: bKJYIa
|
||||
#: src/modules/settings/logic-functions/components/tabs/SettingsLogicFunctionCodeEditorTab.tsx
|
||||
msgid "Code your function"
|
||||
@@ -13393,6 +13398,11 @@ msgstr ""
|
||||
msgid "Run a workflow and return here to view its executions"
|
||||
msgstr "Execute um workflow e volte aqui para ver as suas execuções"
|
||||
|
||||
#. js-lingui-id: rRyKdg
|
||||
#: src/modules/settings/roles/role-permissions/permission-flags/hooks/useActionRolePermissionFlagConfig.ts
|
||||
msgid "Run code to analyze files and data"
|
||||
msgstr ""
|
||||
|
||||
#. js-lingui-id: UPaWvi
|
||||
#: src/modules/settings/logic-functions/components/tabs/SettingsLogicFunctionTestTab.tsx
|
||||
msgid "Run Function"
|
||||
|
||||
@@ -3537,6 +3537,11 @@ msgstr "Editor de Cod"
|
||||
msgid "Code Execution"
|
||||
msgstr "Executare cod"
|
||||
|
||||
#. js-lingui-id: T9qjpu
|
||||
#: src/modules/settings/roles/role-permissions/permission-flags/hooks/useActionRolePermissionFlagConfig.ts
|
||||
msgid "Code Interpreter"
|
||||
msgstr ""
|
||||
|
||||
#. js-lingui-id: bKJYIa
|
||||
#: src/modules/settings/logic-functions/components/tabs/SettingsLogicFunctionCodeEditorTab.tsx
|
||||
msgid "Code your function"
|
||||
@@ -13393,6 +13398,11 @@ msgstr ""
|
||||
msgid "Run a workflow and return here to view its executions"
|
||||
msgstr "Rulează un workflow și întoarce-te aici pentru a vedea execuțiile acestuia"
|
||||
|
||||
#. js-lingui-id: rRyKdg
|
||||
#: src/modules/settings/roles/role-permissions/permission-flags/hooks/useActionRolePermissionFlagConfig.ts
|
||||
msgid "Run code to analyze files and data"
|
||||
msgstr ""
|
||||
|
||||
#. js-lingui-id: UPaWvi
|
||||
#: src/modules/settings/logic-functions/components/tabs/SettingsLogicFunctionTestTab.tsx
|
||||
msgid "Run Function"
|
||||
|
||||
Binary file not shown.
@@ -3537,6 +3537,11 @@ msgstr "Код Едитор"
|
||||
msgid "Code Execution"
|
||||
msgstr "Извршавање кода"
|
||||
|
||||
#. js-lingui-id: T9qjpu
|
||||
#: src/modules/settings/roles/role-permissions/permission-flags/hooks/useActionRolePermissionFlagConfig.ts
|
||||
msgid "Code Interpreter"
|
||||
msgstr ""
|
||||
|
||||
#. js-lingui-id: bKJYIa
|
||||
#: src/modules/settings/logic-functions/components/tabs/SettingsLogicFunctionCodeEditorTab.tsx
|
||||
msgid "Code your function"
|
||||
@@ -13393,6 +13398,11 @@ msgstr ""
|
||||
msgid "Run a workflow and return here to view its executions"
|
||||
msgstr "Покрените радни процес и вратите се овде да погледате његове извршавања"
|
||||
|
||||
#. js-lingui-id: rRyKdg
|
||||
#: src/modules/settings/roles/role-permissions/permission-flags/hooks/useActionRolePermissionFlagConfig.ts
|
||||
msgid "Run code to analyze files and data"
|
||||
msgstr ""
|
||||
|
||||
#. js-lingui-id: UPaWvi
|
||||
#: src/modules/settings/logic-functions/components/tabs/SettingsLogicFunctionTestTab.tsx
|
||||
msgid "Run Function"
|
||||
|
||||
@@ -3537,6 +3537,11 @@ msgstr "Kodredigerare"
|
||||
msgid "Code Execution"
|
||||
msgstr "Kodkörning"
|
||||
|
||||
#. js-lingui-id: T9qjpu
|
||||
#: src/modules/settings/roles/role-permissions/permission-flags/hooks/useActionRolePermissionFlagConfig.ts
|
||||
msgid "Code Interpreter"
|
||||
msgstr ""
|
||||
|
||||
#. js-lingui-id: bKJYIa
|
||||
#: src/modules/settings/logic-functions/components/tabs/SettingsLogicFunctionCodeEditorTab.tsx
|
||||
msgid "Code your function"
|
||||
@@ -13395,6 +13400,11 @@ msgstr ""
|
||||
msgid "Run a workflow and return here to view its executions"
|
||||
msgstr "Kör en arbetsflöde och återvänd hit för att se dess körningar"
|
||||
|
||||
#. js-lingui-id: rRyKdg
|
||||
#: src/modules/settings/roles/role-permissions/permission-flags/hooks/useActionRolePermissionFlagConfig.ts
|
||||
msgid "Run code to analyze files and data"
|
||||
msgstr ""
|
||||
|
||||
#. js-lingui-id: UPaWvi
|
||||
#: src/modules/settings/logic-functions/components/tabs/SettingsLogicFunctionTestTab.tsx
|
||||
msgid "Run Function"
|
||||
|
||||
@@ -3537,6 +3537,11 @@ msgstr "Kod Düzenleyici"
|
||||
msgid "Code Execution"
|
||||
msgstr "Kod Yürütme"
|
||||
|
||||
#. js-lingui-id: T9qjpu
|
||||
#: src/modules/settings/roles/role-permissions/permission-flags/hooks/useActionRolePermissionFlagConfig.ts
|
||||
msgid "Code Interpreter"
|
||||
msgstr ""
|
||||
|
||||
#. js-lingui-id: bKJYIa
|
||||
#: src/modules/settings/logic-functions/components/tabs/SettingsLogicFunctionCodeEditorTab.tsx
|
||||
msgid "Code your function"
|
||||
@@ -13393,6 +13398,11 @@ msgstr ""
|
||||
msgid "Run a workflow and return here to view its executions"
|
||||
msgstr "Bir iş akışı çalıştırın ve yürütmelerini görmek için buraya geri dönün"
|
||||
|
||||
#. js-lingui-id: rRyKdg
|
||||
#: src/modules/settings/roles/role-permissions/permission-flags/hooks/useActionRolePermissionFlagConfig.ts
|
||||
msgid "Run code to analyze files and data"
|
||||
msgstr ""
|
||||
|
||||
#. js-lingui-id: UPaWvi
|
||||
#: src/modules/settings/logic-functions/components/tabs/SettingsLogicFunctionTestTab.tsx
|
||||
msgid "Run Function"
|
||||
|
||||
@@ -3537,6 +3537,11 @@ msgstr "Редактор коду"
|
||||
msgid "Code Execution"
|
||||
msgstr "Виконання коду"
|
||||
|
||||
#. js-lingui-id: T9qjpu
|
||||
#: src/modules/settings/roles/role-permissions/permission-flags/hooks/useActionRolePermissionFlagConfig.ts
|
||||
msgid "Code Interpreter"
|
||||
msgstr ""
|
||||
|
||||
#. js-lingui-id: bKJYIa
|
||||
#: src/modules/settings/logic-functions/components/tabs/SettingsLogicFunctionCodeEditorTab.tsx
|
||||
msgid "Code your function"
|
||||
@@ -13393,6 +13398,11 @@ msgstr ""
|
||||
msgid "Run a workflow and return here to view its executions"
|
||||
msgstr "Запустіть workflow і поверніться сюди, щоб переглянути його виконання"
|
||||
|
||||
#. js-lingui-id: rRyKdg
|
||||
#: src/modules/settings/roles/role-permissions/permission-flags/hooks/useActionRolePermissionFlagConfig.ts
|
||||
msgid "Run code to analyze files and data"
|
||||
msgstr ""
|
||||
|
||||
#. js-lingui-id: UPaWvi
|
||||
#: src/modules/settings/logic-functions/components/tabs/SettingsLogicFunctionTestTab.tsx
|
||||
msgid "Run Function"
|
||||
|
||||
@@ -3537,6 +3537,11 @@ msgstr "Trình chỉnh sửa mã"
|
||||
msgid "Code Execution"
|
||||
msgstr "Thực thi mã"
|
||||
|
||||
#. js-lingui-id: T9qjpu
|
||||
#: src/modules/settings/roles/role-permissions/permission-flags/hooks/useActionRolePermissionFlagConfig.ts
|
||||
msgid "Code Interpreter"
|
||||
msgstr ""
|
||||
|
||||
#. js-lingui-id: bKJYIa
|
||||
#: src/modules/settings/logic-functions/components/tabs/SettingsLogicFunctionCodeEditorTab.tsx
|
||||
msgid "Code your function"
|
||||
@@ -13393,6 +13398,11 @@ msgstr ""
|
||||
msgid "Run a workflow and return here to view its executions"
|
||||
msgstr "Chạy một quy trình làm việc và trở lại đây để xem các thực thi của nó"
|
||||
|
||||
#. js-lingui-id: rRyKdg
|
||||
#: src/modules/settings/roles/role-permissions/permission-flags/hooks/useActionRolePermissionFlagConfig.ts
|
||||
msgid "Run code to analyze files and data"
|
||||
msgstr ""
|
||||
|
||||
#. js-lingui-id: UPaWvi
|
||||
#: src/modules/settings/logic-functions/components/tabs/SettingsLogicFunctionTestTab.tsx
|
||||
msgid "Run Function"
|
||||
|
||||
@@ -3537,6 +3537,11 @@ msgstr "代码编辑器"
|
||||
msgid "Code Execution"
|
||||
msgstr "代码执行"
|
||||
|
||||
#. js-lingui-id: T9qjpu
|
||||
#: src/modules/settings/roles/role-permissions/permission-flags/hooks/useActionRolePermissionFlagConfig.ts
|
||||
msgid "Code Interpreter"
|
||||
msgstr ""
|
||||
|
||||
#. js-lingui-id: bKJYIa
|
||||
#: src/modules/settings/logic-functions/components/tabs/SettingsLogicFunctionCodeEditorTab.tsx
|
||||
msgid "Code your function"
|
||||
@@ -13393,6 +13398,11 @@ msgstr ""
|
||||
msgid "Run a workflow and return here to view its executions"
|
||||
msgstr "运行工作流并返回此处查看其执行情况"
|
||||
|
||||
#. js-lingui-id: rRyKdg
|
||||
#: src/modules/settings/roles/role-permissions/permission-flags/hooks/useActionRolePermissionFlagConfig.ts
|
||||
msgid "Run code to analyze files and data"
|
||||
msgstr ""
|
||||
|
||||
#. js-lingui-id: UPaWvi
|
||||
#: src/modules/settings/logic-functions/components/tabs/SettingsLogicFunctionTestTab.tsx
|
||||
msgid "Run Function"
|
||||
|
||||
@@ -3537,6 +3537,11 @@ msgstr "代碼編輯器"
|
||||
msgid "Code Execution"
|
||||
msgstr "程式碼執行"
|
||||
|
||||
#. js-lingui-id: T9qjpu
|
||||
#: src/modules/settings/roles/role-permissions/permission-flags/hooks/useActionRolePermissionFlagConfig.ts
|
||||
msgid "Code Interpreter"
|
||||
msgstr ""
|
||||
|
||||
#. js-lingui-id: bKJYIa
|
||||
#: src/modules/settings/logic-functions/components/tabs/SettingsLogicFunctionCodeEditorTab.tsx
|
||||
msgid "Code your function"
|
||||
@@ -13393,6 +13398,11 @@ msgstr ""
|
||||
msgid "Run a workflow and return here to view its executions"
|
||||
msgstr "運行工作流程並返回此處查看其執行情況"
|
||||
|
||||
#. js-lingui-id: rRyKdg
|
||||
#: src/modules/settings/roles/role-permissions/permission-flags/hooks/useActionRolePermissionFlagConfig.ts
|
||||
msgid "Run code to analyze files and data"
|
||||
msgstr ""
|
||||
|
||||
#. js-lingui-id: UPaWvi
|
||||
#: src/modules/settings/logic-functions/components/tabs/SettingsLogicFunctionTestTab.tsx
|
||||
msgid "Run Function"
|
||||
|
||||
+7
-15
@@ -31,9 +31,7 @@ import {
|
||||
export const AgentChatThreadInitializationEffect = () => {
|
||||
const client = useApolloClient();
|
||||
const { replaceDraft, applyChanges } = useUpdateMetadataStoreDraft();
|
||||
const hasAiSettingsPermission = useHasPermissionFlag(
|
||||
PermissionFlagType.AI_SETTINGS,
|
||||
);
|
||||
const hasAiPermission = useHasPermissionFlag(PermissionFlagType.AI);
|
||||
|
||||
const currentAiChatThread = useAtomStateValue(currentAiChatThreadState);
|
||||
const setCurrentAiChatThread = useSetAtomState(currentAiChatThreadState);
|
||||
@@ -58,7 +56,7 @@ export const AgentChatThreadInitializationEffect = () => {
|
||||
useAtomState(hasInitializedAgentChatThreadsState);
|
||||
|
||||
useEffect(() => {
|
||||
if (storeEntry.status !== 'empty' || !hasAiSettingsPermission) {
|
||||
if (storeEntry.status !== 'empty' || !hasAiPermission) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -75,19 +73,13 @@ export const AgentChatThreadInitializationEffect = () => {
|
||||
replaceDraft('agentChatThreads', result.data.chatThreads);
|
||||
applyChanges();
|
||||
});
|
||||
}, [
|
||||
storeEntry.status,
|
||||
hasAiSettingsPermission,
|
||||
client,
|
||||
replaceDraft,
|
||||
applyChanges,
|
||||
]);
|
||||
}, [storeEntry.status, hasAiPermission, client, replaceDraft, applyChanges]);
|
||||
|
||||
useEffect(() => {
|
||||
setAgentChatThreadsLoading(
|
||||
storeEntry.status === 'empty' && hasAiSettingsPermission,
|
||||
storeEntry.status === 'empty' && hasAiPermission,
|
||||
);
|
||||
}, [storeEntry.status, hasAiSettingsPermission, setAgentChatThreadsLoading]);
|
||||
}, [storeEntry.status, hasAiPermission, setAgentChatThreadsLoading]);
|
||||
|
||||
useEffect(() => {
|
||||
if (
|
||||
@@ -97,7 +89,7 @@ export const AgentChatThreadInitializationEffect = () => {
|
||||
return;
|
||||
}
|
||||
|
||||
if (storeEntry.status === 'empty' && hasAiSettingsPermission) {
|
||||
if (storeEntry.status === 'empty' && hasAiPermission) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -152,7 +144,7 @@ export const AgentChatThreadInitializationEffect = () => {
|
||||
}, [
|
||||
agentChatVisibleThreads,
|
||||
currentAiChatThread,
|
||||
hasAiSettingsPermission,
|
||||
hasAiPermission,
|
||||
hasInitializedAgentChatThreads,
|
||||
setHasInitializedAgentChatThreads,
|
||||
storeEntry.status,
|
||||
|
||||
@@ -69,7 +69,10 @@ export const SettingsAgentModelCapabilities = ({
|
||||
return null;
|
||||
}
|
||||
|
||||
if (!nativeCapabilities.webSearch && !nativeCapabilities.twitterSearch) {
|
||||
const showNativeWebSearch = nativeCapabilities.webSearch;
|
||||
const showNativeTwitterSearch = nativeCapabilities.twitterSearch;
|
||||
|
||||
if (!showNativeWebSearch && !showNativeTwitterSearch) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -91,7 +94,7 @@ export const SettingsAgentModelCapabilities = ({
|
||||
};
|
||||
|
||||
const capabilities = [
|
||||
...(nativeCapabilities.webSearch
|
||||
...(showNativeWebSearch
|
||||
? [
|
||||
{
|
||||
key: 'webSearch' as const,
|
||||
@@ -101,7 +104,7 @@ export const SettingsAgentModelCapabilities = ({
|
||||
},
|
||||
]
|
||||
: []),
|
||||
...(nativeCapabilities.twitterSearch
|
||||
...(showNativeTwitterSearch
|
||||
? [
|
||||
{
|
||||
key: 'twitterSearch' as const,
|
||||
|
||||
@@ -224,6 +224,23 @@ export const PageChangeEffect = () => {
|
||||
}
|
||||
case isMatchingLocation(location, AppPath.RecordShowPage): {
|
||||
const isNewRecord = location.state?.isNewRecord === true;
|
||||
const isSidePanelOpen = store.get(isSidePanelOpenedState.atom);
|
||||
|
||||
if (!isSidePanelOpen) {
|
||||
resetFocusStackToFocusItem({
|
||||
focusStackItem: {
|
||||
focusId: PageFocusId.RecordShowPage,
|
||||
componentInstance: {
|
||||
componentType: FocusComponentType.PAGE,
|
||||
componentInstanceId: PageFocusId.RecordShowPage,
|
||||
},
|
||||
globalHotkeysConfig: {
|
||||
enableGlobalHotkeysWithModifiers: true,
|
||||
enableGlobalHotkeysConflictingWithKeyboard: true,
|
||||
},
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
if (
|
||||
isNewRecord &&
|
||||
@@ -234,26 +251,6 @@ export const PageChangeEffect = () => {
|
||||
fieldName: location.state.labelIdentifierFieldName,
|
||||
});
|
||||
}
|
||||
|
||||
const isSidePanelOpen = store.get(isSidePanelOpenedState.atom);
|
||||
|
||||
if (isSidePanelOpen) {
|
||||
return;
|
||||
}
|
||||
|
||||
resetFocusStackToFocusItem({
|
||||
focusStackItem: {
|
||||
focusId: PageFocusId.RecordShowPage,
|
||||
componentInstance: {
|
||||
componentType: FocusComponentType.PAGE,
|
||||
componentInstanceId: PageFocusId.RecordShowPage,
|
||||
},
|
||||
globalHotkeysConfig: {
|
||||
enableGlobalHotkeysWithModifiers: true,
|
||||
enableGlobalHotkeysConflictingWithKeyboard: true,
|
||||
},
|
||||
},
|
||||
});
|
||||
break;
|
||||
}
|
||||
case isMatchingLocation(location, AppPath.SignInUp): {
|
||||
|
||||
@@ -16,12 +16,10 @@ export const MainNavigationDrawer = ({ className }: { className?: string }) => {
|
||||
navigationDrawerActiveTabState,
|
||||
);
|
||||
const currentWorkspace = useAtomStateValue(currentWorkspaceState);
|
||||
const hasAiSettingsPermission = useHasPermissionFlag(
|
||||
PermissionFlagType.AI_SETTINGS,
|
||||
);
|
||||
const hasAiPermission = useHasPermissionFlag(PermissionFlagType.AI);
|
||||
|
||||
const showAiChatContent =
|
||||
hasAiSettingsPermission &&
|
||||
hasAiPermission &&
|
||||
navigationDrawerActiveTab === NAVIGATION_DRAWER_TABS.AI_CHAT_HISTORY;
|
||||
|
||||
return (
|
||||
|
||||
+2
-4
@@ -144,13 +144,11 @@ export const MainNavigationDrawerTabsRow = () => {
|
||||
const setIsNavigationDrawerExpanded = useSetAtomState(
|
||||
isNavigationDrawerExpandedState,
|
||||
);
|
||||
const hasAiSettingsPermission = useHasPermissionFlag(
|
||||
PermissionFlagType.AI_SETTINGS,
|
||||
);
|
||||
const hasAiPermission = useHasPermissionFlag(PermissionFlagType.AI);
|
||||
|
||||
const isExpanded = isNavigationDrawerExpanded || isMobile;
|
||||
|
||||
if (!hasAiSettingsPermission) {
|
||||
if (!hasAiPermission) {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
@@ -41,9 +41,7 @@ export const MobileNavigationBar = () => {
|
||||
const { switchToNewChat } = useSwitchToNewAiChat();
|
||||
const { alphaSortedActiveNonSystemObjectMetadataItems } =
|
||||
useFilteredObjectMetadataItems();
|
||||
const hasAiSettingsPermission = useHasPermissionFlag(
|
||||
PermissionFlagType.AI_SETTINGS,
|
||||
);
|
||||
const hasAiPermission = useHasPermissionFlag(PermissionFlagType.AI);
|
||||
|
||||
const setContextStoreCurrentObjectMetadataItemId = useSetAtomComponentState(
|
||||
contextStoreCurrentObjectMetadataItemIdComponentState,
|
||||
@@ -100,7 +98,7 @@ export const MobileNavigationBar = () => {
|
||||
openRecordsSearchPage();
|
||||
},
|
||||
},
|
||||
...(hasAiSettingsPermission
|
||||
...(hasAiPermission
|
||||
? [
|
||||
{
|
||||
name: 'newAiChat' as const,
|
||||
|
||||
+2
-2
@@ -4,7 +4,7 @@ import { useArrayField } from '@/object-record/record-field/ui/meta-types/hooks/
|
||||
import { ArrayFieldMenuItem } from '@/object-record/record-field/ui/meta-types/input/components/ArrayFieldMenuItem';
|
||||
import { MultiItemFieldInput } from '@/object-record/record-field/ui/meta-types/input/components/MultiItemFieldInput';
|
||||
import { MULTI_ITEM_FIELD_INPUT_DROPDOWN_ID_PREFIX } from '@/object-record/record-field/ui/meta-types/input/constants/MultiItemFieldInputDropdownClickOutsideId';
|
||||
import { arraySchema } from '@/object-record/record-field/ui/types/guards/isFieldArrayValue';
|
||||
import { arrayFieldValueSchema } from '@/object-record/record-field/ui/validation-schemas/arrayFieldValueSchema';
|
||||
import { useContext, useMemo } from 'react';
|
||||
import { MULTI_ITEM_FIELD_DEFAULT_MAX_VALUES } from 'twenty-shared/constants';
|
||||
import { isDefined } from 'twenty-shared/utils';
|
||||
@@ -22,7 +22,7 @@ export const ArrayFieldInput = () => {
|
||||
[draftValue],
|
||||
);
|
||||
const parseStringArrayToArrayValue = (arrayItems: string[]) => {
|
||||
const parseResponse = arraySchema.safeParse(arrayItems);
|
||||
const parseResponse = arrayFieldValueSchema.safeParse(arrayItems);
|
||||
|
||||
if (parseResponse.success) {
|
||||
return parseResponse.data;
|
||||
|
||||
+2
-2
@@ -4,7 +4,7 @@ import { EmailsFieldMenuItem } from '@/object-record/record-field/ui/meta-types/
|
||||
import { MULTI_ITEM_FIELD_INPUT_DROPDOWN_ID_PREFIX } from '@/object-record/record-field/ui/meta-types/input/constants/MultiItemFieldInputDropdownClickOutsideId';
|
||||
import { recordFieldInputIsFieldInErrorComponentState } from '@/object-record/record-field/ui/states/recordFieldInputIsFieldInErrorComponentState';
|
||||
import { type FieldEmailsValue } from '@/object-record/record-field/ui/types/FieldMetadata';
|
||||
import { emailsSchema } from '@/object-record/record-field/ui/types/guards/isFieldEmailsValue';
|
||||
import { emailsFieldValueSchema } from '@/object-record/record-field/ui/validation-schemas/emailsFieldValueSchema';
|
||||
import { emailSchema } from '@/object-record/record-field/ui/validation-schemas/emailSchema';
|
||||
import { useSetAtomComponentState } from '@/ui/utilities/state/jotai/hooks/useSetAtomComponentState';
|
||||
import { useLingui } from '@lingui/react/macro';
|
||||
@@ -41,7 +41,7 @@ export const EmailsFieldInput = () => {
|
||||
additionalEmails: nextAdditionalEmails,
|
||||
};
|
||||
|
||||
const parseResponse = emailsSchema.safeParse(nextValue);
|
||||
const parseResponse = emailsFieldValueSchema.safeParse(nextValue);
|
||||
|
||||
if (parseResponse.success) {
|
||||
return parseResponse.data;
|
||||
|
||||
+2
-2
@@ -9,7 +9,7 @@ import { MULTI_ITEM_FIELD_INPUT_DROPDOWN_ID_PREFIX } from '@/object-record/recor
|
||||
import { uploadMultipleFiles } from '@/object-record/record-field/ui/meta-types/utils/uploadMultipleFiles';
|
||||
import { recordFieldInputIsFieldInErrorComponentState } from '@/object-record/record-field/ui/states/recordFieldInputIsFieldInErrorComponentState';
|
||||
import { type FieldFilesValue } from '@/object-record/record-field/ui/types/FieldMetadata';
|
||||
import { filesSchema } from '@/object-record/record-field/ui/types/guards/isFieldFilesValue';
|
||||
import { filesFieldValueSchema } from '@/object-record/record-field/ui/validation-schemas/filesFieldValueSchema';
|
||||
import { useSnackBar } from '@/ui/feedback/snack-bar-manager/hooks/useSnackBar';
|
||||
import { filePreviewState } from '@/ui/field/display/states/filePreviewState';
|
||||
import { useAtomStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomStateValue';
|
||||
@@ -39,7 +39,7 @@ export const FilesFieldInput = () => {
|
||||
|
||||
const parseFilesArrayToFilesValue = useCallback(
|
||||
(filesArray: FieldFilesValue[]) => {
|
||||
const parseResponse = filesSchema.safeParse(filesArray);
|
||||
const parseResponse = filesFieldValueSchema.safeParse(filesArray);
|
||||
if (parseResponse.success) {
|
||||
return parseResponse.data;
|
||||
}
|
||||
|
||||
+2
-2
@@ -5,7 +5,7 @@ import { MULTI_ITEM_FIELD_INPUT_DROPDOWN_ID_PREFIX } from '@/object-record/recor
|
||||
import { getFieldLinkDefinedLinks } from '@/object-record/record-field/ui/meta-types/input/utils/getFieldLinkDefinedLinks';
|
||||
import { recordFieldInputIsFieldInErrorComponentState } from '@/object-record/record-field/ui/states/recordFieldInputIsFieldInErrorComponentState';
|
||||
import { type FieldLinksValue } from '@/object-record/record-field/ui/types/FieldMetadata';
|
||||
import { linksSchema } from '@/object-record/record-field/ui/types/guards/isFieldLinksValue';
|
||||
import { linksFieldValueSchema } from '@/object-record/record-field/ui/validation-schemas/linksFieldValueSchema';
|
||||
import { useSetAtomComponentState } from '@/ui/utilities/state/jotai/hooks/useSetAtomComponentState';
|
||||
import { useContext, useMemo } from 'react';
|
||||
import { MULTI_ITEM_FIELD_DEFAULT_MAX_VALUES } from 'twenty-shared/constants';
|
||||
@@ -38,7 +38,7 @@ export const LinksFieldInput = () => {
|
||||
primaryLinkLabel: nextPrimaryLink?.label ?? null,
|
||||
secondaryLinks: nextSecondaryLinks,
|
||||
};
|
||||
const parseResponse = linksSchema.safeParse(nextValue);
|
||||
const parseResponse = linksFieldValueSchema.safeParse(nextValue);
|
||||
if (parseResponse.success) {
|
||||
return parseResponse.data;
|
||||
}
|
||||
|
||||
+2
-2
@@ -18,7 +18,7 @@ import {
|
||||
type FieldPhonesValue,
|
||||
type PhoneRecord,
|
||||
} from '@/object-record/record-field/ui/types/FieldMetadata';
|
||||
import { phonesSchema } from '@/object-record/record-field/ui/types/guards/isFieldPhonesValue';
|
||||
import { phonesFieldValueSchema } from '@/object-record/record-field/ui/validation-schemas/phonesFieldValueSchema';
|
||||
import { PhoneCountryPickerDropdownButton } from '@/ui/input/components/internal/phone/components/PhoneCountryPickerDropdownButton';
|
||||
import { useContext } from 'react';
|
||||
import { MULTI_ITEM_FIELD_DEFAULT_MAX_VALUES } from 'twenty-shared/constants';
|
||||
@@ -103,7 +103,7 @@ export const PhonesFieldInput = () => {
|
||||
primaryPhoneCallingCode: nextPrimaryPhone?.callingCode ?? '',
|
||||
additionalPhones: nextAdditionalPhones,
|
||||
};
|
||||
const parseResponse = phonesSchema.safeParse(nextValue);
|
||||
const parseResponse = phonesFieldValueSchema.safeParse(nextValue);
|
||||
if (parseResponse.success) {
|
||||
return parseResponse.data;
|
||||
}
|
||||
|
||||
+1
-1
@@ -49,7 +49,7 @@ export type FieldCurrencyDraftValue = {
|
||||
};
|
||||
export type FieldFullNameDraftValue = { firstName: string; lastName: string };
|
||||
export type FieldAddressDraftValue = {
|
||||
addressStreet1: string;
|
||||
addressStreet1: string | null;
|
||||
addressStreet2: string | null;
|
||||
addressCity: string | null;
|
||||
addressState: string | null;
|
||||
|
||||
+1
-1
@@ -256,7 +256,7 @@ export type FormFieldCurrencyValue = {
|
||||
};
|
||||
export type FieldFullNameValue = { firstName: string; lastName: string };
|
||||
export type FieldAddressValue = {
|
||||
addressStreet1: string;
|
||||
addressStreet1: string | null;
|
||||
addressStreet2: string | null;
|
||||
addressCity: string | null;
|
||||
addressState: string | null;
|
||||
|
||||
+16
-21
@@ -1,7 +1,4 @@
|
||||
import {
|
||||
isFieldAddressValue,
|
||||
addressSchema,
|
||||
} from '@/object-record/record-field/ui/types/guards/isFieldAddressValue';
|
||||
import { isFieldAddressValue } from '@/object-record/record-field/ui/types/guards/isFieldAddressValue';
|
||||
|
||||
describe('isFieldAddressValue', () => {
|
||||
it('should return true for valid address values', () => {
|
||||
@@ -34,6 +31,21 @@ describe('isFieldAddressValue', () => {
|
||||
).toBe(true);
|
||||
});
|
||||
|
||||
it('should return true when addressStreet1 is null but other subfields are filled', () => {
|
||||
expect(
|
||||
isFieldAddressValue({
|
||||
addressStreet1: null,
|
||||
addressStreet2: null,
|
||||
addressCity: 'Mountain View',
|
||||
addressState: null,
|
||||
addressPostcode: null,
|
||||
addressCountry: null,
|
||||
addressLat: null,
|
||||
addressLng: null,
|
||||
}),
|
||||
).toBe(true);
|
||||
});
|
||||
|
||||
it('should return false for incomplete address', () => {
|
||||
expect(isFieldAddressValue({ addressStreet1: '123 Main St' })).toBe(false);
|
||||
});
|
||||
@@ -43,20 +55,3 @@ describe('isFieldAddressValue', () => {
|
||||
expect(isFieldAddressValue('address')).toBe(false);
|
||||
});
|
||||
});
|
||||
|
||||
describe('addressSchema', () => {
|
||||
it('should parse a valid address', () => {
|
||||
const result = addressSchema.safeParse({
|
||||
addressStreet1: '123 Main St',
|
||||
addressStreet2: null,
|
||||
addressCity: 'Paris',
|
||||
addressState: null,
|
||||
addressPostcode: '75001',
|
||||
addressCountry: 'France',
|
||||
addressLat: null,
|
||||
addressLng: null,
|
||||
});
|
||||
|
||||
expect(result.success).toBe(true);
|
||||
});
|
||||
});
|
||||
|
||||
+2
-23
@@ -1,28 +1,7 @@
|
||||
import { z } from 'zod';
|
||||
|
||||
import { ALLOWED_ADDRESS_SUBFIELDS } from 'twenty-shared/types';
|
||||
import { type FieldAddressValue } from '@/object-record/record-field/ui/types/FieldMetadata';
|
||||
|
||||
export const addressSchema = z.object({
|
||||
addressStreet1: z.string(),
|
||||
addressStreet2: z.string().nullable(),
|
||||
addressCity: z.string().nullable(),
|
||||
addressState: z.string().nullable(),
|
||||
addressPostcode: z.string().nullable(),
|
||||
addressCountry: z.string().nullable(),
|
||||
addressLat: z.number().nullable(),
|
||||
addressLng: z.number().nullable(),
|
||||
});
|
||||
import { addressFieldValueSchema } from '@/object-record/record-field/ui/validation-schemas/addressFieldValueSchema';
|
||||
|
||||
export const isFieldAddressValue = (
|
||||
fieldValue: unknown,
|
||||
): fieldValue is FieldAddressValue =>
|
||||
addressSchema.safeParse(fieldValue).success;
|
||||
|
||||
export const addressSettingsSchema = z.object({
|
||||
subFields: z
|
||||
.array(z.enum(ALLOWED_ADDRESS_SUBFIELDS))
|
||||
.min(1)
|
||||
.optional()
|
||||
.nullable(),
|
||||
});
|
||||
addressFieldValueSchema.safeParse(fieldValue).success;
|
||||
|
||||
+3
-4
@@ -1,8 +1,7 @@
|
||||
import { type FieldArrayValue } from '@/object-record/record-field/ui/types/FieldMetadata';
|
||||
import { z } from 'zod';
|
||||
|
||||
export const arraySchema = z.union([z.null(), z.array(z.string())]);
|
||||
import { arrayFieldValueSchema } from '@/object-record/record-field/ui/validation-schemas/arrayFieldValueSchema';
|
||||
|
||||
export const isFieldArrayValue = (
|
||||
fieldValue: unknown,
|
||||
): fieldValue is FieldArrayValue => arraySchema.safeParse(fieldValue).success;
|
||||
): fieldValue is FieldArrayValue =>
|
||||
arrayFieldValueSchema.safeParse(fieldValue).success;
|
||||
|
||||
+2
-9
@@ -1,14 +1,7 @@
|
||||
import { z } from 'zod';
|
||||
|
||||
import { CurrencyCode } from 'twenty-shared/constants';
|
||||
import { type FieldCurrencyValue } from '@/object-record/record-field/ui/types/FieldMetadata';
|
||||
|
||||
const currencySchema = z.object({
|
||||
currencyCode: z.union([z.enum(CurrencyCode), z.literal('')]).nullable(),
|
||||
amountMicros: z.number().nullable(),
|
||||
});
|
||||
import { currencyFieldValueSchema } from '@/object-record/record-field/ui/validation-schemas/currencyFieldValueSchema';
|
||||
|
||||
export const isFieldCurrencyValue = (
|
||||
fieldValue: unknown,
|
||||
): fieldValue is FieldCurrencyValue =>
|
||||
currencySchema.safeParse(fieldValue).success;
|
||||
currencyFieldValueSchema.safeParse(fieldValue).success;
|
||||
|
||||
+3
-8
@@ -1,12 +1,7 @@
|
||||
import { z } from 'zod';
|
||||
|
||||
import { type FieldEmailsValue } from '@/object-record/record-field/ui/types/FieldMetadata';
|
||||
|
||||
export const emailsSchema = z.object({
|
||||
primaryEmail: z.string(),
|
||||
additionalEmails: z.array(z.string()).nullable(),
|
||||
}) satisfies z.ZodType<FieldEmailsValue>;
|
||||
import { emailsFieldValueSchema } from '@/object-record/record-field/ui/validation-schemas/emailsFieldValueSchema';
|
||||
|
||||
export const isFieldEmailsValue = (
|
||||
fieldValue: unknown,
|
||||
): fieldValue is FieldEmailsValue => emailsSchema.safeParse(fieldValue).success;
|
||||
): fieldValue is FieldEmailsValue =>
|
||||
emailsFieldValueSchema.safeParse(fieldValue).success;
|
||||
|
||||
+3
-22
@@ -1,26 +1,7 @@
|
||||
import { type FieldFilesValue } from '@/object-record/record-field/ui/types/FieldMetadata';
|
||||
import { z } from 'zod';
|
||||
import { filesFieldValueSchema } from '@/object-record/record-field/ui/validation-schemas/filesFieldValueSchema';
|
||||
|
||||
const fileSchema = z.object({
|
||||
fileId: z.string(),
|
||||
label: z.string(),
|
||||
extension: z.string().optional(),
|
||||
url: z.string().optional(),
|
||||
fileCategory: z
|
||||
.enum([
|
||||
'ARCHIVE',
|
||||
'AUDIO',
|
||||
'IMAGE',
|
||||
'PRESENTATION',
|
||||
'SPREADSHEET',
|
||||
'TEXT_DOCUMENT',
|
||||
'VIDEO',
|
||||
'OTHER',
|
||||
] as const)
|
||||
.optional(),
|
||||
});
|
||||
|
||||
export const filesSchema = z.array(fileSchema);
|
||||
export const isFieldFilesValue = (
|
||||
fieldValue: unknown,
|
||||
): fieldValue is FieldFilesValue[] => filesSchema.safeParse(fieldValue).success;
|
||||
): fieldValue is FieldFilesValue[] =>
|
||||
filesFieldValueSchema.safeParse(fieldValue).success;
|
||||
|
||||
+2
-8
@@ -1,13 +1,7 @@
|
||||
import { z } from 'zod';
|
||||
|
||||
import { type FieldFullNameValue } from '@/object-record/record-field/ui/types/FieldMetadata';
|
||||
|
||||
const fullnameSchema = z.object({
|
||||
firstName: z.string(),
|
||||
lastName: z.string(),
|
||||
});
|
||||
import { fullNameFieldValueSchema } from '@/object-record/record-field/ui/validation-schemas/fullNameFieldValueSchema';
|
||||
|
||||
export const isFieldFullNameValue = (
|
||||
fieldValue: unknown,
|
||||
): fieldValue is FieldFullNameValue =>
|
||||
fullnameSchema.safeParse(fieldValue).success;
|
||||
fullNameFieldValueSchema.safeParse(fieldValue).success;
|
||||
|
||||
+3
-15
@@ -1,19 +1,7 @@
|
||||
import { z } from 'zod';
|
||||
import { type FieldLinksValue } from '@/object-record/record-field/ui/types/FieldMetadata';
|
||||
|
||||
export const linksSchema = z.object({
|
||||
primaryLinkLabel: z.string().nullable(),
|
||||
primaryLinkUrl: z.string().nullable(),
|
||||
secondaryLinks: z
|
||||
.array(
|
||||
z.object({
|
||||
label: z.string().nullable(),
|
||||
url: z.string().nullable(),
|
||||
}),
|
||||
)
|
||||
.nullable(),
|
||||
}) satisfies z.ZodType<FieldLinksValue>;
|
||||
import { linksFieldValueSchema } from '@/object-record/record-field/ui/validation-schemas/linksFieldValueSchema';
|
||||
|
||||
export const isFieldLinksValue = (
|
||||
fieldValue: unknown,
|
||||
): fieldValue is FieldLinksValue => linksSchema.safeParse(fieldValue).success;
|
||||
): fieldValue is FieldLinksValue =>
|
||||
linksFieldValueSchema.safeParse(fieldValue).success;
|
||||
|
||||
+3
-18
@@ -1,22 +1,7 @@
|
||||
import { z } from 'zod';
|
||||
|
||||
import { type FieldPhonesValue } from '@/object-record/record-field/ui/types/FieldMetadata';
|
||||
|
||||
export const phonesSchema = z.object({
|
||||
primaryPhoneNumber: z.string(),
|
||||
primaryPhoneCountryCode: z.string(),
|
||||
primaryPhoneCallingCode: z.string(),
|
||||
additionalPhones: z
|
||||
.array(
|
||||
z.object({
|
||||
number: z.string(),
|
||||
callingCode: z.string(),
|
||||
countryCode: z.string(),
|
||||
}),
|
||||
)
|
||||
.nullable(),
|
||||
}) satisfies z.ZodType<FieldPhonesValue>;
|
||||
import { phonesFieldValueSchema } from '@/object-record/record-field/ui/validation-schemas/phonesFieldValueSchema';
|
||||
|
||||
export const isFieldPhonesValue = (
|
||||
fieldValue: unknown,
|
||||
): fieldValue is FieldPhonesValue => phonesSchema.safeParse(fieldValue).success;
|
||||
): fieldValue is FieldPhonesValue =>
|
||||
phonesFieldValueSchema.safeParse(fieldValue).success;
|
||||
|
||||
+3
-23
@@ -1,27 +1,7 @@
|
||||
import { z } from 'zod';
|
||||
|
||||
import {
|
||||
type FieldJsonValue,
|
||||
type Json,
|
||||
} from '@/object-record/record-field/ui/types/FieldMetadata';
|
||||
|
||||
// See https://zod.dev/?id=json-type
|
||||
const literalSchema = z.union([z.string(), z.number(), z.boolean(), z.null()]);
|
||||
const jsonSchema: z.ZodType<Json> = z.lazy(() =>
|
||||
z.union([
|
||||
literalSchema,
|
||||
z.array(jsonSchema),
|
||||
z.record(z.string(), jsonSchema),
|
||||
]),
|
||||
);
|
||||
|
||||
export const jsonWithoutLiteralsSchema: z.ZodType<FieldJsonValue> = z.union([
|
||||
z.null(), // Exclude literal values other than null
|
||||
z.array(jsonSchema),
|
||||
z.record(z.string(), jsonSchema),
|
||||
]);
|
||||
import { type FieldJsonValue } from '@/object-record/record-field/ui/types/FieldMetadata';
|
||||
import { rawJsonFieldValueSchema } from '@/object-record/record-field/ui/validation-schemas/rawJsonFieldValueSchema';
|
||||
|
||||
export const isFieldRawJsonValue = (
|
||||
fieldValue: unknown,
|
||||
): fieldValue is FieldJsonValue =>
|
||||
jsonWithoutLiteralsSchema.safeParse(fieldValue).success;
|
||||
rawJsonFieldValueSchema.safeParse(fieldValue).success;
|
||||
|
||||
+2
-7
@@ -1,12 +1,7 @@
|
||||
import { type FieldRichTextValue } from '@/object-record/record-field/ui/types/FieldMetadata';
|
||||
import { z } from 'zod';
|
||||
|
||||
export const richTextSchema: z.ZodType<FieldRichTextValue> = z.object({
|
||||
blocknote: z.string().nullable(),
|
||||
markdown: z.string().nullable(),
|
||||
});
|
||||
import { richTextFieldValueSchema } from '@/object-record/record-field/ui/validation-schemas/richTextFieldValueSchema';
|
||||
|
||||
export const isFieldRichTextValue = (
|
||||
fieldValue: unknown,
|
||||
): fieldValue is FieldRichTextValue =>
|
||||
richTextSchema.safeParse(fieldValue).success;
|
||||
richTextFieldValueSchema.safeParse(fieldValue).success;
|
||||
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
import { ALLOWED_ADDRESS_SUBFIELDS } from 'twenty-shared/types';
|
||||
import { z } from 'zod';
|
||||
|
||||
export const addressFieldSettingsSchema = z.object({
|
||||
subFields: z
|
||||
.array(z.enum(ALLOWED_ADDRESS_SUBFIELDS))
|
||||
.min(1)
|
||||
.optional()
|
||||
.nullable(),
|
||||
});
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
import { z } from 'zod';
|
||||
|
||||
export const addressFieldValueSchema = z.object({
|
||||
addressStreet1: z.string().nullable(),
|
||||
addressStreet2: z.string().nullable(),
|
||||
addressCity: z.string().nullable(),
|
||||
addressState: z.string().nullable(),
|
||||
addressPostcode: z.string().nullable(),
|
||||
addressCountry: z.string().nullable(),
|
||||
addressLat: z.number().nullable(),
|
||||
addressLng: z.number().nullable(),
|
||||
});
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
import { z } from 'zod';
|
||||
|
||||
export const arrayFieldValueSchema = z.union([z.null(), z.array(z.string())]);
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
import { CurrencyCode } from 'twenty-shared/constants';
|
||||
import { z } from 'zod';
|
||||
|
||||
export const currencyFieldValueSchema = z.object({
|
||||
currencyCode: z.union([z.enum(CurrencyCode), z.literal('')]).nullable(),
|
||||
amountMicros: z.number().nullable(),
|
||||
});
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
import { z } from 'zod';
|
||||
|
||||
import { type FieldEmailsValue } from '@/object-record/record-field/ui/types/FieldMetadata';
|
||||
|
||||
export const emailsFieldValueSchema = z.object({
|
||||
primaryEmail: z.string(),
|
||||
additionalEmails: z.array(z.string()).nullable(),
|
||||
}) satisfies z.ZodType<FieldEmailsValue>;
|
||||
+22
@@ -0,0 +1,22 @@
|
||||
import { z } from 'zod';
|
||||
|
||||
const fileSchema = z.object({
|
||||
fileId: z.string(),
|
||||
label: z.string(),
|
||||
extension: z.string().optional(),
|
||||
url: z.string().optional(),
|
||||
fileCategory: z
|
||||
.enum([
|
||||
'ARCHIVE',
|
||||
'AUDIO',
|
||||
'IMAGE',
|
||||
'PRESENTATION',
|
||||
'SPREADSHEET',
|
||||
'TEXT_DOCUMENT',
|
||||
'VIDEO',
|
||||
'OTHER',
|
||||
] as const)
|
||||
.optional(),
|
||||
});
|
||||
|
||||
export const filesFieldValueSchema = z.array(fileSchema);
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
import { z } from 'zod';
|
||||
|
||||
export const fullNameFieldValueSchema = z.object({
|
||||
firstName: z.string(),
|
||||
lastName: z.string(),
|
||||
});
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
import { z } from 'zod';
|
||||
|
||||
import { type FieldLinksValue } from '@/object-record/record-field/ui/types/FieldMetadata';
|
||||
|
||||
export const linksFieldValueSchema = z.object({
|
||||
primaryLinkLabel: z.string().nullable(),
|
||||
primaryLinkUrl: z.string().nullable(),
|
||||
secondaryLinks: z
|
||||
.array(
|
||||
z.object({
|
||||
label: z.string().nullable(),
|
||||
url: z.string().nullable(),
|
||||
}),
|
||||
)
|
||||
.nullable(),
|
||||
}) satisfies z.ZodType<FieldLinksValue>;
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
import { z } from 'zod';
|
||||
|
||||
import { type FieldPhonesValue } from '@/object-record/record-field/ui/types/FieldMetadata';
|
||||
|
||||
export const phonesFieldValueSchema = z.object({
|
||||
primaryPhoneNumber: z.string(),
|
||||
primaryPhoneCountryCode: z.string(),
|
||||
primaryPhoneCallingCode: z.string().optional(),
|
||||
additionalPhones: z
|
||||
.array(
|
||||
z.object({
|
||||
number: z.string(),
|
||||
callingCode: z.string(),
|
||||
countryCode: z.string(),
|
||||
}),
|
||||
)
|
||||
.nullable(),
|
||||
}) satisfies z.ZodType<FieldPhonesValue>;
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user