Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
LOFAR
Manage
Activity
Members
Labels
Plan
Issues
Wiki
Jira issues
Open Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Insights
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
RadioObservatory
LOFAR
Commits
a68f6cb1
Commit
a68f6cb1
authored
4 years ago
by
Ramesh Kumar
Browse files
Options
Downloads
Plain Diff
Merge branch '
TMSS-275
' into
TMSS-243
parents
ae056c1c
d7dc799e
Branches
Branches containing commit
Tags
Tags containing commit
1 merge request
!191
Resolve TMSS-243
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
SAS/TMSS/frontend/tmss_webapp/src/routes/Project/create.js
+22
-11
22 additions, 11 deletions
SAS/TMSS/frontend/tmss_webapp/src/routes/Project/create.js
with
22 additions
and
11 deletions
SAS/TMSS/frontend/tmss_webapp/src/routes/Project/create.js
+
22
−
11
View file @
a68f6cb1
...
@@ -157,9 +157,19 @@ export class ProjectCreate extends Component {
...
@@ -157,9 +157,19 @@ export class ProjectCreate extends Component {
* @param {string} key
* @param {string} key
* @param {any} value
* @param {any} value
*/
*/
setProjectParams
(
key
,
value
)
{
setProjectParams
(
key
,
value
,
type
)
{
let
project
=
this
.
state
.
project
;
let
project
=
this
.
state
.
project
;
switch
(
type
)
{
case
'
NUMBER
'
:
{
console
.
log
(
"
Parsing Number
"
);
project
[
key
]
=
value
?
parseInt
(
value
):
0
;
break
;
}
default
:
{
project
[
key
]
=
value
;
project
[
key
]
=
value
;
break
;
}
}
this
.
setState
({
project
:
project
,
validForm
:
this
.
validateForm
(
key
)});
this
.
setState
({
project
:
project
,
validForm
:
this
.
validateForm
(
key
)});
}
}
...
@@ -173,12 +183,13 @@ export class ProjectCreate extends Component {
...
@@ -173,12 +183,13 @@ export class ProjectCreate extends Component {
let
projectQuota
=
this
.
state
.
projectQuota
;
let
projectQuota
=
this
.
state
.
projectQuota
;
let
resource
=
_
.
find
(
this
.
state
.
resources
,
{
'
name
'
:
key
});
let
resource
=
_
.
find
(
this
.
state
.
resources
,
{
'
name
'
:
key
});
let
newValue
=
0
;
if
(
this
.
resourceUnitMap
[
resource
.
name
])
{
if
(
this
.
resourceUnitMap
[
resource
.
name
])
{
projectQuota
[
key
]
=
event
.
target
.
value
.
replace
(
this
.
resourceUnitMap
[
resource
.
name
].
display
,
''
);
newValue
=
event
.
target
.
value
.
replace
(
this
.
resourceUnitMap
[
resource
.
name
].
display
,
''
);
}
else
{
}
else
{
projectQuota
[
key
]
=
event
.
target
.
value
;
newValue
=
event
.
target
.
value
;
}
}
// console.log(`${key} - ${event.target.v
alue
}`)
;
projectQuota
[
key
]
=
newValue
===
"
NaN
"
?
0
:
newV
alue
;
this
.
setState
({
projectQuota
:
projectQuota
});
this
.
setState
({
projectQuota
:
projectQuota
});
}
}
}
}
...
@@ -360,8 +371,8 @@ export class ProjectCreate extends Component {
...
@@ -360,8 +371,8 @@ export class ProjectCreate extends Component {
<
div
className
=
"
col-lg-4 col-md-4 col-sm-12
"
data
-
testid
=
"
trig_prio
"
>
<
div
className
=
"
col-lg-4 col-md-4 col-sm-12
"
data
-
testid
=
"
trig_prio
"
>
<
InputNumber
inputId
=
"
trig_prio
"
name
=
"
trig_prio
"
value
=
{
this
.
state
.
project
.
trigger_priority
}
<
InputNumber
inputId
=
"
trig_prio
"
name
=
"
trig_prio
"
value
=
{
this
.
state
.
project
.
trigger_priority
}
mode
=
"
decimal
"
showButtons
min
=
{
0
}
max
=
{
1001
}
step
=
{
10
}
useGrouping
=
{
false
}
mode
=
"
decimal
"
showButtons
min
=
{
0
}
max
=
{
1001
}
step
=
{
10
}
useGrouping
=
{
false
}
onChange
=
{(
e
)
=>
this
.
setProjectParams
(
'
trigger_priority
'
,
e
.
target
.
value
)}
onChange
=
{(
e
)
=>
this
.
setProjectParams
(
'
trigger_priority
'
,
e
.
value
)}
onBlur
=
{(
e
)
=>
this
.
setProjectParams
(
'
trigger_priority
'
,
e
.
target
.
value
)}
/
>
onBlur
=
{(
e
)
=>
this
.
setProjectParams
(
'
trigger_priority
'
,
e
.
target
.
value
,
'
NUMBER
'
)}
/
>
<
label
className
=
"
error
"
>
<
label
className
=
"
error
"
>
{
this
.
state
.
errors
.
trigger_priority
?
this
.
state
.
errors
.
trigger_priority
:
""
}
{
this
.
state
.
errors
.
trigger_priority
?
this
.
state
.
errors
.
trigger_priority
:
""
}
...
@@ -404,8 +415,8 @@ export class ProjectCreate extends Component {
...
@@ -404,8 +415,8 @@ export class ProjectCreate extends Component {
<
div
className
=
"
col-lg-4 col-md-4 col-sm-12
"
data
-
testid
=
"
proj-rank
"
>
<
div
className
=
"
col-lg-4 col-md-4 col-sm-12
"
data
-
testid
=
"
proj-rank
"
>
<
InputNumber
inputId
=
"
proj-rank
"
name
=
"
rank
"
data
-
testid
=
"
rank
"
value
=
{
this
.
state
.
project
.
priority_rank
}
<
InputNumber
inputId
=
"
proj-rank
"
name
=
"
rank
"
data
-
testid
=
"
rank
"
value
=
{
this
.
state
.
project
.
priority_rank
}
mode
=
"
decimal
"
showButtons
min
=
{
0
}
max
=
{
100
}
mode
=
"
decimal
"
showButtons
min
=
{
0
}
max
=
{
100
}
onChange
=
{(
e
)
=>
this
.
setProjectParams
(
'
priority_rank
'
,
e
.
target
.
value
)}
onChange
=
{(
e
)
=>
this
.
setProjectParams
(
'
priority_rank
'
,
e
.
value
)}
onBlur
=
{(
e
)
=>
this
.
setProjectParams
(
'
priority_rank
'
,
e
.
target
.
value
)}
/
>
onBlur
=
{(
e
)
=>
this
.
setProjectParams
(
'
priority_rank
'
,
e
.
target
.
value
,
'
NUMBER
'
)}
/
>
<
label
className
=
"
error
"
>
<
label
className
=
"
error
"
>
{
this
.
state
.
errors
.
priority_rank
?
this
.
state
.
errors
.
priority_rank
:
""
}
{
this
.
state
.
errors
.
priority_rank
?
this
.
state
.
errors
.
priority_rank
:
""
}
<
/label
>
<
/label
>
...
@@ -439,10 +450,10 @@ export class ProjectCreate extends Component {
...
@@ -439,10 +450,10 @@ export class ProjectCreate extends Component {
<
/div
>
<
/div
>
<
/div
>
<
/div
>
<
div
className
=
"
p-grid p-justify-start
"
>
<
div
className
=
"
p-grid p-justify-start
"
>
<
div
className
=
"
p-col-1
"
>
<
div
className
=
"
col-lg-1 col-md-2 col-sm-6
"
>
<
Button
label
=
"
Save
"
className
=
"
p-button-primary
"
id
=
"
save-btn
"
data
-
testid
=
"
save-btn
"
icon
=
"
pi pi-check
"
onClick
=
{
this
.
saveProject
}
disabled
=
{
!
this
.
state
.
validForm
}
/
>
<
Button
label
=
"
Save
"
className
=
"
p-button-primary
"
id
=
"
save-btn
"
data
-
testid
=
"
save-btn
"
icon
=
"
pi pi-check
"
onClick
=
{
this
.
saveProject
}
disabled
=
{
!
this
.
state
.
validForm
}
/
>
<
/div
>
<
/div
>
<
div
className
=
"
p-col-1
"
>
<
div
className
=
"
col-lg-1 col-md-2 col-sm-6
"
>
<
Button
label
=
"
Cancel
"
className
=
"
p-button-danger
"
icon
=
"
pi pi-times
"
onClick
=
{
this
.
cancelCreate
}
/
>
<
Button
label
=
"
Cancel
"
className
=
"
p-button-danger
"
icon
=
"
pi pi-times
"
onClick
=
{
this
.
cancelCreate
}
/
>
<
/div
>
<
/div
>
<
/div
>
<
/div
>
...
...
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