[CHORE] Avoid isDefined duplicated reference, move it to twenty-shared (#9967)
# Introduction Avoid having multiple `isDefined` definition across our pacakges Also avoid importing `isDefined` from `twenty-ui` which exposes a huge barrel for a such little util function ## In a nutshell Removed own `isDefined.ts` definition from `twenty-ui` `twenty-front` and `twenty-server` to move it to `twenty-shared`. Updated imports for each packages, and added explicit dependencies to `twenty-shared` if not already in place Related PR https://github.com/twentyhq/twenty/pull/9941
This commit is contained in:
@ -6,5 +6,8 @@
|
|||||||
"type": "module",
|
"type": "module",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "npx vite build"
|
"build": "npx vite build"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"twenty-shared": "workspace:*"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
import { isDefined } from '~/utils/isDefined';
|
import { isDefined } from 'twenty-shared';
|
||||||
|
|
||||||
// Open options page programmatically in a new tab.
|
// Open options page programmatically in a new tab.
|
||||||
// chrome.runtime.onInstalled.addListener((details) => {
|
// chrome.runtime.onInstalled.addListener((details) => {
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
import { isDefined } from '~/utils/isDefined';
|
import { isDefined } from 'twenty-shared';
|
||||||
|
|
||||||
interface CustomDiv extends HTMLDivElement {
|
interface CustomDiv extends HTMLDivElement {
|
||||||
onClickHandler: (newHandler: () => void) => void;
|
onClickHandler: (newHandler: () => void) => void;
|
||||||
|
|||||||
@ -1,10 +1,10 @@
|
|||||||
|
import { isDefined } from 'twenty-shared';
|
||||||
import { createDefaultButton } from '~/contentScript/createButton';
|
import { createDefaultButton } from '~/contentScript/createButton';
|
||||||
import changeSidePanelUrl from '~/contentScript/utils/changeSidepanelUrl';
|
import changeSidePanelUrl from '~/contentScript/utils/changeSidepanelUrl';
|
||||||
import extractCompanyLinkedinLink from '~/contentScript/utils/extractCompanyLinkedinLink';
|
import extractCompanyLinkedinLink from '~/contentScript/utils/extractCompanyLinkedinLink';
|
||||||
import extractDomain from '~/contentScript/utils/extractDomain';
|
import extractDomain from '~/contentScript/utils/extractDomain';
|
||||||
import { createCompany, fetchCompany } from '~/db/company.db';
|
import { createCompany, fetchCompany } from '~/db/company.db';
|
||||||
import { CompanyInput } from '~/db/types/company.types';
|
import { CompanyInput } from '~/db/types/company.types';
|
||||||
import { isDefined } from '~/utils/isDefined';
|
|
||||||
|
|
||||||
export const checkIfCompanyExists = async () => {
|
export const checkIfCompanyExists = async () => {
|
||||||
const { tab: activeTab } = await chrome.runtime.sendMessage({
|
const { tab: activeTab } = await chrome.runtime.sendMessage({
|
||||||
|
|||||||
@ -1,9 +1,9 @@
|
|||||||
|
import { isDefined } from 'twenty-shared';
|
||||||
import { createDefaultButton } from '~/contentScript/createButton';
|
import { createDefaultButton } from '~/contentScript/createButton';
|
||||||
import changeSidePanelUrl from '~/contentScript/utils/changeSidepanelUrl';
|
import changeSidePanelUrl from '~/contentScript/utils/changeSidepanelUrl';
|
||||||
import extractFirstAndLastName from '~/contentScript/utils/extractFirstAndLastName';
|
import extractFirstAndLastName from '~/contentScript/utils/extractFirstAndLastName';
|
||||||
import { createPerson, fetchPerson } from '~/db/person.db';
|
import { createPerson, fetchPerson } from '~/db/person.db';
|
||||||
import { PersonInput } from '~/db/types/person.types';
|
import { PersonInput } from '~/db/types/person.types';
|
||||||
import { isDefined } from '~/utils/isDefined';
|
|
||||||
|
|
||||||
export const checkIfPersonExists = async () => {
|
export const checkIfPersonExists = async () => {
|
||||||
const { tab: activeTab } = await chrome.runtime.sendMessage({
|
const { tab: activeTab } = await chrome.runtime.sendMessage({
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
|
import { isDefined } from 'twenty-shared';
|
||||||
import { insertButtonForCompany } from '~/contentScript/extractCompanyProfile';
|
import { insertButtonForCompany } from '~/contentScript/extractCompanyProfile';
|
||||||
import { insertButtonForPerson } from '~/contentScript/extractPersonProfile';
|
import { insertButtonForPerson } from '~/contentScript/extractPersonProfile';
|
||||||
import { isDefined } from '~/utils/isDefined';
|
|
||||||
|
|
||||||
// Inject buttons into the DOM when SPA is reloaded on the resource url.
|
// Inject buttons into the DOM when SPA is reloaded on the resource url.
|
||||||
// e.g. reload the page when on https://www.linkedin.com/in/mabdullahabaid/
|
// e.g. reload the page when on https://www.linkedin.com/in/mabdullahabaid/
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
import { isDefined } from '~/utils/isDefined';
|
import { isDefined } from 'twenty-shared';
|
||||||
|
|
||||||
const btn = document.getElementById('twenty-settings-btn');
|
const btn = document.getElementById('twenty-settings-btn');
|
||||||
if (!isDefined(btn)) {
|
if (!isDefined(btn)) {
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
import { isDefined } from '~/utils/isDefined';
|
import { isDefined } from 'twenty-shared';
|
||||||
|
|
||||||
const changeSidePanelUrl = async (url: string) => {
|
const changeSidePanelUrl = async (url: string) => {
|
||||||
if (isDefined(url)) {
|
if (isDefined(url)) {
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
// Extract "https://www.linkedin.com/company/twenty/" from any of the following urls, which the user can visit while on the company page.
|
// Extract "https://www.linkedin.com/company/twenty/" from any of the following urls, which the user can visit while on the company page.
|
||||||
|
|
||||||
import { isDefined } from '~/utils/isDefined';
|
import { isDefined } from 'twenty-shared';
|
||||||
|
|
||||||
// "https://www.linkedin.com/company/twenty/" "https://www.linkedin.com/company/twenty/about/" "https://www.linkedin.com/company/twenty/people/".
|
// "https://www.linkedin.com/company/twenty/" "https://www.linkedin.com/company/twenty/about/" "https://www.linkedin.com/company/twenty/people/".
|
||||||
const extractCompanyLinkedinLink = (activeTabUrl: string) => {
|
const extractCompanyLinkedinLink = (activeTabUrl: string) => {
|
||||||
|
|||||||
@ -1,10 +1,10 @@
|
|||||||
|
import { isDefined } from 'twenty-shared';
|
||||||
import {
|
import {
|
||||||
ExchangeAuthCodeInput,
|
ExchangeAuthCodeInput,
|
||||||
ExchangeAuthCodeResponse,
|
ExchangeAuthCodeResponse,
|
||||||
Tokens,
|
Tokens,
|
||||||
} from '~/db/types/auth.types';
|
} from '~/db/types/auth.types';
|
||||||
import { EXCHANGE_AUTHORIZATION_CODE } from '~/graphql/auth/mutations';
|
import { EXCHANGE_AUTHORIZATION_CODE } from '~/graphql/auth/mutations';
|
||||||
import { isDefined } from '~/utils/isDefined';
|
|
||||||
import { callMutation } from '~/utils/requestDb';
|
import { callMutation } from '~/utils/requestDb';
|
||||||
|
|
||||||
export const exchangeAuthorizationCode = async (
|
export const exchangeAuthorizationCode = async (
|
||||||
|
|||||||
@ -1,3 +1,4 @@
|
|||||||
|
import { isDefined } from 'twenty-shared';
|
||||||
import {
|
import {
|
||||||
CompanyInput,
|
CompanyInput,
|
||||||
CreateCompanyResponse,
|
CreateCompanyResponse,
|
||||||
@ -6,7 +7,6 @@ import {
|
|||||||
import { Company, CompanyFilterInput } from '~/generated/graphql';
|
import { Company, CompanyFilterInput } from '~/generated/graphql';
|
||||||
import { CREATE_COMPANY } from '~/graphql/company/mutations';
|
import { CREATE_COMPANY } from '~/graphql/company/mutations';
|
||||||
import { FIND_COMPANY } from '~/graphql/company/queries';
|
import { FIND_COMPANY } from '~/graphql/company/queries';
|
||||||
import { isDefined } from '~/utils/isDefined';
|
|
||||||
|
|
||||||
import { callMutation, callQuery } from '../utils/requestDb';
|
import { callMutation, callQuery } from '../utils/requestDb';
|
||||||
|
|
||||||
|
|||||||
@ -1,3 +1,4 @@
|
|||||||
|
import { isDefined } from 'twenty-shared';
|
||||||
import {
|
import {
|
||||||
CreatePersonResponse,
|
CreatePersonResponse,
|
||||||
FindPersonResponse,
|
FindPersonResponse,
|
||||||
@ -6,7 +7,6 @@ import {
|
|||||||
import { Person, PersonFilterInput } from '~/generated/graphql';
|
import { Person, PersonFilterInput } from '~/generated/graphql';
|
||||||
import { CREATE_PERSON } from '~/graphql/person/mutations';
|
import { CREATE_PERSON } from '~/graphql/person/mutations';
|
||||||
import { FIND_PERSON } from '~/graphql/person/queries';
|
import { FIND_PERSON } from '~/graphql/person/queries';
|
||||||
import { isDefined } from '~/utils/isDefined';
|
|
||||||
|
|
||||||
import { callMutation, callQuery } from '../utils/requestDb';
|
import { callMutation, callQuery } from '../utils/requestDb';
|
||||||
|
|
||||||
|
|||||||
@ -1,8 +1,8 @@
|
|||||||
import { ApolloClient, InMemoryCache } from '@apollo/client';
|
import { ApolloClient, InMemoryCache } from '@apollo/client';
|
||||||
|
|
||||||
|
import { isDefined } from 'twenty-shared';
|
||||||
import { Tokens } from '~/db/types/auth.types';
|
import { Tokens } from '~/db/types/auth.types';
|
||||||
import { RENEW_TOKEN } from '~/graphql/auth/mutations';
|
import { RENEW_TOKEN } from '~/graphql/auth/mutations';
|
||||||
import { isDefined } from '~/utils/isDefined';
|
|
||||||
|
|
||||||
export const renewToken = async (
|
export const renewToken = async (
|
||||||
appToken: string,
|
appToken: string,
|
||||||
|
|||||||
@ -1,8 +1,8 @@
|
|||||||
import { useEffect, useState } from 'react';
|
import { useEffect, useState } from 'react';
|
||||||
|
|
||||||
|
import { isDefined } from 'twenty-shared';
|
||||||
import Settings from '~/options/Settings';
|
import Settings from '~/options/Settings';
|
||||||
import Sidepanel from '~/options/Sidepanel';
|
import Sidepanel from '~/options/Sidepanel';
|
||||||
import { isDefined } from '~/utils/isDefined';
|
|
||||||
|
|
||||||
const App = () => {
|
const App = () => {
|
||||||
const [currentScreen, setCurrentScreen] = useState('');
|
const [currentScreen, setCurrentScreen] = useState('');
|
||||||
|
|||||||
@ -1,10 +1,10 @@
|
|||||||
import { useEffect, useState } from 'react';
|
|
||||||
import styled from '@emotion/styled';
|
import styled from '@emotion/styled';
|
||||||
|
import { useEffect, useState } from 'react';
|
||||||
|
|
||||||
import { MainButton } from '@/ui/input/button/MainButton';
|
import { MainButton } from '@/ui/input/button/MainButton';
|
||||||
import { TextInput } from '@/ui/input/components/TextInput';
|
import { TextInput } from '@/ui/input/components/TextInput';
|
||||||
|
import { isDefined } from 'twenty-shared';
|
||||||
import { clearStore } from '~/utils/apolloClient';
|
import { clearStore } from '~/utils/apolloClient';
|
||||||
import { isDefined } from '~/utils/isDefined';
|
|
||||||
|
|
||||||
const StyledWrapper = styled.div`
|
const StyledWrapper = styled.div`
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
|||||||
@ -1,8 +1,8 @@
|
|||||||
import { useCallback, useEffect, useRef, useState } from 'react';
|
|
||||||
import styled from '@emotion/styled';
|
import styled from '@emotion/styled';
|
||||||
|
import { useCallback, useEffect, useRef, useState } from 'react';
|
||||||
|
|
||||||
import { MainButton } from '@/ui/input/button/MainButton';
|
import { MainButton } from '@/ui/input/button/MainButton';
|
||||||
import { isDefined } from '~/utils/isDefined';
|
import { isDefined } from 'twenty-shared';
|
||||||
|
|
||||||
const StyledIframe = styled.iframe`
|
const StyledIframe = styled.iframe`
|
||||||
display: block;
|
display: block;
|
||||||
|
|||||||
@ -1,8 +1,8 @@
|
|||||||
import { useEffect, useState } from 'react';
|
|
||||||
import styled from '@emotion/styled';
|
import styled from '@emotion/styled';
|
||||||
import { motion } from 'framer-motion';
|
import { motion } from 'framer-motion';
|
||||||
|
import { useEffect, useState } from 'react';
|
||||||
|
|
||||||
import { isDefined } from '~/utils/isDefined';
|
import { isDefined } from 'twenty-shared';
|
||||||
|
|
||||||
export type ToggleSize = 'small' | 'medium';
|
export type ToggleSize = 'small' | 'medium';
|
||||||
|
|
||||||
|
|||||||
@ -2,7 +2,7 @@ import { ApolloClient, from, HttpLink, InMemoryCache } from '@apollo/client';
|
|||||||
import { setContext } from '@apollo/client/link/context';
|
import { setContext } from '@apollo/client/link/context';
|
||||||
import { onError } from '@apollo/client/link/error';
|
import { onError } from '@apollo/client/link/error';
|
||||||
|
|
||||||
import { isDefined } from '~/utils/isDefined';
|
import { isDefined } from 'twenty-shared';
|
||||||
|
|
||||||
export const clearStore = () => {
|
export const clearStore = () => {
|
||||||
chrome.storage.local.remove([
|
chrome.storage.local.remove([
|
||||||
|
|||||||
@ -1,8 +1,8 @@
|
|||||||
import { OperationVariables } from '@apollo/client';
|
import { OperationVariables } from '@apollo/client';
|
||||||
import { DocumentNode } from 'graphql';
|
import { DocumentNode } from 'graphql';
|
||||||
|
|
||||||
|
import { isDefined } from 'twenty-shared';
|
||||||
import getApolloClient from '~/utils/apolloClient';
|
import getApolloClient from '~/utils/apolloClient';
|
||||||
import { isDefined } from '~/utils/isDefined';
|
|
||||||
|
|
||||||
export const callQuery = async <T>(
|
export const callQuery = async <T>(
|
||||||
query: DocumentNode,
|
query: DocumentNode,
|
||||||
|
|||||||
@ -5,7 +5,7 @@ import { scrollWrapperInstanceComponentState } from '@/ui/utilities/scroll/state
|
|||||||
import { scrollWrapperScrollTopComponentState } from '@/ui/utilities/scroll/states/scrollWrapperScrollTopComponentState';
|
import { scrollWrapperScrollTopComponentState } from '@/ui/utilities/scroll/states/scrollWrapperScrollTopComponentState';
|
||||||
import { useRecoilComponentStateV2 } from '@/ui/utilities/state/component-state/hooks/useRecoilComponentStateV2';
|
import { useRecoilComponentStateV2 } from '@/ui/utilities/state/component-state/hooks/useRecoilComponentStateV2';
|
||||||
import { useRecoilComponentValueV2 } from '@/ui/utilities/state/component-state/hooks/useRecoilComponentValueV2';
|
import { useRecoilComponentValueV2 } from '@/ui/utilities/state/component-state/hooks/useRecoilComponentValueV2';
|
||||||
import { isDefined } from '~/utils/isDefined';
|
import { isDefined } from 'twenty-shared';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @deprecated We should now use useScrollToPosition instead
|
* @deprecated We should now use useScrollToPosition instead
|
||||||
|
|||||||
@ -9,7 +9,7 @@ import { objectMetadataItemsState } from '@/object-metadata/states/objectMetadat
|
|||||||
import { useRecoilComponentValueV2 } from '@/ui/utilities/state/component-state/hooks/useRecoilComponentValueV2';
|
import { useRecoilComponentValueV2 } from '@/ui/utilities/state/component-state/hooks/useRecoilComponentValueV2';
|
||||||
import { useIsFeatureEnabled } from '@/workspace/hooks/useIsFeatureEnabled';
|
import { useIsFeatureEnabled } from '@/workspace/hooks/useIsFeatureEnabled';
|
||||||
import { useRecoilValue } from 'recoil';
|
import { useRecoilValue } from 'recoil';
|
||||||
import { isDefined } from 'twenty-ui';
|
import { isDefined } from 'twenty-shared';
|
||||||
import { FeatureFlagKey } from '~/generated/graphql';
|
import { FeatureFlagKey } from '~/generated/graphql';
|
||||||
|
|
||||||
export const RecordActionMenuEntriesSetter = () => {
|
export const RecordActionMenuEntriesSetter = () => {
|
||||||
|
|||||||
@ -14,7 +14,7 @@ import { useRecordTable } from '@/object-record/record-table/hooks/useRecordTabl
|
|||||||
import { ConfirmationModal } from '@/ui/layout/modal/components/ConfirmationModal';
|
import { ConfirmationModal } from '@/ui/layout/modal/components/ConfirmationModal';
|
||||||
import { useRecoilComponentValueV2 } from '@/ui/utilities/state/component-state/hooks/useRecoilComponentValueV2';
|
import { useRecoilComponentValueV2 } from '@/ui/utilities/state/component-state/hooks/useRecoilComponentValueV2';
|
||||||
import { useCallback, useState } from 'react';
|
import { useCallback, useState } from 'react';
|
||||||
import { isDefined } from 'twenty-ui';
|
import { isDefined } from 'twenty-shared';
|
||||||
|
|
||||||
export const useDeleteMultipleRecordsAction: ActionHookWithObjectMetadataItem =
|
export const useDeleteMultipleRecordsAction: ActionHookWithObjectMetadataItem =
|
||||||
({ objectMetadataItem }) => {
|
({ objectMetadataItem }) => {
|
||||||
|
|||||||
@ -5,7 +5,7 @@ import { useFavorites } from '@/favorites/hooks/useFavorites';
|
|||||||
import { recordStoreFamilyState } from '@/object-record/record-store/states/recordStoreFamilyState';
|
import { recordStoreFamilyState } from '@/object-record/record-store/states/recordStoreFamilyState';
|
||||||
import { isNull } from '@sniptt/guards';
|
import { isNull } from '@sniptt/guards';
|
||||||
import { useRecoilValue } from 'recoil';
|
import { useRecoilValue } from 'recoil';
|
||||||
import { isDefined } from 'twenty-ui';
|
import { isDefined } from 'twenty-shared';
|
||||||
|
|
||||||
export const useAddToFavoritesSingleRecordAction: ActionHookWithObjectMetadataItem =
|
export const useAddToFavoritesSingleRecordAction: ActionHookWithObjectMetadataItem =
|
||||||
({ objectMetadataItem }) => {
|
({ objectMetadataItem }) => {
|
||||||
|
|||||||
@ -11,7 +11,7 @@ import { useRightDrawer } from '@/ui/layout/right-drawer/hooks/useRightDrawer';
|
|||||||
import { isNull } from '@sniptt/guards';
|
import { isNull } from '@sniptt/guards';
|
||||||
import { useCallback, useContext, useState } from 'react';
|
import { useCallback, useContext, useState } from 'react';
|
||||||
import { useRecoilValue } from 'recoil';
|
import { useRecoilValue } from 'recoil';
|
||||||
import { isDefined } from 'twenty-ui';
|
import { isDefined } from 'twenty-shared';
|
||||||
|
|
||||||
export const useDeleteSingleRecordAction: ActionHookWithObjectMetadataItem = ({
|
export const useDeleteSingleRecordAction: ActionHookWithObjectMetadataItem = ({
|
||||||
objectMetadataItem,
|
objectMetadataItem,
|
||||||
|
|||||||
@ -9,7 +9,7 @@ import { ConfirmationModal } from '@/ui/layout/modal/components/ConfirmationModa
|
|||||||
import { useRightDrawer } from '@/ui/layout/right-drawer/hooks/useRightDrawer';
|
import { useRightDrawer } from '@/ui/layout/right-drawer/hooks/useRightDrawer';
|
||||||
import { useCallback, useContext, useState } from 'react';
|
import { useCallback, useContext, useState } from 'react';
|
||||||
import { useRecoilValue } from 'recoil';
|
import { useRecoilValue } from 'recoil';
|
||||||
import { isDefined } from 'twenty-ui';
|
import { isDefined } from 'twenty-shared';
|
||||||
import { useNavigateApp } from '~/hooks/useNavigateApp';
|
import { useNavigateApp } from '~/hooks/useNavigateApp';
|
||||||
|
|
||||||
export const useDestroySingleRecordAction: ActionHookWithObjectMetadataItem = ({
|
export const useDestroySingleRecordAction: ActionHookWithObjectMetadataItem = ({
|
||||||
|
|||||||
@ -4,7 +4,7 @@ import { CoreObjectNameSingular } from '@/object-metadata/types/CoreObjectNameSi
|
|||||||
import { recordStoreFamilyState } from '@/object-record/record-store/states/recordStoreFamilyState';
|
import { recordStoreFamilyState } from '@/object-record/record-store/states/recordStoreFamilyState';
|
||||||
import { BlockNoteEditor } from '@blocknote/core';
|
import { BlockNoteEditor } from '@blocknote/core';
|
||||||
import { useRecoilValue } from 'recoil';
|
import { useRecoilValue } from 'recoil';
|
||||||
import { isDefined } from 'twenty-ui';
|
import { isDefined } from 'twenty-shared';
|
||||||
|
|
||||||
export const useExportNoteAction: ActionHookWithObjectMetadataItem = ({
|
export const useExportNoteAction: ActionHookWithObjectMetadataItem = ({
|
||||||
objectMetadataItem,
|
objectMetadataItem,
|
||||||
|
|||||||
@ -2,7 +2,7 @@ import { useSelectedRecordIdOrThrow } from '@/action-menu/actions/record-actions
|
|||||||
import { ActionHookWithObjectMetadataItem } from '@/action-menu/actions/types/ActionHook';
|
import { ActionHookWithObjectMetadataItem } from '@/action-menu/actions/types/ActionHook';
|
||||||
import { useDeleteFavorite } from '@/favorites/hooks/useDeleteFavorite';
|
import { useDeleteFavorite } from '@/favorites/hooks/useDeleteFavorite';
|
||||||
import { useFavorites } from '@/favorites/hooks/useFavorites';
|
import { useFavorites } from '@/favorites/hooks/useFavorites';
|
||||||
import { isDefined } from 'twenty-ui';
|
import { isDefined } from 'twenty-shared';
|
||||||
|
|
||||||
export const useRemoveFromFavoritesSingleRecordAction: ActionHookWithObjectMetadataItem =
|
export const useRemoveFromFavoritesSingleRecordAction: ActionHookWithObjectMetadataItem =
|
||||||
({ objectMetadataItem }) => {
|
({ objectMetadataItem }) => {
|
||||||
|
|||||||
@ -2,7 +2,7 @@ import { useSelectedRecordIdOrThrow } from '@/action-menu/actions/record-actions
|
|||||||
import { ActionHookWithoutObjectMetadataItem } from '@/action-menu/actions/types/ActionHook';
|
import { ActionHookWithoutObjectMetadataItem } from '@/action-menu/actions/types/ActionHook';
|
||||||
import { useActivateWorkflowVersion } from '@/workflow/hooks/useActivateWorkflowVersion';
|
import { useActivateWorkflowVersion } from '@/workflow/hooks/useActivateWorkflowVersion';
|
||||||
import { useWorkflowWithCurrentVersion } from '@/workflow/hooks/useWorkflowWithCurrentVersion';
|
import { useWorkflowWithCurrentVersion } from '@/workflow/hooks/useWorkflowWithCurrentVersion';
|
||||||
import { isDefined } from 'twenty-ui';
|
import { isDefined } from 'twenty-shared';
|
||||||
|
|
||||||
export const useActivateWorkflowSingleRecordAction: ActionHookWithoutObjectMetadataItem =
|
export const useActivateWorkflowSingleRecordAction: ActionHookWithoutObjectMetadataItem =
|
||||||
() => {
|
() => {
|
||||||
|
|||||||
@ -2,7 +2,7 @@ import { useSelectedRecordIdOrThrow } from '@/action-menu/actions/record-actions
|
|||||||
import { ActionHookWithoutObjectMetadataItem } from '@/action-menu/actions/types/ActionHook';
|
import { ActionHookWithoutObjectMetadataItem } from '@/action-menu/actions/types/ActionHook';
|
||||||
import { useDeactivateWorkflowVersion } from '@/workflow/hooks/useDeactivateWorkflowVersion';
|
import { useDeactivateWorkflowVersion } from '@/workflow/hooks/useDeactivateWorkflowVersion';
|
||||||
import { useWorkflowWithCurrentVersion } from '@/workflow/hooks/useWorkflowWithCurrentVersion';
|
import { useWorkflowWithCurrentVersion } from '@/workflow/hooks/useWorkflowWithCurrentVersion';
|
||||||
import { isDefined } from 'twenty-ui';
|
import { isDefined } from 'twenty-shared';
|
||||||
|
|
||||||
export const useDeactivateWorkflowSingleRecordAction: ActionHookWithoutObjectMetadataItem =
|
export const useDeactivateWorkflowSingleRecordAction: ActionHookWithoutObjectMetadataItem =
|
||||||
() => {
|
() => {
|
||||||
|
|||||||
@ -2,7 +2,7 @@ import { useSelectedRecordIdOrThrow } from '@/action-menu/actions/record-actions
|
|||||||
import { ActionHookWithoutObjectMetadataItem } from '@/action-menu/actions/types/ActionHook';
|
import { ActionHookWithoutObjectMetadataItem } from '@/action-menu/actions/types/ActionHook';
|
||||||
import { useDeleteOneWorkflowVersion } from '@/workflow/hooks/useDeleteOneWorkflowVersion';
|
import { useDeleteOneWorkflowVersion } from '@/workflow/hooks/useDeleteOneWorkflowVersion';
|
||||||
import { useWorkflowWithCurrentVersion } from '@/workflow/hooks/useWorkflowWithCurrentVersion';
|
import { useWorkflowWithCurrentVersion } from '@/workflow/hooks/useWorkflowWithCurrentVersion';
|
||||||
import { isDefined } from 'twenty-ui';
|
import { isDefined } from 'twenty-shared';
|
||||||
|
|
||||||
export const useDiscardDraftWorkflowSingleRecordAction: ActionHookWithoutObjectMetadataItem =
|
export const useDiscardDraftWorkflowSingleRecordAction: ActionHookWithoutObjectMetadataItem =
|
||||||
() => {
|
() => {
|
||||||
|
|||||||
@ -4,7 +4,7 @@ import { CoreObjectNameSingular } from '@/object-metadata/types/CoreObjectNameSi
|
|||||||
import { AppPath } from '@/types/AppPath';
|
import { AppPath } from '@/types/AppPath';
|
||||||
import { useActiveWorkflowVersion } from '@/workflow/hooks/useActiveWorkflowVersion';
|
import { useActiveWorkflowVersion } from '@/workflow/hooks/useActiveWorkflowVersion';
|
||||||
import { useWorkflowWithCurrentVersion } from '@/workflow/hooks/useWorkflowWithCurrentVersion';
|
import { useWorkflowWithCurrentVersion } from '@/workflow/hooks/useWorkflowWithCurrentVersion';
|
||||||
import { isDefined } from 'twenty-ui';
|
import { isDefined } from 'twenty-shared';
|
||||||
import { useNavigateApp } from '~/hooks/useNavigateApp';
|
import { useNavigateApp } from '~/hooks/useNavigateApp';
|
||||||
|
|
||||||
export const useSeeActiveVersionWorkflowSingleRecordAction: ActionHookWithoutObjectMetadataItem =
|
export const useSeeActiveVersionWorkflowSingleRecordAction: ActionHookWithoutObjectMetadataItem =
|
||||||
|
|||||||
@ -4,7 +4,7 @@ import { CoreObjectNamePlural } from '@/object-metadata/types/CoreObjectNamePlur
|
|||||||
import { AppPath } from '@/types/AppPath';
|
import { AppPath } from '@/types/AppPath';
|
||||||
import { ViewFilterOperand } from '@/views/types/ViewFilterOperand';
|
import { ViewFilterOperand } from '@/views/types/ViewFilterOperand';
|
||||||
import { useWorkflowWithCurrentVersion } from '@/workflow/hooks/useWorkflowWithCurrentVersion';
|
import { useWorkflowWithCurrentVersion } from '@/workflow/hooks/useWorkflowWithCurrentVersion';
|
||||||
import { isDefined } from 'twenty-ui';
|
import { isDefined } from 'twenty-shared';
|
||||||
import { useNavigateApp } from '~/hooks/useNavigateApp';
|
import { useNavigateApp } from '~/hooks/useNavigateApp';
|
||||||
|
|
||||||
export const useSeeRunsWorkflowSingleRecordAction: ActionHookWithoutObjectMetadataItem =
|
export const useSeeRunsWorkflowSingleRecordAction: ActionHookWithoutObjectMetadataItem =
|
||||||
|
|||||||
@ -4,7 +4,7 @@ import { CoreObjectNamePlural } from '@/object-metadata/types/CoreObjectNamePlur
|
|||||||
import { AppPath } from '@/types/AppPath';
|
import { AppPath } from '@/types/AppPath';
|
||||||
import { ViewFilterOperand } from '@/views/types/ViewFilterOperand';
|
import { ViewFilterOperand } from '@/views/types/ViewFilterOperand';
|
||||||
import { useWorkflowWithCurrentVersion } from '@/workflow/hooks/useWorkflowWithCurrentVersion';
|
import { useWorkflowWithCurrentVersion } from '@/workflow/hooks/useWorkflowWithCurrentVersion';
|
||||||
import { isDefined } from 'twenty-ui';
|
import { isDefined } from 'twenty-shared';
|
||||||
import { useNavigateApp } from '~/hooks/useNavigateApp';
|
import { useNavigateApp } from '~/hooks/useNavigateApp';
|
||||||
|
|
||||||
export const useSeeVersionsWorkflowSingleRecordAction: ActionHookWithoutObjectMetadataItem =
|
export const useSeeVersionsWorkflowSingleRecordAction: ActionHookWithoutObjectMetadataItem =
|
||||||
|
|||||||
@ -2,7 +2,7 @@ import { useSelectedRecordIdOrThrow } from '@/action-menu/actions/record-actions
|
|||||||
import { ActionHookWithoutObjectMetadataItem } from '@/action-menu/actions/types/ActionHook';
|
import { ActionHookWithoutObjectMetadataItem } from '@/action-menu/actions/types/ActionHook';
|
||||||
import { useRunWorkflowVersion } from '@/workflow/hooks/useRunWorkflowVersion';
|
import { useRunWorkflowVersion } from '@/workflow/hooks/useRunWorkflowVersion';
|
||||||
import { useWorkflowWithCurrentVersion } from '@/workflow/hooks/useWorkflowWithCurrentVersion';
|
import { useWorkflowWithCurrentVersion } from '@/workflow/hooks/useWorkflowWithCurrentVersion';
|
||||||
import { isDefined } from 'twenty-ui';
|
import { isDefined } from 'twenty-shared';
|
||||||
|
|
||||||
export const useTestWorkflowSingleRecordAction: ActionHookWithoutObjectMetadataItem =
|
export const useTestWorkflowSingleRecordAction: ActionHookWithoutObjectMetadataItem =
|
||||||
() => {
|
() => {
|
||||||
|
|||||||
@ -6,7 +6,7 @@ import { AppPath } from '@/types/AppPath';
|
|||||||
import { ViewFilterOperand } from '@/views/types/ViewFilterOperand';
|
import { ViewFilterOperand } from '@/views/types/ViewFilterOperand';
|
||||||
import { useWorkflowWithCurrentVersion } from '@/workflow/hooks/useWorkflowWithCurrentVersion';
|
import { useWorkflowWithCurrentVersion } from '@/workflow/hooks/useWorkflowWithCurrentVersion';
|
||||||
import { useRecoilValue } from 'recoil';
|
import { useRecoilValue } from 'recoil';
|
||||||
import { isDefined } from 'twenty-ui';
|
import { isDefined } from 'twenty-shared';
|
||||||
import { useNavigateApp } from '~/hooks/useNavigateApp';
|
import { useNavigateApp } from '~/hooks/useNavigateApp';
|
||||||
|
|
||||||
export const useSeeRunsWorkflowVersionSingleRecordAction: ActionHookWithoutObjectMetadataItem =
|
export const useSeeRunsWorkflowVersionSingleRecordAction: ActionHookWithoutObjectMetadataItem =
|
||||||
|
|||||||
@ -6,7 +6,7 @@ import { AppPath } from '@/types/AppPath';
|
|||||||
import { ViewFilterOperand } from '@/views/types/ViewFilterOperand';
|
import { ViewFilterOperand } from '@/views/types/ViewFilterOperand';
|
||||||
import { useWorkflowWithCurrentVersion } from '@/workflow/hooks/useWorkflowWithCurrentVersion';
|
import { useWorkflowWithCurrentVersion } from '@/workflow/hooks/useWorkflowWithCurrentVersion';
|
||||||
import { useRecoilValue } from 'recoil';
|
import { useRecoilValue } from 'recoil';
|
||||||
import { isDefined } from 'twenty-ui';
|
import { isDefined } from 'twenty-shared';
|
||||||
import { useNavigateApp } from '~/hooks/useNavigateApp';
|
import { useNavigateApp } from '~/hooks/useNavigateApp';
|
||||||
|
|
||||||
export const useSeeVersionsWorkflowVersionSingleRecordAction: ActionHookWithoutObjectMetadataItem =
|
export const useSeeVersionsWorkflowVersionSingleRecordAction: ActionHookWithoutObjectMetadataItem =
|
||||||
|
|||||||
@ -8,7 +8,7 @@ import { useWorkflowVersion } from '@/workflow/hooks/useWorkflowVersion';
|
|||||||
import { useWorkflowWithCurrentVersion } from '@/workflow/hooks/useWorkflowWithCurrentVersion';
|
import { useWorkflowWithCurrentVersion } from '@/workflow/hooks/useWorkflowWithCurrentVersion';
|
||||||
import { openOverrideWorkflowDraftConfirmationModalState } from '@/workflow/states/openOverrideWorkflowDraftConfirmationModalState';
|
import { openOverrideWorkflowDraftConfirmationModalState } from '@/workflow/states/openOverrideWorkflowDraftConfirmationModalState';
|
||||||
import { useSetRecoilState } from 'recoil';
|
import { useSetRecoilState } from 'recoil';
|
||||||
import { isDefined } from 'twenty-ui';
|
import { isDefined } from 'twenty-shared';
|
||||||
import { useNavigateApp } from '~/hooks/useNavigateApp';
|
import { useNavigateApp } from '~/hooks/useNavigateApp';
|
||||||
|
|
||||||
export const useUseAsDraftWorkflowVersionSingleRecordAction: ActionHookWithoutObjectMetadataItem =
|
export const useUseAsDraftWorkflowVersionSingleRecordAction: ActionHookWithoutObjectMetadataItem =
|
||||||
|
|||||||
@ -12,8 +12,8 @@ import { useRunWorkflowVersion } from '@/workflow/hooks/useRunWorkflowVersion';
|
|||||||
import { msg } from '@lingui/core/macro';
|
import { msg } from '@lingui/core/macro';
|
||||||
|
|
||||||
import { useRecoilValue } from 'recoil';
|
import { useRecoilValue } from 'recoil';
|
||||||
import { capitalize } from 'twenty-shared';
|
import { capitalize, isDefined } from 'twenty-shared';
|
||||||
import { IconSettingsAutomation, isDefined } from 'twenty-ui';
|
import { IconSettingsAutomation } from 'twenty-ui';
|
||||||
export const useWorkflowRunRecordActions = ({
|
export const useWorkflowRunRecordActions = ({
|
||||||
objectMetadataItem,
|
objectMetadataItem,
|
||||||
}: {
|
}: {
|
||||||
|
|||||||
@ -7,8 +7,8 @@ import { useRunWorkflowVersion } from '@/workflow/hooks/useRunWorkflowVersion';
|
|||||||
import { useIsFeatureEnabled } from '@/workspace/hooks/useIsFeatureEnabled';
|
import { useIsFeatureEnabled } from '@/workspace/hooks/useIsFeatureEnabled';
|
||||||
import { msg } from '@lingui/core/macro';
|
import { msg } from '@lingui/core/macro';
|
||||||
|
|
||||||
import { capitalize } from 'twenty-shared';
|
import { capitalize, isDefined } from 'twenty-shared';
|
||||||
import { IconSettingsAutomation, isDefined } from 'twenty-ui';
|
import { IconSettingsAutomation } from 'twenty-ui';
|
||||||
import { FeatureFlagKey } from '~/generated/graphql';
|
import { FeatureFlagKey } from '~/generated/graphql';
|
||||||
|
|
||||||
export const useRunWorkflowActions = () => {
|
export const useRunWorkflowActions = () => {
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
import { ActionMenuEntry } from '@/action-menu/types/ActionMenuEntry';
|
import { ActionMenuEntry } from '@/action-menu/types/ActionMenuEntry';
|
||||||
import { isDefined } from 'twenty-ui';
|
import { isDefined } from 'twenty-shared';
|
||||||
|
|
||||||
export const wrapActionInCallbacks = ({
|
export const wrapActionInCallbacks = ({
|
||||||
action,
|
action,
|
||||||
|
|||||||
@ -2,7 +2,7 @@ import { actionMenuEntriesComponentState } from '@/action-menu/states/actionMenu
|
|||||||
import { ActionMenuComponentInstanceContext } from '@/action-menu/states/contexts/ActionMenuComponentInstanceContext';
|
import { ActionMenuComponentInstanceContext } from '@/action-menu/states/contexts/ActionMenuComponentInstanceContext';
|
||||||
import { ActionMenuEntry } from '@/action-menu/types/ActionMenuEntry';
|
import { ActionMenuEntry } from '@/action-menu/types/ActionMenuEntry';
|
||||||
import { createComponentSelectorV2 } from '@/ui/utilities/state/component-state/utils/createComponentSelectorV2';
|
import { createComponentSelectorV2 } from '@/ui/utilities/state/component-state/utils/createComponentSelectorV2';
|
||||||
import { isDefined } from 'twenty-ui';
|
import { isDefined } from 'twenty-shared';
|
||||||
|
|
||||||
export const actionMenuEntriesComponentSelector = createComponentSelectorV2<
|
export const actionMenuEntriesComponentSelector = createComponentSelectorV2<
|
||||||
ActionMenuEntry[]
|
ActionMenuEntry[]
|
||||||
|
|||||||
@ -3,8 +3,8 @@ import styled from '@emotion/styled';
|
|||||||
import { isNonEmptyString } from '@sniptt/guards';
|
import { isNonEmptyString } from '@sniptt/guards';
|
||||||
import { ChangeEvent, useRef } from 'react';
|
import { ChangeEvent, useRef } from 'react';
|
||||||
|
|
||||||
|
import { isDefined } from 'twenty-shared';
|
||||||
import { Button } from 'twenty-ui';
|
import { Button } from 'twenty-ui';
|
||||||
import { isDefined } from '~/utils/isDefined';
|
|
||||||
import { isUndefinedOrNull } from '~/utils/isUndefinedOrNull';
|
import { isUndefinedOrNull } from '~/utils/isUndefinedOrNull';
|
||||||
|
|
||||||
import { AttachmentIcon } from '../../files/components/AttachmentIcon';
|
import { AttachmentIcon } from '../../files/components/AttachmentIcon';
|
||||||
|
|||||||
@ -3,15 +3,6 @@ import styled from '@emotion/styled';
|
|||||||
import { format } from 'date-fns';
|
import { format } from 'date-fns';
|
||||||
import { useContext } from 'react';
|
import { useContext } from 'react';
|
||||||
import { useRecoilValue } from 'recoil';
|
import { useRecoilValue } from 'recoil';
|
||||||
import {
|
|
||||||
Avatar,
|
|
||||||
AvatarGroup,
|
|
||||||
Card,
|
|
||||||
CardContent,
|
|
||||||
IconArrowRight,
|
|
||||||
IconLock,
|
|
||||||
isDefined,
|
|
||||||
} from 'twenty-ui';
|
|
||||||
|
|
||||||
import { CalendarCurrentEventCursor } from '@/activities/calendar/components/CalendarCurrentEventCursor';
|
import { CalendarCurrentEventCursor } from '@/activities/calendar/components/CalendarCurrentEventCursor';
|
||||||
import { CalendarContext } from '@/activities/calendar/contexts/CalendarContext';
|
import { CalendarContext } from '@/activities/calendar/contexts/CalendarContext';
|
||||||
@ -20,6 +11,15 @@ import { getCalendarEventEndDate } from '@/activities/calendar/utils/getCalendar
|
|||||||
import { getCalendarEventStartDate } from '@/activities/calendar/utils/getCalendarEventStartDate';
|
import { getCalendarEventStartDate } from '@/activities/calendar/utils/getCalendarEventStartDate';
|
||||||
import { hasCalendarEventEnded } from '@/activities/calendar/utils/hasCalendarEventEnded';
|
import { hasCalendarEventEnded } from '@/activities/calendar/utils/hasCalendarEventEnded';
|
||||||
import { currentWorkspaceMemberState } from '@/auth/states/currentWorkspaceMemberState';
|
import { currentWorkspaceMemberState } from '@/auth/states/currentWorkspaceMemberState';
|
||||||
|
import { isDefined } from 'twenty-shared';
|
||||||
|
import {
|
||||||
|
Avatar,
|
||||||
|
AvatarGroup,
|
||||||
|
Card,
|
||||||
|
CardContent,
|
||||||
|
IconArrowRight,
|
||||||
|
IconLock,
|
||||||
|
} from 'twenty-ui';
|
||||||
import {
|
import {
|
||||||
CalendarChannelVisibility,
|
CalendarChannelVisibility,
|
||||||
TimelineCalendarEvent,
|
TimelineCalendarEvent,
|
||||||
|
|||||||
@ -3,9 +3,9 @@ import { useMemo, useState } from 'react';
|
|||||||
|
|
||||||
import { findUpcomingCalendarEvent } from '@/activities/calendar/utils/findUpcomingCalendarEvent';
|
import { findUpcomingCalendarEvent } from '@/activities/calendar/utils/findUpcomingCalendarEvent';
|
||||||
import { getCalendarEventStartDate } from '@/activities/calendar/utils/getCalendarEventStartDate';
|
import { getCalendarEventStartDate } from '@/activities/calendar/utils/getCalendarEventStartDate';
|
||||||
|
import { isDefined } from 'twenty-shared';
|
||||||
import { TimelineCalendarEvent } from '~/generated/graphql';
|
import { TimelineCalendarEvent } from '~/generated/graphql';
|
||||||
import { groupArrayItemsBy } from '~/utils/array/groupArrayItemsBy';
|
import { groupArrayItemsBy } from '~/utils/array/groupArrayItemsBy';
|
||||||
import { isDefined } from '~/utils/isDefined';
|
|
||||||
import { sortDesc } from '~/utils/sort';
|
import { sortDesc } from '~/utils/sort';
|
||||||
|
|
||||||
export const useCalendarEvents = (calendarEvents: TimelineCalendarEvent[]) => {
|
export const useCalendarEvents = (calendarEvents: TimelineCalendarEvent[]) => {
|
||||||
|
|||||||
@ -17,7 +17,7 @@ import { RightDrawerHotkeyScope } from '@/ui/layout/right-drawer/types/RightDraw
|
|||||||
import { usePreviousHotkeyScope } from '@/ui/utilities/hotkey/hooks/usePreviousHotkeyScope';
|
import { usePreviousHotkeyScope } from '@/ui/utilities/hotkey/hooks/usePreviousHotkeyScope';
|
||||||
import { useScopedHotkeys } from '@/ui/utilities/hotkey/hooks/useScopedHotkeys';
|
import { useScopedHotkeys } from '@/ui/utilities/hotkey/hooks/useScopedHotkeys';
|
||||||
import { isNonTextWritingKey } from '@/ui/utilities/hotkey/utils/isNonTextWritingKey';
|
import { isNonTextWritingKey } from '@/ui/utilities/hotkey/utils/isNonTextWritingKey';
|
||||||
import { isDefined } from '~/utils/isDefined';
|
import { isDefined } from 'twenty-shared';
|
||||||
|
|
||||||
import { BLOCK_SCHEMA } from '@/activities/blocks/constants/Schema';
|
import { BLOCK_SCHEMA } from '@/activities/blocks/constants/Schema';
|
||||||
import { ActivityRichTextEditorChangeOnActivityIdEffect } from '@/activities/components/ActivityRichTextEditorChangeOnActivityIdEffect';
|
import { ActivityRichTextEditorChangeOnActivityIdEffect } from '@/activities/components/ActivityRichTextEditorChangeOnActivityIdEffect';
|
||||||
|
|||||||
@ -14,7 +14,7 @@ import { useFindManyRecords } from '@/object-record/hooks/useFindManyRecords';
|
|||||||
import { useFindOneRecord } from '@/object-record/hooks/useFindOneRecord';
|
import { useFindOneRecord } from '@/object-record/hooks/useFindOneRecord';
|
||||||
import { viewableRecordIdState } from '@/object-record/record-right-drawer/states/viewableRecordIdState';
|
import { viewableRecordIdState } from '@/object-record/record-right-drawer/states/viewableRecordIdState';
|
||||||
import { useUpsertRecordsInStore } from '@/object-record/record-store/hooks/useUpsertRecordsInStore';
|
import { useUpsertRecordsInStore } from '@/object-record/record-store/hooks/useUpsertRecordsInStore';
|
||||||
import { isDefined } from 'twenty-ui';
|
import { isDefined } from 'twenty-shared';
|
||||||
|
|
||||||
export const useRightDrawerEmailThread = () => {
|
export const useRightDrawerEmailThread = () => {
|
||||||
const viewableRecordId = useRecoilValue(viewableRecordIdState);
|
const viewableRecordId = useRecoilValue(viewableRecordIdState);
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
import { isNonEmptyString } from '@sniptt/guards';
|
import { isNonEmptyString } from '@sniptt/guards';
|
||||||
|
|
||||||
import { EmailThreadMessageParticipant } from '@/activities/emails/types/EmailThreadMessageParticipant';
|
import { EmailThreadMessageParticipant } from '@/activities/emails/types/EmailThreadMessageParticipant';
|
||||||
import { isDefined } from '~/utils/isDefined';
|
import { isDefined } from 'twenty-shared';
|
||||||
|
|
||||||
export const getDisplayNameFromParticipant = ({
|
export const getDisplayNameFromParticipant = ({
|
||||||
participant,
|
participant,
|
||||||
|
|||||||
@ -17,7 +17,7 @@ import { DropZone } from '@/activities/files/components/DropZone';
|
|||||||
import { useAttachments } from '@/activities/files/hooks/useAttachments';
|
import { useAttachments } from '@/activities/files/hooks/useAttachments';
|
||||||
import { useUploadAttachmentFile } from '@/activities/files/hooks/useUploadAttachmentFile';
|
import { useUploadAttachmentFile } from '@/activities/files/hooks/useUploadAttachmentFile';
|
||||||
import { ActivityTargetableObject } from '@/activities/types/ActivityTargetableEntity';
|
import { ActivityTargetableObject } from '@/activities/types/ActivityTargetableEntity';
|
||||||
import { isDefined } from '~/utils/isDefined';
|
import { isDefined } from 'twenty-shared';
|
||||||
|
|
||||||
const StyledAttachmentsContainer = styled.div`
|
const StyledAttachmentsContainer = styled.div`
|
||||||
display: flex;
|
display: flex;
|
||||||
|
|||||||
@ -8,7 +8,7 @@ import { Task } from '@/activities/types/Task';
|
|||||||
import { TaskTarget } from '@/activities/types/TaskTarget';
|
import { TaskTarget } from '@/activities/types/TaskTarget';
|
||||||
import { objectMetadataItemsState } from '@/object-metadata/states/objectMetadataItemsState';
|
import { objectMetadataItemsState } from '@/object-metadata/states/objectMetadataItemsState';
|
||||||
import { CoreObjectNameSingular } from '@/object-metadata/types/CoreObjectNameSingular';
|
import { CoreObjectNameSingular } from '@/object-metadata/types/CoreObjectNameSingular';
|
||||||
import { isDefined } from '~/utils/isDefined';
|
import { isDefined } from 'twenty-shared';
|
||||||
|
|
||||||
export const useActivityTargetObjectRecords = (
|
export const useActivityTargetObjectRecords = (
|
||||||
activity?: Task | Note,
|
activity?: Task | Note,
|
||||||
|
|||||||
@ -13,8 +13,8 @@ import { useGetRecordFromCache } from '@/object-record/cache/hooks/useGetRecordF
|
|||||||
import { useUpsertFindManyRecordsQueryInCache } from '@/object-record/cache/hooks/useUpsertFindManyRecordsQueryInCache';
|
import { useUpsertFindManyRecordsQueryInCache } from '@/object-record/cache/hooks/useUpsertFindManyRecordsQueryInCache';
|
||||||
import { getRecordFromCache } from '@/object-record/cache/utils/getRecordFromCache';
|
import { getRecordFromCache } from '@/object-record/cache/utils/getRecordFromCache';
|
||||||
import { ObjectRecord } from '@/object-record/types/ObjectRecord';
|
import { ObjectRecord } from '@/object-record/types/ObjectRecord';
|
||||||
|
import { isDefined } from 'twenty-shared';
|
||||||
import { sortByAscString } from '~/utils/array/sortByAscString';
|
import { sortByAscString } from '~/utils/array/sortByAscString';
|
||||||
import { isDefined } from '~/utils/isDefined';
|
|
||||||
|
|
||||||
export const usePrepareFindManyActivitiesQuery = ({
|
export const usePrepareFindManyActivitiesQuery = ({
|
||||||
activityObjectNameSingular,
|
activityObjectNameSingular,
|
||||||
|
|||||||
@ -3,7 +3,7 @@ import { useRecoilValue } from 'recoil';
|
|||||||
import { usePrepareFindManyActivitiesQuery } from '@/activities/hooks/usePrepareFindManyActivitiesQuery';
|
import { usePrepareFindManyActivitiesQuery } from '@/activities/hooks/usePrepareFindManyActivitiesQuery';
|
||||||
import { objectShowPageTargetableObjectState } from '@/activities/timeline-activities/states/objectShowPageTargetableObjectIdState';
|
import { objectShowPageTargetableObjectState } from '@/activities/timeline-activities/states/objectShowPageTargetableObjectIdState';
|
||||||
import { CoreObjectNameSingular } from '@/object-metadata/types/CoreObjectNameSingular';
|
import { CoreObjectNameSingular } from '@/object-metadata/types/CoreObjectNameSingular';
|
||||||
import { isDefined } from '~/utils/isDefined';
|
import { isDefined } from 'twenty-shared';
|
||||||
|
|
||||||
// This hook should only be executed if the normalized cache is up-to-date
|
// This hook should only be executed if the normalized cache is up-to-date
|
||||||
// It will take a targetableObject and prepare the queries for the activities
|
// It will take a targetableObject and prepare the queries for the activities
|
||||||
|
|||||||
@ -2,7 +2,7 @@ import { BLOCK_SCHEMA } from '@/activities/blocks/constants/Schema';
|
|||||||
import { recordStoreFamilyState } from '@/object-record/record-store/states/recordStoreFamilyState';
|
import { recordStoreFamilyState } from '@/object-record/record-store/states/recordStoreFamilyState';
|
||||||
import { isNonEmptyString } from '@sniptt/guards';
|
import { isNonEmptyString } from '@sniptt/guards';
|
||||||
import { useRecoilCallback } from 'recoil';
|
import { useRecoilCallback } from 'recoil';
|
||||||
import { isDefined } from 'twenty-ui';
|
import { isDefined } from 'twenty-shared';
|
||||||
import { isDeeplyEqual } from '~/utils/isDeeplyEqual';
|
import { isDeeplyEqual } from '~/utils/isDeeplyEqual';
|
||||||
|
|
||||||
export const useReplaceActivityBlockEditorContent = (
|
export const useReplaceActivityBlockEditorContent = (
|
||||||
|
|||||||
@ -9,7 +9,7 @@ import { Note } from '@/activities/types/Note';
|
|||||||
import { Task } from '@/activities/types/Task';
|
import { Task } from '@/activities/types/Task';
|
||||||
import { CoreObjectNameSingular } from '@/object-metadata/types/CoreObjectNameSingular';
|
import { CoreObjectNameSingular } from '@/object-metadata/types/CoreObjectNameSingular';
|
||||||
import { useUpdateOneRecord } from '@/object-record/hooks/useUpdateOneRecord';
|
import { useUpdateOneRecord } from '@/object-record/hooks/useUpdateOneRecord';
|
||||||
import { isDefined } from '~/utils/isDefined';
|
import { isDefined } from 'twenty-shared';
|
||||||
|
|
||||||
export const useUpsertActivity = ({
|
export const useUpsertActivity = ({
|
||||||
activityObjectNameSingular,
|
activityObjectNameSingular,
|
||||||
|
|||||||
@ -8,12 +8,12 @@ import { useFindOneRecord } from '@/object-record/hooks/useFindOneRecord';
|
|||||||
import { useUpsertRecordsInStore } from '@/object-record/record-store/hooks/useUpsertRecordsInStore';
|
import { useUpsertRecordsInStore } from '@/object-record/record-store/hooks/useUpsertRecordsInStore';
|
||||||
import { UserContext } from '@/users/contexts/UserContext';
|
import { UserContext } from '@/users/contexts/UserContext';
|
||||||
import { useContext } from 'react';
|
import { useContext } from 'react';
|
||||||
|
import { isDefined } from 'twenty-shared';
|
||||||
import {
|
import {
|
||||||
formatToHumanReadableDay,
|
formatToHumanReadableDay,
|
||||||
formatToHumanReadableMonth,
|
formatToHumanReadableMonth,
|
||||||
formatToHumanReadableTime,
|
formatToHumanReadableTime,
|
||||||
} from '~/utils/format/formatDate';
|
} from '~/utils/format/formatDate';
|
||||||
import { isDefined } from '~/utils/isDefined';
|
|
||||||
import { isUndefinedOrNull } from '~/utils/isUndefinedOrNull';
|
import { isUndefinedOrNull } from '~/utils/isUndefinedOrNull';
|
||||||
|
|
||||||
const StyledEventCardCalendarEventContainer = styled.div`
|
const StyledEventCardCalendarEventContainer = styled.div`
|
||||||
|
|||||||
@ -5,7 +5,7 @@ import { FieldMetadataItem } from '@/object-metadata/types/FieldMetadataItem';
|
|||||||
import { ObjectMetadataItem } from '@/object-metadata/types/ObjectMetadataItem';
|
import { ObjectMetadataItem } from '@/object-metadata/types/ObjectMetadataItem';
|
||||||
import { useSetRecordValue } from '@/object-record/record-store/contexts/RecordFieldValueSelectorContext';
|
import { useSetRecordValue } from '@/object-record/record-store/contexts/RecordFieldValueSelectorContext';
|
||||||
import { recordStoreFamilyState } from '@/object-record/record-store/states/recordStoreFamilyState';
|
import { recordStoreFamilyState } from '@/object-record/record-store/states/recordStoreFamilyState';
|
||||||
import { isDefined } from 'twenty-ui';
|
import { isDefined } from 'twenty-shared';
|
||||||
|
|
||||||
export const EventFieldDiffValueEffect = ({
|
export const EventFieldDiffValueEffect = ({
|
||||||
diffArtificialRecordStoreId,
|
diffArtificialRecordStoreId,
|
||||||
|
|||||||
@ -8,7 +8,7 @@ import { EventCardMessageNotShared } from '@/activities/timeline-activities/rows
|
|||||||
import { CoreObjectNameSingular } from '@/object-metadata/types/CoreObjectNameSingular';
|
import { CoreObjectNameSingular } from '@/object-metadata/types/CoreObjectNameSingular';
|
||||||
import { useFindOneRecord } from '@/object-record/hooks/useFindOneRecord';
|
import { useFindOneRecord } from '@/object-record/hooks/useFindOneRecord';
|
||||||
import { useUpsertRecordsInStore } from '@/object-record/record-store/hooks/useUpsertRecordsInStore';
|
import { useUpsertRecordsInStore } from '@/object-record/record-store/hooks/useUpsertRecordsInStore';
|
||||||
import { isDefined } from '~/utils/isDefined';
|
import { isDefined } from 'twenty-shared';
|
||||||
|
|
||||||
const StyledEventCardMessageContainer = styled.div`
|
const StyledEventCardMessageContainer = styled.div`
|
||||||
display: flex;
|
display: flex;
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
import { TimelineActivity } from '@/activities/timeline-activities/types/TimelineActivity';
|
import { TimelineActivity } from '@/activities/timeline-activities/types/TimelineActivity';
|
||||||
import { CurrentWorkspaceMember } from '@/auth/states/currentWorkspaceMemberState';
|
import { CurrentWorkspaceMember } from '@/auth/states/currentWorkspaceMemberState';
|
||||||
import { isDefined } from '~/utils/isDefined';
|
import { isDefined } from 'twenty-shared';
|
||||||
|
|
||||||
export const getTimelineActivityAuthorFullName = (
|
export const getTimelineActivityAuthorFullName = (
|
||||||
event: TimelineActivity,
|
event: TimelineActivity,
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
import { TimelineActivity } from '@/activities/timeline-activities/types/TimelineActivity';
|
import { TimelineActivity } from '@/activities/timeline-activities/types/TimelineActivity';
|
||||||
import { isDefined } from '~/utils/isDefined';
|
import { isDefined } from 'twenty-shared';
|
||||||
|
|
||||||
export type EventGroup = {
|
export type EventGroup = {
|
||||||
month: number;
|
month: number;
|
||||||
|
|||||||
@ -10,10 +10,10 @@ import { previousUrlState } from '@/auth/states/previousUrlState';
|
|||||||
import { tokenPairState } from '@/auth/states/tokenPairState';
|
import { tokenPairState } from '@/auth/states/tokenPairState';
|
||||||
import { workspacesState } from '@/auth/states/workspaces';
|
import { workspacesState } from '@/auth/states/workspaces';
|
||||||
import { isDebugModeState } from '@/client-config/states/isDebugModeState';
|
import { isDebugModeState } from '@/client-config/states/isDebugModeState';
|
||||||
|
import { isDefined } from 'twenty-shared';
|
||||||
import { REACT_APP_SERVER_BASE_URL } from '~/config';
|
import { REACT_APP_SERVER_BASE_URL } from '~/config';
|
||||||
import { useIsMatchingLocation } from '~/hooks/useIsMatchingLocation';
|
import { useIsMatchingLocation } from '~/hooks/useIsMatchingLocation';
|
||||||
import { useUpdateEffect } from '~/hooks/useUpdateEffect';
|
import { useUpdateEffect } from '~/hooks/useUpdateEffect';
|
||||||
import { isDefined } from '~/utils/isDefined';
|
|
||||||
|
|
||||||
import { AppPath } from '@/types/AppPath';
|
import { AppPath } from '@/types/AppPath';
|
||||||
import { ApolloFactory, Options } from '../services/apollo.factory';
|
import { ApolloFactory, Options } from '../services/apollo.factory';
|
||||||
|
|||||||
@ -4,7 +4,7 @@ import { ReadFieldFunction } from '@apollo/client/cache/core/types/common';
|
|||||||
import { RecordGqlRefEdge } from '@/object-record/cache/types/RecordGqlRefEdge';
|
import { RecordGqlRefEdge } from '@/object-record/cache/types/RecordGqlRefEdge';
|
||||||
import { RecordGqlOperationOrderBy } from '@/object-record/graphql/types/RecordGqlOperationOrderBy';
|
import { RecordGqlOperationOrderBy } from '@/object-record/graphql/types/RecordGqlOperationOrderBy';
|
||||||
import { OrderBy } from '@/types/OrderBy';
|
import { OrderBy } from '@/types/OrderBy';
|
||||||
import { isDefined } from '~/utils/isDefined';
|
import { isDefined } from 'twenty-shared';
|
||||||
import { sortAsc, sortDesc, sortNullsFirst, sortNullsLast } from '~/utils/sort';
|
import { sortAsc, sortDesc, sortNullsFirst, sortNullsLast } from '~/utils/sort';
|
||||||
|
|
||||||
export const sortCachedObjectEdges = ({
|
export const sortCachedObjectEdges = ({
|
||||||
|
|||||||
@ -2,8 +2,7 @@ import { ApolloCache, StoreObject } from '@apollo/client';
|
|||||||
|
|
||||||
import { RecordGqlRefEdge } from '@/object-record/cache/types/RecordGqlRefEdge';
|
import { RecordGqlRefEdge } from '@/object-record/cache/types/RecordGqlRefEdge';
|
||||||
import { isObjectRecordConnectionWithRefs } from '@/object-record/cache/utils/isObjectRecordConnectionWithRefs';
|
import { isObjectRecordConnectionWithRefs } from '@/object-record/cache/utils/isObjectRecordConnectionWithRefs';
|
||||||
import { capitalize } from 'twenty-shared';
|
import { capitalize, isDefined } from 'twenty-shared';
|
||||||
import { isDefined } from '~/utils/isDefined';
|
|
||||||
|
|
||||||
export const triggerAttachRelationOptimisticEffect = ({
|
export const triggerAttachRelationOptimisticEffect = ({
|
||||||
cache,
|
cache,
|
||||||
|
|||||||
@ -13,7 +13,7 @@ import { CachedObjectRecordQueryVariables } from '@/apollo/types/CachedObjectRec
|
|||||||
import { encodeCursor } from '@/apollo/utils/encodeCursor';
|
import { encodeCursor } from '@/apollo/utils/encodeCursor';
|
||||||
import { getRecordFromCache } from '@/object-record/cache/utils/getRecordFromCache';
|
import { getRecordFromCache } from '@/object-record/cache/utils/getRecordFromCache';
|
||||||
import { getRecordNodeFromRecord } from '@/object-record/cache/utils/getRecordNodeFromRecord';
|
import { getRecordNodeFromRecord } from '@/object-record/cache/utils/getRecordNodeFromRecord';
|
||||||
import { isDefined } from '~/utils/isDefined';
|
import { isDefined } from 'twenty-shared';
|
||||||
import { parseApolloStoreFieldName } from '~/utils/parseApolloStoreFieldName';
|
import { parseApolloStoreFieldName } from '~/utils/parseApolloStoreFieldName';
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
@ -5,7 +5,7 @@ import { ObjectMetadataItem } from '@/object-metadata/types/ObjectMetadataItem';
|
|||||||
import { RecordGqlRefEdge } from '@/object-record/cache/types/RecordGqlRefEdge';
|
import { RecordGqlRefEdge } from '@/object-record/cache/types/RecordGqlRefEdge';
|
||||||
import { isObjectRecordConnectionWithRefs } from '@/object-record/cache/utils/isObjectRecordConnectionWithRefs';
|
import { isObjectRecordConnectionWithRefs } from '@/object-record/cache/utils/isObjectRecordConnectionWithRefs';
|
||||||
import { RecordGqlNode } from '@/object-record/graphql/types/RecordGqlNode';
|
import { RecordGqlNode } from '@/object-record/graphql/types/RecordGqlNode';
|
||||||
import { isDefined } from '~/utils/isDefined';
|
import { isDefined } from 'twenty-shared';
|
||||||
|
|
||||||
export const triggerDestroyRecordsOptimisticEffect = ({
|
export const triggerDestroyRecordsOptimisticEffect = ({
|
||||||
cache,
|
cache,
|
||||||
|
|||||||
@ -9,7 +9,7 @@ import { getEdgeTypename } from '@/object-record/cache/utils/getEdgeTypename';
|
|||||||
import { isObjectRecordConnectionWithRefs } from '@/object-record/cache/utils/isObjectRecordConnectionWithRefs';
|
import { isObjectRecordConnectionWithRefs } from '@/object-record/cache/utils/isObjectRecordConnectionWithRefs';
|
||||||
import { RecordGqlNode } from '@/object-record/graphql/types/RecordGqlNode';
|
import { RecordGqlNode } from '@/object-record/graphql/types/RecordGqlNode';
|
||||||
import { isRecordMatchingFilter } from '@/object-record/record-filter/utils/isRecordMatchingFilter';
|
import { isRecordMatchingFilter } from '@/object-record/record-filter/utils/isRecordMatchingFilter';
|
||||||
import { isDefined } from '~/utils/isDefined';
|
import { isDefined } from 'twenty-shared';
|
||||||
import { parseApolloStoreFieldName } from '~/utils/parseApolloStoreFieldName';
|
import { parseApolloStoreFieldName } from '~/utils/parseApolloStoreFieldName';
|
||||||
|
|
||||||
// TODO: add extensive unit tests for this function
|
// TODO: add extensive unit tests for this function
|
||||||
|
|||||||
@ -9,7 +9,7 @@ import { getEdgeTypename } from '@/object-record/cache/utils/getEdgeTypename';
|
|||||||
import { isObjectRecordConnectionWithRefs } from '@/object-record/cache/utils/isObjectRecordConnectionWithRefs';
|
import { isObjectRecordConnectionWithRefs } from '@/object-record/cache/utils/isObjectRecordConnectionWithRefs';
|
||||||
import { RecordGqlNode } from '@/object-record/graphql/types/RecordGqlNode';
|
import { RecordGqlNode } from '@/object-record/graphql/types/RecordGqlNode';
|
||||||
import { isRecordMatchingFilter } from '@/object-record/record-filter/utils/isRecordMatchingFilter';
|
import { isRecordMatchingFilter } from '@/object-record/record-filter/utils/isRecordMatchingFilter';
|
||||||
import { isDefined } from '~/utils/isDefined';
|
import { isDefined } from 'twenty-shared';
|
||||||
import { parseApolloStoreFieldName } from '~/utils/parseApolloStoreFieldName';
|
import { parseApolloStoreFieldName } from '~/utils/parseApolloStoreFieldName';
|
||||||
|
|
||||||
// TODO: add extensive unit tests for this function
|
// TODO: add extensive unit tests for this function
|
||||||
|
|||||||
@ -9,9 +9,9 @@ import { RecordGqlConnection } from '@/object-record/graphql/types/RecordGqlConn
|
|||||||
import { RecordGqlNode } from '@/object-record/graphql/types/RecordGqlNode';
|
import { RecordGqlNode } from '@/object-record/graphql/types/RecordGqlNode';
|
||||||
import { ApolloCache } from '@apollo/client';
|
import { ApolloCache } from '@apollo/client';
|
||||||
import { isArray } from '@sniptt/guards';
|
import { isArray } from '@sniptt/guards';
|
||||||
|
import { isDefined } from 'twenty-shared';
|
||||||
import { FieldMetadataType } from '~/generated-metadata/graphql';
|
import { FieldMetadataType } from '~/generated-metadata/graphql';
|
||||||
import { isDeeplyEqual } from '~/utils/isDeeplyEqual';
|
import { isDeeplyEqual } from '~/utils/isDeeplyEqual';
|
||||||
import { isDefined } from '~/utils/isDefined';
|
|
||||||
|
|
||||||
type triggerUpdateRelationsOptimisticEffectArgs = {
|
type triggerUpdateRelationsOptimisticEffectArgs = {
|
||||||
cache: ApolloCache<unknown>;
|
cache: ApolloCache<unknown>;
|
||||||
|
|||||||
@ -13,8 +13,8 @@ import { createUploadLink } from 'apollo-upload-client';
|
|||||||
|
|
||||||
import { renewToken } from '@/auth/services/AuthService';
|
import { renewToken } from '@/auth/services/AuthService';
|
||||||
import { CurrentWorkspaceMember } from '@/auth/states/currentWorkspaceMemberState';
|
import { CurrentWorkspaceMember } from '@/auth/states/currentWorkspaceMemberState';
|
||||||
|
import { isDefined } from 'twenty-shared';
|
||||||
import { AuthTokenPair } from '~/generated/graphql';
|
import { AuthTokenPair } from '~/generated/graphql';
|
||||||
import { isDefined } from '~/utils/isDefined';
|
|
||||||
import { logDebug } from '~/utils/logDebug';
|
import { logDebug } from '~/utils/logDebug';
|
||||||
|
|
||||||
import { GraphQLFormattedError } from 'graphql';
|
import { GraphQLFormattedError } from 'graphql';
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
import { ObjectRecord } from '@/object-record/types/ObjectRecord';
|
import { ObjectRecord } from '@/object-record/types/ObjectRecord';
|
||||||
import { isDefined } from '~/utils/isDefined';
|
import { isDefined } from 'twenty-shared';
|
||||||
|
|
||||||
import { Buffer } from 'buffer';
|
import { Buffer } from 'buffer';
|
||||||
|
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
import { ApolloLink, gql, Operation } from '@apollo/client';
|
import { ApolloLink, gql, Operation } from '@apollo/client';
|
||||||
|
|
||||||
import { isDefined } from '~/utils/isDefined';
|
import { isDefined } from 'twenty-shared';
|
||||||
import { logDebug } from '~/utils/logDebug';
|
import { logDebug } from '~/utils/logDebug';
|
||||||
import { logError } from '~/utils/logError';
|
import { logError } from '~/utils/logError';
|
||||||
|
|
||||||
|
|||||||
@ -21,9 +21,9 @@ import { AppPath } from '@/types/AppPath';
|
|||||||
import { PageHotkeyScope } from '@/types/PageHotkeyScope';
|
import { PageHotkeyScope } from '@/types/PageHotkeyScope';
|
||||||
import { SettingsPath } from '@/types/SettingsPath';
|
import { SettingsPath } from '@/types/SettingsPath';
|
||||||
import { useSetHotkeyScope } from '@/ui/utilities/hotkey/hooks/useSetHotkeyScope';
|
import { useSetHotkeyScope } from '@/ui/utilities/hotkey/hooks/useSetHotkeyScope';
|
||||||
|
import { isDefined } from 'twenty-shared';
|
||||||
import { useIsMatchingLocation } from '~/hooks/useIsMatchingLocation';
|
import { useIsMatchingLocation } from '~/hooks/useIsMatchingLocation';
|
||||||
import { usePageChangeEffectNavigateLocation } from '~/hooks/usePageChangeEffectNavigateLocation';
|
import { usePageChangeEffectNavigateLocation } from '~/hooks/usePageChangeEffectNavigateLocation';
|
||||||
import { isDefined } from '~/utils/isDefined';
|
|
||||||
|
|
||||||
// TODO: break down into smaller functions and / or hooks
|
// TODO: break down into smaller functions and / or hooks
|
||||||
// - moved usePageChangeEffectNavigateLocation into dedicated hook
|
// - moved usePageChangeEffectNavigateLocation into dedicated hook
|
||||||
|
|||||||
@ -8,7 +8,7 @@ import { AppPath } from '@/types/AppPath';
|
|||||||
import { SnackBarVariant } from '@/ui/feedback/snack-bar-manager/components/SnackBar';
|
import { SnackBarVariant } from '@/ui/feedback/snack-bar-manager/components/SnackBar';
|
||||||
import { useSnackBar } from '@/ui/feedback/snack-bar-manager/hooks/useSnackBar';
|
import { useSnackBar } from '@/ui/feedback/snack-bar-manager/hooks/useSnackBar';
|
||||||
import { useSetRecoilState } from 'recoil';
|
import { useSetRecoilState } from 'recoil';
|
||||||
import { isDefined } from 'twenty-ui';
|
import { isDefined } from 'twenty-shared';
|
||||||
import { useNavigateApp } from '~/hooks/useNavigateApp';
|
import { useNavigateApp } from '~/hooks/useNavigateApp';
|
||||||
|
|
||||||
export const VerifyEffect = () => {
|
export const VerifyEffect = () => {
|
||||||
|
|||||||
@ -20,6 +20,7 @@ import { clientConfigApiStatusState } from '@/client-config/states/clientConfigA
|
|||||||
import { isDebugModeState } from '@/client-config/states/isDebugModeState';
|
import { isDebugModeState } from '@/client-config/states/isDebugModeState';
|
||||||
import { supportChatState } from '@/client-config/states/supportChatState';
|
import { supportChatState } from '@/client-config/states/supportChatState';
|
||||||
import { ColorScheme } from '@/workspace-member/types/WorkspaceMember';
|
import { ColorScheme } from '@/workspace-member/types/WorkspaceMember';
|
||||||
|
import { isDefined } from 'twenty-shared';
|
||||||
import { REACT_APP_SERVER_BASE_URL } from '~/config';
|
import { REACT_APP_SERVER_BASE_URL } from '~/config';
|
||||||
import {
|
import {
|
||||||
useCheckUserExistsLazyQuery,
|
useCheckUserExistsLazyQuery,
|
||||||
@ -29,7 +30,6 @@ import {
|
|||||||
useGetLoginTokenFromEmailVerificationTokenMutation,
|
useGetLoginTokenFromEmailVerificationTokenMutation,
|
||||||
useSignUpMutation,
|
useSignUpMutation,
|
||||||
} from '~/generated/graphql';
|
} from '~/generated/graphql';
|
||||||
import { isDefined } from '~/utils/isDefined';
|
|
||||||
|
|
||||||
import { currentWorkspaceMembersState } from '@/auth/states/currentWorkspaceMembersStates';
|
import { currentWorkspaceMembersState } from '@/auth/states/currentWorkspaceMembersStates';
|
||||||
import { isDeveloperDefaultSignInPrefilledState } from '@/client-config/states/isDeveloperDefaultSignInPrefilledState';
|
import { isDeveloperDefaultSignInPrefilledState } from '@/client-config/states/isDeveloperDefaultSignInPrefilledState';
|
||||||
|
|||||||
@ -7,13 +7,13 @@ import {
|
|||||||
} from '@apollo/client';
|
} from '@apollo/client';
|
||||||
|
|
||||||
import { loggerLink } from '@/apollo/utils/loggerLink';
|
import { loggerLink } from '@/apollo/utils/loggerLink';
|
||||||
|
import { isDefined } from 'twenty-shared';
|
||||||
import {
|
import {
|
||||||
AuthTokenPair,
|
AuthTokenPair,
|
||||||
RenewTokenDocument,
|
RenewTokenDocument,
|
||||||
RenewTokenMutation,
|
RenewTokenMutation,
|
||||||
RenewTokenMutationVariables,
|
RenewTokenMutationVariables,
|
||||||
} from '~/generated/graphql';
|
} from '~/generated/graphql';
|
||||||
import { isDefined } from '~/utils/isDefined';
|
|
||||||
import { isUndefinedOrNull } from '~/utils/isUndefinedOrNull';
|
import { isUndefinedOrNull } from '~/utils/isUndefinedOrNull';
|
||||||
|
|
||||||
const logger = loggerLink(() => 'Twenty-Refresh');
|
const logger = loggerLink(() => 'Twenty-Refresh');
|
||||||
|
|||||||
@ -26,7 +26,7 @@ import { authProvidersState } from '@/client-config/states/authProvidersState';
|
|||||||
import { useRedirectToWorkspaceDomain } from '@/domain-manager/hooks/useRedirectToWorkspaceDomain';
|
import { useRedirectToWorkspaceDomain } from '@/domain-manager/hooks/useRedirectToWorkspaceDomain';
|
||||||
import { SnackBarVariant } from '@/ui/feedback/snack-bar-manager/components/SnackBar';
|
import { SnackBarVariant } from '@/ui/feedback/snack-bar-manager/components/SnackBar';
|
||||||
import { useSnackBar } from '@/ui/feedback/snack-bar-manager/hooks/useSnackBar';
|
import { useSnackBar } from '@/ui/feedback/snack-bar-manager/hooks/useSnackBar';
|
||||||
import { isDefined } from '~/utils/isDefined';
|
import { isDefined } from 'twenty-shared';
|
||||||
|
|
||||||
const StyledContentContainer = styled(motion.div)`
|
const StyledContentContainer = styled(motion.div)`
|
||||||
margin-bottom: ${({ theme }) => theme.spacing(8)};
|
margin-bottom: ${({ theme }) => theme.spacing(8)};
|
||||||
|
|||||||
@ -7,7 +7,7 @@ import { useRecoilValue } from 'recoil';
|
|||||||
import { HorizontalSeparator, MainButton } from 'twenty-ui';
|
import { HorizontalSeparator, MainButton } from 'twenty-ui';
|
||||||
|
|
||||||
import { workspaceAuthProvidersState } from '@/workspace/states/workspaceAuthProvidersState';
|
import { workspaceAuthProvidersState } from '@/workspace/states/workspaceAuthProvidersState';
|
||||||
import { isDefined } from '~/utils/isDefined';
|
import { isDefined } from 'twenty-shared';
|
||||||
|
|
||||||
const StyledContentContainer = styled.div`
|
const StyledContentContainer = styled.div`
|
||||||
margin-bottom: ${({ theme }) => theme.spacing(8)};
|
margin-bottom: ${({ theme }) => theme.spacing(8)};
|
||||||
|
|||||||
@ -14,8 +14,8 @@ import styled from '@emotion/styled';
|
|||||||
import { useMemo, useState } from 'react';
|
import { useMemo, useState } from 'react';
|
||||||
import { useFormContext } from 'react-hook-form';
|
import { useFormContext } from 'react-hook-form';
|
||||||
import { useRecoilValue } from 'recoil';
|
import { useRecoilValue } from 'recoil';
|
||||||
|
import { isDefined } from 'twenty-shared';
|
||||||
import { Loader, MainButton } from 'twenty-ui';
|
import { Loader, MainButton } from 'twenty-ui';
|
||||||
import { isDefined } from '~/utils/isDefined';
|
|
||||||
|
|
||||||
const StyledForm = styled.form`
|
const StyledForm = styled.form`
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
|||||||
@ -6,8 +6,8 @@ import {
|
|||||||
import { workspaceAuthProvidersState } from '@/workspace/states/workspaceAuthProvidersState';
|
import { workspaceAuthProvidersState } from '@/workspace/states/workspaceAuthProvidersState';
|
||||||
import { useTheme } from '@emotion/react';
|
import { useTheme } from '@emotion/react';
|
||||||
import { useRecoilValue, useSetRecoilState } from 'recoil';
|
import { useRecoilValue, useSetRecoilState } from 'recoil';
|
||||||
|
import { isDefined } from 'twenty-shared';
|
||||||
import { HorizontalSeparator, IconLock, MainButton } from 'twenty-ui';
|
import { HorizontalSeparator, IconLock, MainButton } from 'twenty-ui';
|
||||||
import { isDefined } from '~/utils/isDefined';
|
|
||||||
|
|
||||||
export const SignInUpWithSSO = () => {
|
export const SignInUpWithSSO = () => {
|
||||||
const theme = useTheme();
|
const theme = useTheme();
|
||||||
|
|||||||
@ -10,7 +10,7 @@ import { captchaState } from '@/client-config/states/captchaState';
|
|||||||
import { workspaceAuthProvidersState } from '@/workspace/states/workspaceAuthProvidersState';
|
import { workspaceAuthProvidersState } from '@/workspace/states/workspaceAuthProvidersState';
|
||||||
import { useEffect, useState } from 'react';
|
import { useEffect, useState } from 'react';
|
||||||
import { useRecoilValue, useSetRecoilState } from 'recoil';
|
import { useRecoilValue, useSetRecoilState } from 'recoil';
|
||||||
import { isDefined } from '~/utils/isDefined';
|
import { isDefined } from 'twenty-shared';
|
||||||
|
|
||||||
const searchParams = new URLSearchParams(window.location.search);
|
const searchParams = new URLSearchParams(window.location.search);
|
||||||
const email = searchParams.get('email');
|
const email = searchParams.get('email');
|
||||||
|
|||||||
@ -11,7 +11,7 @@ import {
|
|||||||
} from '@/auth/states/signInUpStepState';
|
} from '@/auth/states/signInUpStepState';
|
||||||
import { PASSWORD_REGEX } from '@/auth/utils/passwordRegex';
|
import { PASSWORD_REGEX } from '@/auth/utils/passwordRegex';
|
||||||
import { isDeveloperDefaultSignInPrefilledState } from '@/client-config/states/isDeveloperDefaultSignInPrefilledState';
|
import { isDeveloperDefaultSignInPrefilledState } from '@/client-config/states/isDeveloperDefaultSignInPrefilledState';
|
||||||
import { isDefined } from '~/utils/isDefined';
|
import { isDefined } from 'twenty-shared';
|
||||||
|
|
||||||
const makeValidationSchema = (signInUpStep: SignInUpStep) =>
|
const makeValidationSchema = (signInUpStep: SignInUpStep) =>
|
||||||
z
|
z
|
||||||
|
|||||||
@ -9,9 +9,9 @@ import { useSnackBar } from '@/ui/feedback/snack-bar-manager/hooks/useSnackBar';
|
|||||||
import { isDefaultLayoutAuthModalVisibleState } from '@/ui/layout/states/isDefaultLayoutAuthModalVisibleState';
|
import { isDefaultLayoutAuthModalVisibleState } from '@/ui/layout/states/isDefaultLayoutAuthModalVisibleState';
|
||||||
|
|
||||||
import { AppPath } from '@/types/AppPath';
|
import { AppPath } from '@/types/AppPath';
|
||||||
|
import { isDefined } from 'twenty-shared';
|
||||||
import { useGetWorkspaceFromInviteHashQuery } from '~/generated/graphql';
|
import { useGetWorkspaceFromInviteHashQuery } from '~/generated/graphql';
|
||||||
import { useNavigateApp } from '~/hooks/useNavigateApp';
|
import { useNavigateApp } from '~/hooks/useNavigateApp';
|
||||||
import { isDefined } from '~/utils/isDefined';
|
|
||||||
|
|
||||||
export const useWorkspaceFromInviteHash = () => {
|
export const useWorkspaceFromInviteHash = () => {
|
||||||
const { enqueueSnackBar } = useSnackBar();
|
const { enqueueSnackBar } = useSnackBar();
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
import { useRecoilCallback } from 'recoil';
|
import { useRecoilCallback } from 'recoil';
|
||||||
|
|
||||||
import { captchaTokenState } from '@/captcha/states/captchaTokenState';
|
import { captchaTokenState } from '@/captcha/states/captchaTokenState';
|
||||||
import { isDefined } from '~/utils/isDefined';
|
import { isDefined } from 'twenty-shared';
|
||||||
|
|
||||||
export const useReadCaptchaToken = () => {
|
export const useReadCaptchaToken = () => {
|
||||||
const readCaptchaToken = useRecoilCallback(
|
const readCaptchaToken = useRecoilCallback(
|
||||||
|
|||||||
@ -5,7 +5,7 @@ import { useRecoilValue, useSetRecoilState } from 'recoil';
|
|||||||
import { tokenPairState } from '@/auth/states/tokenPairState';
|
import { tokenPairState } from '@/auth/states/tokenPairState';
|
||||||
import { isLoadingTokensFromExtensionState } from '@/chrome-extension-sidecar/states/isLoadingTokensFromExtensionState';
|
import { isLoadingTokensFromExtensionState } from '@/chrome-extension-sidecar/states/isLoadingTokensFromExtensionState';
|
||||||
import { chromeExtensionIdState } from '@/client-config/states/chromeExtensionIdState';
|
import { chromeExtensionIdState } from '@/client-config/states/chromeExtensionIdState';
|
||||||
import { isDefined } from '~/utils/isDefined';
|
import { isDefined } from 'twenty-shared';
|
||||||
import { isInFrame } from '~/utils/isInIframe';
|
import { isInFrame } from '~/utils/isInIframe';
|
||||||
|
|
||||||
export const ChromeExtensionSidecarEffect = () => {
|
export const ChromeExtensionSidecarEffect = () => {
|
||||||
|
|||||||
@ -16,8 +16,8 @@ import { supportChatState } from '@/client-config/states/supportChatState';
|
|||||||
import { domainConfigurationState } from '@/domain-manager/states/domainConfigurationState';
|
import { domainConfigurationState } from '@/domain-manager/states/domainConfigurationState';
|
||||||
import { useEffect } from 'react';
|
import { useEffect } from 'react';
|
||||||
import { useRecoilState, useSetRecoilState } from 'recoil';
|
import { useRecoilState, useSetRecoilState } from 'recoil';
|
||||||
|
import { isDefined } from 'twenty-shared';
|
||||||
import { useGetClientConfigQuery } from '~/generated/graphql';
|
import { useGetClientConfigQuery } from '~/generated/graphql';
|
||||||
import { isDefined } from '~/utils/isDefined';
|
|
||||||
|
|
||||||
export const ClientConfigProviderEffect = () => {
|
export const ClientConfigProviderEffect = () => {
|
||||||
const setIsDebugMode = useSetRecoilState(isDebugModeState);
|
const setIsDebugMode = useSetRecoilState(isDebugModeState);
|
||||||
|
|||||||
@ -11,7 +11,7 @@ import { useRecoilComponentValueV2 } from '@/ui/utilities/state/component-state/
|
|||||||
import { useLingui } from '@lingui/react/macro';
|
import { useLingui } from '@lingui/react/macro';
|
||||||
import { isNonEmptyString } from '@sniptt/guards';
|
import { isNonEmptyString } from '@sniptt/guards';
|
||||||
import { useRecoilValue } from 'recoil';
|
import { useRecoilValue } from 'recoil';
|
||||||
import { isDefined } from 'twenty-ui';
|
import { isDefined } from 'twenty-shared';
|
||||||
|
|
||||||
export type CommandGroupConfig = {
|
export type CommandGroupConfig = {
|
||||||
heading: string;
|
heading: string;
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
import { useSelectableList } from '@/ui/layout/selectable-list/hooks/useSelectableList';
|
import { useSelectableList } from '@/ui/layout/selectable-list/hooks/useSelectableList';
|
||||||
import { useEffect } from 'react';
|
import { useEffect } from 'react';
|
||||||
import { useRecoilValue } from 'recoil';
|
import { useRecoilValue } from 'recoil';
|
||||||
import { isDefined } from 'twenty-ui';
|
import { isDefined } from 'twenty-shared';
|
||||||
|
|
||||||
export const CommandMenuDefaultSelectionEffect = ({
|
export const CommandMenuDefaultSelectionEffect = ({
|
||||||
selectableItemIds,
|
selectableItemIds,
|
||||||
|
|||||||
@ -12,7 +12,8 @@ import { SelectableList } from '@/ui/layout/selectable-list/components/Selectabl
|
|||||||
import { AppHotkeyScope } from '@/ui/utilities/hotkey/types/AppHotkeyScope';
|
import { AppHotkeyScope } from '@/ui/utilities/hotkey/types/AppHotkeyScope';
|
||||||
import { ScrollWrapper } from '@/ui/utilities/scroll/components/ScrollWrapper';
|
import { ScrollWrapper } from '@/ui/utilities/scroll/components/ScrollWrapper';
|
||||||
import styled from '@emotion/styled';
|
import styled from '@emotion/styled';
|
||||||
import { MOBILE_VIEWPORT, isDefined } from 'twenty-ui';
|
import { isDefined } from 'twenty-shared';
|
||||||
|
import { MOBILE_VIEWPORT } from 'twenty-ui';
|
||||||
|
|
||||||
const MOBILE_NAVIGATION_BAR_HEIGHT = 64;
|
const MOBILE_NAVIGATION_BAR_HEIGHT = 64;
|
||||||
|
|
||||||
|
|||||||
@ -4,7 +4,7 @@ import { COMMAND_MENU_PAGES_CONFIG } from '@/command-menu/constants/CommandMenuP
|
|||||||
import { commandMenuPageState } from '@/command-menu/states/commandMenuPageState';
|
import { commandMenuPageState } from '@/command-menu/states/commandMenuPageState';
|
||||||
import styled from '@emotion/styled';
|
import styled from '@emotion/styled';
|
||||||
import { useRecoilValue } from 'recoil';
|
import { useRecoilValue } from 'recoil';
|
||||||
import { isDefined } from 'twenty-ui';
|
import { isDefined } from 'twenty-shared';
|
||||||
|
|
||||||
const StyledCommandMenuContent = styled.div`
|
const StyledCommandMenuContent = styled.div`
|
||||||
flex: 1;
|
flex: 1;
|
||||||
|
|||||||
@ -13,7 +13,8 @@ import { useTheme } from '@emotion/react';
|
|||||||
import styled from '@emotion/styled';
|
import styled from '@emotion/styled';
|
||||||
import { useLingui } from '@lingui/react/macro';
|
import { useLingui } from '@lingui/react/macro';
|
||||||
import { useRecoilState, useRecoilValue } from 'recoil';
|
import { useRecoilState, useRecoilValue } from 'recoil';
|
||||||
import { IconX, isDefined, LightIconButton, useIsMobile } from 'twenty-ui';
|
import { isDefined } from 'twenty-shared';
|
||||||
|
import { IconX, LightIconButton, useIsMobile } from 'twenty-ui';
|
||||||
|
|
||||||
const StyledInputContainer = styled.div`
|
const StyledInputContainer = styled.div`
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
|||||||
@ -8,7 +8,8 @@ import { objectMetadataItemsState } from '@/object-metadata/states/objectMetadat
|
|||||||
import { useRecoilComponentValueV2 } from '@/ui/utilities/state/component-state/hooks/useRecoilComponentValueV2';
|
import { useRecoilComponentValueV2 } from '@/ui/utilities/state/component-state/hooks/useRecoilComponentValueV2';
|
||||||
import { t } from '@lingui/core/macro';
|
import { t } from '@lingui/core/macro';
|
||||||
import { useRecoilValue } from 'recoil';
|
import { useRecoilValue } from 'recoil';
|
||||||
import { IconArrowBackUp, isDefined } from 'twenty-ui';
|
import { isDefined } from 'twenty-shared';
|
||||||
|
import { IconArrowBackUp } from 'twenty-ui';
|
||||||
|
|
||||||
export const ResetContextToSelectionCommandButton = () => {
|
export const ResetContextToSelectionCommandButton = () => {
|
||||||
const contextStoreTargetedRecordsRule = useRecoilComponentValueV2(
|
const contextStoreTargetedRecordsRule = useRecoilComponentValueV2(
|
||||||
|
|||||||
@ -2,7 +2,7 @@ import { useCommandMenu } from '@/command-menu/hooks/useCommandMenu';
|
|||||||
import { isNonEmptyString } from '@sniptt/guards';
|
import { isNonEmptyString } from '@sniptt/guards';
|
||||||
import { useCallback } from 'react';
|
import { useCallback } from 'react';
|
||||||
import { useNavigate } from 'react-router-dom';
|
import { useNavigate } from 'react-router-dom';
|
||||||
import { isDefined } from 'twenty-ui';
|
import { isDefined } from 'twenty-shared';
|
||||||
|
|
||||||
export const useCommandMenuOnItemClick = () => {
|
export const useCommandMenuOnItemClick = () => {
|
||||||
const { toggleCommandMenu } = useCommandMenu();
|
const { toggleCommandMenu } = useCommandMenu();
|
||||||
|
|||||||
@ -9,8 +9,8 @@ import { useViewFromQueryParams } from '@/views/hooks/internal/useViewFromQueryP
|
|||||||
import { View } from '@/views/types/View';
|
import { View } from '@/views/types/View';
|
||||||
import { isUndefined } from '@sniptt/guards';
|
import { isUndefined } from '@sniptt/guards';
|
||||||
import { useEffect } from 'react';
|
import { useEffect } from 'react';
|
||||||
|
import { isDefined } from 'twenty-shared';
|
||||||
import { isDeeplyEqual } from '~/utils/isDeeplyEqual';
|
import { isDeeplyEqual } from '~/utils/isDeeplyEqual';
|
||||||
import { isDefined } from '~/utils/isDefined';
|
|
||||||
|
|
||||||
export const ContextStoreViewIdEffect = ({
|
export const ContextStoreViewIdEffect = ({
|
||||||
objectNamePlural,
|
objectNamePlural,
|
||||||
|
|||||||
@ -3,12 +3,12 @@ import { useMutation } from '@apollo/client';
|
|||||||
import { CREATE_ONE_DATABASE_CONNECTION } from '@/databases/graphql/mutations/createOneDatabaseConnection';
|
import { CREATE_ONE_DATABASE_CONNECTION } from '@/databases/graphql/mutations/createOneDatabaseConnection';
|
||||||
import { GET_MANY_DATABASE_CONNECTIONS } from '@/databases/graphql/queries/findManyDatabaseConnections';
|
import { GET_MANY_DATABASE_CONNECTIONS } from '@/databases/graphql/queries/findManyDatabaseConnections';
|
||||||
import { useApolloMetadataClient } from '@/object-metadata/hooks/useApolloMetadataClient';
|
import { useApolloMetadataClient } from '@/object-metadata/hooks/useApolloMetadataClient';
|
||||||
|
import { isDefined } from 'twenty-shared';
|
||||||
import {
|
import {
|
||||||
CreateRemoteServerInput,
|
CreateRemoteServerInput,
|
||||||
CreateServerMutation,
|
CreateServerMutation,
|
||||||
CreateServerMutationVariables,
|
CreateServerMutationVariables,
|
||||||
} from '~/generated-metadata/graphql';
|
} from '~/generated-metadata/graphql';
|
||||||
import { isDefined } from '~/utils/isDefined';
|
|
||||||
|
|
||||||
export const useCreateOneDatabaseConnection = () => {
|
export const useCreateOneDatabaseConnection = () => {
|
||||||
const apolloMetadataClient = useApolloMetadataClient();
|
const apolloMetadataClient = useApolloMetadataClient();
|
||||||
|
|||||||
@ -7,12 +7,12 @@ import { useApolloMetadataClient } from '@/object-metadata/hooks/useApolloMetada
|
|||||||
import { useFindManyObjectMetadataItems } from '@/object-metadata/hooks/useFindManyObjectMetadataItems';
|
import { useFindManyObjectMetadataItems } from '@/object-metadata/hooks/useFindManyObjectMetadataItems';
|
||||||
import { CoreObjectNameSingular } from '@/object-metadata/types/CoreObjectNameSingular';
|
import { CoreObjectNameSingular } from '@/object-metadata/types/CoreObjectNameSingular';
|
||||||
import { useFindManyRecordsQuery } from '@/object-record/hooks/useFindManyRecordsQuery';
|
import { useFindManyRecordsQuery } from '@/object-record/hooks/useFindManyRecordsQuery';
|
||||||
|
import { isDefined } from 'twenty-shared';
|
||||||
import {
|
import {
|
||||||
RemoteTableInput,
|
RemoteTableInput,
|
||||||
SyncRemoteTableMutation,
|
SyncRemoteTableMutation,
|
||||||
SyncRemoteTableMutationVariables,
|
SyncRemoteTableMutationVariables,
|
||||||
} from '~/generated-metadata/graphql';
|
} from '~/generated-metadata/graphql';
|
||||||
import { isDefined } from '~/utils/isDefined';
|
|
||||||
|
|
||||||
export const useSyncRemoteTable = () => {
|
export const useSyncRemoteTable = () => {
|
||||||
const apolloMetadataClient = useApolloMetadataClient();
|
const apolloMetadataClient = useApolloMetadataClient();
|
||||||
|
|||||||
@ -7,12 +7,12 @@ import { useApolloMetadataClient } from '@/object-metadata/hooks/useApolloMetada
|
|||||||
import { useFindManyObjectMetadataItems } from '@/object-metadata/hooks/useFindManyObjectMetadataItems';
|
import { useFindManyObjectMetadataItems } from '@/object-metadata/hooks/useFindManyObjectMetadataItems';
|
||||||
import { CoreObjectNameSingular } from '@/object-metadata/types/CoreObjectNameSingular';
|
import { CoreObjectNameSingular } from '@/object-metadata/types/CoreObjectNameSingular';
|
||||||
import { useFindManyRecordsQuery } from '@/object-record/hooks/useFindManyRecordsQuery';
|
import { useFindManyRecordsQuery } from '@/object-record/hooks/useFindManyRecordsQuery';
|
||||||
|
import { isDefined } from 'twenty-shared';
|
||||||
import {
|
import {
|
||||||
RemoteTableInput,
|
RemoteTableInput,
|
||||||
SyncRemoteTableSchemaChangesMutation,
|
SyncRemoteTableSchemaChangesMutation,
|
||||||
SyncRemoteTableSchemaChangesMutationVariables,
|
SyncRemoteTableSchemaChangesMutationVariables,
|
||||||
} from '~/generated-metadata/graphql';
|
} from '~/generated-metadata/graphql';
|
||||||
import { isDefined } from '~/utils/isDefined';
|
|
||||||
|
|
||||||
export const useSyncRemoteTableSchemaChanges = () => {
|
export const useSyncRemoteTableSchemaChanges = () => {
|
||||||
const apolloMetadataClient = useApolloMetadataClient();
|
const apolloMetadataClient = useApolloMetadataClient();
|
||||||
|
|||||||
@ -5,12 +5,12 @@ import { UNSYNC_REMOTE_TABLE } from '@/databases/graphql/mutations/unsyncRemoteT
|
|||||||
import { modifyRemoteTableFromCache } from '@/databases/utils/modifyRemoteTableFromCache';
|
import { modifyRemoteTableFromCache } from '@/databases/utils/modifyRemoteTableFromCache';
|
||||||
import { useApolloMetadataClient } from '@/object-metadata/hooks/useApolloMetadataClient';
|
import { useApolloMetadataClient } from '@/object-metadata/hooks/useApolloMetadataClient';
|
||||||
import { useFindManyObjectMetadataItems } from '@/object-metadata/hooks/useFindManyObjectMetadataItems';
|
import { useFindManyObjectMetadataItems } from '@/object-metadata/hooks/useFindManyObjectMetadataItems';
|
||||||
|
import { isDefined } from 'twenty-shared';
|
||||||
import {
|
import {
|
||||||
RemoteTableInput,
|
RemoteTableInput,
|
||||||
UnsyncRemoteTableMutation,
|
UnsyncRemoteTableMutation,
|
||||||
UnsyncRemoteTableMutationVariables,
|
UnsyncRemoteTableMutationVariables,
|
||||||
} from '~/generated-metadata/graphql';
|
} from '~/generated-metadata/graphql';
|
||||||
import { isDefined } from '~/utils/isDefined';
|
|
||||||
|
|
||||||
export const useUnsyncRemoteTable = () => {
|
export const useUnsyncRemoteTable = () => {
|
||||||
const apolloMetadataClient = useApolloMetadataClient();
|
const apolloMetadataClient = useApolloMetadataClient();
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
import { domainConfigurationState } from '@/domain-manager/states/domainConfigurationState';
|
import { domainConfigurationState } from '@/domain-manager/states/domainConfigurationState';
|
||||||
import { useRecoilValue } from 'recoil';
|
import { useRecoilValue } from 'recoil';
|
||||||
import { isDefined } from '~/utils/isDefined';
|
import { isDefined } from 'twenty-shared';
|
||||||
|
|
||||||
export const useBuildWorkspaceUrl = () => {
|
export const useBuildWorkspaceUrl = () => {
|
||||||
const domainConfiguration = useRecoilValue(domainConfigurationState);
|
const domainConfiguration = useRecoilValue(domainConfigurationState);
|
||||||
|
|||||||
@ -4,8 +4,8 @@ import { useIsCurrentLocationOnDefaultDomain } from '@/domain-manager/hooks/useI
|
|||||||
import { useRedirectToDefaultDomain } from '@/domain-manager/hooks/useRedirectToDefaultDomain';
|
import { useRedirectToDefaultDomain } from '@/domain-manager/hooks/useRedirectToDefaultDomain';
|
||||||
import { workspaceAuthProvidersState } from '@/workspace/states/workspaceAuthProvidersState';
|
import { workspaceAuthProvidersState } from '@/workspace/states/workspaceAuthProvidersState';
|
||||||
import { useRecoilValue, useSetRecoilState } from 'recoil';
|
import { useRecoilValue, useSetRecoilState } from 'recoil';
|
||||||
|
import { isDefined } from 'twenty-shared';
|
||||||
import { useGetPublicWorkspaceDataBySubdomainQuery } from '~/generated/graphql';
|
import { useGetPublicWorkspaceDataBySubdomainQuery } from '~/generated/graphql';
|
||||||
import { isDefined } from '~/utils/isDefined';
|
|
||||||
|
|
||||||
export const useGetPublicWorkspaceDataBySubdomain = () => {
|
export const useGetPublicWorkspaceDataBySubdomain = () => {
|
||||||
const { isDefaultDomain } = useIsCurrentLocationOnDefaultDomain();
|
const { isDefaultDomain } = useIsCurrentLocationOnDefaultDomain();
|
||||||
|
|||||||
@ -1,8 +1,8 @@
|
|||||||
import { isDefined } from '~/utils/isDefined';
|
|
||||||
import { isMultiWorkspaceEnabledState } from '@/client-config/states/isMultiWorkspaceEnabledState';
|
import { isMultiWorkspaceEnabledState } from '@/client-config/states/isMultiWorkspaceEnabledState';
|
||||||
import { useRecoilValue } from 'recoil';
|
|
||||||
import { domainConfigurationState } from '@/domain-manager/states/domainConfigurationState';
|
|
||||||
import { useReadDefaultDomainFromConfiguration } from '@/domain-manager/hooks/useReadDefaultDomainFromConfiguration';
|
import { useReadDefaultDomainFromConfiguration } from '@/domain-manager/hooks/useReadDefaultDomainFromConfiguration';
|
||||||
|
import { domainConfigurationState } from '@/domain-manager/states/domainConfigurationState';
|
||||||
|
import { useRecoilValue } from 'recoil';
|
||||||
|
import { isDefined } from 'twenty-shared';
|
||||||
|
|
||||||
export const useIsCurrentLocationOnAWorkspaceSubdomain = () => {
|
export const useIsCurrentLocationOnAWorkspaceSubdomain = () => {
|
||||||
const { defaultDomain } = useReadDefaultDomainFromConfiguration();
|
const { defaultDomain } = useReadDefaultDomainFromConfiguration();
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
import { isDefined } from '~/utils/isDefined';
|
import { useIsCurrentLocationOnAWorkspaceSubdomain } from '@/domain-manager/hooks/useIsCurrentLocationOnAWorkspaceSubdomain';
|
||||||
import { domainConfigurationState } from '@/domain-manager/states/domainConfigurationState';
|
import { domainConfigurationState } from '@/domain-manager/states/domainConfigurationState';
|
||||||
import { useRecoilValue } from 'recoil';
|
import { useRecoilValue } from 'recoil';
|
||||||
import { useIsCurrentLocationOnAWorkspaceSubdomain } from '@/domain-manager/hooks/useIsCurrentLocationOnAWorkspaceSubdomain';
|
import { isDefined } from 'twenty-shared';
|
||||||
|
|
||||||
export const useReadWorkspaceSubdomainFromCurrentLocation = () => {
|
export const useReadWorkspaceSubdomainFromCurrentLocation = () => {
|
||||||
const domainConfiguration = useRecoilValue(domainConfigurationState);
|
const domainConfiguration = useRecoilValue(domainConfigurationState);
|
||||||
|
|||||||
@ -7,8 +7,8 @@ import { currentUserState } from '@/auth/states/currentUserState';
|
|||||||
import { currentWorkspaceMemberState } from '@/auth/states/currentWorkspaceMemberState';
|
import { currentWorkspaceMemberState } from '@/auth/states/currentWorkspaceMemberState';
|
||||||
import { currentWorkspaceState } from '@/auth/states/currentWorkspaceState';
|
import { currentWorkspaceState } from '@/auth/states/currentWorkspaceState';
|
||||||
import { sentryConfigState } from '@/client-config/states/sentryConfigState';
|
import { sentryConfigState } from '@/client-config/states/sentryConfigState';
|
||||||
|
import { isDefined } from 'twenty-shared';
|
||||||
import { REACT_APP_SERVER_BASE_URL } from '~/config';
|
import { REACT_APP_SERVER_BASE_URL } from '~/config';
|
||||||
import { isDefined } from '~/utils/isDefined';
|
|
||||||
|
|
||||||
export const SentryInitEffect = () => {
|
export const SentryInitEffect = () => {
|
||||||
const sentryConfig = useRecoilValue(sentryConfigState);
|
const sentryConfig = useRecoilValue(sentryConfigState);
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user