Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
jami-jams
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
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
savoirfairelinux
jami-jams
Commits
b2812dd3
Commit
b2812dd3
authored
4 years ago
by
Larbi Gharib
Browse files
Options
Downloads
Patches
Plain Diff
Blueprint no default value
Change-Id: Iffaa5c3b3c11ab4bacaea6cf94cdb431db7b24b1
parent
2032d6f0
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
jams-react-client/src/views/Blueprints/Blueprints.js
+16
-9
16 additions, 9 deletions
jams-react-client/src/views/Blueprints/Blueprints.js
with
16 additions
and
9 deletions
jams-react-client/src/views/Blueprints/Blueprints.js
+
16
−
9
View file @
b2812dd3
...
...
@@ -86,10 +86,12 @@ export default function Blueprints() {
const
[
progress
,
setProgress
]
=
React
.
useState
(
0
);
const
[
searchValue
,
setSearchValue
]
=
React
.
useState
(
false
)
const
[
blueprintName
,
setBlueprintName
]
=
React
.
useState
()
const
[
blueprintNameExits
,
setBlueprintNameExits
,
]
=
React
.
useState
()
const
[
blueprintName
,
setBlueprintName
]
=
React
.
useState
(
""
)
const
[
blueprintNameExits
,
setBlueprintNameExits
]
=
React
.
useState
()
const
[
open
,
setOpen
]
=
React
.
useState
(
false
)
const
[
disableCreate
,
setDisableCreate
]
=
React
.
useState
(
false
);
const
[
removedBlueprint
,
setRemovedBlueprint
]
=
React
.
useState
()
const
[
openRemoveDialog
,
setOpenRemoveDialog
]
=
React
.
useState
()
...
...
@@ -133,10 +135,14 @@ export default function Blueprints() {
}
const
handleCheckBlueprintNameExists
=
(
searchBlueprintNameValue
)
=>
{
setDisableCreate
(
true
);
axios
(
configApiCall
(
api_path_blueprints
+
"
?name=
"
+
searchBlueprintNameValue
,
'
GET
'
,
null
,
null
)).
then
((
response
)
=>
{
setBlueprintNameExits
(
false
)
setDisableCreate
(
true
);
setBlueprintNameExits
(
true
);
}).
catch
((
error
)
=>
{
setBlueprintNameExits
(
true
)
console
.
log
(
error
);
setDisableCreate
(
false
);
setBlueprintNameExits
(
false
);
});
}
...
...
@@ -204,26 +210,27 @@ export default function Blueprints() {
<
InputLabel
htmlFor
=
"
blueprintName
"
>
Blueprint
name
<
/InputLabel
>
<
Input
id
=
"
blueprintName
"
placeholder
=
{
b
lueprintName
}
placeholder
=
"
B
lueprint
Name
"
startAdornment
=
{
<
InputAdornment
position
=
"
start
"
>
<
AllInbox
/>
<
/InputAdornment>
}
onChange
=
{
e
=>
{
const
searchBlueprintNameValue
=
e
.
target
.
value
;
setBlueprintName
(
searchBlueprintNameValue
);
initCheckBlueprintNameExists
(
blueprintName
);
setBlueprintName
(
e
.
target
.
value
);
initCheckBlueprintNameExists
(
e
.
target
.
value
);
}}
/
>
<
/FormControl
>
{
disableCreate
&&
blueprintName
.
length
>
0
&&
<
p
>
Bluerpint
name
already
exists
!<
/p>
}
{
disableCreate
&&
blueprintName
.
length
==
0
&&
<
p
>
Bluerpint
name
is
empty
<
/p>
}
<
/DialogContentText
>
<
/DialogContent
>
<
DialogActions
>
<
Button
onClick
=
{
handleClose
}
color
=
"
info
"
>
Cancel
<
/Button
>
<
Button
onClick
=
{
handleCreateBlueprint
}
color
=
"
primary
"
autoFocus
>
<
Button
onClick
=
{
handleCreateBlueprint
}
color
=
"
primary
"
disabled
=
{
disableCreate
}
autoFocus
>
Create
<
/Button
>
<
/DialogActions
>
...
...
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