-
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
- move tool reference to context external tool module - new endpoint for tool reference from context external tool id - add new tool reference controller - add board-element as context for context external tools
- Loading branch information
1 parent
1f90ed1
commit f2f0b36
Showing
73 changed files
with
1,246 additions
and
785 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
1 change: 1 addition & 0 deletions
1
apps/server/src/modules/tool/common/enum/tool-context-type.enum.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 |
---|---|---|
@@ -1,3 +1,4 @@ | ||
export enum ToolContextType { | ||
COURSE = 'course', | ||
BOARD_ELEMENT = 'board-element', | ||
} |
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
apps/server/src/modules/tool/common/mapper/tool-status-response.mapper.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 { ToolConfigurationStatusResponse } from '../../context-external-tool/controller/dto/tool-configuration-status.response'; | ||
import { ToolConfigurationStatus } from '../enum'; | ||
|
||
export const statusMapping: Record<ToolConfigurationStatus, ToolConfigurationStatusResponse> = { | ||
[ToolConfigurationStatus.LATEST]: ToolConfigurationStatusResponse.LATEST, | ||
[ToolConfigurationStatus.OUTDATED]: ToolConfigurationStatusResponse.OUTDATED, | ||
[ToolConfigurationStatus.UNKNOWN]: ToolConfigurationStatusResponse.UNKNOWN, | ||
}; | ||
|
||
export class ToolStatusResponseMapper { | ||
static mapToResponse(status: ToolConfigurationStatus): ToolConfigurationStatusResponse { | ||
return statusMapping[status]; | ||
} | ||
} |
27 changes: 15 additions & 12 deletions
27
apps/server/src/modules/tool/context-external-tool/context-external-tool.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 |
---|---|---|
@@ -1,25 +1,28 @@ | ||
import { forwardRef, Module } from '@nestjs/common'; | ||
import { Module } from '@nestjs/common'; | ||
import { LoggerModule } from '@src/core/logger'; | ||
import { AuthorizationModule } from '@src/modules/authorization'; | ||
import { CommonToolModule } from '../common'; | ||
import { ExternalToolModule } from '../external-tool'; | ||
import { SchoolExternalToolModule } from '../school-external-tool'; | ||
import { | ||
ContextExternalToolAuthorizableService, | ||
ContextExternalToolService, | ||
ContextExternalToolValidationService, | ||
ToolReferenceService, | ||
} from './service'; | ||
import { CommonToolModule } from '../common'; | ||
|
||
@Module({ | ||
// TODO: remove authorization module here N21-1055 | ||
imports: [ | ||
CommonToolModule, | ||
ExternalToolModule, | ||
SchoolExternalToolModule, | ||
LoggerModule, | ||
forwardRef(() => AuthorizationModule), | ||
imports: [CommonToolModule, ExternalToolModule, SchoolExternalToolModule, LoggerModule], | ||
providers: [ | ||
ContextExternalToolService, | ||
ContextExternalToolValidationService, | ||
ContextExternalToolAuthorizableService, | ||
ToolReferenceService, | ||
], | ||
exports: [ | ||
ContextExternalToolService, | ||
ContextExternalToolValidationService, | ||
ContextExternalToolAuthorizableService, | ||
ToolReferenceService, | ||
], | ||
providers: [ContextExternalToolService, ContextExternalToolValidationService, ContextExternalToolAuthorizableService], | ||
exports: [ContextExternalToolService, ContextExternalToolValidationService, ContextExternalToolAuthorizableService], | ||
}) | ||
export class ContextExternalToolModule {} |
Oops, something went wrong.