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

Tags => Code integration

parent 60ce3995
No related branches found
No related tags found
No related merge requests found
...@@ -3,7 +3,7 @@ import ClientsSharedConfig from '../../config/ClientsSharedConfig.js'; ...@@ -3,7 +3,7 @@ import ClientsSharedConfig from '../../config/ClientsSharedConfig.js';
class DojoBackendHelper { 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 }`; let url = `${ ClientsSharedConfig.apiURL }${ route }`;
if ( options ) { if ( options ) {
...@@ -18,6 +18,10 @@ class DojoBackendHelper { ...@@ -18,6 +18,10 @@ class DojoBackendHelper {
if ( options.gitlabProjectId ) { if ( options.gitlabProjectId ) {
url = url.replace('{{gitlabProjectId}}', encodeURIComponent(options.gitlabProjectId)); url = url.replace('{{gitlabProjectId}}', encodeURIComponent(options.gitlabProjectId));
} }
if ( options.tagName ) {
url = url.replace('{{tagName}}', encodeURIComponent(options.tagName));
}
} }
return url; return url;
......
interface TagSubmit { interface TagProposal {
  • michael.minelli @michael.minelli ·
    Author Owner

    @vincent.steinman Essayez de pas mélanger plusieurs termes pour désigner la même ressource. Bien sur suivant la situation vous pouvez utiliser le pluriel ou le singulier. Utilisons donc TagProposal.

    @orestis.malaspin

    Edited by michael.minelli
  • Please register or sign in to reply
name: string; name: string;
type: 'Language' | 'Framework' | 'Theme' | 'UserDefined'; type: 'Language' | 'Framework' | 'Theme' | 'UserDefined';
state: 'PendingApproval' | 'Declined' | 'Approved'; state: 'PendingApproval' | 'Declined' | 'Approved';
details: string;
} }
export default TagSubmit;
export default TagProposal;
...@@ -11,11 +11,11 @@ enum ApiRoute { ...@@ -11,11 +11,11 @@ enum ApiRoute {
ASSIGNMENT_CORRECTION_UPDATE_DELETE = '/assignments/{{assignmentNameOrUrl}}/corrections/{{exerciseIdOrUrl}}', ASSIGNMENT_CORRECTION_UPDATE_DELETE = '/assignments/{{assignmentNameOrUrl}}/corrections/{{exerciseIdOrUrl}}',
EXERCISE_CREATE = '/assignments/{{assignmentNameOrUrl}}/exercises', EXERCISE_CREATE = '/assignments/{{assignmentNameOrUrl}}/exercises',
EXERCISE_ASSIGNMENT = '/exercises/{{exerciseIdOrUrl}}/assignment', EXERCISE_ASSIGNMENT = '/exercises/{{exerciseIdOrUrl}}/assignment',
EXERCISE_RESULTS = '/exercises/{{exerciseIdOrUrl}}/results' EXERCISE_RESULTS = '/exercises/{{exerciseIdOrUrl}}/results',
ADD_TAG = '/tags', TAG_CREATE = '/tags',
  • michael.minelli @michael.minelli ·
    Author Owner

    @vincent.steinman Le nommage des éléments de l'énumération se fait (comme on peut le constater sur toutes les lignes du haut) : NOM-DE-LA-RESSOURCE_ACTION. Comme on peut également le voir plus haut le mot pour désigner l'ajout d'une ressource est le mot create et non add. @orestis.malaspin

  • Please register or sign in to reply
DELETE_TAG = '/tags/{{tageName}}', TAG_DELETE = '/tags/{{tagName}}',
PROPOSE_TAG = '/tags/proposals/{{tagState}}', TAG_PROPOSAL_GET_CREATE = '/tags/proposals',
//ANSWER_TAG_PROPOSAL = '/tags/proposals/{{tagProposalName}}' 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