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
79e708da
Commit
79e708da
authored
5 years ago
by
Jörn Künsemöller
Browse files
Options
Downloads
Patches
Plain Diff
TMSS-146
: Working basic JSON-enabled TaskDraft CRUD page for UC1
parent
786e8634
No related branches found
No related tags found
1 merge request
!104
Resolve TMSS-146
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
SAS/TMSS/frontend/frontend_poc/src/UC1.js
+46
-10
46 additions, 10 deletions
SAS/TMSS/frontend/frontend_poc/src/UC1.js
with
46 additions
and
10 deletions
SAS/TMSS/frontend/frontend_poc/src/UC1.js
+
46
−
10
View file @
79e708da
...
@@ -383,7 +383,36 @@ class EditTaskDraft extends Component {
...
@@ -383,7 +383,36 @@ class EditTaskDraft extends Component {
name
:
"
my_name
"
,
name
:
"
my_name
"
,
tags
:
[
"
test
"
],
tags
:
[
"
test
"
],
description
:
'
my_description
'
,
description
:
'
my_description
'
,
specifications_doc
:
`{}`
,
specifications_doc
:
{
"
stations
"
:
[
{
"
group
"
:
"
ALL
"
,
"
min_stations
"
:
1
}
],
"
antenna_set
"
:
"
HBA_DUAL
"
,
"
filter
"
:
"
HBA_110_190
"
,
"
analog_pointing
"
:
{
"
direction_type
"
:
"
J2000
"
,
"
angle1
"
:
42
,
"
angle2
"
:
42
},
"
beams
"
:
[
{
"
name
"
:
"
calibrator
"
,
"
digital_pointing
"
:
{
"
direction_type
"
:
"
J2000
"
,
"
angle1
"
:
24
,
"
angle2
"
:
24
},
"
subbands
"
:
[
1
,
2
,
3
]
}
]
},
copies
:
null
,
copies
:
null
,
copy_reason
:
null
,
copy_reason
:
null
,
scheduling_unit_draft
:
api_url
+
"
scheduling_unit_draft/1/
"
,
scheduling_unit_draft
:
api_url
+
"
scheduling_unit_draft/1/
"
,
...
@@ -407,6 +436,7 @@ class EditTaskDraft extends Component {
...
@@ -407,6 +436,7 @@ class EditTaskDraft extends Component {
}
}
onChangeDescription
(
e
)
{
onChangeDescription
(
e
)
{
e
.
preventDefault
()
this
.
setState
({
this
.
setState
({
description
:
e
.
target
.
value
description
:
e
.
target
.
value
});
});
...
@@ -414,7 +444,7 @@ class EditTaskDraft extends Component {
...
@@ -414,7 +444,7 @@ class EditTaskDraft extends Component {
onChangeSpecificationsDoc
(
e
)
{
onChangeSpecificationsDoc
(
e
)
{
this
.
setState
({
this
.
setState
({
specifications_doc
:
e
.
target
.
value
specifications_doc
:
e
.
formData
});
});
}
}
...
@@ -443,6 +473,8 @@ class EditTaskDraft extends Component {
...
@@ -443,6 +473,8 @@ class EditTaskDraft extends Component {
}
}
onSubmit
(
e
)
{
onSubmit
(
e
)
{
console
.
log
(
'
onSubmit
'
);
console
.
log
(
e
);
e
.
preventDefault
();
e
.
preventDefault
();
const
data
=
{
const
data
=
{
name
:
this
.
state
.
name
,
name
:
this
.
state
.
name
,
...
@@ -465,8 +497,12 @@ class EditTaskDraft extends Component {
...
@@ -465,8 +497,12 @@ class EditTaskDraft extends Component {
}
}
}
}
onSpecSubmit
=
({
formData
})
=>
{
console
.
log
(
formData
);
updateSpec
(
formData
)
{
this
.
state
.
specifications_doc
=
formData
;}
console
.
log
(
'
updateSpec
'
);
console
.
log
(
formData
);
// do not use setState to prevent infinite loop
this
.
state
.
specifications_doc
=
formData
;
}
render
()
{
render
()
{
return
(
return
(
...
@@ -495,7 +531,7 @@ class EditTaskDraft extends Component {
...
@@ -495,7 +531,7 @@ class EditTaskDraft extends Component {
type
=
"
text
"
type
=
"
text
"
className
=
"
form-control
"
className
=
"
form-control
"
value
=
{
this
.
state
.
copies
}
value
=
{
this
.
state
.
copies
}
onChange
=
{
this
.
onChangeC
ycle
}
onChange
=
{
this
.
onChangeC
opies
}
/
>
/
>
<
/div
>
<
/div
>
<
div
className
=
"
form-group
"
>
<
div
className
=
"
form-group
"
>
...
@@ -504,7 +540,7 @@ class EditTaskDraft extends Component {
...
@@ -504,7 +540,7 @@ class EditTaskDraft extends Component {
type
=
"
text
"
type
=
"
text
"
className
=
"
form-control
"
className
=
"
form-control
"
value
=
{
this
.
state
.
copy_reason
}
value
=
{
this
.
state
.
copy_reason
}
onChange
=
{
this
.
onChangeC
ycle
}
onChange
=
{
this
.
onChangeC
opyReason
}
/
>
/
>
<
/div
>
<
/div
>
<
div
className
=
"
form-group
"
>
<
div
className
=
"
form-group
"
>
...
@@ -513,7 +549,7 @@ class EditTaskDraft extends Component {
...
@@ -513,7 +549,7 @@ class EditTaskDraft extends Component {
type
=
"
text
"
type
=
"
text
"
className
=
"
form-control
"
className
=
"
form-control
"
value
=
{
this
.
state
.
scheduling_unit_draft
}
value
=
{
this
.
state
.
scheduling_unit_draft
}
onChange
=
{
this
.
onChange
Cycle
}
onChange
=
{
this
.
onChange
SchedulingUnitDraft
}
/
>
/
>
<
/div
>
<
/div
>
<
div
className
=
"
form-group
"
>
<
div
className
=
"
form-group
"
>
...
@@ -522,17 +558,17 @@ class EditTaskDraft extends Component {
...
@@ -522,17 +558,17 @@ class EditTaskDraft extends Component {
type
=
"
text
"
type
=
"
text
"
className
=
"
form-control
"
className
=
"
form-control
"
value
=
{
this
.
state
.
specifications_template
}
value
=
{
this
.
state
.
specifications_template
}
onChange
=
{
this
.
onChange
Cycl
e
}
onChange
=
{
this
.
onChange
SpecificationsTemplat
e
}
/
>
/
>
<
/div
>
<
/div
>
<
div
className
=
"
form-group
"
>
<
div
className
=
"
form-group
"
>
<
label
>
SpecificationsDoc
:
<
/label
>
<
label
>
SpecificationsDoc
:
<
/label
>
<
Form
schema
=
{
schema
}
<
Form
schema
=
{
schema
}
className
=
"
form-control
"
additionalMetaSchemas
=
{[
additionalMetaSchemas
]}
additionalMetaSchemas
=
{[
additionalMetaSchemas
]}
liveValidate
=
{
true
}
liveValidate
=
{
true
}
show_opt_in
=
{
true
}
formData
=
{
this
.
state
.
specifications_doc
}
formData
=
{
this
.
state
.
specifications_doc
}
on
Submit
=
{
this
.
on
SpecSubmit
}
/
>
on
Change
=
{
this
.
on
ChangeSpecificationsDoc
}
/
>
<
/div
>
<
/div
>
<
br
/>
<
br
/>
...
...
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