Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
zesje
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
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
Réouven ASSOULY
zesje
Commits
8f183642
Commit
8f183642
authored
6 years ago
by
Justin van der Krieken
Browse files
Options
Downloads
Patches
Plain Diff
Let name change make use of existing logic
This implements actually saving name to the server
parent
06843512
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
client/components/PDFEditor.jsx
+29
-19
29 additions, 19 deletions
client/components/PDFEditor.jsx
with
29 additions
and
19 deletions
client/components/PDFEditor.jsx
+
29
−
19
View file @
8f183642
...
...
@@ -289,23 +289,6 @@ class PDFEditor extends React.Component {
}
}
handleWidgetNameChange
=
(
page
,
index
)
=>
{
return
(
e
)
=>
{
const
value
=
e
.
target
.
value
this
.
setState
((
prevState
,
props
)
=>
{
return
{
widgets
:
update
(
prevState
.
widgets
,
{
[
page
]:
{
[
index
]:
{
name
:
{
$set
:
value
},
}
}
})
}
})
}
}
getWidgetSafe
=
(
page
,
widget
)
=>
{
const
widgets
=
this
.
state
.
widgets
if
(
widgets
&&
page
!==
null
&&
widget
!==
null
...
...
@@ -399,14 +382,27 @@ class PDFEditor extends React.Component {
</
div
>
<
div
className
=
"panel-block"
>
<
div
className
=
"field"
>
<
label
className
=
"label"
>
Name
</
label
>
<
div
className
=
"control"
>
<
label
className
=
"label"
>
Name
</
label
>
</
div
>
<
div
className
=
"control"
>
<
input
className
=
"input"
type
=
"text"
placeholder
=
"Question name"
value
=
{
widget
.
name
||
''
}
onChange
=
{
this
.
handleWidgetNameChange
(
page
,
selectedWidget
)
}
onChange
=
{
(
e
)
=>
{
/*
* We're only updating with the button for now
* because onChange is too much spam and
* it is not guarranteed that the server
* receives requests in-order. This confuses
* ponyORM
*/
this
.
handleWidgetUpdate
(
page
,
selectedWidget
,
{
name
:
{
$set
:
e
.
target
.
value
},
},
false
)
}
}
/>
</
div
>
</
div
>
...
...
@@ -414,6 +410,10 @@ class PDFEditor extends React.Component {
<
div
className
=
"panel-block"
>
<
div
className
=
"field"
>
<
label
className
=
"label"
>
Actions
</
label
>
</
div
>
</
div
>
<
div
className
=
"panel-block"
>
<
div
className
=
"field has-addons"
>
<
div
className
=
"control"
>
<
button
className
=
"button is-danger"
...
...
@@ -422,6 +422,16 @@ class PDFEditor extends React.Component {
Delete
</
button
>
</
div
>
<
div
className
=
"control"
>
<
button
className
=
"button is-success"
onClick
=
{
(
e
)
=>
{
this
.
handleWidgetUpdate
(
page
,
selectedWidget
,
{})
}
}
>
Save name
</
button
>
</
div
>
</
div
>
</
div
>
</
nav
>
...
...
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