Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dn 38 #76

Merged
merged 9 commits into from
Sep 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
{
"extends": "eslint-config-ct-prodeng",
"rules": {
"vuejs-accessibility/label-has-for": "off"
},
"plugins": [
"vue"
]
Expand Down
463 changes: 240 additions & 223 deletions src/main/js/bundles/dn_querybuilder/FieldWidget.vue

Large diffs are not rendered by default.

134 changes: 74 additions & 60 deletions src/main/js/bundles/dn_querybuilder/QueryBuilderWidget.vue
Original file line number Diff line number Diff line change
Expand Up @@ -32,18 +32,19 @@
>
<v-flex xs3>
<v-subheader class="pl-2">
{{ i18n.selectStore }}
<!-- This label is correctly defined but the rule triggers a false positive -->
<!--eslint-disable-next-line vuejs-accessibility/label-has-for -->
<label for="selectedStoreIdSelect">{{ i18n.selectStore }}</label>
</v-subheader>
</v-flex>
<v-flex xs9>
<v-select
v-if="storeData.length > 1"
id="selectedStoreIdSelect"
ref="selectedStoreIdSelect"
v-model="selectedStoreId"
:items="storeData"
:loading="loading"
:aria-label="i18n.aria.selectLayer"
label="i18n.selectStore"
item-value="id"
class="pa-0"
single-line
Expand Down Expand Up @@ -111,27 +112,32 @@
</v-btn>
</div>
<div v-else>
<v-radio-group
v-model="spatialRelation"
class="mt-2"
row
hide-details
>
<v-radio
:label="i18n.everywhere"
:disabled="disableSpatialRelationRadio"
hide-details
value="everywhere"
color="primary"
/>
<v-radio
:label="i18n.currentExtent"
:disabled="disableSpatialRelationRadio"
<fieldset>
<legend class="visually-hidden">
{{ i18n.spatialRelation }}
</legend>
<v-radio-group
v-model="spatialRelation"
class="mt-2"
row
hide-details
value="current_extent"
color="primary"
/>
</v-radio-group>
>
<v-radio
:label="i18n.everywhere"
:disabled="disableSpatialRelationRadio"
hide-details
value="everywhere"
color="primary"
/>
<v-radio
:label="i18n.currentExtent"
:disabled="disableSpatialRelationRadio"
hide-details
value="current_extent"
color="primary"
/>
</v-radio-group>
</fieldset>
</div>
</v-flex>
</v-layout>
Expand All @@ -148,27 +154,32 @@
</v-subheader>
</v-flex>
<v-flex xs9>
<v-radio-group
v-model="linkOperator"
class="mt-2"
row
hide-details
>
<v-radio
:label="i18n.and"
:disabled="disableLinkOperatorRadio"
hide-details
value="$and"
color="primary"
/>
<v-radio
:label="i18n.or"
:disabled="disableLinkOperatorRadio"
<fieldset>
<legend class="visually-hidden">
{{ i18n.linkOperator }}
</legend>
<v-radio-group
v-model="linkOperator"
class="mt-2"
row
hide-details
value="$or"
color="primary"
/>
</v-radio-group>
>
<v-radio
:label="i18n.and"
:disabled="disableLinkOperatorRadio"
hide-details
value="$and"
color="primary"
/>
<v-radio
:label="i18n.or"
:disabled="disableLinkOperatorRadio"
hide-details
value="$or"
color="primary"
/>
</v-radio-group>
</fieldset>
</v-flex>
</v-layout>
<v-layout
Expand Down Expand Up @@ -241,22 +252,23 @@
color="primary"
indeterminate
/>
<field-widget
v-for="(fieldQuery, index) in fieldQueries"
v-else
:ref="'fieldWidget_' + index"
:key="index"
:locale="locale"
:field-query="fieldQuery"
:index="index"
:active-tool="activeTool"
:enable-distinct-values="enableDistinctValues"
:show-field-infos="visibleElements.fieldInfos"
:i18n="i18n"
:operators="operators"
@remove="removeField"
@add="addField"
/>
<div v-else>
<field-widget
v-for="(fieldQuery, index) in fieldQueries"
:ref="'fieldWidget_' + index"
:key="index"
:locale="locale"
:field-query="fieldQuery"
:index="index"
:active-tool="activeTool"
:enable-distinct-values="enableDistinctValues"
:show-field-infos="visibleElements.fieldInfos"
:i18n="i18n"
:operators="operators"
@remove="removeField"
@add="addField"
/>
</div>
<v-btn
v-if="!editable && !processing"
:aria-label="i18n.aria.add"
Expand Down Expand Up @@ -369,6 +381,8 @@
and: "and",
or: "or",
enterValue: "enter value",
conditionFieldsetLegend: "Condition",
conditionFieldNameLabel: "Field name",
relationalOperators: {
is: "is",
exists: "exists",
Expand Down Expand Up @@ -431,7 +445,7 @@
ariaLabelAdded: false,
textToRead: "",
replaceOpenedTables: false,
operators: {default:{default:[]}}
operators: {default: {default: []}}
};
},
computed: {
Expand Down
10 changes: 10 additions & 0 deletions src/main/js/bundles/dn_querybuilder/css/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,13 @@
-webkit-box-orient: vertical;
overflow: hidden;
}

