Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
frontend
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
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
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Helmholtz Centre for Environmental Research – UFZ
IT
RDM
BioMe
tmd
frontend
Commits
97af7806
Commit
97af7806
authored
3 years ago
by
Lars Kollmann
Browse files
Options
Downloads
Patches
Plain Diff
#370
add nullchecks to prevent errors when entity is null
parent
a5e4a3c8
No related branches found
No related tags found
2 merge requests
!377
merge develop in to master
,
!348
Resolve "Umzug der gen.Filter"
Pipeline
#421467
passed
3 years ago
Stage: build
Stage: test
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
app/src/components/shared/sharedFilter/SharedTable.ts
+29
-19
29 additions, 19 deletions
app/src/components/shared/sharedFilter/SharedTable.ts
with
29 additions
and
19 deletions
app/src/components/shared/sharedFilter/SharedTable.ts
+
29
−
19
View file @
97af7806
...
...
@@ -221,23 +221,29 @@ export default class SharedTable extends Vue {
let
imageRefsUrl
:
Array
<
{}
>
=
[];
const
sectionInfo
:
Array
<
{}
>
=
[];
for
(
const
userEdge
of
item
.
users
.
collection
)
{
observers
.
push
(
userEdge
.
username
);
if
(
item
.
users
)
{
for
(
const
userEdge
of
item
.
users
.
collection
)
{
observers
.
push
(
userEdge
.
username
);
}
observers
.
join
(
"
,
"
);
}
observers
.
join
(
"
,
"
);
item
.
sectionEvents
.
collection
.
forEach
((
event
)
=>
{
imageRefsUrl
=
[];
if
(
event
.
imageRefs
.
collection
.
length
)
{
event
.
imageRefs
.
collection
.
forEach
((
imageRef
)
=>
{
imageRef
.
thumbnailRefs
.
collection
.
filter
((
thumbnailRef
)
=>
{
if
(
thumbnailRef
.
url
.
includes
(
"
medium
"
))
{
imageRefsUrl
.
push
({
imageRefUrl
:
imageRef
.
url
,
thumbnailRefUrl
:
thumbnailRef
.
url
});
}
if
(
item
.
sectionEvents
)
{
item
.
sectionEvents
.
collection
.
forEach
((
event
)
=>
{
imageRefsUrl
=
[];
if
(
event
.
imageRefs
.
collection
.
length
)
{
event
.
imageRefs
.
collection
.
forEach
((
imageRef
)
=>
{
imageRef
.
thumbnailRefs
.
collection
.
filter
((
thumbnailRef
)
=>
{
if
(
thumbnailRef
.
url
.
includes
(
"
medium
"
))
{
imageRefsUrl
.
push
({
imageRefUrl
:
imageRef
.
url
,
thumbnailRefUrl
:
thumbnailRef
.
url
});
}
});
});
});
sectionInfo
.
push
({
sectionComment
:
event
.
comment
,
sectionName
:
event
.
section
.
name
,
sectionLabel
:
event
.
section
.
label
,
imageUrl
:
imageRefsUrl
});
}
});
sectionInfo
.
push
({
sectionComment
:
event
.
comment
,
sectionName
:
event
.
section
.
name
,
sectionLabel
:
event
.
section
.
label
,
imageUrl
:
imageRefsUrl
});
}
});
}
const
newItem
=
{
id
:
item
.
id
.
replace
(
/^
\D
+/g
,
""
),
inspectionId
:
item
.
id
.
replace
(
/^
\D
+/g
,
""
),
...
...
@@ -301,7 +307,7 @@ export default class SharedTable extends Vue {
for
(
const
item
of
this
.
data
.
data
.
observations
.
collection
)
{
const
developmentalStageId
=
item
.
developmentalStage
.
id
.
replace
(
/^
\D
+/g
,
""
);
const
imageRefsUrl
:
Array
<
{}
>
=
[];
if
(
item
.
imageRefs
.
collection
.
length
)
{
if
(
this
.
hasImageRefs
(
item
)
)
{
item
.
imageRefs
.
collection
.
forEach
((
image
)
=>
{
image
.
thumbnailRefs
.
collection
.
filter
((
thumbnailRef
)
=>
{
if
(
thumbnailRef
.
url
.
includes
(
"
medium
"
))
{
...
...
@@ -522,15 +528,19 @@ export default class SharedTable extends Vue {
}
}
private
isValidInspectionData
(
data
:
AxiosResponse
)
{
private
isValidInspectionData
(
data
:
AxiosResponse
)
:
boolean
{
return
data
&&
data
.
data
&&
data
.
data
.
inspections
&&
data
.
data
.
inspections
.
collection
;
}
private
isValidApplyFiltersData
(
data
:
AxiosResponse
)
{
private
isValidApplyFiltersData
(
data
:
AxiosResponse
)
:
boolean
{
return
data
&&
data
.
data
&&
data
.
data
.
applyFilters
&&
data
.
data
.
applyFilters
.
collection
;
}
private
isValidObservationsData
(
data
:
AxiosResponse
)
{
private
isValidObservationsData
(
data
:
AxiosResponse
)
:
boolean
{
return
data
&&
data
.
data
&&
data
.
data
.
observations
&&
data
.
data
.
observations
.
collection
;
}
private
hasImageRefs
(
item
:
any
):
boolean
{
return
item
.
imageRefs
&&
item
.
imageRefs
.
collection
&&
item
.
imageRefs
.
collection
.
length
;
}
}
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