refactor: remove mappers (#326)

* refactor: remove mappers

* chore: generate graphql types

* lint: remove useless import

* Remove preset-react-create-app from storybook addons

* test: remove old tests

* Upgrade storybook version

* Remove sb preset-cra and add sb svgr loader

* chore: remove figma image url from storybook

---------

Co-authored-by: Charles Bochet <charles@twenty.com>
This commit is contained in:
Sammy Teillet
2023-06-19 16:07:16 +02:00
committed by GitHub
parent c8c4a953c2
commit 96a53ad765
27 changed files with 849 additions and 1005 deletions

View File

@ -1,26 +1,11 @@
export interface Workspace {
id: string;
domainName?: string;
displayName?: string;
logo?: string | null;
__typename?: string;
}
import { Workspace as GQLWorkspace } from '../../../generated/graphql';
import { DeepPartial } from '../../utils/utils';
export type GraphqlQueryWorkspace = {
id: string;
displayName?: string;
domainName?: string;
logo?: string | null;
__typename?: string;
};
export type Workspace = DeepPartial<GQLWorkspace> & { id: GQLWorkspace['id'] };
export type GraphqlMutationWorkspace = {
id: string;
displayName?: string;
domainName?: string;
logo?: string | null;
__typename?: string;
};
export type GraphqlQueryWorkspace = Workspace;
export type GraphqlMutationWorkspace = Workspace;
export const mapToWorkspace = (
workspace: GraphqlQueryWorkspace,
@ -33,10 +18,4 @@ export const mapToWorkspace = (
export const mapToGqlWorkspace = (
workspace: Workspace,
): GraphqlMutationWorkspace => ({
id: workspace.id,
domainName: workspace.domainName,
displayName: workspace.displayName,
logo: workspace.logo,
__typename: 'workspaces',
});
): GraphqlMutationWorkspace => workspace;