Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
C
caosdb-webui
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
caosdb
Software
caosdb-webui
Commits
f6de7219
Commit
f6de7219
authored
3 years ago
by
florian
Browse files
Options
Downloads
Patches
Plain Diff
DRAFT: Remove person reference from ext_references
parent
ed7475be
No related branches found
No related tags found
2 merge requests
!47
Release v0.4.0
,
!41
Document reference resolver and move person resolving to separate example
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/core/js/ext_references.js
+2
-19
2 additions, 19 deletions
src/core/js/ext_references.js
with
2 additions
and
19 deletions
src/core/js/ext_references.js
+
2
−
19
View file @
f6de7219
...
...
@@ -273,22 +273,6 @@ var resolve_references = new function () {
}
/**
* Return the name of a person as firstname + lastname
*/
this
.
get_person_str
=
function
(
el
)
{
var
valpr
=
getProperties
(
el
);
if
(
valpr
==
undefined
)
{
return
;
}
return
valpr
.
filter
(
valprel
=>
valprel
.
name
.
toLowerCase
()
==
"
firstname
"
)[
0
].
value
+
"
"
+
valpr
.
filter
(
valprel
=>
valprel
.
name
.
toLowerCase
()
==
"
lastname
"
)[
0
].
value
;
}
/**
* Return true iff the entity has at least one direct parent named `par`.
*
...
...
@@ -327,7 +311,8 @@ var resolve_references = new function () {
* resolved as a string and returns a `reference_info` object with
* the resolved custom reference as a `text` property.
*
* See caosdb-webui/src/ext/js/person_resolver for an example.
* See caosdb-webui/src/ext/js/person_reference_resolver.js for an
* example.
*
* TODO refactor to be configurable. @async @param {string} id - the id of
* the entity which is to be resolved. @return {reference_info}
...
...
@@ -356,8 +341,6 @@ var resolve_references = new function () {
var
pths
=
getEntityHeadingAttribute
(
entity
,
"
path
"
)
.
split
(
"
/
"
);
ret
[
"
text
"
]
=
pths
[
pths
.
length
-
1
];
}
else
if
(
par
.
name
===
"
Person
"
)
{
ret
[
"
text
"
]
=
this
.
get_person_str
(
entity
);
}
else
if
(
par
.
name
===
"
TestReferenced
"
&&
typeof
resolve_references
.
test_resolver
===
"
function
"
)
{
// this is a test case, initialized by the test suite.
ret
=
resolve_references
.
test_resolver
(
entity
);
...
...
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