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
b36a204c
Commit
b36a204c
authored
4 years ago
by
Ramesh Kumar
Browse files
Options
Downloads
Patches
Plain Diff
TMSS-238
: Date field error msg updated.
parent
ddc64a9c
No related branches found
No related tags found
1 merge request
!199
Resolve TMSS-238
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
SAS/TMSS/frontend/tmss_webapp/src/routes/Cycle/create.js
+8
-5
8 additions, 5 deletions
SAS/TMSS/frontend/tmss_webapp/src/routes/Cycle/create.js
with
8 additions
and
5 deletions
SAS/TMSS/frontend/tmss_webapp/src/routes/Cycle/create.js
+
8
−
5
View file @
b36a204c
...
@@ -98,7 +98,8 @@ export class CycleCreate extends Component {
...
@@ -98,7 +98,8 @@ export class CycleCreate extends Component {
let
cycleQuota
=
this
.
state
.
cycleQuota
;
let
cycleQuota
=
this
.
state
.
cycleQuota
;
for
(
const
resource
of
resources
)
{
for
(
const
resource
of
resources
)
{
const
conversionFactor
=
this
.
resourceUnitMap
[
resource
.
quantity_value
]?
this
.
resourceUnitMap
[
resource
.
quantity_value
].
conversionFactor
:
1
;
const
conversionFactor
=
this
.
resourceUnitMap
[
resource
.
quantity_value
]?
this
.
resourceUnitMap
[
resource
.
quantity_value
].
conversionFactor
:
1
;
cycleQuota
[
resource
[
'
name
'
]]
=
this
.
cycleResourceDefaults
[
resource
.
name
]
/
conversionFactor
;
// cycleQuota[resource['name']] = this.cycleResourceDefaults[resource.name]/conversionFactor;
cycleQuota
[
resource
[
'
name
'
]]
=
0
;
}
}
return
cycleQuota
;
return
cycleQuota
;
}
}
...
@@ -224,7 +225,7 @@ export class CycleCreate extends Component {
...
@@ -224,7 +225,7 @@ export class CycleCreate extends Component {
if
(
this
.
state
.
cycle
[
'
start
'
]
&&
this
.
state
.
cycle
[
'
stop
'
]){
if
(
this
.
state
.
cycle
[
'
start
'
]
&&
this
.
state
.
cycle
[
'
stop
'
]){
var
isSameOrAfter
=
moment
(
this
.
state
.
cycle
[
'
stop
'
]).
isSameOrAfter
(
this
.
state
.
cycle
[
'
start
'
]);
var
isSameOrAfter
=
moment
(
this
.
state
.
cycle
[
'
stop
'
]).
isSameOrAfter
(
this
.
state
.
cycle
[
'
start
'
]);
if
(
!
isSameOrAfter
){
if
(
!
isSameOrAfter
){
errors
[
'
stop
'
]
=
` Stop date
should be after
Start date`
;
errors
[
'
stop
'
]
=
` Stop date
can not be before
Start date`
;
validForm
=
false
;
validForm
=
false
;
}
else
{
}
else
{
validForm
=
true
;
validForm
=
true
;
...
@@ -241,6 +242,7 @@ export class CycleCreate extends Component {
...
@@ -241,6 +242,7 @@ export class CycleCreate extends Component {
let
cycleQuota
=
[];
let
cycleQuota
=
[];
let
cycle
=
this
.
state
.
cycle
;
let
cycle
=
this
.
state
.
cycle
;
let
stoptime
=
_
.
replace
(
this
.
state
.
cycle
[
'
stop
'
],
'
00:00:00
'
,
'
23:59:59
'
);
let
stoptime
=
_
.
replace
(
this
.
state
.
cycle
[
'
stop
'
],
'
00:00:00
'
,
'
23:59:59
'
);
cycle
[
'
start
'
]
=
moment
(
cycle
[
'
start
'
]).
format
(
"
YYYY-MM-DDTHH:mm:ss
"
);
cycle
[
'
stop
'
]
=
moment
(
stoptime
).
format
(
"
YYYY-MM-DDTHH:mm:ss
"
);
cycle
[
'
stop
'
]
=
moment
(
stoptime
).
format
(
"
YYYY-MM-DDTHH:mm:ss
"
);
this
.
setState
({
cycle
:
cycle
});
this
.
setState
({
cycle
:
cycle
});
for
(
const
resource
in
this
.
state
.
cycleQuota
)
{
for
(
const
resource
in
this
.
state
.
cycleQuota
)
{
...
@@ -296,7 +298,6 @@ export class CycleCreate extends Component {
...
@@ -296,7 +298,6 @@ export class CycleCreate extends Component {
this
.
setState
({
this
.
setState
({
dialog
:
{
header
:
''
,
detail
:
''
},
dialog
:
{
header
:
''
,
detail
:
''
},
cycle
:
{
cycle
:
{
url
:
''
,
name
:
''
,
name
:
''
,
description
:
''
,
description
:
''
,
start
:
''
,
start
:
''
,
...
@@ -379,13 +380,14 @@ export class CycleCreate extends Component {
...
@@ -379,13 +380,14 @@ export class CycleCreate extends Component {
d
dateFormat
=
"
dd-M-yy
"
d
dateFormat
=
"
dd-M-yy
"
value
=
{
this
.
state
.
cycle
.
start
}
value
=
{
this
.
state
.
cycle
.
start
}
onChange
=
{
e
=>
this
.
setCycleParams
(
'
start
'
,
e
.
value
)}
onChange
=
{
e
=>
this
.
setCycleParams
(
'
start
'
,
e
.
value
)}
onBlur
=
{
e
=>
this
.
setCycleParams
(
'
start
'
,
e
.
value
)}
data
-
testid
=
"
start
"
data
-
testid
=
"
start
"
tooltip
=
"
Moment at which the cycle starts, that is, when its projects can run.
"
tooltipOptions
=
{
this
.
tooltipOptions
}
tooltip
=
"
Moment at which the cycle starts, that is, when its projects can run.
"
tooltipOptions
=
{
this
.
tooltipOptions
}
showIcon
=
{
true
}
showIcon
=
{
true
}
/
>
/
>
<
label
className
=
{
this
.
state
.
errors
.
start
?
"
error
"
:
"
info
"
}
>
<
label
className
=
{
this
.
state
.
errors
.
start
?
"
error
"
:
"
info
"
}
>
{
this
.
state
.
errors
.
start
?
this
.
state
.
errors
.
start
:
"
Start Date is mandatory
"
}
{
this
.
state
.
errors
.
start
?
this
.
state
.
errors
.
start
:
""
}
<
/label
>
<
/label
>
<
/div
>
<
/div
>
<
div
className
=
"
col-lg-1 col-md-1 col-sm-12
"
><
/div
>
<
div
className
=
"
col-lg-1 col-md-1 col-sm-12
"
><
/div
>
...
@@ -395,13 +397,14 @@ export class CycleCreate extends Component {
...
@@ -395,13 +397,14 @@ export class CycleCreate extends Component {
d
dateFormat
=
"
dd-M-yy
"
d
dateFormat
=
"
dd-M-yy
"
value
=
{
this
.
state
.
cycle
.
stop
}
value
=
{
this
.
state
.
cycle
.
stop
}
onChange
=
{
e
=>
this
.
setCycleParams
(
'
stop
'
,
e
.
value
)}
onChange
=
{
e
=>
this
.
setCycleParams
(
'
stop
'
,
e
.
value
)}
onBlur
=
{
e
=>
this
.
setCycleParams
(
'
stop
'
,
e
.
value
)}
data
-
testid
=
"
stop
"
data
-
testid
=
"
stop
"
tooltip
=
"
Moment at which the cycle officially ends.
"
tooltipOptions
=
{
this
.
tooltipOptions
}
tooltip
=
"
Moment at which the cycle officially ends.
"
tooltipOptions
=
{
this
.
tooltipOptions
}
showIcon
=
{
true
}
showIcon
=
{
true
}
/
>
/
>
<
label
className
=
{
this
.
state
.
errors
.
stop
?
"
error
"
:
"
info
"
}
>
<
label
className
=
{
this
.
state
.
errors
.
stop
?
"
error
"
:
"
info
"
}
>
{
this
.
state
.
errors
.
stop
?
this
.
state
.
errors
.
stop
:
"
Stop Date is mandatory
"
}
{
this
.
state
.
errors
.
stop
?
this
.
state
.
errors
.
stop
:
""
}
<
/label
>
<
/label
>
<
/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