Skip to content

Commit 1f227ab

Browse files
committed
fix: consistent inconsistencies
1 parent 1af5702 commit 1f227ab

File tree

4 files changed

+49
-39
lines changed

4 files changed

+49
-39
lines changed

app/pages/translate/index.vue

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,17 +16,14 @@
1616
<UPageGrid>
1717
<UPageCard v-for="(card, index) in cards" :key="index" v-bind="card" />
1818
</UPageGrid>
19-
<div
20-
v-if="uiStore.uiInconsistencies.length > 0"
21-
class="flex flex-col gap-8"
22-
>
19+
<template v-if="uiStore.uiInconsistencies.length > 0">
2320
<p>{{ uiStore.uiInconsistencies.length }} UI inconsistentie(s):</p>
2421
<UAlert
2522
v-for="term in uiStore.uiInconsistencies"
2623
:key="term.key"
2724
color="warning"
2825
variant="subtle"
29-
:title="`Inconsistentie voor: ${term.key}`"
26+
:title="`Inconsistentie in de key: ${term.key}`"
3027
:description="`NWS: ${term.nws} • NWP: ${term.nwp}`"
3128
:actions="[
3229
{
@@ -41,7 +38,7 @@
4138
},
4239
]"
4340
/>
44-
</div>
41+
</template>
4542
</UPageBody>
4643
</UPage>
4744
</template>
@@ -53,7 +50,7 @@ const translationStore = useTranslationStore();
5350
const cards = computed((): PageCardProps[] => {
5451
return [
5552
{
56-
description: `${uiStore.keys.length} records. ${uiStore.inconsistentNWS.length > 0 ? `${uiStore.inconsistentNWS.flatMap((i) => i.others).length} inconsistentie(s).` : ""}`,
53+
description: `${uiStore.keys.length} records. ${uiStore.inconsistentNWS.length > 0 ? `${uiStore.inconsistentNWS.length} mogelijke inconsistentie(s).` : ""}`,
5754
icon: "i-lucide:monitor",
5855
title: "NWS UI",
5956
to: "/translate/nws",

app/pages/translate/nws/index.vue

Lines changed: 35 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,41 @@
11
<template>
2-
<div class="flex flex-col gap-4">
2+
<div class="flex flex-col gap-8">
33
<p>Kies een key uit de lijst om te vertalen.</p>
4-
<UAlert
5-
v-for="i in uiStore.inconsistentNWS"
6-
:key="i.key"
7-
color="warning"
8-
variant="subtle"
9-
:title="`Inconsistentie in de term: ${i.original} = ${i.translation}`"
10-
:description="
11-
i.others.length === 1
12-
? i.others[0]!.value
13-
: `${i.others.length} inconsistente vertalingen`
14-
"
15-
:actions="[
16-
{
17-
label: 'Open termen naast elkaar',
18-
to: `/translate/nws/${i.key},${i.others.map((o) => o.key).join(',')}`,
19-
},
20-
...(i.others.length === 1
21-
? ([
22-
{
23-
label: 'Markeer als consistent',
24-
onClick: () => {
25-
uiStore.markNWSConsistent(i.key, i.others[0]!.key);
4+
<template v-if="uiStore.inconsistentNWS.length > 0">
5+
<p>
6+
{{ uiStore.inconsistentNWS.length }} mogelijke inconsistentie(s)
7+
gevonden:
8+
</p>
9+
<UAlert
10+
v-for="i in uiStore.inconsistentNWS"
11+
:key="i.key"
12+
color="warning"
13+
variant="subtle"
14+
:title="`Inconsistentie in de term: ${i.original} = ${i.translation}`"
15+
:description="
16+
i.others.length === 1
17+
? i.others[0]!.value
18+
: `${i.others.length} inconsistente vertalingen`
19+
"
20+
:actions="[
21+
{
22+
label: 'Open termen naast elkaar',
23+
to: `/translate/nws/${i.key},${i.others.map((o) => o.key).join(',')}`,
24+
},
25+
...(i.others.length === 1
26+
? ([
27+
{
28+
label: 'Markeer als consistent',
29+
onClick: () => {
30+
uiStore.markNWSConsistent(i.key, i.others[0]!.key);
31+
},
32+
color: 'neutral',
2633
},
27-
color: 'neutral',
28-
},
29-
] as const)
30-
: []),
31-
]"
32-
/>
34+
] as const)
35+
: []),
36+
]"
37+
/>
38+
</template>
3339
</div>
3440
</template>
3541
<script setup lang="ts">

app/pages/translate/tips/index.vue

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@
88

99
<UPageBody>
1010
<template v-if="translationStore.inconsistentTips.length">
11+
<p>
12+
{{ translationStore.inconsistentTips.length }} inconsistentie(s)
13+
gevonden:
14+
</p>
1115
<UAlert
1216
v-for="h in translationStore.inconsistentTips"
1317
:key="h.heading"

eslint.config.mjs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import vitest from "@vitest/eslint-plugin";
2+
import eslintConfigPrettier from "eslint-config-prettier/flat";
23
import perfectionist from "eslint-plugin-perfectionist";
3-
import eslintPluginPrettierRecommended from "eslint-plugin-prettier/recommended";
4+
//import eslintPluginPrettierRecommended from "eslint-plugin-prettier/recommended";
45
import security from "eslint-plugin-security";
56

67
// @ts-check
@@ -42,8 +43,10 @@ export default withNuxt(
4243
},
4344

4445
// Prettier
45-
eslintPluginPrettierRecommended,
46-
{ rules: { "prettier/prettier": ["error", { endOfLine: "auto" }] } },
46+
eslintConfigPrettier,
47+
// Causing issues: https://github.com/prettier/eslint-plugin-prettier/issues/65
48+
//eslintPluginPrettierRecommended,
49+
//{ rules: { "prettier/prettier": ["error", { endOfLine: "auto" }] } },
4750
).overrideRules({
4851
"security/detect-object-injection": "off",
4952
"vue/attributes-order": [

0 commit comments

Comments
 (0)