Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
N
NodeClientSharedCode
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
External wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Dojo Project (HES-SO)
Projects
Shared
NodeClientSharedCode
Commits
ce495680
Commit
ce495680
authored
1 year ago
by
michael.minelli
Browse files
Options
Downloads
Patches
Plain Diff
Sonar => Resolve issues
parent
2b2b2376
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
helpers/Dojo/AssignmentValidator.ts
+1
-1
1 addition, 1 deletion
helpers/Dojo/AssignmentValidator.ts
helpers/Dojo/DojoBackendHelper.ts
+28
-0
28 additions, 0 deletions
helpers/Dojo/DojoBackendHelper.ts
types/Dojo/ApiRoute.ts
+7
-7
7 additions, 7 deletions
types/Dojo/ApiRoute.ts
with
36 additions
and
8 deletions
helpers/Dojo/AssignmentValidator.ts
+
1
−
1
View file @
ce495680
...
@@ -146,7 +146,7 @@ class AssignmentValidator {
...
@@ -146,7 +146,7 @@ class AssignmentValidator {
// Immutable files validation (Check if exists and if the given type is correct)
// Immutable files validation (Check if exists and if the given type is correct)
this
.
newSubStep
(
'
ASSIGNMENT_FILE_IMMUTABLES_VALIDATION
'
,
'
Validating immutable files
'
);
this
.
newSubStep
(
'
ASSIGNMENT_FILE_IMMUTABLES_VALIDATION
'
,
'
Validating immutable files
'
);
for
(
const
immutable
of
validationResults
.
content
!
.
immutable
)
{
for
(
const
immutable
of
this
.
assignmentFile
.
immutable
)
{
const
immutablePath
=
path
.
join
(
this
.
folderAssignment
,
immutable
.
path
);
const
immutablePath
=
path
.
join
(
this
.
folderAssignment
,
immutable
.
path
);
if
(
!
fs
.
existsSync
(
immutablePath
)
)
{
if
(
!
fs
.
existsSync
(
immutablePath
)
)
{
this
.
emitError
(
`Immutable path not found:
${
immutable
.
path
}
`
,
assignmentFileValidationError
,
AssignmentCheckerError
.
IMMUTABLE_PATH_NOT_FOUND
);
this
.
emitError
(
`Immutable path not found:
${
immutable
.
path
}
`
,
assignmentFileValidationError
,
AssignmentCheckerError
.
IMMUTABLE_PATH_NOT_FOUND
);
...
...
This diff is collapsed.
Click to expand it.
helpers/Dojo/DojoBackendHelper.ts
0 → 100644
+
28
−
0
View file @
ce495680
import
ApiRoute
from
'
../../types/Dojo/ApiRoute
'
;
import
ClientsSharedConfig
from
'
../../config/ClientsSharedConfig
'
;
class
DojoBackendHelper
{
public
getApiUrl
(
route
:
ApiRoute
,
options
?:
Partial
<
{
assignmentNameOrUrl
:
string
,
exerciseIdOrUrl
:
string
,
gitlabProjectId
:
string
}
>
):
string
{
const
url
=
`
${
ClientsSharedConfig
.
apiURL
}${
route
}
`
;
if
(
options
)
{
if
(
options
.
assignmentNameOrUrl
)
{
return
url
.
replace
(
'
{{assignmentNameOrUrl}}
'
,
encodeURIComponent
(
options
.
assignmentNameOrUrl
));
}
if
(
options
.
exerciseIdOrUrl
)
{
return
url
.
replace
(
'
{{exerciseIdOrUrl}}
'
,
encodeURIComponent
(
options
.
exerciseIdOrUrl
));
}
if
(
options
.
gitlabProjectId
)
{
return
url
.
replace
(
'
{{gitlabProjectId}}
'
,
encodeURIComponent
(
options
.
gitlabProjectId
));
}
}
return
url
;
}
}
export
default
new
DojoBackendHelper
();
\ No newline at end of file
This diff is collapsed.
Click to expand it.
types/Dojo/ApiRoute.ts
+
7
−
7
View file @
ce495680
...
@@ -2,16 +2,16 @@ enum ApiRoute {
...
@@ -2,16 +2,16 @@ enum ApiRoute {
LOGIN
=
'
/login
'
,
LOGIN
=
'
/login
'
,
REFRESH_TOKENS
=
'
/refresh_tokens
'
,
REFRESH_TOKENS
=
'
/refresh_tokens
'
,
TEST_SESSION
=
'
/test_session
'
,
TEST_SESSION
=
'
/test_session
'
,
GITLAB_CHECK_TEMPLATE_ACCESS
=
'
/gitlab/project/{{
i
d}}/checkTemplateAccess
'
,
GITLAB_CHECK_TEMPLATE_ACCESS
=
'
/gitlab/project/{{
gitlabProjectI
d}}/checkTemplateAccess
'
,
ASSIGNMENT_GET
=
'
/assignments/{{
n
ameOrUrl}}
'
,
ASSIGNMENT_GET
=
'
/assignments/{{
assignmentN
ameOrUrl}}
'
,
ASSIGNMENT_CREATE
=
'
/assignments
'
,
ASSIGNMENT_CREATE
=
'
/assignments
'
,
ASSIGNMENT_PUBLISH
=
'
/assignments/{{
n
ameOrUrl}}/publish
'
,
ASSIGNMENT_PUBLISH
=
'
/assignments/{{
assignmentN
ameOrUrl}}/publish
'
,
ASSIGNMENT_UNPUBLISH
=
'
/assignments/{{
n
ameOrUrl}}/unpublish
'
,
ASSIGNMENT_UNPUBLISH
=
'
/assignments/{{
assignmentN
ameOrUrl}}/unpublish
'
,
ASSIGNMENT_CORRECTION_LINK
=
'
/assignments/{{assignmentNameOrUrl}}/corrections
'
,
ASSIGNMENT_CORRECTION_LINK
=
'
/assignments/{{assignmentNameOrUrl}}/corrections
'
,
ASSIGNMENT_CORRECTION_UPDATE
=
'
/assignments/{{assignmentNameOrUrl}}/corrections/{{exerciseIdOrUrl}}
'
,
ASSIGNMENT_CORRECTION_UPDATE
=
'
/assignments/{{assignmentNameOrUrl}}/corrections/{{exerciseIdOrUrl}}
'
,
EXERCISE_CREATE
=
'
/assignments/{{
n
ameOrUrl}}/exercises
'
,
EXERCISE_CREATE
=
'
/assignments/{{
assignmentN
ameOrUrl}}/exercises
'
,
EXERCISE_ASSIGNMENT
=
'
/exercises/{{
id
}}/assignment
'
,
EXERCISE_ASSIGNMENT
=
'
/exercises/{{
exerciseIdOrUrl
}}/assignment
'
,
EXERCISE_RESULTS
=
'
/exercises/{{
id
}}/results
'
EXERCISE_RESULTS
=
'
/exercises/{{
exerciseIdOrUrl
}}/results
'
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment