Skip to content

Commit

Permalink
add org edit - initial
Browse files Browse the repository at this point in the history
  • Loading branch information
mahmoudmoravej committed Mar 6, 2024
1 parent 020467e commit 41e6ec6
Show file tree
Hide file tree
Showing 6 changed files with 499 additions and 2 deletions.
198 changes: 196 additions & 2 deletions app/@types/graphql/schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,36 @@ export type AdviceEdge = {
export type AiEngine = {
__typename?: 'AiEngine';
id: Scalars['Int']['output'];
title?: Maybe<Scalars['String']['output']>;
organizationId: Scalars['Int']['output'];
settings?: Maybe<Scalars['String']['output']>;
type: AiEngineType;
typeId: Scalars['Int']['output'];
};

/** The connection type for AiEngine. */
export type AiEngineConnection = {
__typename?: 'AiEngineConnection';
/** A list of edges. */
edges?: Maybe<Array<Maybe<AiEngineEdge>>>;
/** A list of nodes. */
nodes?: Maybe<Array<Maybe<AiEngine>>>;
/** Information to aid in pagination. */
pageInfo: PageInfo;
};

/** An edge in a connection. */
export type AiEngineEdge = {
__typename?: 'AiEngineEdge';
/** A cursor for use in pagination. */
cursor: Scalars['String']['output'];
/** The item at the end of the edge. */
node?: Maybe<AiEngine>;
};

export type AiEngineType = {
__typename?: 'AiEngineType';
id: Scalars['Int']['output'];
title: Scalars['String']['output'];
};

/** Autogenerated input type of AnalyzeActivity */
Expand Down Expand Up @@ -478,6 +507,8 @@ export type Mutation = {
managerCreate?: Maybe<ManagerCreatePayload>;
/** Updates a manager by id */
managerUpdate?: Maybe<ManagerUpdatePayload>;
/** Update an existing organization by id */
organizationUpdate?: Maybe<OrganizationUpdatePayload>;
/** Creates a new report */
reportCreate?: Maybe<ReportCreatePayload>;
/** Updates a report by id */
Expand Down Expand Up @@ -551,6 +582,11 @@ export type MutationManagerUpdateArgs = {
};


export type MutationOrganizationUpdateArgs = {
input: OrganizationUpdateInput;
};


export type MutationReportCreateArgs = {
input: ReportCreateInput;
};
Expand Down Expand Up @@ -583,12 +619,51 @@ export type Order = {

export type Organization = {
__typename?: 'Organization';
aiEngines?: Maybe<AiEngineConnection>;
githubOrgs?: Maybe<Scalars['String']['output']>;
githubToken?: Maybe<Scalars['String']['output']>;
id: Scalars['Int']['output'];
isPersonal: Scalars['Boolean']['output'];
name?: Maybe<Scalars['String']['output']>;
name: Scalars['String']['output'];
ownerUserId: Scalars['Int']['output'];
useSystemAiEngine: Scalars['Boolean']['output'];
useSystemGithubToken: Scalars['Boolean']['output'];
userId?: Maybe<Scalars['Int']['output']>;
};


export type OrganizationAiEnginesArgs = {
after?: InputMaybe<Scalars['String']['input']>;
before?: InputMaybe<Scalars['String']['input']>;
first?: InputMaybe<Scalars['Int']['input']>;
last?: InputMaybe<Scalars['Int']['input']>;
};

export type OrganizationUpdate = {
githubOrgs?: InputMaybe<Scalars['String']['input']>;
githubToken?: InputMaybe<Scalars['String']['input']>;
name: Scalars['String']['input'];
ownerUserId: Scalars['Int']['input'];
useSystemAiEngine: Scalars['Boolean']['input'];
useSystemGithubToken: Scalars['Boolean']['input'];
};

/** Autogenerated input type of OrganizationUpdate */
export type OrganizationUpdateInput = {
/** A unique identifier for the client performing the mutation. */
clientMutationId?: InputMaybe<Scalars['String']['input']>;
id: Scalars['ID']['input'];
organizationInput: OrganizationUpdate;
};

/** Autogenerated return type of OrganizationUpdate. */
export type OrganizationUpdatePayload = {
__typename?: 'OrganizationUpdatePayload';
/** A unique identifier for the client performing the mutation. */
clientMutationId?: Maybe<Scalars['String']['output']>;
organization: Organization;
};

/** Information about pagination in a connection. */
export type PageInfo = {
__typename?: 'PageInfo';
Expand Down Expand Up @@ -630,6 +705,8 @@ export type Query = {
individuals: IndividualConnection;
/** Returns logged in user details */
myInfo: UserInfo;
/** Returns an organization */
organization: Organization;
/** Returns a vision */
vision: Vision;
/** Returns list of vision types */
Expand Down Expand Up @@ -703,6 +780,11 @@ export type QueryIndividualsArgs = {
};


export type QueryOrganizationArgs = {
id: Scalars['ID']['input'];
};


export type QueryVisionArgs = {
id: Scalars['ID']['input'];
};
Expand Down Expand Up @@ -1088,6 +1170,22 @@ export type IndividualsQueryVariables = Exact<{

export type IndividualsQuery = { __typename?: 'Query', individuals: { __typename?: 'IndividualConnection', nodes?: Array<{ __typename?: 'Individual', id: number, fullname?: string | null, jobTitle?: string | null, jobLevelId?: string | null, isManager: boolean } | null> | null }, managerInfo?: { __typename?: 'Individual', id: number, fullname?: string | null, jobTitle?: string | null } };

export type FindOrganizationQueryVariables = Exact<{
id: Scalars['ID']['input'];
}>;


export type FindOrganizationQuery = { __typename?: 'Query', organization: { __typename?: 'Organization', id: number, name: string, ownerUserId: number, githubOrgs?: string | null, useSystemGithubToken: boolean, githubToken?: string | null, useSystemAiEngine: boolean, aiEngines?: { __typename?: 'AiEngineConnection', nodes?: Array<{ __typename?: 'AiEngine', id: number, settings?: string | null, type: { __typename?: 'AiEngineType', id: number, title: string } } | null> | null } | null } };

export type OrganizationFragmentFragment = { __typename?: 'Organization', id: number, name: string, ownerUserId: number, githubOrgs?: string | null, useSystemGithubToken: boolean, githubToken?: string | null, useSystemAiEngine: boolean, aiEngines?: { __typename?: 'AiEngineConnection', nodes?: Array<{ __typename?: 'AiEngine', id: number, settings?: string | null, type: { __typename?: 'AiEngineType', id: number, title: string } } | null> | null } | null };

export type UpdateOrganizationMutationVariables = Exact<{
input: OrganizationUpdateInput;
}>;


export type UpdateOrganizationMutation = { __typename?: 'Mutation', organizationUpdate?: { __typename?: 'OrganizationUpdatePayload', organization: { __typename?: 'Organization', id: number, name: string, ownerUserId: number, githubOrgs?: string | null, useSystemGithubToken: boolean, githubToken?: string | null, useSystemAiEngine: boolean, aiEngines?: { __typename?: 'AiEngineConnection', nodes?: Array<{ __typename?: 'AiEngine', id: number, settings?: string | null, type: { __typename?: 'AiEngineType', id: number, title: string } } | null> | null } | null } } | null };

export type FindVisionQueryVariables = Exact<{
id: Scalars['ID']['input'];
}>;
Expand Down Expand Up @@ -1190,6 +1288,27 @@ export const IndividualFragmentFragmentDoc = gql`
isManager
}
`;
export const OrganizationFragmentFragmentDoc = gql`
fragment OrganizationFragment on Organization {
id
name
ownerUserId
githubOrgs
useSystemGithubToken
githubToken
useSystemAiEngine
aiEngines {
nodes {
id
type {
id
title
}
settings
}
}
}
`;
export const VisionFragmentFragmentDoc = gql`
fragment VisionFragment on Vision {
id
Expand Down Expand Up @@ -1949,6 +2068,81 @@ export type IndividualsQueryHookResult = ReturnType<typeof useIndividualsQuery>;
export type IndividualsLazyQueryHookResult = ReturnType<typeof useIndividualsLazyQuery>;
export type IndividualsSuspenseQueryHookResult = ReturnType<typeof useIndividualsSuspenseQuery>;
export type IndividualsQueryResult = Apollo.QueryResult<IndividualsQuery, IndividualsQueryVariables>;
export const FindOrganizationDocument = gql`
query findOrganization($id: ID!) {
organization(id: $id) {
...OrganizationFragment
}
}
${OrganizationFragmentFragmentDoc}`;

/**
* __useFindOrganizationQuery__
*
* To run a query within a React component, call `useFindOrganizationQuery` and pass it any options that fit your needs.
* When your component renders, `useFindOrganizationQuery` 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 } = useFindOrganizationQuery({
* variables: {
* id: // value for 'id'
* },
* });
*/
export function useFindOrganizationQuery(baseOptions: Apollo.QueryHookOptions<FindOrganizationQuery, FindOrganizationQueryVariables> & ({ variables: FindOrganizationQueryVariables; skip?: boolean; } | { skip: boolean; }) ) {
const options = {...defaultOptions, ...baseOptions}
return Apollo.useQuery<FindOrganizationQuery, FindOrganizationQueryVariables>(FindOrganizationDocument, options);
}
export function useFindOrganizationLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions<FindOrganizationQuery, FindOrganizationQueryVariables>) {
const options = {...defaultOptions, ...baseOptions}
return Apollo.useLazyQuery<FindOrganizationQuery, FindOrganizationQueryVariables>(FindOrganizationDocument, options);
}
export function useFindOrganizationSuspenseQuery(baseOptions?: Apollo.SuspenseQueryHookOptions<FindOrganizationQuery, FindOrganizationQueryVariables>) {
const options = {...defaultOptions, ...baseOptions}
return Apollo.useSuspenseQuery<FindOrganizationQuery, FindOrganizationQueryVariables>(FindOrganizationDocument, options);
}
export type FindOrganizationQueryHookResult = ReturnType<typeof useFindOrganizationQuery>;
export type FindOrganizationLazyQueryHookResult = ReturnType<typeof useFindOrganizationLazyQuery>;
export type FindOrganizationSuspenseQueryHookResult = ReturnType<typeof useFindOrganizationSuspenseQuery>;
export type FindOrganizationQueryResult = Apollo.QueryResult<FindOrganizationQuery, FindOrganizationQueryVariables>;
export const UpdateOrganizationDocument = gql`
mutation UpdateOrganization($input: OrganizationUpdateInput!) {
organizationUpdate(input: $input) {
organization {
...OrganizationFragment
}
}
}
${OrganizationFragmentFragmentDoc}`;
export type UpdateOrganizationMutationFn = Apollo.MutationFunction<UpdateOrganizationMutation, UpdateOrganizationMutationVariables>;

/**
* __useUpdateOrganizationMutation__
*
* To run a mutation, you first call `useUpdateOrganizationMutation` within a React component and pass it any options that fit your needs.
* When your component renders, `useUpdateOrganizationMutation` 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 [updateOrganizationMutation, { data, loading, error }] = useUpdateOrganizationMutation({
* variables: {
* input: // value for 'input'
* },
* });
*/
export function useUpdateOrganizationMutation(baseOptions?: Apollo.MutationHookOptions<UpdateOrganizationMutation, UpdateOrganizationMutationVariables>) {
const options = {...defaultOptions, ...baseOptions}
return Apollo.useMutation<UpdateOrganizationMutation, UpdateOrganizationMutationVariables>(UpdateOrganizationDocument, options);
}
export type UpdateOrganizationMutationHookResult = ReturnType<typeof useUpdateOrganizationMutation>;
export type UpdateOrganizationMutationResult = Apollo.MutationResult<UpdateOrganizationMutation>;
export type UpdateOrganizationMutationOptions = Apollo.BaseMutationOptions<UpdateOrganizationMutation, UpdateOrganizationMutationVariables>;
export const FindVisionDocument = gql`
query findVision($id: ID!) {
vision(id: $id) {
Expand Down
Loading

0 comments on commit 41e6ec6

Please sign in to comment.