.visually-hidden:not(:focus):not(:active) {
clip: rect(0 0 0 0);
clip-path: inset(50%);
height: 1px;
overflow: hidden;
position: absolute;
white-space: nowrap;
width: 1px;
}
8 changes: 5 additions & 3 deletions src/main/js/bundles/dn_querybuilder/nls/bundle.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ export default {
filterTitle: "Filter",
setFilterActionLabel: "Filter map content",
resetFilterActionLabel: "Reset filter",
conditionFieldsetLegend: "Condition",
conditionFieldNameLabel: "Field name",
relationalOperators: {
is: "is",
is_not: "is not",
Expand Down Expand Up @@ -77,9 +79,9 @@ export default {
noResultsError: "No results found for your query!"
},
aria: {
add: "add new field query",
remove: "remove current field query",
negate: "negate current statement",
add: "add new condition",
remove: "remove current condition",
negate: "negate current condition",
selectLayer: "select layer",
sortingField: "select sort field name",
linkOperatorsEnabled: "Link operators are active.",
Expand Down
10 changes: 6 additions & 4 deletions src/main/js/bundles/dn_querybuilder/nls/de/bundle.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,15 @@ export default {
and: "Alle Bedingungen",
or: "Mindestens eine Bedingung",
enterValue: "Wert eingeben",
removeQuery: "Diesen Ausdruck entfernen",
removeQuery: "Diese Bedingung entfernen",
multipleSpatialInputs: "Mehrere Geometrien auswählen",
resetSpatialInput: "Räumliche Einschränkung entfernen",
negateSpatialInput: "Außerhalb der ausgewählten Geometrie suchen",
filterTitle: "Filter",
setFilterActionLabel: "Karteninhalt filtern",
resetFilterActionLabel: "Filter zurücksetzen",
conditionFieldsetLegend: "Bedingung",
conditionFieldNameLabel: "Feldname",
relationalOperators: {
is: "ist gleich",
is_not: "ist nicht gleich",
Expand Down Expand Up @@ -76,9 +78,9 @@ export default {
noResultsError: "Keine Ergebnisse für Ihre Abfrage gefunden!"
},
aria: {
add: "Neuen Ausdruck hinzufügen",
remove: "Aktuellen Ausdruck entfernen",
negate: "Aktuellen Ausdruck negieren",
add: "Neue Bedingung hinzufügen",
remove: "Aktuelle Bedingung entfernen",
negate: "Aktuelle Bedingung negieren",
selectLayer: "Layer auswählen",
sortingField: "Sortierfeldname auswählen",
linkOperatorsEnabled: "Verknüpfungsoperatoren sind aktiv.",
Expand Down
Loading