diff --git a/helpers/Dojo/DojoBackendHelper.ts b/helpers/Dojo/DojoBackendHelper.ts index 7475376fb003f3661e1363f3c437098b04ad6082..025c3876bc73bd9a6887279171a27668963f990f 100644 --- a/helpers/Dojo/DojoBackendHelper.ts +++ b/helpers/Dojo/DojoBackendHelper.ts @@ -3,7 +3,7 @@ import ClientsSharedConfig from '../../config/ClientsSharedConfig.js'; class DojoBackendHelper { - public getApiUrl(route: ApiRoute, options?: Partial<{ assignmentNameOrUrl: string, exerciseIdOrUrl: string, gitlabProjectId: string }>): string { + public getApiUrl(route: ApiRoute, options?: Partial<{ assignmentNameOrUrl: string, exerciseIdOrUrl: string, gitlabProjectId: string, tagName: string }>): string { let url = `${ ClientsSharedConfig.apiURL }${ route }`; if ( options ) { @@ -18,6 +18,10 @@ class DojoBackendHelper { if ( options.gitlabProjectId ) { url = url.replace('{{gitlabProjectId}}', encodeURIComponent(options.gitlabProjectId)); } + + if ( options.tagName ) { + url = url.replace('{{tagName}}', encodeURIComponent(options.tagName)); + } } return url; diff --git a/models/Tag.ts b/models/Tag.ts new file mode 100644 index 0000000000000000000000000000000000000000..632f6578b60b6f709e3c3101e235740fe758fda2 --- /dev/null +++ b/models/Tag.ts @@ -0,0 +1,17 @@ +import { CommitSchema } from '@gitbeaker/rest'; +import Assignment from './Assignment'; +import Exercise from './Exercise'; + + +interface Tags { + name: string; + type: 'Language' | 'Framework' | 'Theme' | 'UserDefined'; + + exercise: Exercise | undefined; + assignment: Assignment | undefined; + + correctionCommit: CommitSchema | undefined; +} + +export default Tags; + \ No newline at end of file diff --git a/models/TagProposal.ts b/models/TagProposal.ts new file mode 100644 index 0000000000000000000000000000000000000000..94c3c8c8ccd9cc8f88f4d04ee1e784a602fb777c --- /dev/null +++ b/models/TagProposal.ts @@ -0,0 +1,9 @@ +interface TagProposal { + name: string; + type: 'Language' | 'Framework' | 'Theme' | 'UserDefined'; + state: 'PendingApproval' | 'Declined' | 'Approved'; + details: string; +} + + +export default TagProposal; diff --git a/types/Dojo/ApiRoute.ts b/types/Dojo/ApiRoute.ts index ef63323d1381f1af9f8acc1f3da044602b195fba..9d5b40f3625caae3ad9c2f0c1cc0bf4874e12ba9 100644 --- a/types/Dojo/ApiRoute.ts +++ b/types/Dojo/ApiRoute.ts @@ -11,7 +11,11 @@ enum ApiRoute { ASSIGNMENT_CORRECTION_UPDATE_DELETE = '/assignments/{{assignmentNameOrUrl}}/corrections/{{exerciseIdOrUrl}}', EXERCISE_CREATE = '/assignments/{{assignmentNameOrUrl}}/exercises', EXERCISE_ASSIGNMENT = '/exercises/{{exerciseIdOrUrl}}/assignment', - EXERCISE_RESULTS = '/exercises/{{exerciseIdOrUrl}}/results' + EXERCISE_RESULTS = '/exercises/{{exerciseIdOrUrl}}/results', + TAG_CREATE = '/tags', + TAG_DELETE = '/tags/{{tagName}}', + TAG_PROPOSAL_GET_CREATE = '/tags/proposals', + TAG_PROPOSAL_UPDATE = '/tags/proposals/{{tagName}}', }