Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
DojoCLI
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
UI
DojoCLI
Commits
7c642e25
Commit
7c642e25
authored
2 years ago
by
michael.minelli
Browse files
Options
Downloads
Patches
Plain Diff
EnonceCreate => Add confirmation message with informations
parent
eb22282d
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
NodeApp/src/commander/enonce/EnonceCreateCommand.ts
+19
-3
19 additions, 3 deletions
NodeApp/src/commander/enonce/EnonceCreateCommand.ts
NodeApp/src/managers/DojoBackendManager.ts
+10
-5
10 additions, 5 deletions
NodeApp/src/managers/DojoBackendManager.ts
with
29 additions
and
8 deletions
NodeApp/src/commander/enonce/EnonceCreateCommand.ts
+
19
−
3
View file @
7c642e25
...
...
@@ -6,6 +6,7 @@ import SessionManager from '../../managers/SessionManager';
import
GitlabUser
from
'
../../shared/types/Gitlab/GitlabUser
'
;
import
DojoBackendManager
from
'
../../managers/DojoBackendManager
'
;
import
Toolbox
from
'
../../shared/Toolbox
'
;
import
Enonce
from
'
../../types/Enonce
'
;
class
EnonceCreateCommand
extends
CommanderCommand
{
...
...
@@ -122,9 +123,24 @@ class EnonceCreateCommand extends CommanderCommand {
{
console
.
log
(
chalk
.
cyan
(
'
Please wait while we are creating the enonce...
'
));
const
enonce
=
await
DojoBackendManager
.
createProject
(
options
.
name
,
members
,
templateIdOrNamespace
);
try
{
const
enonce
:
Enonce
=
await
DojoBackendManager
.
createProject
(
options
.
name
,
members
,
templateIdOrNamespace
);
console
.
log
(
enonce
);
const
oraInfo
=
(
message
:
string
)
=>
{
ora
({
text
:
message
,
indent
:
4
}).
start
().
info
();
};
oraInfo
(
`Dojo ID:
${
enonce
.
id
}
`
);
oraInfo
(
`Name:
${
enonce
.
name
}
`
);
oraInfo
(
`Web URL:
${
enonce
.
gitlabCreationInfo
.
web_url
}
`
);
oraInfo
(
`HTTP Repo:
${
enonce
.
gitlabCreationInfo
.
http_url_to_repo
}
`
);
oraInfo
(
`SSH Repo:
${
enonce
.
gitlabCreationInfo
.
ssh_url_to_repo
}
`
);
}
catch
(
error
)
{
return
;
}
}
}
}
...
...
This diff is collapsed.
Click to expand it.
NodeApp/src/managers/DojoBackendManager.ts
+
10
−
5
View file @
7c642e25
...
...
@@ -5,6 +5,7 @@ import ApiRoutes from '../types/ApiRoutes';
import
{
StatusCodes
}
from
'
http-status-codes
'
;
import
Enonce
from
'
../types/Enonce
'
;
import
GitlabUser
from
'
../shared/types/Gitlab/GitlabUser
'
;
import
DojoResponse
from
'
../types/DojoResponse
'
;
class
DojoBackendManager
{
...
...
@@ -68,12 +69,16 @@ class DojoBackendManager {
}
try
{
const
response
=
await
axios
.
post
<
Enonce
>
(
this
.
getApiUrl
(
ApiRoutes
.
ENONCE_CREATE
),
Object
.
assign
({
const
response
=
await
axios
.
post
<
DojoResponse
<
Enonce
>
>
(
this
.
getApiUrl
(
ApiRoutes
.
ENONCE_CREATE
),
Object
.
assign
({
name
:
name
,
members
:
JSON
.
stringify
(
members
)
},
templateIdOrNamespace
?
{
template
:
templateIdOrNamespace
}
:
{}));
return
response
.
data
;
if
(
verbose
)
{
spinner
.
succeed
(
`Enonce successfully created`
);
}
return
response
.
data
.
data
;
}
catch
(
error
)
{
if
(
verbose
)
{
if
(
error
instanceof
AxiosError
)
{
...
...
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