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
Compare revisions
2b2b2376b0389a39283327bba5bfaf7d1ce136ac to ce495680ad5fe004f65f7b062660280077d23909
Compare revisions
Changes are shown as if the
source
revision was being merged into the
target
revision.
Learn more about comparing revisions.
Source
dojo_project/projects/shared/nodeclientsharedcode
Select target project
No results found
ce495680ad5fe004f65f7b062660280077d23909
Select Git revision
Swap
Target
dojo_project/projects/shared/nodeclientsharedcode
Select target project
dojo_project/projects/shared/nodeclientsharedcode
1 result
2b2b2376b0389a39283327bba5bfaf7d1ce136ac
Select Git revision
Show changes
Only incoming changes from source
Include changes to target since source was created
Compare
Commits on Source (1)
Sonar => Resolve issues
· ce495680
michael.minelli
authored
1 year ago
ce495680
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
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
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
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.