Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
DBRepo
Manage
Activity
Members
Labels
Plan
External wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
FAIR Data Austria DB Repository
DBRepo
Commits
90c8101b
Unverified
Commit
90c8101b
authored
Nov 25, 2023
by
Martin Weise
Browse files
Options
Downloads
Patches
Plain Diff
Updated result set for units and concepts
parent
031c4379
No related branches found
No related tags found
4 merge requests
!231
CI: Remove build for log-service
,
!228
Better error message handling in the frontend
,
!223
Release of version 1.4.0
,
!215
Resolve "Fix the unit independent search"
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
dbrepo-ui/api/index.js
+10
-0
10 additions, 0 deletions
dbrepo-ui/api/index.js
dbrepo-ui/api/semantic.service.js
+11
-32
11 additions, 32 deletions
dbrepo-ui/api/semantic.service.js
dbrepo-ui/pages/search/index.vue
+20
-6
20 additions, 6 deletions
dbrepo-ui/pages/search/index.vue
with
41 additions
and
38 deletions
dbrepo-ui/api/index.js
+
10
−
0
View file @
90c8101b
import
axios
from
'
axios
'
import
axios
from
'
axios
'
import
Vue
from
'
vue
'
const
baseUrl
=
`
${
location
.
protocol
}
//
${
location
.
host
}
`
const
baseUrl
=
`
${
location
.
protocol
}
//
${
location
.
host
}
`
...
@@ -10,4 +11,13 @@ const instance = axios.create({
...
@@ -10,4 +11,13 @@ const instance = axios.create({
baseURL
:
baseUrl
baseURL
:
baseUrl
})
})
function
displayError
(
error
,
warning
)
{
const
{
code
,
message
}
=
error
.
response
.
data
console
.
error
(
warning
,
error
)
Vue
.
$toast
.
error
(
`[
${
code
}
]
${
warning
}
:
${
message
}
`
)
}
export
default
instance
export
default
instance
export
{
displayError
}
This diff is collapsed.
Click to expand it.
dbrepo-ui/api/semantic.service.js
+
11
−
32
View file @
90c8101b
import
Vue
from
'
vue
'
import
api
,
{
displayError
}
from
'
@/api
'
import
api
from
'
@/api
'
class
SemanticService
{
class
SemanticService
{
findAllOntologies
()
{
findAllOntologies
()
{
...
@@ -11,9 +10,7 @@ class SemanticService {
...
@@ -11,9 +10,7 @@ class SemanticService {
resolve
(
ontologies
)
resolve
(
ontologies
)
})
})
.
catch
((
error
)
=>
{
.
catch
((
error
)
=>
{
const
{
code
,
message
}
=
error
.
response
.
data
displayError
(
error
,
'
Failed to load ontologies
'
)
console
.
error
(
'
Failed to load ontologies
'
,
error
)
Vue
.
$toast
.
error
(
`[
${
code
}
] Failed to load ontologies:
${
message
}
`
)
reject
(
error
)
reject
(
error
)
})
})
})
})
...
@@ -28,9 +25,7 @@ class SemanticService {
...
@@ -28,9 +25,7 @@ class SemanticService {
resolve
(
concepts
)
resolve
(
concepts
)
})
})
.
catch
((
error
)
=>
{
.
catch
((
error
)
=>
{
const
{
code
,
message
}
=
error
.
response
.
data
displayError
(
error
,
'
Failed to load concepts
'
)
console
.
error
(
'
Failed to load concepts
'
,
error
)
Vue
.
$toast
.
error
(
`[
${
code
}
] Failed to load concepts:
${
message
}
`
)
reject
(
error
)
reject
(
error
)
})
})
})
})
...
@@ -45,9 +40,7 @@ class SemanticService {
...
@@ -45,9 +40,7 @@ class SemanticService {
resolve
(
concept
)
resolve
(
concept
)
})
})
.
catch
((
error
)
=>
{
.
catch
((
error
)
=>
{
const
{
code
,
message
}
=
error
.
response
.
data
displayError
(
error
,
'
Failed to update concept
'
)
console
.
error
(
'
Failed to update concept
'
,
error
)
Vue
.
$toast
.
error
(
`[
${
code
}
] Failed to update concept:
${
message
}
`
)
reject
(
error
)
reject
(
error
)
})
})
})
})
...
@@ -62,9 +55,7 @@ class SemanticService {
...
@@ -62,9 +55,7 @@ class SemanticService {
resolve
(
units
)
resolve
(
units
)
})
})
.
catch
((
error
)
=>
{
.
catch
((
error
)
=>
{
const
{
code
,
message
}
=
error
.
response
.
data
displayError
(
error
,
'
Failed to load units
'
)
console
.
error
(
'
Failed to load units
'
,
error
)
Vue
.
$toast
.
error
(
`[
${
code
}
] Failed to load units:
${
message
}
`
)
reject
(
error
)
reject
(
error
)
})
})
})
})
...
@@ -79,9 +70,7 @@ class SemanticService {
...
@@ -79,9 +70,7 @@ class SemanticService {
resolve
(
unit
)
resolve
(
unit
)
})
})
.
catch
((
error
)
=>
{
.
catch
((
error
)
=>
{
const
{
code
,
message
}
=
error
.
response
.
data
displayError
(
error
,
'
Failed to update unit
'
)
console
.
error
(
'
Failed to update unit
'
,
error
)
Vue
.
$toast
.
error
(
`[
${
code
}
] Failed to update unit:
${
message
}
`
)
reject
(
error
)
reject
(
error
)
})
})
})
})
...
@@ -96,9 +85,7 @@ class SemanticService {
...
@@ -96,9 +85,7 @@ class SemanticService {
resolve
(
ontology
)
resolve
(
ontology
)
})
})
.
catch
((
error
)
=>
{
.
catch
((
error
)
=>
{
const
{
code
,
message
}
=
error
.
response
.
data
displayError
(
error
,
'
Failed to find ontology
'
)
console
.
error
(
'
Failed to load ontology
'
,
error
)
Vue
.
$toast
.
error
(
`[
${
code
}
] Failed to load ontology:
${
message
}
`
)
reject
(
error
)
reject
(
error
)
})
})
})
})
...
@@ -113,9 +100,7 @@ class SemanticService {
...
@@ -113,9 +100,7 @@ class SemanticService {
resolve
(
ontology
)
resolve
(
ontology
)
})
})
.
catch
((
error
)
=>
{
.
catch
((
error
)
=>
{
const
{
code
,
message
}
=
error
.
response
.
data
displayError
(
error
,
'
Failed to register ontology
'
)
console
.
error
(
'
Failed to register ontology
'
,
error
)
Vue
.
$toast
.
error
(
`[
${
code
}
] Failed to register ontology:
${
message
}
`
)
reject
(
error
)
reject
(
error
)
})
})
})
})
...
@@ -130,9 +115,7 @@ class SemanticService {
...
@@ -130,9 +115,7 @@ class SemanticService {
resolve
(
ontology
)
resolve
(
ontology
)
})
})
.
catch
((
error
)
=>
{
.
catch
((
error
)
=>
{
const
{
code
,
message
}
=
error
.
response
.
data
displayError
(
error
,
'
Failed to update ontology
'
)
console
.
error
(
'
Failed to update ontology
'
,
error
)
Vue
.
$toast
.
error
(
`[
${
code
}
] Failed to update ontology:
${
message
}
`
)
reject
(
error
)
reject
(
error
)
})
})
})
})
...
@@ -143,9 +126,7 @@ class SemanticService {
...
@@ -143,9 +126,7 @@ class SemanticService {
api
.
delete
(
`/api/semantic/ontology/
${
id
}
`
,
{
headers
:
{
Accept
:
'
application/json
'
}
})
api
.
delete
(
`/api/semantic/ontology/
${
id
}
`
,
{
headers
:
{
Accept
:
'
application/json
'
}
})
.
then
(()
=>
resolve
())
.
then
(()
=>
resolve
())
.
catch
((
error
)
=>
{
.
catch
((
error
)
=>
{
const
{
code
,
message
}
=
error
.
response
.
data
displayError
(
error
,
'
Failed to unregister ontology
'
)
console
.
error
(
'
Failed to delete ontology
'
,
error
)
Vue
.
$toast
.
error
(
`[
${
code
}
] Failed to delete ontology:
${
message
}
`
)
reject
(
error
)
reject
(
error
)
})
})
})
})
...
@@ -160,9 +141,7 @@ class SemanticService {
...
@@ -160,9 +141,7 @@ class SemanticService {
resolve
(
semantics
)
resolve
(
semantics
)
})
})
.
catch
((
error
)
=>
{
.
catch
((
error
)
=>
{
const
{
code
,
message
}
=
error
.
response
.
data
displayError
(
error
,
'
Failed to suggest table column semantic
'
)
console
.
error
(
'
Failed to load table column semantics
'
,
error
)
Vue
.
$toast
.
error
(
`[
${
code
}
] Failed to load table column semantics:
${
message
}
`
)
reject
(
error
)
reject
(
error
)
})
})
})
})
...
...
This diff is collapsed.
Click to expand it.
dbrepo-ui/pages/search/index.vue
+
20
−
6
View file @
90c8101b
...
@@ -137,6 +137,24 @@ export default {
...
@@ -137,6 +137,24 @@ export default {
}
}
return
item
.
exchangeName
!==
undefined
return
item
.
exchangeName
!==
undefined
},
},
isConcept
(
item
)
{
if
(
!
item
)
{
return
false
}
if
(
'
_class
'
in
item
)
{
return
/at.tuwien.api.database.table.columns.concepts.ConceptDto/
.
test
(
item
.
_class
)
}
return
false
},
isUnit
(
item
)
{
if
(
!
item
)
{
return
false
}
if
(
'
_class
'
in
item
)
{
return
/at.tuwien.api.database.table.columns.concepts.UnitDto/
.
test
(
item
.
_class
)
}
return
false
},
isTable
(
item
)
{
isTable
(
item
)
{
if
(
!
item
)
{
if
(
!
item
)
{
return
false
return
false
...
@@ -188,7 +206,7 @@ export default {
...
@@ -188,7 +206,7 @@ export default {
return
false
return
false
},
},
title
(
item
)
{
title
(
item
)
{
if
(
this
.
isDatabase
(
item
)
||
this
.
isTable
(
item
)
||
this
.
isColumn
(
item
)
||
this
.
isView
(
item
))
{
if
(
this
.
isDatabase
(
item
)
||
this
.
isTable
(
item
)
||
this
.
isColumn
(
item
)
||
this
.
isView
(
item
)
||
this
.
isConcept
(
item
)
||
this
.
isUnit
(
item
)
)
{
return
item
.
name
return
item
.
name
}
else
if
(
this
.
isIdentifier
(
item
))
{
}
else
if
(
this
.
isIdentifier
(
item
))
{
return
item
.
title
return
item
.
title
...
@@ -196,16 +214,12 @@ export default {
...
@@ -196,16 +214,12 @@ export default {
return
null
return
null
},
},
description
(
item
)
{
description
(
item
)
{
if
(
this
.
isDatabase
(
item
))
{
if
(
this
.
isDatabase
(
item
)
||
this
.
isTable
(
item
)
||
this
.
isIdentifier
(
item
)
||
this
.
isConcept
(
item
)
||
this
.
isUnit
(
item
))
{
return
item
.
description
}
else
if
(
this
.
isTable
(
item
))
{
return
item
.
description
return
item
.
description
}
else
if
(
this
.
isColumn
(
item
))
{
}
else
if
(
this
.
isColumn
(
item
))
{
return
null
return
null
}
else
if
(
this
.
isView
(
item
))
{
}
else
if
(
this
.
isView
(
item
))
{
return
item
.
query
return
item
.
query
}
else
if
(
this
.
isIdentifier
(
item
))
{
return
item
.
description
}
}
return
false
return
false
},
},
...
...
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
sign in
to comment