-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4170 from alkem-io/develop
Release: Virtual Contributor, Platform Invitations, Invitations with Roles
- Loading branch information
Showing
125 changed files
with
4,210 additions
and
1,681 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
src/domain/communication/message.answer.to.question/message.answer.to.question.module.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import { Module } from '@nestjs/common'; | ||
import { ContributorLookupModule } from '@services/infrastructure/contributor-lookup/contributor.lookup.module'; | ||
import { TypeOrmModule } from '@nestjs/typeorm'; | ||
import { VirtualContributor } from '@domain/community/virtual-contributor'; | ||
|
||
@Module({ | ||
imports: [ | ||
ContributorLookupModule, | ||
TypeOrmModule.forFeature([VirtualContributor]), | ||
], | ||
providers: [], | ||
exports: [], | ||
}) | ||
export class MessageAnswerToQuestionModule {} |
18 changes: 18 additions & 0 deletions
18
...n/communication/message.answer.to.question/message.answer.to.question.source.interface.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import { Field, ObjectType } from '@nestjs/graphql'; | ||
|
||
@ObjectType('MessageAnswerToQuestionSource', { | ||
description: 'A source used in a detailed answer to a question.', | ||
}) | ||
export class IAnswerToQuestionSource { | ||
@Field(() => String, { | ||
nullable: true, | ||
description: 'The URI of the source', | ||
}) | ||
uri!: string; | ||
|
||
@Field(() => String, { | ||
nullable: true, | ||
description: 'The title of the source', | ||
}) | ||
title!: string; | ||
} |
4 changes: 2 additions & 2 deletions
4
src/domain/communication/message.reaction/message.reaction.module.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,16 @@ | ||
import { Module } from '@nestjs/common'; | ||
import { MessageResolverFields } from './message.resolver.fields'; | ||
import { UserLookupModule } from '@services/infrastructure/user-lookup/user.lookup.module'; | ||
import { ContributorLookupModule } from '@services/infrastructure/contributor-lookup/contributor.lookup.module'; | ||
import { TypeOrmModule } from '@nestjs/typeorm'; | ||
import { VirtualContributor } from '@domain/community/virtual-contributor'; | ||
import { MessageService } from './message.service'; | ||
|
||
@Module({ | ||
imports: [UserLookupModule, TypeOrmModule.forFeature([VirtualContributor])], | ||
providers: [MessageResolverFields], | ||
exports: [MessageResolverFields], | ||
imports: [ | ||
ContributorLookupModule, | ||
TypeOrmModule.forFeature([VirtualContributor]), | ||
], | ||
providers: [MessageResolverFields, MessageService], | ||
exports: [MessageResolverFields, MessageService], | ||
}) | ||
export class MessageModule {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import { LogContext } from '@common/enums/logging.context'; | ||
import { IMessageAnswerToQuestion } from '../message.answer.to.question/message.answer.to.question.interface'; | ||
import { LoggerService } from '@nestjs/common/services/logger.service'; | ||
import { WINSTON_MODULE_NEST_PROVIDER } from 'nest-winston'; | ||
import { Inject, Injectable } from '@nestjs/common'; | ||
|
||
@Injectable() | ||
export class MessageService { | ||
constructor( | ||
@Inject(WINSTON_MODULE_NEST_PROVIDER) private readonly logger: LoggerService | ||
) {} | ||
|
||
public convertAnswerToSimpleMessage( | ||
answerToQuestion: IMessageAnswerToQuestion | ||
): string { | ||
this.logger.verbose?.( | ||
`Converting answer to simple message: ${JSON.stringify( | ||
answerToQuestion | ||
)}`, | ||
LogContext.COMMUNICATION | ||
); | ||
let answer = answerToQuestion.answer; | ||
|
||
if (answerToQuestion.sources) { | ||
answer = `${answer}\n${answerToQuestion.sources | ||
.map(({ title, uri }) => `- [${title}](${uri})`) | ||
.join('\n')}`; | ||
} | ||
return answer; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.