Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
piveau-ui
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
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
KIT
KI-Allianz
A Core Module Datenplattform
piveau-hub
piveau-ui
Commits
b30a0f36
Commit
b30a0f36
authored
2 years ago
by
Martin Koerwien
Browse files
Options
Downloads
Patches
Plain Diff
refactor: create SettingsFacet.vue
parent
5e1e6222
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/modules/datasets/datasetsFacets/DatasetsFacets.vue
+6
-56
6 additions, 56 deletions
src/modules/datasets/datasetsFacets/DatasetsFacets.vue
src/modules/datasets/datasetsFacets/SettingsFacet.vue
+67
-0
67 additions, 0 deletions
src/modules/datasets/datasetsFacets/SettingsFacet.vue
with
73 additions
and
56 deletions
src/modules/datasets/datasetsFacets/DatasetsFacets.vue
+
6
−
56
View file @
b30a0f36
...
...
@@ -11,30 +11,9 @@
:catalogLanguageIds=
"catalogLanguageIds"
/>
<!-- Facet settings -->
<div
class=
"row facet-field mb-3"
v-if=
"!showCatalogDetails"
>
<facet
:header=
"$t('message.datasetFacets.settings')"
:toolTipTitle=
"$t('message.helpIcon.settings')"
:items=
"[]"
class=
"col pr-0"
>
<template
#after
>
<div
class=
"form-group list-group-item list-group-item-action d-flex justify-content-between align-items-center"
>
{{
$t
(
'
message.datasetFacets.operator
'
)
}}
<span
class=
"ml-2 d-flex flex-wrap"
>
<div
class=
"custom-control custom-radio"
>
<input
type=
"radio"
id=
"radio-and"
name=
"radio-facet-operator"
class=
"custom-control-input"
@
click=
"changeFacetOperator(FACET_OPERATORS.and)"
:checked=
"getFacetOperator === FACET_OPERATORS.and"
>
<label
class=
"custom-control-label"
for=
"radio-and"
>
{{
$t
(
'
message.datasetFacets.and
'
)
}}
</label>
</div>
<div
class=
"custom-control custom-radio"
>
<input
type=
"radio"
class=
"custom-control-input"
id=
"radio-or"
name=
"radio-facet-operator"
@
click=
"changeFacetOperator(FACET_OPERATORS.or)"
:checked=
"getFacetOperator === FACET_OPERATORS.or"
>
<label
class=
"custom-control-label"
for=
"radio-or"
>
{{
$t
(
'
message.datasetFacets.or
'
).
toUpperCase
()
}}
</label>
</div>
</span>
</div>
</
template
>
</facet>
</div>
<settings-facet
v-if=
"!showCatalogDetails"
/>
<!-- Facets -->
<div
class=
"row facet-field mb-3"
v-for=
"(field, index) in getSortedFacets"
...
...
@@ -127,11 +106,13 @@ import DatasetsFacetsItem from './DatasetsFacetsItem.vue';
import
{
getTranslationFor
,
getFacetTranslation
}
from
'
../../utils/helpers
'
;
import
DatasetsFacetMap
from
"
@/modules/datasets/datasetsFacets/DatasetsFacetMap
"
;
import
CatalogDetailsFacet
from
"
@/modules/datasets/datasetsFacets/CatalogDetailsFacet
"
;
import
SettingsFacet
from
"
@/modules/datasets/datasetsFacets/SettingsFacet
"
;
export
default
{
name
:
'
datasetFacets
'
,
dependencies
:
[
'
catalogService
'
],
components
:
{
SettingsFacet
,
CatalogDetailsFacet
,
// Facet,
DatasetsFacetMap
,
...
...
@@ -189,9 +170,6 @@ export default {
datasetBoundsWatcher
()
{
return
this
.
getDatasetGeoBounds
;
},
facetOperatorWatcher
()
{
return
this
.
getFacetOperator
;
},
facetGroupOperatorWatcher
()
{
return
this
.
getFacetGroupOperator
;
},
...
...
@@ -254,7 +232,6 @@ export default {
'
toggleFacet
'
,
'
addFacet
'
,
'
removeFacet
'
,
'
setFacetOperator
'
,
'
setFacetGroupOperator
'
,
'
setDataServices
'
,
'
setPage
'
,
...
...
@@ -347,10 +324,6 @@ export default {
);
}
},
changeFacetOperator
(
op
)
{
this
.
setFacetOperator
(
op
);
this
.
setFacetGroupOperator
(
op
);
},
toggleFacetGroupOperator
()
{
let
op
=
this
.
getFacetGroupOperator
;
op
=
op
===
this
.
FACET_GROUP_OPERATORS
.
and
?
this
.
FACET_GROUP_OPERATORS
.
or
:
this
.
FACET_GROUP_OPERATORS
.
and
;
...
...
@@ -379,15 +352,6 @@ export default {
}
},
watch
:
{
facetOperatorWatcher
:
{
handler
(
facetOperator
)
{
this
.
$router
.
replace
(
{
query
:
Object
.
assign
({},
this
.
$route
.
query
,
{
facetOperator
})
}
).
catch
(
error
=>
{
console
.
log
(
error
);
}
);
},
},
facetGroupOperatorWatcher
:
{
handler
(
facetGroupOperator
)
{
this
.
$router
.
replace
(
...
...
@@ -397,20 +361,6 @@ export default {
);
},
},
// dataServicesWatcher: {
// handler(dataServices) {
// this.$router.replace(
// { query: Object.assign({}, this.$route.query, { dataServices }) }
// ).catch(
// error => { console.log(error); }
// );
// },
// },
// showCatalogDetailsWatcher: {
// handler(showCatalogDetails) {
// this.showCatalogDetails = showCatalogDetails;
// },
// },
getDataServices
(
dataServices
)
{
this
.
$router
.
replace
(
{
query
:
Object
.
assign
({},
this
.
$route
.
query
,
{
dataServices
})
}
...
...
@@ -435,7 +385,7 @@ export default {
};
</
script
>
<
style
lang=
"scss"
scoped
>
<
style
lang=
"scss"
>
.facet
:hover
{
cursor
:
pointer
;
...
...
This diff is collapsed.
Click to expand it.
src/modules/datasets/datasetsFacets/SettingsFacet.vue
0 → 100644
+
67
−
0
View file @
b30a0f36
<
template
>
<div
class=
"row facet-field mb-3"
>
<facet
:header=
"$t('message.datasetFacets.settings')"
:toolTipTitle=
"$t('message.helpIcon.settings')"
:items=
"[]"
class=
"col pr-0"
>
<template
#after
>
<div
class=
"form-group list-group-item list-group-item-action d-flex justify-content-between align-items-center"
>
{{
$t
(
'
message.datasetFacets.operator
'
)
}}
<span
class=
"ml-2 d-flex flex-wrap"
>
<div
class=
"custom-control custom-radio"
>
<input
type=
"radio"
id=
"radio-and"
name=
"radio-facet-operator"
class=
"custom-control-input"
@
click=
"changeFacetOperator(FACET_OPERATORS.and)"
:checked=
"getFacetOperator === FACET_OPERATORS.and"
>
<label
class=
"custom-control-label"
for=
"radio-and"
>
{{
$t
(
'
message.datasetFacets.and
'
)
}}
</label>
</div>
<div
class=
"custom-control custom-radio"
>
<input
type=
"radio"
class=
"custom-control-input"
id=
"radio-or"
name=
"radio-facet-operator"
@
click=
"changeFacetOperator(FACET_OPERATORS.or)"
:checked=
"getFacetOperator === FACET_OPERATORS.or"
>
<label
class=
"custom-control-label"
for=
"radio-or"
>
{{
$t
(
'
message.datasetFacets.or
'
).
toUpperCase
()
}}
</label>
</div>
</span>
</div>
</
template
>
</facet>
</div>
</template>
<
script
>
import
{
mapActions
,
mapGetters
}
from
"
vuex
"
;
export
default
{
name
:
"
SettingsFacet
"
,
data
()
{
return
{
FACET_OPERATORS
:
this
.
$env
.
datasets
.
facets
.
FACET_OPERATORS
};
},
computed
:
{
...
mapGetters
(
'
datasets
'
,
[
'
getFacetOperator
'
]),
},
methods
:
{
...
mapActions
(
'
datasets
'
,
[
'
setFacetOperator
'
,
'
setFacetGroupOperator
'
]),
changeFacetOperator
(
op
)
{
this
.
setFacetOperator
(
op
);
this
.
setFacetGroupOperator
(
op
);
}
},
watch
:
{
getFacetOperator
(
facetOperator
)
{
this
.
$router
.
replace
(
{
query
:
Object
.
assign
({},
this
.
$route
.
query
,
{
facetOperator
})
}
).
catch
(
error
=>
{
console
.
log
(
error
);
}
);
}
}
}
</
script
>
<
style
scoped
>
</
style
>
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