Skip to content
Snippets Groups Projects
Commit 8c87edbb authored by michael.minelli's avatar michael.minelli
Browse files

Merge branch 'tags_integration' into v4.2

parents 55a94e77 026cd6d1
No related branches found
No related tags found
No related merge requests found
......@@ -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;
......
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
interface TagProposal {
name: string;
type: 'Language' | 'Framework' | 'Theme' | 'UserDefined';
state: 'PendingApproval' | 'Declined' | 'Approved';
details: string;
}
export default TagProposal;
......@@ -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}}',
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment