Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
EUbOPEN Web
Manage
Activity
Members
Labels
Plan
Issues
15
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Deploy
Releases
Package Registry
Container Registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Issue analytics
Insights
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
ChEMBL
EUbOPEN
EUbOPEN Web
Commits
b9d66983
Commit
b9d66983
authored
3 years ago
by
David Mendez
Browse files
Options
Downloads
Patches
Plain Diff
Add missing file!!!
parent
2c649cb9
No related branches found
Branches containing commit
No related tags found
1 merge request
!8
Improve layout of report cards and search bar
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
store/probe/calculatedProperties.js
+72
-0
72 additions, 0 deletions
store/probe/calculatedProperties.js
with
72 additions
and
0 deletions
store/probe/calculatedProperties.js
0 → 100644
+
72
−
0
View file @
b9d66983
import
RequestNotifications
from
'
@/web-components-submodule/utils/RequestNotifications.js
'
import
EntityNames
from
'
~/web-components-submodule/standardisation/EntityNames.js
'
import
IndexNames
from
'
~/web-components-submodule/standardisation/IndexNames.js
'
import
ESProxyService
from
'
~/web-components-submodule/services/ESProxyService.js
'
import
ObjectPropertyAccess
from
'
~/web-components-submodule/utils/ObjectPropertyAccess.js
'
export
const
state
=
()
=>
({
calculatedProperties
:
[],
dataLoaded
:
false
,
})
export
const
mutations
=
{
SET_DATA_LOADED
(
state
,
dataLoaded
)
{
state
.
dataLoaded
=
dataLoaded
},
SET_CALCULATED_PROPERTIES
(
state
,
calculatedProperties
)
{
state
.
calculatedProperties
=
calculatedProperties
},
}
export
const
actions
=
{
loadData
({
commit
,
state
,
dispatch
},
itemID
)
{
const
entityID
=
EntityNames
.
EubopenCompound
.
entityID
const
indexName
=
IndexNames
.
getIndexNameFromEntityID
(
entityID
)
const
groupName
=
'
calculated_properties
'
ESProxyService
.
getPopertyGroupConfiguration
(
indexName
,
groupName
)
.
then
((
response
)
=>
{
const
propertiesConfig
=
response
.
data
.
properties
.
default
const
propertiesToFetch
=
propertiesConfig
.
map
((
propConfig
)
=>
{
return
{
label
:
propConfig
.
label
,
prop_id
:
propConfig
.
prop_id
,
}
})
const
docSource
=
propertiesToFetch
.
map
(
(
propConfig
)
=>
propConfig
.
prop_id
)
ESProxyService
.
getESDocument
(
indexName
,
itemID
,
docSource
)
.
then
((
response
)
=>
{
const
sourceObtained
=
response
.
data
.
_source
const
calculatedProperties
=
propertiesToFetch
.
map
((
propConfig
)
=>
{
return
{
label
:
propConfig
.
label
,
value
:
ObjectPropertyAccess
.
getPropertyPalue
(
sourceObtained
,
propConfig
.
prop_id
,
'
--
'
),
}
})
commit
(
'
SET_CALCULATED_PROPERTIES
'
,
calculatedProperties
)
commit
(
'
SET_DATA_LOADED
'
,
true
)
})
.
catch
((
error
)
=>
{
RequestNotifications
.
dispatchRequestErrorNotification
(
error
,
dispatch
,
`There was an error while loading the calculated properties!`
)
})
})
.
catch
((
error
)
=>
{
RequestNotifications
.
dispatchRequestErrorNotification
(
error
,
dispatch
,
`There was an error while fetching the list of properties for the calculated properties!`
)
})
},
}
This diff is collapsed.
Click to expand it.
Preview
0%
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