Renamed nullable utils into isDefined and isUndefinedOrNull (#4402)
* Renamed nullable utils into isDefined and isUndefinedOrNull
This commit is contained in:
@ -18,7 +18,7 @@ import { Button } from '@/ui/input/button/components/Button.tsx';
|
||||
import { SubMenuTopBarContainer } from '@/ui/layout/page/SubMenuTopBarContainer';
|
||||
import { Section } from '@/ui/layout/section/components/Section.tsx';
|
||||
import { useBillingPortalSessionQuery } from '~/generated/graphql.tsx';
|
||||
import { isNonNullable } from '~/utils/isNonNullable';
|
||||
import { isDefined } from '~/utils/isDefined';
|
||||
|
||||
const StyledH1Title = styled(H1Title)`
|
||||
margin-bottom: 0;
|
||||
@ -46,7 +46,7 @@ export const SettingsBilling = () => {
|
||||
onboardingStatus === OnboardingStatus.Canceled;
|
||||
|
||||
const openBillingPortal = () => {
|
||||
if (isNonNullable(data)) {
|
||||
if (isDefined(data)) {
|
||||
window.location.replace(data.billingPortalSession.url);
|
||||
}
|
||||
};
|
||||
|
||||
@ -28,7 +28,7 @@ import { Breadcrumb } from '@/ui/navigation/bread-crumb/components/Breadcrumb';
|
||||
import { View } from '@/views/types/View';
|
||||
import { ViewType } from '@/views/types/ViewType';
|
||||
import { FieldMetadataType } from '~/generated-metadata/graphql';
|
||||
import { isNullable } from '~/utils/isNullable';
|
||||
import { isUndefinedOrNull } from '~/utils/isUndefinedOrNull';
|
||||
|
||||
const StyledSettingsObjectFieldTypeSelect = styled(
|
||||
SettingsDataModelFieldTypeSelect,
|
||||
@ -96,7 +96,7 @@ export const SettingsObjectNewFieldStep2 = () => {
|
||||
onCompleted: async (data: ObjectRecordConnection<View>) => {
|
||||
const views = data.edges;
|
||||
|
||||
if (isNullable(views)) return;
|
||||
if (isUndefinedOrNull(views)) return;
|
||||
|
||||
setObjectViews(data.edges.map(({ node }) => node));
|
||||
},
|
||||
@ -112,7 +112,7 @@ export const SettingsObjectNewFieldStep2 = () => {
|
||||
onCompleted: async (data: ObjectRecordConnection<View>) => {
|
||||
const views = data.edges;
|
||||
|
||||
if (isNullable(views)) return;
|
||||
if (isUndefinedOrNull(views)) return;
|
||||
|
||||
setRelationObjectViews(data.edges.map(({ node }) => node));
|
||||
},
|
||||
|
||||
@ -26,7 +26,7 @@ import { SubMenuTopBarContainer } from '@/ui/layout/page/SubMenuTopBarContainer'
|
||||
import { Section } from '@/ui/layout/section/components/Section';
|
||||
import { Breadcrumb } from '@/ui/navigation/bread-crumb/components/Breadcrumb';
|
||||
import { useGenerateApiKeyTokenMutation } from '~/generated/graphql';
|
||||
import { isNonNullable } from '~/utils/isNonNullable';
|
||||
import { isDefined } from '~/utils/isDefined';
|
||||
|
||||
const StyledInfo = styled.span`
|
||||
color: ${({ theme }) => theme.font.color.light};
|
||||
@ -119,7 +119,7 @@ export const SettingsDevelopersApiKeyDetail = () => {
|
||||
};
|
||||
|
||||
useEffect(() => {
|
||||
if (isNonNullable(apiKeyData)) {
|
||||
if (isDefined(apiKeyData)) {
|
||||
return () => {
|
||||
setGeneratedApi(apiKeyId, null);
|
||||
};
|
||||
|
||||
@ -18,7 +18,7 @@ import { SubMenuTopBarContainer } from '@/ui/layout/page/SubMenuTopBarContainer'
|
||||
import { Section } from '@/ui/layout/section/components/Section';
|
||||
import { Breadcrumb } from '@/ui/navigation/bread-crumb/components/Breadcrumb';
|
||||
import { useGenerateApiKeyTokenMutation } from '~/generated/graphql';
|
||||
import { isNonNullable } from '~/utils/isNonNullable';
|
||||
import { isDefined } from '~/utils/isDefined';
|
||||
|
||||
export const SettingsDevelopersApiKeysNew = () => {
|
||||
const [generateOneApiKeyToken] = useGenerateApiKeyTokenMutation();
|
||||
@ -55,7 +55,7 @@ export const SettingsDevelopersApiKeysNew = () => {
|
||||
expiresAt: expiresAt,
|
||||
},
|
||||
});
|
||||
if (isNonNullable(tokenData.data?.generateApiKeyToken)) {
|
||||
if (isDefined(tokenData.data?.generateApiKeyToken)) {
|
||||
setGeneratedApi(newApiKey.id, tokenData.data.generateApiKeyToken.token);
|
||||
navigate(`/settings/developers/api-keys/${newApiKey.id}`);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user