Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion front/.nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
18.6.0
18.16.0
196 changes: 195 additions & 1 deletion front/src/generated/graphql.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ export type CommentThreadTarget = {
createdAt: Scalars['DateTime'];
id: Scalars['ID'];
updatedAt: Scalars['DateTime'];
workspace: Workspace;
workspace?: Maybe<Workspace>;
};

export type CommentThreadTargetCreateManyCommentThreadInput = {
Expand Down Expand Up @@ -712,6 +712,17 @@ export enum FileFolder {
WorkspaceLogo = 'WorkspaceLogo'
}

export type IntFilter = {
equals?: InputMaybe<Scalars['Int']>;
gt?: InputMaybe<Scalars['Int']>;
gte?: InputMaybe<Scalars['Int']>;
in?: InputMaybe<Array<Scalars['Int']>>;
lt?: InputMaybe<Scalars['Int']>;
lte?: InputMaybe<Scalars['Int']>;
not?: InputMaybe<NestedIntFilter>;
notIn?: InputMaybe<Array<Scalars['Int']>>;
};

export type IntNullableFilter = {
equals?: InputMaybe<Scalars['Int']>;
gt?: InputMaybe<Scalars['Int']>;
Expand Down Expand Up @@ -765,6 +776,7 @@ export type Mutation = {
updateOnePerson?: Maybe<Person>;
updateOnePipelineProgress?: Maybe<PipelineProgress>;
updateOnePipelineStage?: Maybe<PipelineStage>;
updateOneViewField: ViewField;
updateUser: User;
updateWorkspace: Workspace;
uploadAttachment: Scalars['String'];
Expand Down Expand Up @@ -880,6 +892,12 @@ export type MutationUpdateOnePipelineStageArgs = {
};


export type MutationUpdateOneViewFieldArgs = {
data: ViewFieldUpdateInput;
where: ViewFieldWhereUniqueInput;
};


export type MutationUpdateUserArgs = {
data: UserUpdateInput;
where: UserWhereUniqueInput;
Expand Down Expand Up @@ -985,6 +1003,17 @@ export type NestedEnumPipelineProgressableTypeFilter = {
notIn?: InputMaybe<Array<PipelineProgressableType>>;
};

export type NestedIntFilter = {
equals?: InputMaybe<Scalars['Int']>;
gt?: InputMaybe<Scalars['Int']>;
gte?: InputMaybe<Scalars['Int']>;
in?: InputMaybe<Array<Scalars['Int']>>;
lt?: InputMaybe<Scalars['Int']>;
lte?: InputMaybe<Scalars['Int']>;
not?: InputMaybe<NestedIntFilter>;
notIn?: InputMaybe<Array<Scalars['Int']>>;
};

export type NestedIntNullableFilter = {
equals?: InputMaybe<Scalars['Int']>;
gt?: InputMaybe<Scalars['Int']>;
Expand Down Expand Up @@ -1500,6 +1529,7 @@ export type Query = {
findManyPipelineProgress: Array<PipelineProgress>;
findManyPipelineStage: Array<PipelineStage>;
findManyUser: Array<User>;
findManyViewField: Array<ViewField>;
findManyWorkspaceMember: Array<WorkspaceMember>;
findUniqueCompany: Company;
findUniquePerson: Person;
Expand Down Expand Up @@ -1586,6 +1616,16 @@ export type QueryFindManyUserArgs = {
};


export type QueryFindManyViewFieldArgs = {
cursor?: InputMaybe<ViewFieldWhereUniqueInput>;
distinct?: InputMaybe<Array<ViewFieldScalarFieldEnum>>;
orderBy?: InputMaybe<Array<ViewFieldOrderByWithRelationInput>>;
skip?: InputMaybe<Scalars['Int']>;
take?: InputMaybe<Scalars['Int']>;
where?: InputMaybe<ViewFieldWhereInput>;
};


export type QueryFindManyWorkspaceMemberArgs = {
cursor?: InputMaybe<WorkspaceMemberWhereUniqueInput>;
distinct?: InputMaybe<Array<WorkspaceMemberScalarFieldEnum>>;
Expand Down Expand Up @@ -1867,6 +1907,66 @@ export type Verify = {
user: User;
};

export type ViewField = {
__typename?: 'ViewField';
fieldName: Scalars['String'];
id: Scalars['ID'];
index: Scalars['Int'];
isVisible: Scalars['Boolean'];
objectName: Scalars['String'];
sizeInPx: Scalars['Int'];
};

export type ViewFieldOrderByWithRelationInput = {
fieldName?: InputMaybe<SortOrder>;
id?: InputMaybe<SortOrder>;
index?: InputMaybe<SortOrder>;
isVisible?: InputMaybe<SortOrder>;
objectName?: InputMaybe<SortOrder>;
sizeInPx?: InputMaybe<SortOrder>;
};

export enum ViewFieldScalarFieldEnum {
FieldName = 'fieldName',
Id = 'id',
Index = 'index',
IsVisible = 'isVisible',
ObjectName = 'objectName',
SizeInPx = 'sizeInPx',
WorkspaceId = 'workspaceId'
}

export type ViewFieldUpdateInput = {
fieldName?: InputMaybe<Scalars['String']>;
id?: InputMaybe<Scalars['String']>;
index?: InputMaybe<Scalars['Int']>;
isVisible?: InputMaybe<Scalars['Boolean']>;
objectName?: InputMaybe<Scalars['String']>;
sizeInPx?: InputMaybe<Scalars['Int']>;
};

export type ViewFieldUpdateManyWithoutWorkspaceNestedInput = {
connect?: InputMaybe<Array<ViewFieldWhereUniqueInput>>;
disconnect?: InputMaybe<Array<ViewFieldWhereUniqueInput>>;
set?: InputMaybe<Array<ViewFieldWhereUniqueInput>>;
};

export type ViewFieldWhereInput = {
AND?: InputMaybe<Array<ViewFieldWhereInput>>;
NOT?: InputMaybe<Array<ViewFieldWhereInput>>;
OR?: InputMaybe<Array<ViewFieldWhereInput>>;
fieldName?: InputMaybe<StringFilter>;
id?: InputMaybe<StringFilter>;
index?: InputMaybe<IntFilter>;
isVisible?: InputMaybe<BoolFilter>;
objectName?: InputMaybe<StringFilter>;
sizeInPx?: InputMaybe<IntFilter>;
};

export type ViewFieldWhereUniqueInput = {
id?: InputMaybe<Scalars['String']>;
};

export type Workspace = {
__typename?: 'Workspace';
Attachment?: Maybe<Array<Attachment>>;
Expand All @@ -1885,6 +1985,7 @@ export type Workspace = {
pipelineStages?: Maybe<Array<PipelineStage>>;
pipelines?: Maybe<Array<Pipeline>>;
updatedAt: Scalars['DateTime'];
viewFields?: Maybe<Array<ViewField>>;
workspaceMember?: Maybe<Array<WorkspaceMember>>;
};

Expand Down Expand Up @@ -1959,6 +2060,7 @@ export type WorkspaceUpdateInput = {
pipelineStages?: InputMaybe<PipelineStageUpdateManyWithoutWorkspaceNestedInput>;
pipelines?: InputMaybe<PipelineUpdateManyWithoutWorkspaceNestedInput>;
updatedAt?: InputMaybe<Scalars['DateTime']>;
viewFields?: InputMaybe<ViewFieldUpdateManyWithoutWorkspaceNestedInput>;
workspaceMember?: InputMaybe<WorkspaceMemberUpdateManyWithoutWorkspaceNestedInput>;
};

Expand Down Expand Up @@ -2342,6 +2444,21 @@ export type RemoveProfilePictureMutationVariables = Exact<{

export type RemoveProfilePictureMutation = { __typename?: 'Mutation', updateUser: { __typename?: 'User', id: string, avatarUrl?: string | null } };

export type GetViewFieldsQueryVariables = Exact<{
where?: InputMaybe<ViewFieldWhereInput>;
}>;


export type GetViewFieldsQuery = { __typename?: 'Query', viewFields: Array<{ __typename?: 'ViewField', id: string, fieldName: string, isVisible: boolean, sizeInPx: number, index: number }> };

export type UpdateViewFieldMutationVariables = Exact<{
data: ViewFieldUpdateInput;
where: ViewFieldWhereUniqueInput;
}>;


export type UpdateViewFieldMutation = { __typename?: 'Mutation', updateOneViewField: { __typename?: 'ViewField', id: string, fieldName: string, isVisible: boolean, sizeInPx: number, index: number } };

export type GetWorkspaceMembersQueryVariables = Exact<{ [key: string]: never; }>;


Expand Down Expand Up @@ -4470,6 +4587,83 @@ export function useRemoveProfilePictureMutation(baseOptions?: Apollo.MutationHoo
export type RemoveProfilePictureMutationHookResult = ReturnType<typeof useRemoveProfilePictureMutation>;
export type RemoveProfilePictureMutationResult = Apollo.MutationResult<RemoveProfilePictureMutation>;
export type RemoveProfilePictureMutationOptions = Apollo.BaseMutationOptions<RemoveProfilePictureMutation, RemoveProfilePictureMutationVariables>;
export const GetViewFieldsDocument = gql`
query GetViewFields($where: ViewFieldWhereInput) {
viewFields: findManyViewField(where: $where) {
id
fieldName
isVisible
sizeInPx
index
}
}
`;

/**
* __useGetViewFieldsQuery__
*
* To run a query within a React component, call `useGetViewFieldsQuery` and pass it any options that fit your needs.
* When your component renders, `useGetViewFieldsQuery` returns an object from Apollo Client that contains loading, error, and data properties
* you can use to render your UI.
*
* @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options;
*
* @example
* const { data, loading, error } = useGetViewFieldsQuery({
* variables: {
* where: // value for 'where'
* },
* });
*/
export function useGetViewFieldsQuery(baseOptions?: Apollo.QueryHookOptions<GetViewFieldsQuery, GetViewFieldsQueryVariables>) {
const options = {...defaultOptions, ...baseOptions}
return Apollo.useQuery<GetViewFieldsQuery, GetViewFieldsQueryVariables>(GetViewFieldsDocument, options);
}
export function useGetViewFieldsLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions<GetViewFieldsQuery, GetViewFieldsQueryVariables>) {
const options = {...defaultOptions, ...baseOptions}
return Apollo.useLazyQuery<GetViewFieldsQuery, GetViewFieldsQueryVariables>(GetViewFieldsDocument, options);
}
export type GetViewFieldsQueryHookResult = ReturnType<typeof useGetViewFieldsQuery>;
export type GetViewFieldsLazyQueryHookResult = ReturnType<typeof useGetViewFieldsLazyQuery>;
export type GetViewFieldsQueryResult = Apollo.QueryResult<GetViewFieldsQuery, GetViewFieldsQueryVariables>;
export const UpdateViewFieldDocument = gql`
mutation UpdateViewField($data: ViewFieldUpdateInput!, $where: ViewFieldWhereUniqueInput!) {
updateOneViewField(data: $data, where: $where) {
id
fieldName
isVisible
sizeInPx
index
}
}
`;
export type UpdateViewFieldMutationFn = Apollo.MutationFunction<UpdateViewFieldMutation, UpdateViewFieldMutationVariables>;

/**
* __useUpdateViewFieldMutation__
*
* To run a mutation, you first call `useUpdateViewFieldMutation` within a React component and pass it any options that fit your needs.
* When your component renders, `useUpdateViewFieldMutation` returns a tuple that includes:
* - A mutate function that you can call at any time to execute the mutation
* - An object with fields that represent the current status of the mutation's execution
*
* @param baseOptions options that will be passed into the mutation, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options-2;
*
* @example
* const [updateViewFieldMutation, { data, loading, error }] = useUpdateViewFieldMutation({
* variables: {
* data: // value for 'data'
* where: // value for 'where'
* },
* });
*/
export function useUpdateViewFieldMutation(baseOptions?: Apollo.MutationHookOptions<UpdateViewFieldMutation, UpdateViewFieldMutationVariables>) {
const options = {...defaultOptions, ...baseOptions}
return Apollo.useMutation<UpdateViewFieldMutation, UpdateViewFieldMutationVariables>(UpdateViewFieldDocument, options);
}
export type UpdateViewFieldMutationHookResult = ReturnType<typeof useUpdateViewFieldMutation>;
export type UpdateViewFieldMutationResult = Apollo.MutationResult<UpdateViewFieldMutation>;
export type UpdateViewFieldMutationOptions = Apollo.BaseMutationOptions<UpdateViewFieldMutation, UpdateViewFieldMutationVariables>;
export const GetWorkspaceMembersDocument = gql`
query GetWorkspaceMembers {
workspaceMembers: findManyWorkspaceMember {
Expand Down
13 changes: 13 additions & 0 deletions front/src/modules/views/queries/select.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { gql } from '@apollo/client';

export const GET_VIEW_FIELDS = gql`
query GetViewFields($where: ViewFieldWhereInput) {
viewFields: findManyViewField(where: $where) {
id
fieldName
isVisible
sizeInPx
index
}
}
`;
16 changes: 16 additions & 0 deletions front/src/modules/views/queries/update.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import { gql } from '@apollo/client';

export const UPDATE_VIEW_FIELD = gql`
mutation UpdateViewField(
$data: ViewFieldUpdateInput!
$where: ViewFieldWhereUniqueInput!
) {
updateOneViewField(data: $data, where: $where) {
id
fieldName
isVisible
sizeInPx
index
}
}
`;
2 changes: 1 addition & 1 deletion server/.nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
18.10.0
18.16.0
6 changes: 6 additions & 0 deletions server/src/ability/ability.factory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import {
PipelineProgress,
Attachment,
UserSettings,
ViewField,
} from '@prisma/client';

import { AbilityAction } from './ability.action';
Expand All @@ -36,6 +37,7 @@ type SubjectsAbility = Subjects<{
PipelineProgress: PipelineProgress;
Attachment: Attachment;
UserSettings: UserSettings;
ViewField: ViewField;
}>;

export type AppAbility = PureAbility<
Expand Down Expand Up @@ -128,6 +130,10 @@ export class AbilityFactory {
workspaceId: workspace.id,
});

// ViewField
can(AbilityAction.Read, 'ViewField', { workspaceId: workspace.id });
can(AbilityAction.Update, 'ViewField', { workspaceId: workspace.id });

return build();
}
}
10 changes: 10 additions & 0 deletions server/src/ability/ability.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,10 @@ import {
ReadAttachmentAbilityHandler,
UpdateAttachmentAbilityHandler,
} from './handlers/attachment.ability-handler';
import {
ReadViewFieldAbilityHandler,
UpdateViewFieldAbilityHandler,
} from './handlers/view-field.ability-handler';

@Global()
@Module({
Expand Down Expand Up @@ -178,6 +182,9 @@ import {
CreatePipelineProgressAbilityHandler,
UpdatePipelineProgressAbilityHandler,
DeletePipelineProgressAbilityHandler,
// ViewField
ReadViewFieldAbilityHandler,
UpdateViewFieldAbilityHandler,
],
exports: [
AbilityFactory,
Expand Down Expand Up @@ -259,6 +266,9 @@ import {
CreatePipelineProgressAbilityHandler,
UpdatePipelineProgressAbilityHandler,
DeletePipelineProgressAbilityHandler,
// ViewField
ReadViewFieldAbilityHandler,
UpdateViewFieldAbilityHandler,
],
})
export class AbilityModule {}
Loading