diff --git a/package-lock.json b/package-lock.json index 1b905faf20..ec9b21595f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@alkemio/client-web", - "version": "0.79.7", + "version": "0.80.0", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@alkemio/client-web", - "version": "0.79.7", + "version": "0.80.0", "license": "EUPL-1.2", "dependencies": { "@alkemio/excalidraw": "0.17.1-alkemio-8", diff --git a/package.json b/package.json index 0e52620bf0..78a5df3558 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@alkemio/client-web", - "version": "0.79.7", + "version": "0.80.0", "description": "Alkemio client, enabling users to interact with Challenges hosted on the Alkemio platform.", "repository": { "type": "git", diff --git a/src/core/apollo/generated/apollo-hooks.ts b/src/core/apollo/generated/apollo-hooks.ts index 944a83ba83..84ff06538c 100644 --- a/src/core/apollo/generated/apollo-hooks.ts +++ b/src/core/apollo/generated/apollo-hooks.ts @@ -978,10 +978,10 @@ export const PostSettingsCalloutFragmentDoc = gql` id nameID type - contributions(filter: { postIDs: [$postNameId] }) { + contributions { id post { - ...PostSettings + id } } postNames: contributions { @@ -994,25 +994,6 @@ export const PostSettingsCalloutFragmentDoc = gql` } } } - ${PostSettingsFragmentDoc} -`; -export const PostProvidedFragmentDoc = gql` - fragment PostProvided on Post { - id - nameID - profile { - id - displayName - } - authorization { - id - myPrivileges - } - comments { - id - messagesCount - } - } `; export const WhiteboardSummaryFragmentDoc = gql` fragment WhiteboardSummary on Whiteboard { @@ -8309,18 +8290,10 @@ export function refetchCalloutContentQuery(variables: SchemaTypes.CalloutContent } export const PostDocument = gql` - query Post($calloutId: UUID!, $postNameId: UUID_NAMEID!) { + query Post($postId: UUID!) { lookup { - callout(ID: $calloutId) { - id - nameID - type - contributions(filter: { postIDs: [$postNameId] }) { - id - post { - ...PostDashboard - } - } + post(ID: $postId) { + ...PostDashboard } } } @@ -8339,8 +8312,7 @@ export const PostDocument = gql` * @example * const { data, loading, error } = usePostQuery({ * variables: { - * calloutId: // value for 'calloutId' - * postNameId: // value for 'postNameId' + * postId: // value for 'postId' * }, * }); */ @@ -8426,14 +8398,18 @@ export type UpdatePostMutationOptions = Apollo.BaseMutationOptions< SchemaTypes.UpdatePostMutationVariables >; export const PostSettingsDocument = gql` - query PostSettings($postNameId: UUID_NAMEID!, $calloutId: UUID!) { + query PostSettings($postId: UUID!, $calloutId: UUID!) { lookup { callout(ID: $calloutId) { ...PostSettingsCallout } + post(ID: $postId) { + ...PostSettings + } } } ${PostSettingsCalloutFragmentDoc} + ${PostSettingsFragmentDoc} `; /** @@ -8448,7 +8424,7 @@ export const PostSettingsDocument = gql` * @example * const { data, loading, error } = usePostSettingsQuery({ * variables: { - * postNameId: // value for 'postNameId' + * postId: // value for 'postId' * calloutId: // value for 'calloutId' * }, * }); @@ -8484,21 +8460,26 @@ export function refetchPostSettingsQuery(variables: SchemaTypes.PostSettingsQuer } export const PostProviderDocument = gql` - query PostProvider($calloutId: UUID!, $postNameId: UUID_NAMEID!) { + query PostProvider($postId: UUID!) { lookup { - callout(ID: $calloutId) { + post(ID: $postId) { id nameID - type - contributions(filter: { postIDs: [$postNameId] }) { - post { - ...PostProvided - } + profile { + id + displayName + } + authorization { + id + myPrivileges + } + comments { + id + messagesCount } } } } - ${PostProvidedFragmentDoc} `; /** @@ -8513,8 +8494,7 @@ export const PostProviderDocument = gql` * @example * const { data, loading, error } = usePostProviderQuery({ * variables: { - * calloutId: // value for 'calloutId' - * postNameId: // value for 'postNameId' + * postId: // value for 'postId' * }, * }); */ @@ -8651,6 +8631,78 @@ export type MoveContributionToCalloutMutationOptions = Apollo.BaseMutationOption SchemaTypes.MoveContributionToCalloutMutation, SchemaTypes.MoveContributionToCalloutMutationVariables >; +export const PostCalloutsInCalloutSetDocument = gql` + query PostCalloutsInCalloutSet($calloutsSetId: UUID!) { + lookup { + calloutsSet(ID: $calloutsSetId) { + id + callouts(types: [POST_COLLECTION]) { + id + framing { + id + profile { + id + displayName + } + } + } + } + } + } +`; + +/** + * __usePostCalloutsInCalloutSetQuery__ + * + * To run a query within a React component, call `usePostCalloutsInCalloutSetQuery` and pass it any options that fit your needs. + * When your component renders, `usePostCalloutsInCalloutSetQuery` 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 } = usePostCalloutsInCalloutSetQuery({ + * variables: { + * calloutsSetId: // value for 'calloutsSetId' + * }, + * }); + */ +export function usePostCalloutsInCalloutSetQuery( + baseOptions: Apollo.QueryHookOptions< + SchemaTypes.PostCalloutsInCalloutSetQuery, + SchemaTypes.PostCalloutsInCalloutSetQueryVariables + > +) { + const options = { ...defaultOptions, ...baseOptions }; + return Apollo.useQuery( + PostCalloutsInCalloutSetDocument, + options + ); +} + +export function usePostCalloutsInCalloutSetLazyQuery( + baseOptions?: Apollo.LazyQueryHookOptions< + SchemaTypes.PostCalloutsInCalloutSetQuery, + SchemaTypes.PostCalloutsInCalloutSetQueryVariables + > +) { + const options = { ...defaultOptions, ...baseOptions }; + return Apollo.useLazyQuery< + SchemaTypes.PostCalloutsInCalloutSetQuery, + SchemaTypes.PostCalloutsInCalloutSetQueryVariables + >(PostCalloutsInCalloutSetDocument, options); +} + +export type PostCalloutsInCalloutSetQueryHookResult = ReturnType; +export type PostCalloutsInCalloutSetLazyQueryHookResult = ReturnType; +export type PostCalloutsInCalloutSetQueryResult = Apollo.QueryResult< + SchemaTypes.PostCalloutsInCalloutSetQuery, + SchemaTypes.PostCalloutsInCalloutSetQueryVariables +>; +export function refetchPostCalloutsInCalloutSetQuery(variables: SchemaTypes.PostCalloutsInCalloutSetQueryVariables) { + return { query: PostCalloutsInCalloutSetDocument, variables: variables }; +} + export const WhiteboardFromCalloutDocument = gql` query WhiteboardFromCallout($calloutId: UUID!, $whiteboardId: UUID_NAMEID!) { lookup { @@ -22104,77 +22156,6 @@ export function refetchJourneyRouteResolverQuery(variables: SchemaTypes.JourneyR return { query: JourneyRouteResolverDocument, variables: variables }; } -export const SpaceKeyEntitiesIDsDocument = gql` - query SpaceKeyEntitiesIDs($spaceId: UUID!) { - lookup { - space(ID: $spaceId) { - id - community { - id - } - collaboration { - id - calloutsSet { - id - } - } - } - } - } -`; - -/** - * __useSpaceKeyEntitiesIDsQuery__ - * - * To run a query within a React component, call `useSpaceKeyEntitiesIDsQuery` and pass it any options that fit your needs. - * When your component renders, `useSpaceKeyEntitiesIDsQuery` 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 } = useSpaceKeyEntitiesIDsQuery({ - * variables: { - * spaceId: // value for 'spaceId' - * }, - * }); - */ -export function useSpaceKeyEntitiesIDsQuery( - baseOptions: Apollo.QueryHookOptions< - SchemaTypes.SpaceKeyEntitiesIDsQuery, - SchemaTypes.SpaceKeyEntitiesIDsQueryVariables - > -) { - const options = { ...defaultOptions, ...baseOptions }; - return Apollo.useQuery( - SpaceKeyEntitiesIDsDocument, - options - ); -} - -export function useSpaceKeyEntitiesIDsLazyQuery( - baseOptions?: Apollo.LazyQueryHookOptions< - SchemaTypes.SpaceKeyEntitiesIDsQuery, - SchemaTypes.SpaceKeyEntitiesIDsQueryVariables - > -) { - const options = { ...defaultOptions, ...baseOptions }; - return Apollo.useLazyQuery( - SpaceKeyEntitiesIDsDocument, - options - ); -} - -export type SpaceKeyEntitiesIDsQueryHookResult = ReturnType; -export type SpaceKeyEntitiesIDsLazyQueryHookResult = ReturnType; -export type SpaceKeyEntitiesIDsQueryResult = Apollo.QueryResult< - SchemaTypes.SpaceKeyEntitiesIDsQuery, - SchemaTypes.SpaceKeyEntitiesIDsQueryVariables ->; -export function refetchSpaceKeyEntitiesIDsQuery(variables: SchemaTypes.SpaceKeyEntitiesIDsQueryVariables) { - return { query: SpaceKeyEntitiesIDsDocument, variables: variables }; -} - export const CalloutIdDocument = gql` query CalloutId($calloutNameId: UUID_NAMEID!, $collaborationId: UUID!) { lookup { @@ -24216,6 +24197,156 @@ export function refetchSpaceUrlResolverQuery(variables: SchemaTypes.SpaceUrlReso return { query: SpaceUrlResolverDocument, variables: variables }; } +export const SubspaceUrlResolverDocument = gql` + query SubspaceUrlResolver( + $spaceNameId: UUID_NAMEID! + $level1subspaceNameId: UUID_NAMEID! = "00000000-0000-0000-0000-000000000000" + $level2subspaceNameId: UUID_NAMEID! = "00000000-0000-0000-0000-000000000000" + $level1: Boolean = false + $level2: Boolean = false + ) { + space(ID: $spaceNameId) { + id + subspace(ID: $level1subspaceNameId) @include(if: $level1) { + id + } + subspace(ID: $level1subspaceNameId) @include(if: $level2) { + id + subspace(ID: $level2subspaceNameId) { + id + } + } + } + } +`; + +/** + * __useSubspaceUrlResolverQuery__ + * + * To run a query within a React component, call `useSubspaceUrlResolverQuery` and pass it any options that fit your needs. + * When your component renders, `useSubspaceUrlResolverQuery` 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 } = useSubspaceUrlResolverQuery({ + * variables: { + * spaceNameId: // value for 'spaceNameId' + * level1subspaceNameId: // value for 'level1subspaceNameId' + * level2subspaceNameId: // value for 'level2subspaceNameId' + * level1: // value for 'level1' + * level2: // value for 'level2' + * }, + * }); + */ +export function useSubspaceUrlResolverQuery( + baseOptions: Apollo.QueryHookOptions< + SchemaTypes.SubspaceUrlResolverQuery, + SchemaTypes.SubspaceUrlResolverQueryVariables + > +) { + const options = { ...defaultOptions, ...baseOptions }; + return Apollo.useQuery( + SubspaceUrlResolverDocument, + options + ); +} + +export function useSubspaceUrlResolverLazyQuery( + baseOptions?: Apollo.LazyQueryHookOptions< + SchemaTypes.SubspaceUrlResolverQuery, + SchemaTypes.SubspaceUrlResolverQueryVariables + > +) { + const options = { ...defaultOptions, ...baseOptions }; + return Apollo.useLazyQuery( + SubspaceUrlResolverDocument, + options + ); +} + +export type SubspaceUrlResolverQueryHookResult = ReturnType; +export type SubspaceUrlResolverLazyQueryHookResult = ReturnType; +export type SubspaceUrlResolverQueryResult = Apollo.QueryResult< + SchemaTypes.SubspaceUrlResolverQuery, + SchemaTypes.SubspaceUrlResolverQueryVariables +>; +export function refetchSubspaceUrlResolverQuery(variables: SchemaTypes.SubspaceUrlResolverQueryVariables) { + return { query: SubspaceUrlResolverDocument, variables: variables }; +} + +export const SpaceKeyEntitiesIDsDocument = gql` + query SpaceKeyEntitiesIDs($spaceId: UUID!) { + lookup { + space(ID: $spaceId) { + id + community { + id + } + collaboration { + id + calloutsSet { + id + } + } + } + } + } +`; + +/** + * __useSpaceKeyEntitiesIDsQuery__ + * + * To run a query within a React component, call `useSpaceKeyEntitiesIDsQuery` and pass it any options that fit your needs. + * When your component renders, `useSpaceKeyEntitiesIDsQuery` 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 } = useSpaceKeyEntitiesIDsQuery({ + * variables: { + * spaceId: // value for 'spaceId' + * }, + * }); + */ +export function useSpaceKeyEntitiesIDsQuery( + baseOptions: Apollo.QueryHookOptions< + SchemaTypes.SpaceKeyEntitiesIDsQuery, + SchemaTypes.SpaceKeyEntitiesIDsQueryVariables + > +) { + const options = { ...defaultOptions, ...baseOptions }; + return Apollo.useQuery( + SpaceKeyEntitiesIDsDocument, + options + ); +} + +export function useSpaceKeyEntitiesIDsLazyQuery( + baseOptions?: Apollo.LazyQueryHookOptions< + SchemaTypes.SpaceKeyEntitiesIDsQuery, + SchemaTypes.SpaceKeyEntitiesIDsQueryVariables + > +) { + const options = { ...defaultOptions, ...baseOptions }; + return Apollo.useLazyQuery( + SpaceKeyEntitiesIDsDocument, + options + ); +} + +export type SpaceKeyEntitiesIDsQueryHookResult = ReturnType; +export type SpaceKeyEntitiesIDsLazyQueryHookResult = ReturnType; +export type SpaceKeyEntitiesIDsQueryResult = Apollo.QueryResult< + SchemaTypes.SpaceKeyEntitiesIDsQuery, + SchemaTypes.SpaceKeyEntitiesIDsQueryVariables +>; +export function refetchSpaceKeyEntitiesIDsQuery(variables: SchemaTypes.SpaceKeyEntitiesIDsQueryVariables) { + return { query: SpaceKeyEntitiesIDsDocument, variables: variables }; +} + export const OrganizationUrlResolverDocument = gql` query OrganizationUrlResolver($nameId: NameID!) { lookupByName { @@ -24340,6 +24471,143 @@ export function refetchVirtualContributorUrlResolverQuery( return { query: VirtualContributorUrlResolverDocument, variables: variables }; } +export const VirtualContributorKeyEntitiesIDsDocument = gql` + query VirtualContributorKeyEntitiesIDs($virtualContributorId: UUID!) { + virtualContributor(ID: $virtualContributorId) { + knowledgeBase { + id + calloutsSet { + id + } + } + } + } +`; + +/** + * __useVirtualContributorKeyEntitiesIDsQuery__ + * + * To run a query within a React component, call `useVirtualContributorKeyEntitiesIDsQuery` and pass it any options that fit your needs. + * When your component renders, `useVirtualContributorKeyEntitiesIDsQuery` 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 } = useVirtualContributorKeyEntitiesIDsQuery({ + * variables: { + * virtualContributorId: // value for 'virtualContributorId' + * }, + * }); + */ +export function useVirtualContributorKeyEntitiesIDsQuery( + baseOptions: Apollo.QueryHookOptions< + SchemaTypes.VirtualContributorKeyEntitiesIDsQuery, + SchemaTypes.VirtualContributorKeyEntitiesIDsQueryVariables + > +) { + const options = { ...defaultOptions, ...baseOptions }; + return Apollo.useQuery< + SchemaTypes.VirtualContributorKeyEntitiesIDsQuery, + SchemaTypes.VirtualContributorKeyEntitiesIDsQueryVariables + >(VirtualContributorKeyEntitiesIDsDocument, options); +} + +export function useVirtualContributorKeyEntitiesIDsLazyQuery( + baseOptions?: Apollo.LazyQueryHookOptions< + SchemaTypes.VirtualContributorKeyEntitiesIDsQuery, + SchemaTypes.VirtualContributorKeyEntitiesIDsQueryVariables + > +) { + const options = { ...defaultOptions, ...baseOptions }; + return Apollo.useLazyQuery< + SchemaTypes.VirtualContributorKeyEntitiesIDsQuery, + SchemaTypes.VirtualContributorKeyEntitiesIDsQueryVariables + >(VirtualContributorKeyEntitiesIDsDocument, options); +} + +export type VirtualContributorKeyEntitiesIDsQueryHookResult = ReturnType< + typeof useVirtualContributorKeyEntitiesIDsQuery +>; +export type VirtualContributorKeyEntitiesIDsLazyQueryHookResult = ReturnType< + typeof useVirtualContributorKeyEntitiesIDsLazyQuery +>; +export type VirtualContributorKeyEntitiesIDsQueryResult = Apollo.QueryResult< + SchemaTypes.VirtualContributorKeyEntitiesIDsQuery, + SchemaTypes.VirtualContributorKeyEntitiesIDsQueryVariables +>; +export function refetchVirtualContributorKeyEntitiesIDsQuery( + variables: SchemaTypes.VirtualContributorKeyEntitiesIDsQueryVariables +) { + return { query: VirtualContributorKeyEntitiesIDsDocument, variables: variables }; +} + +export const CalloutUrlResolverDocument = gql` + query CalloutUrlResolver($calloutsSetId: UUID!, $calloutNameId: UUID_NAMEID!) { + lookup { + calloutsSet(ID: $calloutsSetId) { + id + callouts(IDs: [$calloutNameId]) { + id + } + } + } + } +`; + +/** + * __useCalloutUrlResolverQuery__ + * + * To run a query within a React component, call `useCalloutUrlResolverQuery` and pass it any options that fit your needs. + * When your component renders, `useCalloutUrlResolverQuery` 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 } = useCalloutUrlResolverQuery({ + * variables: { + * calloutsSetId: // value for 'calloutsSetId' + * calloutNameId: // value for 'calloutNameId' + * }, + * }); + */ +export function useCalloutUrlResolverQuery( + baseOptions: Apollo.QueryHookOptions< + SchemaTypes.CalloutUrlResolverQuery, + SchemaTypes.CalloutUrlResolverQueryVariables + > +) { + const options = { ...defaultOptions, ...baseOptions }; + return Apollo.useQuery( + CalloutUrlResolverDocument, + options + ); +} + +export function useCalloutUrlResolverLazyQuery( + baseOptions?: Apollo.LazyQueryHookOptions< + SchemaTypes.CalloutUrlResolverQuery, + SchemaTypes.CalloutUrlResolverQueryVariables + > +) { + const options = { ...defaultOptions, ...baseOptions }; + return Apollo.useLazyQuery( + CalloutUrlResolverDocument, + options + ); +} + +export type CalloutUrlResolverQueryHookResult = ReturnType; +export type CalloutUrlResolverLazyQueryHookResult = ReturnType; +export type CalloutUrlResolverQueryResult = Apollo.QueryResult< + SchemaTypes.CalloutUrlResolverQuery, + SchemaTypes.CalloutUrlResolverQueryVariables +>; +export function refetchCalloutUrlResolverQuery(variables: SchemaTypes.CalloutUrlResolverQueryVariables) { + return { query: CalloutUrlResolverDocument, variables: variables }; +} + export const InnovationHubUrlResolverDocument = gql` query InnovationHubUrlResolver($innovationHubNameId: NameID!) { lookupByName { @@ -24460,6 +24728,74 @@ export function refetchInnovationPackUrlResolverQuery(variables: SchemaTypes.Inn return { query: InnovationPackUrlResolverDocument, variables: variables }; } +export const PostInCalloutUrlResolverDocument = gql` + query PostInCalloutUrlResolver($calloutId: UUID!, $postNameId: UUID_NAMEID!) { + lookup { + callout(ID: $calloutId) { + contributions(filter: { postIDs: [$postNameId] }) { + id + post { + id + } + } + } + } + } +`; + +/** + * __usePostInCalloutUrlResolverQuery__ + * + * To run a query within a React component, call `usePostInCalloutUrlResolverQuery` and pass it any options that fit your needs. + * When your component renders, `usePostInCalloutUrlResolverQuery` 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 } = usePostInCalloutUrlResolverQuery({ + * variables: { + * calloutId: // value for 'calloutId' + * postNameId: // value for 'postNameId' + * }, + * }); + */ +export function usePostInCalloutUrlResolverQuery( + baseOptions: Apollo.QueryHookOptions< + SchemaTypes.PostInCalloutUrlResolverQuery, + SchemaTypes.PostInCalloutUrlResolverQueryVariables + > +) { + const options = { ...defaultOptions, ...baseOptions }; + return Apollo.useQuery( + PostInCalloutUrlResolverDocument, + options + ); +} + +export function usePostInCalloutUrlResolverLazyQuery( + baseOptions?: Apollo.LazyQueryHookOptions< + SchemaTypes.PostInCalloutUrlResolverQuery, + SchemaTypes.PostInCalloutUrlResolverQueryVariables + > +) { + const options = { ...defaultOptions, ...baseOptions }; + return Apollo.useLazyQuery< + SchemaTypes.PostInCalloutUrlResolverQuery, + SchemaTypes.PostInCalloutUrlResolverQueryVariables + >(PostInCalloutUrlResolverDocument, options); +} + +export type PostInCalloutUrlResolverQueryHookResult = ReturnType; +export type PostInCalloutUrlResolverLazyQueryHookResult = ReturnType; +export type PostInCalloutUrlResolverQueryResult = Apollo.QueryResult< + SchemaTypes.PostInCalloutUrlResolverQuery, + SchemaTypes.PostInCalloutUrlResolverQueryVariables +>; +export function refetchPostInCalloutUrlResolverQuery(variables: SchemaTypes.PostInCalloutUrlResolverQueryVariables) { + return { query: PostInCalloutUrlResolverDocument, variables: variables }; +} + export const TemplatesSetUrlResolverDocument = gql` query TemplatesSetUrlResolver( $spaceId: UUID! = "00000000-0000-0000-0000-000000000000" diff --git a/src/core/apollo/generated/graphql-schema.ts b/src/core/apollo/generated/graphql-schema.ts index b001437973..3fbf194bcc 100644 --- a/src/core/apollo/generated/graphql-schema.ts +++ b/src/core/apollo/generated/graphql-schema.ts @@ -1236,6 +1236,7 @@ export type CalloutsSetCalloutsArgs = { shuffle?: InputMaybe; sortByActivity?: InputMaybe; tagsets?: InputMaybe>; + types?: InputMaybe>; }; export enum CalloutsSetType { @@ -13106,212 +13107,195 @@ export type CalloutContentQuery = { }; export type PostQueryVariables = Exact<{ - calloutId: Scalars['UUID']; - postNameId: Scalars['UUID_NAMEID']; + postId: Scalars['UUID']; }>; export type PostQuery = { __typename?: 'Query'; lookup: { __typename?: 'LookupQueryResults'; - callout?: + post?: | { - __typename?: 'Callout'; + __typename?: 'Post'; id: string; nameID: string; - type: CalloutType; - contributions: Array<{ - __typename?: 'CalloutContribution'; + createdDate: Date; + profile: { + __typename?: 'Profile'; id: string; - post?: + url: string; + displayName: string; + description?: string | undefined; + tagset?: | { - __typename?: 'Post'; + __typename?: 'Tagset'; id: string; - nameID: string; - createdDate: Date; - profile: { - __typename?: 'Profile'; - id: string; - url: string; - displayName: string; - description?: string | undefined; - tagset?: - | { - __typename?: 'Tagset'; - id: string; - name: string; - tags: Array; - allowedValues: Array; - type: TagsetType; - } - | undefined; - references?: - | Array<{ - __typename?: 'Reference'; - id: string; - name: string; - uri: string; - description?: string | undefined; - }> - | undefined; - visual?: { __typename?: 'Visual'; id: string; uri: string; name: string } | undefined; - }; - createdBy?: - | { - __typename?: 'User'; + name: string; + tags: Array; + allowedValues: Array; + type: TagsetType; + } + | undefined; + references?: + | Array<{ + __typename?: 'Reference'; + id: string; + name: string; + uri: string; + description?: string | undefined; + }> + | undefined; + visual?: { __typename?: 'Visual'; id: string; uri: string; name: string } | undefined; + }; + createdBy?: + | { + __typename?: 'User'; + id: string; + profile: { + __typename?: 'Profile'; + id: string; + displayName: string; + avatar?: { __typename?: 'Visual'; id: string; uri: string } | undefined; + tagsets?: + | Array<{ + __typename?: 'Tagset'; id: string; - profile: { - __typename?: 'Profile'; - id: string; - displayName: string; - avatar?: { __typename?: 'Visual'; id: string; uri: string } | undefined; - tagsets?: - | Array<{ - __typename?: 'Tagset'; - id: string; - name: string; - tags: Array; - allowedValues: Array; - type: TagsetType; - }> - | undefined; - }; - } + name: string; + tags: Array; + allowedValues: Array; + type: TagsetType; + }> | undefined; - comments: { - __typename?: 'Room'; + }; + } + | undefined; + comments: { + __typename?: 'Room'; + id: string; + authorization?: + | { __typename?: 'Authorization'; id: string; myPrivileges?: Array | undefined } + | undefined; + messages: Array<{ + __typename?: 'Message'; + id: string; + message: string; + timestamp: number; + threadID?: string | undefined; + reactions: Array<{ + __typename?: 'Reaction'; + id: string; + emoji: string; + sender?: + | { + __typename?: 'User'; + id: string; + profile: { __typename?: 'Profile'; id: string; displayName: string }; + } + | undefined; + }>; + sender?: + | { + __typename?: 'Organization'; id: string; - authorization?: - | { - __typename?: 'Authorization'; - id: string; - myPrivileges?: Array | undefined; - } - | undefined; - messages: Array<{ - __typename?: 'Message'; + nameID: string; + profile: { + __typename?: 'Profile'; id: string; - message: string; - timestamp: number; - threadID?: string | undefined; - reactions: Array<{ - __typename?: 'Reaction'; - id: string; - emoji: string; - sender?: - | { - __typename?: 'User'; - id: string; - profile: { __typename?: 'Profile'; id: string; displayName: string }; - } - | undefined; - }>; - sender?: + displayName: string; + url: string; + description?: string | undefined; + avatar?: { __typename?: 'Visual'; id: string; uri: string; name: string } | undefined; + tagsets?: + | Array<{ + __typename?: 'Tagset'; + id: string; + name: string; + tags: Array; + allowedValues: Array; + type: TagsetType; + }> + | undefined; + location?: | { - __typename?: 'Organization'; + __typename?: 'Location'; id: string; - nameID: string; - profile: { - __typename?: 'Profile'; - id: string; - displayName: string; - url: string; - description?: string | undefined; - avatar?: { __typename?: 'Visual'; id: string; uri: string; name: string } | undefined; - tagsets?: - | Array<{ - __typename?: 'Tagset'; - id: string; - name: string; - tags: Array; - allowedValues: Array; - type: TagsetType; - }> - | undefined; - location?: - | { - __typename?: 'Location'; - id: string; - country?: string | undefined; - city?: string | undefined; - } - | undefined; - }; + country?: string | undefined; + city?: string | undefined; } + | undefined; + }; + } + | { + __typename?: 'User'; + id: string; + nameID: string; + profile: { + __typename?: 'Profile'; + id: string; + displayName: string; + url: string; + description?: string | undefined; + avatar?: { __typename?: 'Visual'; id: string; uri: string; name: string } | undefined; + tagsets?: + | Array<{ + __typename?: 'Tagset'; + id: string; + name: string; + tags: Array; + allowedValues: Array; + type: TagsetType; + }> + | undefined; + location?: | { - __typename?: 'User'; + __typename?: 'Location'; id: string; - nameID: string; - profile: { - __typename?: 'Profile'; - id: string; - displayName: string; - url: string; - description?: string | undefined; - avatar?: { __typename?: 'Visual'; id: string; uri: string; name: string } | undefined; - tagsets?: - | Array<{ - __typename?: 'Tagset'; - id: string; - name: string; - tags: Array; - allowedValues: Array; - type: TagsetType; - }> - | undefined; - location?: - | { - __typename?: 'Location'; - id: string; - country?: string | undefined; - city?: string | undefined; - } - | undefined; - }; + country?: string | undefined; + city?: string | undefined; } + | undefined; + }; + } + | { + __typename?: 'VirtualContributor'; + id: string; + nameID: string; + profile: { + __typename?: 'Profile'; + id: string; + displayName: string; + url: string; + description?: string | undefined; + avatar?: { __typename?: 'Visual'; id: string; uri: string; name: string } | undefined; + tagsets?: + | Array<{ + __typename?: 'Tagset'; + id: string; + name: string; + tags: Array; + allowedValues: Array; + type: TagsetType; + }> + | undefined; + location?: | { - __typename?: 'VirtualContributor'; + __typename?: 'Location'; id: string; - nameID: string; - profile: { - __typename?: 'Profile'; - id: string; - displayName: string; - url: string; - description?: string | undefined; - avatar?: { __typename?: 'Visual'; id: string; uri: string; name: string } | undefined; - tagsets?: - | Array<{ - __typename?: 'Tagset'; - id: string; - name: string; - tags: Array; - allowedValues: Array; - type: TagsetType; - }> - | undefined; - location?: - | { - __typename?: 'Location'; - id: string; - country?: string | undefined; - city?: string | undefined; - } - | undefined; - }; + country?: string | undefined; + city?: string | undefined; } | undefined; - }>; - vcInteractions: Array<{ - __typename?: 'VcInteraction'; - id: string; - threadID: string; - virtualContributorID: string; - }>; - }; - } - | undefined; - }>; + }; + } + | undefined; + }>; + vcInteractions: Array<{ + __typename?: 'VcInteraction'; + id: string; + threadID: string; + virtualContributorID: string; + }>; + }; } | undefined; }; @@ -13502,7 +13486,7 @@ export type UpdatePostMutation = { }; export type PostSettingsQueryVariables = Exact<{ - postNameId: Scalars['UUID_NAMEID']; + postId: Scalars['UUID']; calloutId: Scalars['UUID']; }>; @@ -13519,69 +13503,66 @@ export type PostSettingsQuery = { contributions: Array<{ __typename?: 'CalloutContribution'; id: string; + post?: { __typename?: 'Post'; id: string } | undefined; + }>; + postNames: Array<{ + __typename?: 'CalloutContribution'; post?: | { __typename?: 'Post'; id: string; - nameID: string; - authorization?: - | { - __typename?: 'Authorization'; - id: string; - myPrivileges?: Array | undefined; - } - | undefined; - profile: { - __typename?: 'Profile'; - id: string; - displayName: string; - description?: string | undefined; - tagset?: - | { - __typename?: 'Tagset'; - id: string; - name: string; - tags: Array; - allowedValues: Array; - type: TagsetType; - } - | undefined; - references?: - | Array<{ - __typename?: 'Reference'; - id: string; - name: string; - uri: string; - description?: string | undefined; - }> - | undefined; - visuals: Array<{ - __typename?: 'Visual'; - id: string; - uri: string; - name: string; - allowedTypes: Array; - aspectRatio: number; - maxHeight: number; - maxWidth: number; - minHeight: number; - minWidth: number; - alternativeText?: string | undefined; - }>; - }; + profile: { __typename?: 'Profile'; id: string; displayName: string }; } | undefined; }>; - postNames: Array<{ - __typename?: 'CalloutContribution'; - post?: + } + | undefined; + post?: + | { + __typename?: 'Post'; + id: string; + nameID: string; + authorization?: + | { __typename?: 'Authorization'; id: string; myPrivileges?: Array | undefined } + | undefined; + profile: { + __typename?: 'Profile'; + id: string; + displayName: string; + description?: string | undefined; + tagset?: | { - __typename?: 'Post'; + __typename?: 'Tagset'; id: string; - profile: { __typename?: 'Profile'; id: string; displayName: string }; + name: string; + tags: Array; + allowedValues: Array; + type: TagsetType; } | undefined; - }>; + references?: + | Array<{ + __typename?: 'Reference'; + id: string; + name: string; + uri: string; + description?: string | undefined; + }> + | undefined; + visuals: Array<{ + __typename?: 'Visual'; + id: string; + uri: string; + name: string; + allowedTypes: Array; + aspectRatio: number; + maxHeight: number; + maxWidth: number; + minHeight: number; + minWidth: number; + alternativeText?: string | undefined; + }>; + }; } | undefined; }; @@ -13636,54 +13617,7 @@ export type PostSettingsCalloutFragment = { contributions: Array<{ __typename?: 'CalloutContribution'; id: string; - post?: - | { - __typename?: 'Post'; - id: string; - nameID: string; - authorization?: - | { __typename?: 'Authorization'; id: string; myPrivileges?: Array | undefined } - | undefined; - profile: { - __typename?: 'Profile'; - id: string; - displayName: string; - description?: string | undefined; - tagset?: - | { - __typename?: 'Tagset'; - id: string; - name: string; - tags: Array; - allowedValues: Array; - type: TagsetType; - } - | undefined; - references?: - | Array<{ - __typename?: 'Reference'; - id: string; - name: string; - uri: string; - description?: string | undefined; - }> - | undefined; - visuals: Array<{ - __typename?: 'Visual'; - id: string; - uri: string; - name: string; - allowedTypes: Array; - aspectRatio: number; - maxHeight: number; - maxWidth: number; - minHeight: number; - minWidth: number; - alternativeText?: string | undefined; - }>; - }; - } - | undefined; + post?: { __typename?: 'Post'; id: string } | undefined; }>; postNames: Array<{ __typename?: 'CalloutContribution'; @@ -13694,55 +13628,28 @@ export type PostSettingsCalloutFragment = { }; export type PostProviderQueryVariables = Exact<{ - calloutId: Scalars['UUID']; - postNameId: Scalars['UUID_NAMEID']; + postId: Scalars['UUID']; }>; export type PostProviderQuery = { __typename?: 'Query'; lookup: { __typename?: 'LookupQueryResults'; - callout?: + post?: | { - __typename?: 'Callout'; + __typename?: 'Post'; id: string; nameID: string; - type: CalloutType; - contributions: Array<{ - __typename?: 'CalloutContribution'; - post?: - | { - __typename?: 'Post'; - id: string; - nameID: string; - profile: { __typename?: 'Profile'; id: string; displayName: string }; - authorization?: - | { - __typename?: 'Authorization'; - id: string; - myPrivileges?: Array | undefined; - } - | undefined; - comments: { __typename?: 'Room'; id: string; messagesCount: number }; - } - | undefined; - }>; + profile: { __typename?: 'Profile'; id: string; displayName: string }; + authorization?: + | { __typename?: 'Authorization'; id: string; myPrivileges?: Array | undefined } + | undefined; + comments: { __typename?: 'Room'; id: string; messagesCount: number }; } | undefined; }; }; -export type PostProvidedFragment = { - __typename?: 'Post'; - id: string; - nameID: string; - profile: { __typename?: 'Profile'; id: string; displayName: string }; - authorization?: - | { __typename?: 'Authorization'; id: string; myPrivileges?: Array | undefined } - | undefined; - comments: { __typename?: 'Room'; id: string; messagesCount: number }; -}; - export type DeletePostMutationVariables = Exact<{ input: DeletePostInput; }>; @@ -13770,6 +13677,32 @@ export type MoveContributionToCalloutMutation = { }; }; +export type PostCalloutsInCalloutSetQueryVariables = Exact<{ + calloutsSetId: Scalars['UUID']; +}>; + +export type PostCalloutsInCalloutSetQuery = { + __typename?: 'Query'; + lookup: { + __typename?: 'LookupQueryResults'; + calloutsSet?: + | { + __typename?: 'CalloutsSet'; + id: string; + callouts: Array<{ + __typename?: 'Callout'; + id: string; + framing: { + __typename?: 'CalloutFraming'; + id: string; + profile: { __typename?: 'Profile'; id: string; displayName: string }; + }; + }>; + } + | undefined; + }; +}; + export type WhiteboardProfileFragment = { __typename?: 'Profile'; id: string; @@ -27081,29 +27014,6 @@ export type JourneyRouteResolverQuery = { }; }; -export type SpaceKeyEntitiesIDsQueryVariables = Exact<{ - spaceId: Scalars['UUID']; -}>; - -export type SpaceKeyEntitiesIDsQuery = { - __typename?: 'Query'; - lookup: { - __typename?: 'LookupQueryResults'; - space?: - | { - __typename?: 'Space'; - id: string; - community: { __typename?: 'Community'; id: string }; - collaboration: { - __typename?: 'Collaboration'; - id: string; - calloutsSet: { __typename?: 'CalloutsSet'; id: string }; - }; - } - | undefined; - }; -}; - export type CalloutIdQueryVariables = Exact<{ calloutNameId: Scalars['UUID_NAMEID']; collaborationId: Scalars['UUID']; @@ -30274,6 +30184,46 @@ export type SpaceUrlResolverQuery = { lookupByName: { __typename?: 'LookupByNameQueryResults'; space?: string | undefined }; }; +export type SubspaceUrlResolverQueryVariables = Exact<{ + spaceNameId: Scalars['UUID_NAMEID']; + level1subspaceNameId?: Scalars['UUID_NAMEID']; + level2subspaceNameId?: Scalars['UUID_NAMEID']; + level1?: InputMaybe; + level2?: InputMaybe; +}>; + +export type SubspaceUrlResolverQuery = { + __typename?: 'Query'; + space: { + __typename?: 'Space'; + id: string; + subspace?: { __typename?: 'Space'; id: string; subspace: { __typename?: 'Space'; id: string } }; + }; +}; + +export type SpaceKeyEntitiesIDsQueryVariables = Exact<{ + spaceId: Scalars['UUID']; +}>; + +export type SpaceKeyEntitiesIDsQuery = { + __typename?: 'Query'; + lookup: { + __typename?: 'LookupQueryResults'; + space?: + | { + __typename?: 'Space'; + id: string; + community: { __typename?: 'Community'; id: string }; + collaboration: { + __typename?: 'Collaboration'; + id: string; + calloutsSet: { __typename?: 'CalloutsSet'; id: string }; + }; + } + | undefined; + }; +}; + export type OrganizationUrlResolverQueryVariables = Exact<{ nameId: Scalars['NameID']; }>; @@ -30292,6 +30242,35 @@ export type VirtualContributorUrlResolverQuery = { lookupByName: { __typename?: 'LookupByNameQueryResults'; virtualContributor?: string | undefined }; }; +export type VirtualContributorKeyEntitiesIDsQueryVariables = Exact<{ + virtualContributorId: Scalars['UUID']; +}>; + +export type VirtualContributorKeyEntitiesIDsQuery = { + __typename?: 'Query'; + virtualContributor: { + __typename?: 'VirtualContributor'; + knowledgeBase?: + | { __typename?: 'KnowledgeBase'; id: string; calloutsSet: { __typename?: 'CalloutsSet'; id: string } } + | undefined; + }; +}; + +export type CalloutUrlResolverQueryVariables = Exact<{ + calloutsSetId: Scalars['UUID']; + calloutNameId: Scalars['UUID_NAMEID']; +}>; + +export type CalloutUrlResolverQuery = { + __typename?: 'Query'; + lookup: { + __typename?: 'LookupQueryResults'; + calloutsSet?: + | { __typename?: 'CalloutsSet'; id: string; callouts: Array<{ __typename?: 'Callout'; id: string }> } + | undefined; + }; +}; + export type InnovationHubUrlResolverQueryVariables = Exact<{ innovationHubNameId: Scalars['NameID']; }>; @@ -30310,6 +30289,28 @@ export type InnovationPackUrlResolverQuery = { lookupByName: { __typename?: 'LookupByNameQueryResults'; innovationPack?: string | undefined }; }; +export type PostInCalloutUrlResolverQueryVariables = Exact<{ + calloutId: Scalars['UUID']; + postNameId: Scalars['UUID_NAMEID']; +}>; + +export type PostInCalloutUrlResolverQuery = { + __typename?: 'Query'; + lookup: { + __typename?: 'LookupQueryResults'; + callout?: + | { + __typename?: 'Callout'; + contributions: Array<{ + __typename?: 'CalloutContribution'; + id: string; + post?: { __typename?: 'Post'; id: string } | undefined; + }>; + } + | undefined; + }; +}; + export type TemplatesSetUrlResolverQueryVariables = Exact<{ spaceId?: Scalars['UUID']; includeSpace?: InputMaybe; diff --git a/src/domain/access/AvailableContributors/common.ts b/src/domain/access/AvailableContributors/common.ts index 948c455c0d..9e3c38cdf1 100644 --- a/src/domain/access/AvailableContributors/common.ts +++ b/src/domain/access/AvailableContributors/common.ts @@ -32,6 +32,7 @@ export type AvailableVirtualContributorsResponse = { id: string; profile: { displayName: string; + url: string; }; }[]; } & AvailableContributorsResponse; diff --git a/src/domain/collaboration/callout/CalloutForm.tsx b/src/domain/collaboration/callout/CalloutForm.tsx index 8f0c56e52b..ef123bbeb5 100644 --- a/src/domain/collaboration/callout/CalloutForm.tsx +++ b/src/domain/collaboration/callout/CalloutForm.tsx @@ -31,7 +31,7 @@ import CalloutWhiteboardField, { WhiteboardFieldSubmittedValues, WhiteboardFieldSubmittedValuesWithPreviewImages, } from './creationDialog/CalloutWhiteboardField/CalloutWhiteboardField'; -import { JourneyTypeName } from '@/domain/journey/JourneyTypeName'; +import { CalloutsSetParentType } from '@/domain/journey/JourneyTypeName'; import { JourneyCalloutGroupNameOptions } from '../calloutsSet/CalloutsInContext/CalloutsGroup'; import { DEFAULT_TAGSET } from '@/domain/common/tags/tagset.constants'; import PostTemplateSelector from '@/domain/templates/components/TemplateSelectors/PostTemplateSelector'; @@ -88,7 +88,7 @@ export interface CalloutFormProps { onChange?: (callout: CalloutFormOutput) => void; onStatusChanged?: (isValid: boolean) => void; children?: FormikConfig['children']; - journeyTypeName: JourneyTypeName; + journeyTypeName: CalloutsSetParentType; temporaryLocation?: boolean; disableRichMedia?: boolean; // images, videos, iframe, etc. disablePostResponses?: boolean; diff --git a/src/domain/collaboration/callout/CalloutViewTypes.tsx b/src/domain/collaboration/callout/CalloutViewTypes.tsx index d324627137..67d02be8bb 100644 --- a/src/domain/collaboration/callout/CalloutViewTypes.tsx +++ b/src/domain/collaboration/callout/CalloutViewTypes.tsx @@ -1,6 +1,6 @@ import { Callout, CalloutVisibility } from '@/core/apollo/generated/graphql-schema'; import { CalloutDeleteType, CalloutEditType } from './edit/CalloutEditType'; -import { JourneyTypeName } from '@/domain/journey/JourneyTypeName'; +import { CalloutsSetParentType } from '@/domain/journey/JourneyTypeName'; export interface CalloutSortEvents { onMoveUp: (calloutId: string) => void; @@ -25,7 +25,7 @@ export interface CalloutLayoutEvents extends Partial { } export interface BaseCalloutViewProps extends CalloutLayoutEvents, Partial { - journeyTypeName: JourneyTypeName; + journeyTypeName: CalloutsSetParentType; contributionsCount: number; loading?: boolean; canCreate?: boolean; diff --git a/src/domain/collaboration/callout/calloutBlock/CalloutSettingsContainer.tsx b/src/domain/collaboration/callout/calloutBlock/CalloutSettingsContainer.tsx index 053da2b802..8323517dd1 100644 --- a/src/domain/collaboration/callout/calloutBlock/CalloutSettingsContainer.tsx +++ b/src/domain/collaboration/callout/calloutBlock/CalloutSettingsContainer.tsx @@ -35,7 +35,7 @@ import { VerticalAlignTopOutlined, } from '@mui/icons-material'; import { Reference, Tagset } from '@/domain/common/profile/Profile'; -import { JourneyTypeName } from '@/domain/journey/JourneyTypeName'; +import { CalloutsSetParentType } from '@/domain/journey/JourneyTypeName'; import { WhiteboardFragmentWithCallout } from '../../calloutsSet/useCallouts/useCallouts'; import { FormatedLink, LinkDetails } from '../links/LinkCollectionCallout'; import ConfirmationDialog from '@/core/ui/dialogs/ConfirmationDialog'; @@ -117,7 +117,7 @@ export interface CalloutSettingsContainerProps }; expanded?: boolean; onExpand?: () => void; - journeyTypeName: JourneyTypeName; + journeyTypeName: CalloutsSetParentType; disableRichMedia?: boolean; disablePostResponses?: boolean; } diff --git a/src/domain/collaboration/callout/creationDialog/CalloutCreationDialog.tsx b/src/domain/collaboration/callout/creationDialog/CalloutCreationDialog.tsx index ccf944b09e..2b2c541992 100644 --- a/src/domain/collaboration/callout/creationDialog/CalloutCreationDialog.tsx +++ b/src/domain/collaboration/callout/creationDialog/CalloutCreationDialog.tsx @@ -25,7 +25,7 @@ import FlexSpacer from '@/core/ui/utils/FlexSpacer'; import Gutters from '@/core/ui/grid/Gutters'; import { WhiteboardFieldSubmittedValuesWithPreviewImages } from './CalloutWhiteboardField/CalloutWhiteboardField'; import { INNOVATION_FLOW_STATES_TAGSET_NAME } from '@/domain/collaboration/InnovationFlow/InnovationFlowStates/useInnovationFlowStates'; -import { JourneyTypeName } from '@/domain/journey/JourneyTypeName'; +import { CalloutsSetParentType } from '@/domain/journey/JourneyTypeName'; import { EmptyWhiteboardString } from '@/domain/common/whiteboard/EmptyWhiteboard'; import { findDefaultTagset } from '@/domain/common/tags/utils'; import ImportTemplatesDialog from '@/domain/templates/components/Dialogs/ImportTemplateDialog/ImportTemplatesDialog'; @@ -54,7 +54,7 @@ export interface CalloutCreationDialogProps { loading: boolean; groupName: CalloutGroupName; flowState?: string; - journeyTypeName: JourneyTypeName; + journeyTypeName: CalloutsSetParentType; availableCalloutTypes?: CalloutType[]; disableRichMedia?: boolean; disablePostResponses?: boolean; diff --git a/src/domain/collaboration/callout/edit/editDialog/CalloutEditDialog.tsx b/src/domain/collaboration/callout/edit/editDialog/CalloutEditDialog.tsx index 39ff7eeb9f..7dd1c26b65 100644 --- a/src/domain/collaboration/callout/edit/editDialog/CalloutEditDialog.tsx +++ b/src/domain/collaboration/callout/edit/editDialog/CalloutEditDialog.tsx @@ -9,7 +9,7 @@ import CalloutForm, { CalloutFormInput, CalloutFormOutput } from '@/domain/colla import { CalloutType, TagsetType } from '@/core/apollo/generated/graphql-schema'; import { CalloutLayoutProps } from '@/domain/collaboration/callout/calloutBlock/CalloutLayout'; import { EmptyWhiteboardString } from '@/domain/common/whiteboard/EmptyWhiteboard'; -import { JourneyTypeName } from '@/domain/journey/JourneyTypeName'; +import { CalloutsSetParentType } from '@/domain/journey/JourneyTypeName'; import { StorageConfigContextProvider } from '@/domain/storage/StorageBucket/StorageConfigContext'; import { DEFAULT_TAGSET } from '@/domain/common/tags/tagset.constants'; import DialogWithGrid from '@/core/ui/dialog/DialogWithGrid'; @@ -22,7 +22,7 @@ export interface CalloutEditDialogProps { onDelete: (callout: CalloutDeleteType) => void; onCalloutEdit: (callout: CalloutEditType) => Promise; canChangeCalloutLocation?: boolean; - journeyTypeName: JourneyTypeName; + journeyTypeName: CalloutsSetParentType; disableRichMedia?: boolean; disablePostResponses?: boolean; } diff --git a/src/domain/collaboration/callout/routing/CalloutRoute.tsx b/src/domain/collaboration/callout/routing/CalloutRoute.tsx index 452db94065..e9b7b92e07 100644 --- a/src/domain/collaboration/callout/routing/CalloutRoute.tsx +++ b/src/domain/collaboration/callout/routing/CalloutRoute.tsx @@ -2,12 +2,12 @@ import { Route, Routes } from 'react-router-dom'; import PostProvider from '@/domain/collaboration/post/context/PostProvider'; import PostRoute from '@/domain/collaboration/post/views/PostRoute'; import WhiteboardRoute from '@/domain/collaboration/whiteboard/views/WhiteboardRoute'; -import { JourneyTypeName } from '@/domain/journey/JourneyTypeName'; +import { CalloutsSetParentType } from '@/domain/journey/JourneyTypeName'; import { nameOfUrl } from '@/main/routing/urlParams'; export interface CalloutRouteProps { parentPagePath: string; - journeyTypeName: JourneyTypeName; + journeyTypeName: CalloutsSetParentType; } const CalloutRoute = ({ parentPagePath, journeyTypeName }: CalloutRouteProps) => ( diff --git a/src/domain/collaboration/calloutsSet/CalloutsInContext/CalloutsGroup.ts b/src/domain/collaboration/calloutsSet/CalloutsInContext/CalloutsGroup.ts index 7173d72bf9..d3756d1f8a 100644 --- a/src/domain/collaboration/calloutsSet/CalloutsInContext/CalloutsGroup.ts +++ b/src/domain/collaboration/calloutsSet/CalloutsInContext/CalloutsGroup.ts @@ -1,5 +1,5 @@ import { CalloutGroupName } from '@/core/apollo/generated/graphql-schema'; -import { JourneyTypeName } from '@/domain/journey/JourneyTypeName'; +import { CalloutsSetParentType, KnowledgeBaseCalloutsSetType } from '@/domain/journey/JourneyTypeName'; export enum CalloutGroupNameValuesMap { Home = 'HOME', @@ -9,8 +9,9 @@ export enum CalloutGroupNameValuesMap { Knowledge = 'KNOWLEDGE', } -export const JourneyCalloutGroupNameOptions: Record = { +export const JourneyCalloutGroupNameOptions: Record = { space: [CalloutGroupName.Home, CalloutGroupName.Community, CalloutGroupName.Subspaces, CalloutGroupName.Knowledge], subspace: [CalloutGroupName.Home], subsubspace: [CalloutGroupName.Home], + [KnowledgeBaseCalloutsSetType]: [CalloutGroupName.Home], }; diff --git a/src/domain/collaboration/calloutsSet/CalloutsView/CalloutsView.tsx b/src/domain/collaboration/calloutsSet/CalloutsView/CalloutsView.tsx index fb752d4c02..7b23287c67 100644 --- a/src/domain/collaboration/calloutsSet/CalloutsView/CalloutsView.tsx +++ b/src/domain/collaboration/calloutsSet/CalloutsView/CalloutsView.tsx @@ -1,7 +1,7 @@ import { useMemo } from 'react'; import { useCalloutEdit } from '../../callout/edit/useCalloutEdit/useCalloutEdit'; import { OrderUpdate, TypedCallout, TypedCalloutDetails } from '../useCallouts/useCallouts'; -import { JourneyTypeName } from '@/domain/journey/JourneyTypeName'; +import { CalloutsSetParentType } from '@/domain/journey/JourneyTypeName'; import { CalloutSortEvents, CalloutSortProps } from '../../callout/CalloutViewTypes'; import CalloutView from '../../callout/CalloutView/CalloutView'; import useNavigate from '@/core/routing/useNavigate'; @@ -32,7 +32,7 @@ const CalloutsViewSkeleton = () => ( export interface CalloutsViewProps { callouts: TypedCallout[] | undefined; - journeyTypeName: JourneyTypeName; + journeyTypeName: CalloutsSetParentType; onSortOrderUpdate?: (movedCalloutId: string) => (update: OrderUpdate) => Promise; onCalloutUpdate?: (calloutId: string) => void; loading?: boolean; diff --git a/src/domain/collaboration/post/containers/PostDashboardContainer/PostDashboardContainer.tsx b/src/domain/collaboration/post/containers/PostDashboardContainer/PostDashboardContainer.tsx index 1ed01a5e56..7ef796296f 100644 --- a/src/domain/collaboration/post/containers/PostDashboardContainer/PostDashboardContainer.tsx +++ b/src/domain/collaboration/post/containers/PostDashboardContainer/PostDashboardContainer.tsx @@ -9,9 +9,10 @@ import { ContainerPropsWithProvided, renderComponentOrChildrenFn } from '@/core/ import { buildAuthorFromUser } from '@/domain/community/user/utils/buildAuthorFromUser'; import usePostMessageMutations from '@/domain/communication/room/Comments/usePostMessageMutations'; import useSubscribeOnRoomEvents from '@/domain/collaboration/callout/useSubscribeOnRoomEvents'; +import useUrlResolver from '@/main/urlResolver/useUrlResolver'; type EntityIds = { - postNameId: string | undefined; + postId: string | undefined; calloutId: string | undefined; }; @@ -38,24 +39,20 @@ type Provided = { export type PostDashboardContainerProps = ContainerPropsWithProvided; -const PostDashboardContainer = ({ calloutId, postNameId, ...rendered }: PostDashboardContainerProps) => { +const PostDashboardContainer = ({ calloutId, postId, ...rendered }: PostDashboardContainerProps) => { const { user: userMetadata, isAuthenticated } = useUserContext(); const user = userMetadata?.user; const { data, loading, error } = usePostQuery({ variables: { - postNameId: postNameId!, - calloutId: calloutId!, + postId: postId!, }, - skip: !calloutId || !postNameId, + skip: !calloutId || !postId, fetchPolicy: 'cache-and-network', }); - const parentCallout = data?.lookup.callout; - - const post = parentCallout?.contributions?.find(x => x.post && x.post.nameID === postNameId)?.post; - + const post = data?.lookup.post; const roomId = post?.comments.id; const isSubscribedToMessages = useSubscribeOnRoomEvents(roomId); @@ -81,7 +78,11 @@ const PostDashboardContainer = ({ calloutId, postNameId, ...rendered }: PostDash const vcInteractions = useMemo(() => post?.comments?.vcInteractions ?? [], [post?.comments?.vcInteractions]); - const commentsPrivileges = post?.comments?.authorization?.myPrivileges ?? []; + // TODO: This is temporary: + // Disabling all comments interaction with this Posts in the VC knowledge-base until we have server fixed + const { vcId } = useUrlResolver(); + const commentsPrivileges = vcId ? [] : post?.comments?.authorization?.myPrivileges ?? []; + const canDeleteComments = commentsPrivileges.includes(AuthorizationPrivilege.Delete); const canDeleteComment = useCallback( authorId => canDeleteComments || (isAuthenticated && authorId === user?.id), diff --git a/src/domain/collaboration/post/containers/PostDashboardContainer/PostDashboardQueries.graphql b/src/domain/collaboration/post/containers/PostDashboardContainer/PostDashboardQueries.graphql index bf31718395..596023f6f8 100644 --- a/src/domain/collaboration/post/containers/PostDashboardContainer/PostDashboardQueries.graphql +++ b/src/domain/collaboration/post/containers/PostDashboardContainer/PostDashboardQueries.graphql @@ -1,18 +1,9 @@ query Post( - $calloutId: UUID! - $postNameId: UUID_NAMEID! + $postId: UUID! ) { lookup { - callout(ID: $calloutId) { - id - nameID - type - contributions(filter: { postIDs: [$postNameId] }) { - id - post { - ...PostDashboard - } - } + post(ID: $postId) { + ...PostDashboard } } } diff --git a/src/domain/collaboration/post/containers/PostSettings/PostSettingsQueries.graphql b/src/domain/collaboration/post/containers/PostSettings/PostSettingsQueries.graphql index 755bff7b5a..2a2d66c96b 100644 --- a/src/domain/collaboration/post/containers/PostSettings/PostSettingsQueries.graphql +++ b/src/domain/collaboration/post/containers/PostSettings/PostSettingsQueries.graphql @@ -1,8 +1,11 @@ -query PostSettings($postNameId: UUID_NAMEID!, $calloutId: UUID!) { +query PostSettings($postId: UUID!, $calloutId: UUID!) { lookup { callout(ID: $calloutId) { ...PostSettingsCallout } + post(ID: $postId) { + ...PostSettings + } } } @@ -36,10 +39,11 @@ fragment PostSettingsCallout on Callout { id nameID type - contributions(filter: { postIDs: [$postNameId] }) { + # TODO This is done to find the contributionId for this postId (see usePostSettings), there must be an easier way + contributions { id post { - ...PostSettings + id } } postNames: contributions { diff --git a/src/domain/collaboration/post/containers/PostSettings/usePostSettings.ts b/src/domain/collaboration/post/containers/PostSettings/usePostSettings.ts index 342140f86e..f0ebfefc77 100644 --- a/src/domain/collaboration/post/containers/PostSettings/usePostSettings.ts +++ b/src/domain/collaboration/post/containers/PostSettings/usePostSettings.ts @@ -48,12 +48,12 @@ export interface PostSettingsContainerState { } export interface PostSettingsContainerProps { - postNameId: string | undefined; + postId: string | undefined; calloutId: string | undefined; } const usePostSettings = ({ - postNameId, + postId, calloutId, }: PostSettingsContainerProps): PostSettingsContainerEntities & PostSettingsContainerActions & @@ -64,26 +64,25 @@ const usePostSettings = ({ const { data, loading, error } = usePostSettingsQuery({ variables: { - postNameId: postNameId!, + postId: postId!, calloutId: calloutId!, }, - skip: !calloutId || !postNameId, + skip: !calloutId || !postId, }); const parentCallout = data?.lookup.callout; - const parentCalloutPostNames = compact( - parentCallout?.postNames?.map(contribution => contribution.post?.profile.displayName) - ); + const parentCalloutPostNames = compact(parentCallout?.postNames?.map(post => post.post?.profile.displayName)); - const postContribution = parentCallout?.contributions?.find(x => x.post && x.post.nameID === postNameId); + const post = data?.lookup.post; + const postContribution = parentCallout?.contributions?.find(x => x.post && x.post.id === postId); const [updatePost, { loading: updating, error: updateError }] = useUpdatePostMutation({ onCompleted: () => notify('Post updated successfully', 'success'), }); const handleUpdate = async (newPost: PostUpdateData) => { - if (postContribution?.post) { + if (post) { await updatePost({ variables: { input: { @@ -99,7 +98,7 @@ const usePostSettings = ({ })), tagsets: [ { - ID: postContribution.post.profile.tagset?.id ?? '', + ID: post.profile.tagset?.id ?? '', tags: newPost.tags, }, ], @@ -126,9 +125,9 @@ const usePostSettings = ({ const handleAddReference = (push: PushFunc, referencesLength: number) => { setPush(push); - if (postContribution?.post) { + if (post) { addReference({ - profileId: postContribution.post.profile.id, + profileId: post.profile.id, name: newReferenceName(t, referencesLength), }); } @@ -143,7 +142,7 @@ const usePostSettings = ({ return { contributionId: postContribution?.id, - post: postContribution?.post, + post, postsNames: parentCalloutPostNames, parentCallout, loading, diff --git a/src/domain/collaboration/post/context/PostProvider.tsx b/src/domain/collaboration/post/context/PostProvider.tsx index 34404dae2c..9fc41a783c 100644 --- a/src/domain/collaboration/post/context/PostProvider.tsx +++ b/src/domain/collaboration/post/context/PostProvider.tsx @@ -1,9 +1,8 @@ import React, { FC, useContext } from 'react'; -import { useUrlParams } from '@/core/routing/useUrlParams'; import { usePostProviderQuery } from '@/core/apollo/generated/apollo-hooks'; import { ApolloError } from '@apollo/client'; import { AuthorizationPrivilege } from '@/core/apollo/generated/graphql-schema'; -import { useRouteResolver } from '@/main/routing/resolvers/RouteResolver'; +import useUrlResolver from '@/main/urlResolver/useUrlResolver'; interface PostPermissions { canUpdate: boolean; @@ -26,21 +25,16 @@ const PostContext = React.createContext({ }); const PostProvider: FC = ({ children }) => { - const { postNameId } = useUrlParams(); - - const { calloutId } = useRouteResolver(); + const { postId } = useUrlResolver(); const { data, loading, error } = usePostProviderQuery({ variables: { - postNameId: postNameId!, - calloutId: calloutId!, + postId: postId!, }, - skip: !calloutId || !postNameId, + skip: !postId, }); - const parentCallout = data?.lookup.callout; - - const post = parentCallout?.contributions?.find(x => x.post && x.post.nameID === postNameId)?.post; + const post = data?.lookup.post; const myPrivileges = post?.authorization?.myPrivileges; diff --git a/src/domain/collaboration/post/context/PostProviderQueries.graphql b/src/domain/collaboration/post/context/PostProviderQueries.graphql index 11e4101b20..dbf71f97f4 100644 --- a/src/domain/collaboration/post/context/PostProviderQueries.graphql +++ b/src/domain/collaboration/post/context/PostProviderQueries.graphql @@ -1,34 +1,22 @@ query PostProvider( - $calloutId: UUID! - $postNameId: UUID_NAMEID! + $postId: UUID! ) { lookup { - callout(ID: $calloutId) { + post (ID: $postId) { id nameID - type - contributions(filter: { postIDs: [$postNameId] }) { - post { - ...PostProvided - } + profile { + id + displayName + } + authorization { + id + myPrivileges + } + comments { + id + messagesCount } } } } - -fragment PostProvided on Post { - id - nameID - profile { - id - displayName - } - authorization { - id - myPrivileges - } - comments { - id - messagesCount - } -} \ No newline at end of file diff --git a/src/domain/collaboration/post/pages/PostCalloutsInCalloutSet.graphql b/src/domain/collaboration/post/pages/PostCalloutsInCalloutSet.graphql new file mode 100644 index 0000000000..f67f51b5f3 --- /dev/null +++ b/src/domain/collaboration/post/pages/PostCalloutsInCalloutSet.graphql @@ -0,0 +1,17 @@ +query PostCalloutsInCalloutSet($calloutsSetId: UUID!) { + lookup { + calloutsSet(ID: $calloutsSetId) { + id + callouts (types: [POST_COLLECTION]){ + id + framing { + id + profile { + id + displayName + } + } + } + } + } +} \ No newline at end of file diff --git a/src/domain/collaboration/post/pages/PostDashboardPage.tsx b/src/domain/collaboration/post/pages/PostDashboardPage.tsx index 727b93437b..917d32ed9d 100644 --- a/src/domain/collaboration/post/pages/PostDashboardPage.tsx +++ b/src/domain/collaboration/post/pages/PostDashboardPage.tsx @@ -7,12 +7,12 @@ import { DialogFooter } from '@/core/ui/dialog/DialogWithGrid'; export interface PostDashboardPageProps { onClose: () => void; calloutId: string | undefined; - postNameId: string | undefined; + postId: string | undefined; } -const PostDashboardPage = ({ onClose, postNameId, calloutId }: PostDashboardPageProps) => ( +const PostDashboardPage = ({ onClose, postId, calloutId }: PostDashboardPageProps) => ( - + {({ post, messages, roomId, ...rest }) => ( void; - collaborationId: string | undefined; calloutId: string | undefined; - postNameId: string | undefined; + postId: string | undefined; + calloutsSetId: string | undefined; } -const PostSettingsPage = ({ collaborationId, postNameId, calloutId, onClose }: PostSettingsPageProps) => { +const PostSettingsPage = ({ postId, calloutId, calloutsSetId, onClose }: PostSettingsPageProps) => { const { t } = useTranslation(); const navigate = useNavigate(); @@ -54,7 +55,7 @@ const PostSettingsPage = ({ collaborationId, postNameId, calloutId, onClose }: P }; const postSettings = usePostSettings({ - postNameId, + postId, calloutId, }); @@ -72,11 +73,14 @@ const PostSettingsPage = ({ collaborationId, postNameId, calloutId, onClose }: P const isMoveEnabled = Boolean(targetCalloutId) && targetCalloutId !== postSettings.parentCallout?.id; - const { callouts, refetchCallouts } = useCalloutsOnCollaboration({ - collaborationId, + const { data: calloutsData, refetch: refetchCallouts } = usePostCalloutsInCalloutSetQuery({ + variables: { + calloutsSetId: calloutsSetId!, + }, + skip: !calloutsSetId, }); - const calloutsOfTypePost = callouts?.filter(({ type }) => type === CalloutType.PostCollection); + const calloutsOfTypePost = calloutsData?.lookup.calloutsSet?.callouts ?? []; // TODO This page component exposes too much of inner logic that should be encapsulated // either in a container/hook or a rendered view @@ -129,7 +133,7 @@ const PostSettingsPage = ({ collaborationId, postNameId, calloutId, onClose }: P return ( - + id === targetCalloutId) ?? null!} + options={calloutsOfTypePost} + value={calloutsOfTypePost.find(({ id }) => id === targetCalloutId)} getOptionLabel={callout => callout.framing.profile.displayName} onChange={(event, callout) => { setTargetCalloutId(callout?.id); diff --git a/src/domain/collaboration/post/pages/PostSharePage.tsx b/src/domain/collaboration/post/pages/PostSharePage.tsx index 735eef3118..4ab0b85eb5 100644 --- a/src/domain/collaboration/post/pages/PostSharePage.tsx +++ b/src/domain/collaboration/post/pages/PostSharePage.tsx @@ -7,17 +7,17 @@ import { DialogFooter } from '@/core/ui/dialog/DialogWithGrid'; export interface PostSharePageProps { onClose: () => void; calloutId: string | undefined; - postNameId: string | undefined; + postId: string | undefined; } -const PostSharePage = ({ onClose, postNameId, calloutId }: PostSharePageProps) => { - if (!postNameId) { +const PostSharePage = ({ onClose, postId, calloutId }: PostSharePageProps) => { + if (!postId) { throw new Error('Must be within a Post route'); } return ( - + {({ post, messages, roomId, ...rest }) => ( { const [backToExplore] = useBackToParentPage(parentPagePath, { keepScroll: true }); const onClose = () => backToExplore(); - - const { postNameId } = useUrlParams(); - const { calloutId, collaborationId } = useRouteResolver(); + const { postId, calloutsSetId, calloutId } = useUrlResolver(); return ( @@ -25,21 +22,16 @@ const PostRoute = ({ parentPagePath }: PostRouteProps) => { } /> } + element={} /> } + element={} /> + } /> diff --git a/src/domain/collaboration/whiteboard/EntityWhiteboardPage/WhiteboardPage.tsx b/src/domain/collaboration/whiteboard/EntityWhiteboardPage/WhiteboardPage.tsx index 2c5f7b5698..dcefdb66e3 100644 --- a/src/domain/collaboration/whiteboard/EntityWhiteboardPage/WhiteboardPage.tsx +++ b/src/domain/collaboration/whiteboard/EntityWhiteboardPage/WhiteboardPage.tsx @@ -1,5 +1,5 @@ import useBackToParentPage from '@/core/routing/deprecated/useBackToParentPage'; -import { JourneyTypeName } from '@/domain/journey/JourneyTypeName'; +import { CalloutsSetParentType } from '@/domain/journey/JourneyTypeName'; import { useCalloutIdQuery } from '@/core/apollo/generated/apollo-hooks'; import WhiteboardView from '../WhiteboardsManagement/WhiteboardView'; import { WhiteboardProvider } from '../containers/WhiteboardProvider'; @@ -9,7 +9,7 @@ export interface WhiteboardPageProps { whiteboardNameId: string; calloutNameId: string; parentUrl: string; - journeyTypeName: JourneyTypeName; + journeyTypeName: CalloutsSetParentType; } const WhiteboardPage = ({ diff --git a/src/domain/collaboration/whiteboard/WhiteboardsManagement/WhiteboardView.tsx b/src/domain/collaboration/whiteboard/WhiteboardsManagement/WhiteboardView.tsx index c49f7f5058..dc8699b212 100644 --- a/src/domain/collaboration/whiteboard/WhiteboardsManagement/WhiteboardView.tsx +++ b/src/domain/collaboration/whiteboard/WhiteboardsManagement/WhiteboardView.tsx @@ -1,7 +1,7 @@ import { ReactNode } from 'react'; import WhiteboardActionsContainer from '../containers/WhiteboardActionsContainer'; import { AuthorizationPrivilege } from '@/core/apollo/generated/graphql-schema'; -import { JourneyTypeName } from '@/domain/journey/JourneyTypeName'; +import { CalloutsSetParentType, KnowledgeBaseCalloutsSetType } from '@/domain/journey/JourneyTypeName'; import WhiteboardDialog, { WhiteboardDetails } from '../WhiteboardDialog/WhiteboardDialog'; import { useFullscreen } from '@/core/ui/fullscreen/useFullscreen'; import FullscreenButton from '@/core/ui/button/FullscreenButton'; @@ -17,7 +17,7 @@ export interface WhiteboardNavigationMethods { } export interface WhiteboardViewProps extends ActiveWhiteboardIdHolder, WhiteboardNavigationMethods { - journeyTypeName: JourneyTypeName; + journeyTypeName: CalloutsSetParentType; whiteboard: WhiteboardDetails | undefined; authorization: { myPrivileges?: AuthorizationPrivilege[] } | undefined; whiteboardShareUrl: string; @@ -83,7 +83,7 @@ const WhiteboardView = ({ dialogTitle: displayName, readOnlyDisplayName: readOnlyDisplayName || !hasUpdatePrivileges, fullscreen, - headerActions: ( + headerActions: journeyTypeName !== KnowledgeBaseCalloutsSetType && ( <> {hasUpdatePrivileges && ( diff --git a/src/domain/collaboration/whiteboard/views/WhiteboardRoute.tsx b/src/domain/collaboration/whiteboard/views/WhiteboardRoute.tsx index 78683f223b..5a4b2d61ae 100644 --- a/src/domain/collaboration/whiteboard/views/WhiteboardRoute.tsx +++ b/src/domain/collaboration/whiteboard/views/WhiteboardRoute.tsx @@ -1,12 +1,12 @@ import { Route, Routes } from 'react-router-dom'; import { useUrlParams } from '@/core/routing/useUrlParams'; -import { JourneyTypeName } from '@/domain/journey/JourneyTypeName'; +import { CalloutsSetParentType } from '@/domain/journey/JourneyTypeName'; import WhiteboardPage from '../EntityWhiteboardPage/WhiteboardPage'; import { useRouteResolver } from '@/main/routing/resolvers/RouteResolver'; export interface WhiteboardRouteProps { parentPagePath: string; - journeyTypeName: JourneyTypeName; + journeyTypeName: CalloutsSetParentType; } const WhiteboardRoute = ({ parentPagePath, journeyTypeName }: WhiteboardRouteProps) => { diff --git a/src/domain/community/inviteContributors/InviteContributorsProps.tsx b/src/domain/community/inviteContributors/InviteContributorsProps.tsx index 8d8c348f60..72be20ff5a 100644 --- a/src/domain/community/inviteContributors/InviteContributorsProps.tsx +++ b/src/domain/community/inviteContributors/InviteContributorsProps.tsx @@ -8,9 +8,8 @@ export interface InviteContributorDialogProps { } export interface ContributorProps extends Identifiable { - nameID?: string; email?: string; - profile?: { + profile: { displayName: string; description?: string; avatar?: { @@ -21,7 +20,7 @@ export interface ContributorProps extends Identifiable { city?: string; country?: string; }; - url?: string; + url: string; }; aiPersona?: { bodyOfKnowledge?: string; diff --git a/src/domain/community/inviteContributors/InviteVCsDialog.tsx b/src/domain/community/inviteContributors/InviteVCsDialog.tsx index 77218c96d6..3956e41926 100644 --- a/src/domain/community/inviteContributors/InviteVCsDialog.tsx +++ b/src/domain/community/inviteContributors/InviteVCsDialog.tsx @@ -12,7 +12,6 @@ import InviteContributorsList from './InviteContributorsList'; import InviteVirtualContributorDialog from '../invitations/InviteVirtualContributorDialog'; import PreviewContributorDialog from './PreviewContributorDialog'; import VCProfileContentView from '../virtualContributor/vcProfilePage/VCProfileContentView'; -import { VirtualContributorProfileProps } from '../virtualContributor/vcProfilePage/model'; import { BasicSpaceProps } from '../virtualContributor/components/BasicSpaceCard'; import Loading from '@/core/ui/loading/Loading'; import { useNotification } from '@/core/ui/notifications/useNotification'; @@ -209,10 +208,7 @@ const InviteVCsDialog = ({ open, onClose }: InviteContributorDialogProps) => { contributor={selectedContributor} actions={renderActions()} > - + )} diff --git a/src/domain/community/virtualContributor/VCRoute.tsx b/src/domain/community/virtualContributor/VCRoute.tsx index cab9144577..ba8a2c836a 100644 --- a/src/domain/community/virtualContributor/VCRoute.tsx +++ b/src/domain/community/virtualContributor/VCRoute.tsx @@ -4,12 +4,14 @@ import { PageLayoutHolderWithOutlet } from '@/domain/journey/common/EntityPageLa import { Error404 } from '@/core/pages/Errors/Error404'; import VCSettingsRoute from '../virtualContributorAdmin/VCSettingsRoute'; import { nameOfUrl } from '@/main/routing/urlParams'; +import VCKnowledgeBaseRoute from './knowledgeBase/VCKnowledgeBaseRoute'; +import { KNOWLEDGE_BASE_PATH } from '@/main/routing/urlBuilders'; export const VCRoute = () => ( }> } /> - } /> + } /> } /> } /> diff --git a/src/domain/community/virtualContributor/knowledgeBase/KnowledgeBaseDialog.tsx b/src/domain/community/virtualContributor/knowledgeBase/KnowledgeBaseDialog.tsx index ee1eba64ad..cbc709e45a 100644 --- a/src/domain/community/virtualContributor/knowledgeBase/KnowledgeBaseDialog.tsx +++ b/src/domain/community/virtualContributor/knowledgeBase/KnowledgeBaseDialog.tsx @@ -10,6 +10,7 @@ import { CalloutGroupName, CalloutType } from '@/core/apollo/generated/graphql-s import { DescriptionComponent } from '@/domain/common/description/DescriptionComponent'; import CalloutsGroupView from '@/domain/collaboration/calloutsSet/CalloutsInContext/CalloutsGroupView'; import { StorageConfigContextProvider } from '@/domain/storage/StorageBucket/StorageConfigContext'; +import { KnowledgeBaseCalloutsSetType } from '@/domain/journey/JourneyTypeName'; type KnowledgeBaseDialogProps = { onClose: () => void; @@ -52,7 +53,7 @@ const KnowledgeBaseDialog = ({ onClose, title, id }: KnowledgeBaseDialogProps) = callouts={callouts} canCreateCallout={canCreateCallout} loading={loading} - journeyTypeName="space" + journeyTypeName={KnowledgeBaseCalloutsSetType} onSortOrderUpdate={onCalloutsSortOrderUpdate} onCalloutUpdate={refetchCallout} groupName={CalloutGroupName.Knowledge} diff --git a/src/domain/community/virtualContributor/knowledgeBase/VCKnowledgeBaseRoute.tsx b/src/domain/community/virtualContributor/knowledgeBase/VCKnowledgeBaseRoute.tsx new file mode 100644 index 0000000000..93f9190af1 --- /dev/null +++ b/src/domain/community/virtualContributor/knowledgeBase/VCKnowledgeBaseRoute.tsx @@ -0,0 +1,29 @@ +import { nameOfUrl } from '@/main/routing/urlParams'; +import { Route, Routes } from 'react-router-dom'; +import VCProfilePage from '../vcProfilePage/VCProfilePage'; +import CalloutRoute from '@/domain/collaboration/callout/routing/CalloutRoute'; +import { useUrlParams } from '@/core/routing/useUrlParams'; +import { buildVCKnowledgeBaseUrl } from '@/main/routing/urlBuilders'; +import { KnowledgeBaseCalloutsSetType } from '@/domain/journey/JourneyTypeName'; + +export const VCKnowledgeBaseRoute = () => { + const { vcNameId } = useUrlParams(); + const parentPagePath = vcNameId ? buildVCKnowledgeBaseUrl(vcNameId) : '/'; + + return ( + + } /> + } /> + + + + } + /> + + ); +}; + +export default VCKnowledgeBaseRoute; diff --git a/src/domain/community/virtualContributor/vcProfilePage/VCProfileContentView.tsx b/src/domain/community/virtualContributor/vcProfilePage/VCProfileContentView.tsx index fde422405e..82b53281fc 100644 --- a/src/domain/community/virtualContributor/vcProfilePage/VCProfileContentView.tsx +++ b/src/domain/community/virtualContributor/vcProfilePage/VCProfileContentView.tsx @@ -1,5 +1,3 @@ -import { useEffect, useState } from 'react'; -import { useLocation } from 'react-router-dom'; import useNavigate from '@/core/routing/useNavigate'; import { Button } from '@mui/material'; import BookIcon from '@mui/icons-material/Book'; @@ -18,9 +16,6 @@ import { type VCProfilePageViewProps } from './model'; import { AiPersonaBodyOfKnowledgeType } from '@/core/apollo/generated/graphql-schema'; import KnowledgeBaseDialog from '@/domain/community/virtualContributor/knowledgeBase/KnowledgeBaseDialog'; -// a temporary Knowledge Base route - `${vcProfileUrl}/${KNOWLEDGE_BASE_PATH} -const KNOWLEDGE_BASE_PATH = 'knowledge-base'; - const SectionTitle = ({ children }) => { return ( @@ -33,14 +28,14 @@ const SectionContent = ({ children }) => { return {children}; }; -export const VCProfileContentView = ({ bokProfile, virtualContributor }: VCProfilePageViewProps) => { +export const VCProfileContentView = ({ + bokProfile, + virtualContributor, + openKnowledgeBaseDialog, +}: VCProfilePageViewProps) => { const { palette } = useTheme(); const { t } = useTranslation(); const navigate = useNavigate(); - const location = useLocation(); - const pathname = location.pathname; - - const [showKnowledgeBase, setShowKnowledgeBase] = useState(false); const darkIcons = palette.icons.dark; @@ -57,46 +52,17 @@ export const VCProfileContentView = ({ bokProfile, virtualContributor }: VCProfi const isExternal = vcType === AiPersonaBodyOfKnowledgeType.None; const hasSpaceKnowledge = vcType === AiPersonaBodyOfKnowledgeType.AlkemioSpace; - const isKnowledgeBasePath = (pathname: string) => { - const pathParts = pathname.split('/'); - - return pathParts[pathParts.length - 1] === KNOWLEDGE_BASE_PATH; - }; - - const removeKnowledgeBaseFromPath = (pathname: string) => { - const pathParts = pathname.split('/'); - - if (pathParts[pathParts.length - 1] === KNOWLEDGE_BASE_PATH) { - pathParts.pop(); - - const newPath = pathParts.join('/'); - navigate(newPath, { replace: true }); - } - }; - - const addKnowledgeBaseToPath = (pathname: string) => { - if (!isKnowledgeBasePath(pathname)) { - const newPath = `${pathname}/${KNOWLEDGE_BASE_PATH}`; - - navigate(newPath, { replace: true }); - } - }; - const handleKnowledgeBaseClick = () => { - setShowKnowledgeBase(true); - addKnowledgeBaseToPath(pathname); + if (virtualContributor) { + navigate(`${virtualContributor.profile.url}/knowledge-base`); + } }; const onCloseKnowledgeBase = () => { - setShowKnowledgeBase(false); - removeKnowledgeBaseFromPath(pathname); - }; - - useEffect(() => { - if (isKnowledgeBasePath(pathname)) { - setShowKnowledgeBase(true); + if (virtualContributor) { + navigate(virtualContributor.profile.url); } - }, [pathname, virtualContributor]); + }; return ( <> @@ -174,7 +140,7 @@ export const VCProfileContentView = ({ bokProfile, virtualContributor }: VCProfi /> - {showKnowledgeBase && ( + {openKnowledgeBaseDialog && ( { +type VCProfilePageProps = { + openKnowledgeBaseDialog?: boolean; + children?: ReactNode; +}; + +export const VCProfilePage = ({ openKnowledgeBaseDialog, children }: VCProfilePageProps) => { const { t } = useTranslation(); const { vcId } = useUrlResolver(); @@ -52,7 +58,9 @@ export const VCProfilePage = () => { + {children} ); }; diff --git a/src/domain/community/virtualContributor/vcProfilePage/VCProfilePageView.tsx b/src/domain/community/virtualContributor/vcProfilePage/VCProfilePageView.tsx index 97827f15d8..23ac59e279 100644 --- a/src/domain/community/virtualContributor/vcProfilePage/VCProfilePageView.tsx +++ b/src/domain/community/virtualContributor/vcProfilePage/VCProfilePageView.tsx @@ -8,7 +8,7 @@ import PageContentBlockHeader from '@/core/ui/content/PageContentBlockHeader'; import { type VCProfilePageViewProps } from './model'; import VCProfileContentView from './VCProfileContentView'; -export const VCProfilePageView = ({ bokProfile, virtualContributor }: VCProfilePageViewProps) => { +export const VCProfilePageView = ({ virtualContributor, ...pageProps }: VCProfilePageViewProps) => { const { t } = useTranslation(); return ( @@ -28,7 +28,7 @@ export const VCProfilePageView = ({ bokProfile, virtualContributor }: VCProfileP - + ); diff --git a/src/domain/community/virtualContributor/vcProfilePage/model.ts b/src/domain/community/virtualContributor/vcProfilePage/model.ts index 5144220a21..31335a6c3e 100644 --- a/src/domain/community/virtualContributor/vcProfilePage/model.ts +++ b/src/domain/community/virtualContributor/vcProfilePage/model.ts @@ -13,6 +13,7 @@ export type VirtualContributorProfileProps = { city?: string; country?: string; }; + url: string; }; provider?: { profile: { @@ -37,4 +38,6 @@ export type VirtualContributorProfileProps = { export type VCProfilePageViewProps = { bokProfile?: BasicSpaceProps; virtualContributor?: VirtualContributorProfileProps; + navigateToKnowledgeBase?: boolean; + openKnowledgeBaseDialog?: boolean; }; diff --git a/src/domain/journey/JourneyTypeName.ts b/src/domain/journey/JourneyTypeName.ts index c31eddc290..696a860443 100644 --- a/src/domain/journey/JourneyTypeName.ts +++ b/src/domain/journey/JourneyTypeName.ts @@ -1,6 +1,8 @@ import { ProfileType, SpaceLevel } from '@/core/apollo/generated/graphql-schema'; export type JourneyTypeName = 'space' | 'subspace' | 'subsubspace'; +export const KnowledgeBaseCalloutsSetType = 'knowledge-base'; +export type CalloutsSetParentType = JourneyTypeName | typeof KnowledgeBaseCalloutsSetType; interface JourneyLocation { spaceNameId: string; diff --git a/src/domain/journey/subspace/routing/SubspaceRoute.tsx b/src/domain/journey/subspace/routing/SubspaceRoute.tsx index 6504b47728..31a4fdc62b 100644 --- a/src/domain/journey/subspace/routing/SubspaceRoute.tsx +++ b/src/domain/journey/subspace/routing/SubspaceRoute.tsx @@ -40,7 +40,6 @@ const SubspaceRoute = () => { {/* Redirecting legacy dashboard links to Subspace Home */} } /> } /> - } /> {props => }} diff --git a/src/main/routing/resolvers/RouteResolver.graphql b/src/main/routing/resolvers/RouteResolver.graphql index 0a83c4e711..05e41049ab 100644 --- a/src/main/routing/resolvers/RouteResolver.graphql +++ b/src/main/routing/resolvers/RouteResolver.graphql @@ -16,22 +16,7 @@ query JourneyRouteResolver( } } -query SpaceKeyEntitiesIDs($spaceId: UUID!) { - lookup { - space(ID: $spaceId) { - id - community { - id - } - collaboration { - id - calloutsSet { - id - } - } - } - } -} + query CalloutId($calloutNameId: UUID_NAMEID!, $collaborationId: UUID!) { lookup { diff --git a/src/main/routing/urlBuilders.ts b/src/main/routing/urlBuilders.ts index ca3c498c39..3859acfb1d 100644 --- a/src/main/routing/urlBuilders.ts +++ b/src/main/routing/urlBuilders.ts @@ -2,6 +2,7 @@ import { _AUTH_LOGIN_PATH } from '@/core/auth/authentication/constants/authentic import { EntityPageSection } from '@/domain/shared/layout/EntityPageSection'; import { ROUTE_HOME } from '@/domain/platform/routes/constants'; import { isAbsoluteUrl } from '@/core/utils/links'; +export const KNOWLEDGE_BASE_PATH = 'knowledge-base'; export const buildSettingsUrl = (entityUrl: string) => { return `${entityUrl}/settings`; @@ -11,6 +12,9 @@ export const buildSettingsProfileUrl = (entityUrl: string) => { return `${entityUrl}/settings/profile`; }; +const buildVCProfileUrl = (vcNameId: string) => `/vc/${vcNameId}`; +export const buildVCKnowledgeBaseUrl = (vcNameId: string) => `${buildVCProfileUrl(vcNameId)}/${KNOWLEDGE_BASE_PATH}`; + export const buildUserProfileUrl = (userNameId: string) => `/user/${userNameId}`; export const buildReturnUrlParam = (returnUrl = ROUTE_HOME, origin = window.location.origin) => { diff --git a/src/main/urlResolver/UrlResolvers.graphql b/src/main/urlResolver/UrlResolvers.graphql index c0bc902675..7bf687033f 100644 --- a/src/main/urlResolver/UrlResolvers.graphql +++ b/src/main/urlResolver/UrlResolvers.graphql @@ -4,6 +4,44 @@ query SpaceUrlResolver ($nameId: NameID!) { } } +query SubspaceUrlResolver ( + $spaceNameId: UUID_NAMEID!, + $level1subspaceNameId: UUID_NAMEID! = "00000000-0000-0000-0000-000000000000", + $level2subspaceNameId: UUID_NAMEID! = "00000000-0000-0000-0000-000000000000", + $level1: Boolean = false, + $level2: Boolean = false +) { + space(ID: $spaceNameId) { + id + subspace(ID:$level1subspaceNameId) @include(if: $level1) { + id + } + subspace(ID:$level1subspaceNameId) @include(if: $level2) { + id + subspace(ID:$level2subspaceNameId) { + id + } + } + } +} + +query SpaceKeyEntitiesIDs($spaceId: UUID!) { + lookup { + space(ID: $spaceId) { + id + community { + id + } + collaboration { + id + calloutsSet { + id + } + } + } + } +} + query OrganizationUrlResolver ($nameId: NameID!) { lookupByName { organization(NAMEID: $nameId) @@ -16,6 +54,28 @@ query VirtualContributorUrlResolver($nameId: NameID!) { } } +query VirtualContributorKeyEntitiesIDs($virtualContributorId: UUID!) { + virtualContributor(ID: $virtualContributorId) { + knowledgeBase { + id + calloutsSet { + id + } + } + } +} + +query CalloutUrlResolver($calloutsSetId: UUID!, $calloutNameId: UUID_NAMEID!) { + lookup { + calloutsSet(ID: $calloutsSetId) { + id + callouts(IDs: [$calloutNameId]) { + id + } + } + } +} + query InnovationHubUrlResolver($innovationHubNameId: NameID!) { lookupByName { innovationHub(NAMEID: $innovationHubNameId) @@ -28,6 +88,19 @@ query InnovationPackUrlResolver($innovationPackNameId: NameID!) { } } +query PostInCalloutUrlResolver($calloutId: UUID!, $postNameId: UUID_NAMEID!) { + lookup { + callout(ID: $calloutId) { + contributions(filter: { postIDs: [$postNameId] }) { + id + post { + id + } + } + } + } +} + query TemplatesSetUrlResolver( $spaceId: UUID! = "00000000-0000-0000-0000-000000000000", $includeSpace: Boolean = false, @@ -61,3 +134,4 @@ query UserUrlResolver($nameId: NameID!) { user(NAMEID: $nameId) } } + diff --git a/src/main/urlResolver/useUrlResolver.ts b/src/main/urlResolver/useUrlResolver.ts index 291552b2df..b03093b07f 100644 --- a/src/main/urlResolver/useUrlResolver.ts +++ b/src/main/urlResolver/useUrlResolver.ts @@ -1,11 +1,16 @@ import { + useCalloutUrlResolverQuery, useInnovationHubUrlResolverQuery, useInnovationPackUrlResolverQuery, useOrganizationUrlResolverQuery, + usePostInCalloutUrlResolverQuery, + useSpaceKeyEntitiesIDsQuery, useSpaceUrlResolverQuery, + useSubspaceUrlResolverQuery, useTemplatesSetUrlResolverQuery, useTemplateUrlResolverQuery, useUserUrlResolverQuery, + useVirtualContributorKeyEntitiesIDsQuery, useVirtualContributorUrlResolverQuery, } from '@/core/apollo/generated/apollo-hooks'; import { useUrlParams } from '@/core/routing/useUrlParams'; @@ -15,10 +20,16 @@ import { NotFoundError } from '@/core/notFound/NotFoundErrorBoundary'; type UseUrlResolverProvided = { spaceId: string | undefined; + subspaceIds: [string, string] | [string, string, string] | undefined; // level0, level1, level2 + subspaceId: string | undefined; organizationId: string | undefined; innovationPackId: string | undefined; innovationHubId: string | undefined; templateId: string | undefined; + calloutsSetId: string | undefined; + calloutId: string | undefined; + contributionId: string | undefined; + postId: string | undefined; userId: string | undefined; vcId: string | undefined; loading: boolean; @@ -40,13 +51,18 @@ const useUrlResolver = ({ const { spaceNameId, + subspaceNameId, + subsubspaceNameId, organizationNameId, innovationHubNameId, innovationPackNameId, templateNameId, userNameId, vcNameId, + calloutNameId, + postNameId, } = urlParams; + let loading = false; // Space const { data: spaceData, loading: spaceLoading } = useSpaceUrlResolverQuery({ @@ -54,16 +70,51 @@ const useUrlResolver = ({ skip: !spaceNameId, }); const spaceId = spaceData?.lookupByName.space; + loading = loading || spaceLoading; if (throwIfNotFound && spaceNameId && !spaceLoading && !spaceId) { throw new NotFoundError(`Space '${spaceNameId}' not found`); } + // Subspace + const { data: subspaceData, loading: subspaceDataLoading } = useSubspaceUrlResolverQuery({ + variables: { + spaceNameId: spaceNameId!, + level1: !!subspaceNameId, + level1subspaceNameId: subspaceNameId, + level2: !!subsubspaceNameId, + level2subspaceNameId: subsubspaceNameId, + }, + skip: !spaceNameId || !subspaceNameId, + }); + const subspaceIds = !spaceId + ? undefined + : subspaceData?.space.subspace?.subspace?.id && subspaceData?.space.subspace?.id + ? ([spaceId, subspaceData.space.subspace.id, subspaceData.space.subspace.subspace.id] as [string, string, string]) + : subspaceData?.space.subspace?.id + ? ([spaceId, subspaceData.space.subspace.id] as [string, string]) + : undefined; + const subspaceId = subspaceData?.space.subspace?.subspace?.id ?? subspaceData?.space.subspace?.id; + loading = loading || subspaceDataLoading; + if (throwIfNotFound && spaceNameId && subspaceNameId && !subspaceDataLoading && !subspaceId) { + throw new NotFoundError(`Subspace '${subspaceNameId}/${subsubspaceNameId}/' not found on '${spaceNameId}'`); + } + + const { data: spaceKeyEntitiesData, loading: spaceKeyEntitiesLoading } = useSpaceKeyEntitiesIDsQuery({ + variables: { + spaceId: subspaceId ?? spaceId!, + }, + skip: (!spaceId && !subspaceId) || !calloutNameId, + }); + loading = loading || spaceKeyEntitiesLoading; + const spaceCalloutsSetId = spaceKeyEntitiesData?.lookup.space?.collaboration?.calloutsSet.id; + // Organization const { data: organizationData, loading: organizationLoading } = useOrganizationUrlResolverQuery({ variables: { nameId: organizationNameId! }, skip: !organizationNameId, }); const organizationId = organizationData?.lookupByName.organization; + loading = loading || organizationLoading; if (throwIfNotFound && organizationNameId && !organizationLoading && !organizationId) { throw new NotFoundError(`Organization '${organizationNameId}' not found`); } @@ -74,6 +125,7 @@ const useUrlResolver = ({ skip: !innovationHubNameId, }); const innovationHubId = innovationHubData?.lookupByName.innovationHub; + loading = loading || innovationHubLoading; if (throwIfNotFound && innovationHubNameId && !innovationHubLoading && !innovationHubId) { throw new NotFoundError(`InnovationHub '${innovationHubNameId}' not found`); } @@ -84,6 +136,7 @@ const useUrlResolver = ({ skip: !innovationPackNameId, }); const innovationPackId = innovationPackData?.lookupByName.innovationPack; + loading = loading || innovationPackLoading; if (throwIfNotFound && innovationPackNameId && !innovationPackLoading && !innovationPackId) { throw new NotFoundError(`InnovationPack '${innovationPackNameId}' not found`); } @@ -101,6 +154,7 @@ const useUrlResolver = ({ !templateNameId || // Only retrieve the templatesSetId if we have to because we want to resolve a templateNameId (!spaceId && !innovationPackId), }); + loading = loading || templatesSetLoading; const templatesSetId = spaceId ? templatesSetData?.lookup.space?.templatesManager?.templatesSet?.id : templatesSetData?.lookup.innovationPack?.templatesSet?.id; @@ -109,6 +163,7 @@ const useUrlResolver = ({ variables: { templatesSetId: templatesSetId!, templateNameId: templateNameId! }, skip: !templatesSetId || !templateNameId, }); + loading = loading || templateLoading; const templateId = templateData?.lookupByName.template; if (throwIfNotFound && templateNameId && !spaceNameId && !innovationPackNameId) { console.error('Template cannot be resolved without a space or innovation pack', { @@ -119,6 +174,7 @@ const useUrlResolver = ({ }); throw new NotFoundError(`Template '${templateNameId}' cannot be found. Space or InnovationPack must be provided`); } + if ( throwIfNotFound && templateNameId && @@ -144,6 +200,7 @@ const useUrlResolver = ({ variables: { nameId: userNameId! }, skip: !userNameId, }); + loading = loading || userLoading; const userId = userData?.lookupByName.user; if (throwIfNotFound && userNameId && !userLoading && !userId) { throw new NotFoundError(`User '${userNameId}' not found`); @@ -155,28 +212,59 @@ const useUrlResolver = ({ skip: !vcNameId, }); const vcId = vcData?.lookupByName.virtualContributor; + loading = loading || vcLoading; if (throwIfNotFound && vcNameId && !vcLoading && !vcId) { - throw new NotFoundError(`User '${vcNameId}' not found`); + throw new NotFoundError(`VirtualContributor '${vcNameId}' not found`); + } + + // Virtual Contributor with callout open + const { data: vcCalloutsSetData, loading: vcCalloutsSetLoading } = useVirtualContributorKeyEntitiesIDsQuery({ + variables: { virtualContributorId: vcId! }, + skip: !vcId || !calloutNameId, + }); + const vcCalloutsSetId = vcCalloutsSetData?.virtualContributor.knowledgeBase?.calloutsSet.id; + loading = loading || vcCalloutsSetLoading; + + // Callouts + const calloutsSetId = vcCalloutsSetId ?? spaceCalloutsSetId; + const { data: calloutData, loading: calloutDataLoading } = useCalloutUrlResolverQuery({ + variables: { calloutsSetId: calloutsSetId!, calloutNameId: calloutNameId! }, + skip: !calloutsSetId || !calloutNameId, + }); + const calloutId = calloutData?.lookup.calloutsSet?.callouts?.[0].id; + loading = loading || calloutDataLoading; + if (throwIfNotFound && calloutNameId && calloutsSetId && !calloutDataLoading && !calloutId) { + throw new NotFoundError(`Callout '${calloutNameId}' not found in VC '${vcNameId}'`); + } + + // Callout for posts and a post open + const { data: calloutPostData, loading: calloutPostLoading } = usePostInCalloutUrlResolverQuery({ + variables: { calloutId: calloutId!, postNameId: postNameId! }, + skip: !calloutId || !postNameId, + }); + const contributionId = calloutPostData?.lookup.callout?.contributions[0]?.id; + const postId = calloutPostData?.lookup.callout?.contributions[0]?.post?.id; + loading = loading || calloutPostLoading; + if (throwIfNotFound && calloutId && postNameId && !calloutPostLoading && !postId) { + throw new NotFoundError(`Post '${postNameId}' in callout '${calloutNameId}' ${calloutId} not found`); } const result = useMemo( () => ({ spaceId, + subspaceId, + subspaceIds, organizationId, innovationPackId, innovationHubId, templateId, userId, vcId, - loading: - spaceLoading || - organizationLoading || - templatesSetLoading || - innovationHubLoading || - innovationPackLoading || - templateLoading || - userLoading || - vcLoading, + calloutId, + calloutsSetId, + contributionId, + postId, + loading, }), [ spaceId, @@ -186,14 +274,11 @@ const useUrlResolver = ({ templateId, userId, vcId, - spaceLoading, - organizationLoading, - templatesSetLoading, - innovationHubLoading, - innovationPackLoading, - templateLoading, - userLoading, - vcLoading, + calloutId, + calloutsSetId, + contributionId, + postId, + loading, ] ); return result;