Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Knowledge Space WP Plugin
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
alg
Knowledge Space WP Plugin
Commits
6c4b917c
Commit
6c4b917c
authored
2 years ago
by
Maximilian Giller
Browse files
Options
Downloads
Patches
Plain Diff
Added effect to trigger checkpoint on selection change
parent
a8985262
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Pipeline
#57135
passed
2 years ago
Stage: test
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/editor/components/nodedetails.tsx
+19
-17
19 additions, 17 deletions
src/editor/components/nodedetails.tsx
with
19 additions
and
17 deletions
src/editor/components/nodedetails.tsx
+
19
−
17
View file @
6c4b917c
import
React
,
{
useState
}
from
"
react
"
;
import
React
,
{
useEffect
,
useState
}
from
"
react
"
;
import
{
DescriptiveReference
,
Node
}
from
"
../../common/graph/node
"
;
import
{
NodeType
}
from
"
../../common/graph/nodetype
"
;
import
"
./nodedetails.css
"
;
...
...
@@ -23,10 +23,6 @@ function NodeDetails({
}:
NodeDetailsProps
)
{
const
[
changed
,
setChanged
]
=
useState
(
false
);
if
(
selectedNodes
.
length
==
0
)
{
return
<
div
id
=
"nodedetails"
>
No node selected.
</
div
>;
}
const
getCollectiveValue
=
function
<
ValueType
>
(
getter: (n: Node) => ValueType,
defaultValue: ValueType
...
...
@@ -38,18 +34,6 @@ function NodeDetails({
return
differentValueFound
?
defaultValue
:
referenceValue
;
}
;
const referenceData: NodeDataChangeRequest =
{
id
:
-
1
,
name
:
getCollectiveValue
((
n
)
=>
n
.
name
,
undefined
),
description
:
getCollectiveValue
((
n
)
=>
n
.
description
,
undefined
),
video
:
getCollectiveValue
((
n
)
=>
n
.
video
,
undefined
),
icon
:
getCollectiveValue
((
n
)
=>
n
.
icon
,
undefined
),
banner
:
getCollectiveValue
((
n
)
=>
n
.
banner
,
undefined
),
references
:
getCollectiveValue
((
n
)
=>
n
.
references
,
undefined
),
type
:
getCollectiveValue
((
n
)
=>
n
.
type
,
undefined
),
visibleAfter
:
getCollectiveValue
((
n
)
=>
n
.
visibleAfter
,
undefined
),
}
;
const handleDataChange = function
<
ValueType
>
(
key: keyof NodeDataChangeRequest,
value: ValueType
...
...
@@ -108,6 +92,24 @@ function NodeDetails({
setChanged
(
false
);
}
;
useEffect(handleBlur, [selectedNodes]);
if (selectedNodes.length == 0)
{
return
<
div
id
=
"nodedetails"
>
No node selected.
</
div
>;
}
const referenceData: NodeDataChangeRequest =
{
id
:
-
1
,
name
:
getCollectiveValue
((
n
)
=>
n
.
name
,
undefined
),
description
:
getCollectiveValue
((
n
)
=>
n
.
description
,
undefined
),
video
:
getCollectiveValue
((
n
)
=>
n
.
video
,
undefined
),
icon
:
getCollectiveValue
((
n
)
=>
n
.
icon
,
undefined
),
banner
:
getCollectiveValue
((
n
)
=>
n
.
banner
,
undefined
),
references
:
getCollectiveValue
((
n
)
=>
n
.
references
,
undefined
),
type
:
getCollectiveValue
((
n
)
=>
n
.
type
,
undefined
),
visibleAfter
:
getCollectiveValue
((
n
)
=>
n
.
visibleAfter
,
undefined
),
}
;
return (
<
div
id
=
"nodedetails"
onBlur
=
{
handleBlur
}
>
{
selectedNodes
.
length
===
1
?
(
...
...
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