-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* add preferred tool endpoint * add preferred tool uc * add apiProperty description * add seed data * add feature flag FEATURE_PREFERRED_CTL_TOOLS_ENABLED --------- Co-authored-by: Steliyan Dinkov <[email protected]> Co-authored-by: Igor Richter <[email protected]>
- Loading branch information
Showing
19 changed files
with
594 additions
and
19 deletions.
There are no files selected for viewing
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
.../server/src/modules/tool/external-tool/controller/dto/request/tool-context-type.params.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 { IsEnum, IsOptional } from 'class-validator'; | ||
import { ApiPropertyOptional } from '@nestjs/swagger'; | ||
import { ToolContextType } from '@modules/tool/common/enum'; | ||
|
||
export class ToolContextTypeParams { | ||
@IsOptional() | ||
@IsEnum(ToolContextType, { each: true }) | ||
@ApiPropertyOptional({ | ||
enum: ToolContextType, | ||
enumName: 'ToolContextType', | ||
description: 'Context types for tools', | ||
}) | ||
contextType?: ToolContextType; | ||
} |
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
11 changes: 11 additions & 0 deletions
11
...er/src/modules/tool/external-tool/controller/dto/response/preferred-tool-list.response.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,11 @@ | ||
import { ApiProperty } from '@nestjs/swagger'; | ||
import { PreferredToolResponse } from './preferred-tool.response'; | ||
|
||
export class PreferredToolListResponse { | ||
@ApiProperty({ type: [PreferredToolResponse] }) | ||
data: PreferredToolResponse[]; | ||
|
||
constructor(data: PreferredToolResponse[]) { | ||
this.data = data; | ||
} | ||
} |
21 changes: 21 additions & 0 deletions
21
.../server/src/modules/tool/external-tool/controller/dto/response/preferred-tool.response.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,21 @@ | ||
import { ApiProperty } from '@nestjs/swagger'; | ||
|
||
export class PreferredToolResponse { | ||
@ApiProperty({ type: String, description: 'Id of the school external tool' }) | ||
schoolExternalToolId: string; | ||
|
||
@ApiProperty({ type: String, description: 'Name of the external tool' }) | ||
name: string; | ||
|
||
@ApiProperty({ | ||
type: String, | ||
description: 'Name of the icon to be rendered when displaying it as a preferred tool', | ||
}) | ||
iconName: string; | ||
|
||
constructor(configuration: PreferredToolResponse) { | ||
this.schoolExternalToolId = configuration.schoolExternalToolId; | ||
this.name = configuration.name; | ||
this.iconName = configuration.iconName; | ||
} | ||
} |
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
Oops, something went wrong.