Changes to import and notifications

This commit is contained in:
Simon Pocrnjič
2025-10-13 21:14:10 +02:00
parent 0bbed64542
commit 79b3e20b02
28 changed files with 2173 additions and 438 deletions
@@ -11,10 +11,21 @@ const props = defineProps({
limit: { type: Number, default: 50 },
loading: { type: Boolean, default: false },
entities: { type: Array, default: () => [] },
// passthrough verbose from parent to render extra sources in table
verbose: { type: Boolean, default: false },
});
// Emits
const emit = defineEmits(["close", "update:limit"]);
const emit = defineEmits(["close", "update:limit", "toggle-verbose"]);
// Local handlers for header controls
function onLimit(e) {
const val = Number(e?.target?.value ?? props.limit ?? 50);
emit("update:limit", isNaN(val) ? 50 : val);
}
function toggleVerbose() {
emit("toggle-verbose");
}
// Map technical entity keys to localized labels
const entityLabelMap = {
@@ -70,6 +81,8 @@ const entitiesWithRows = computed(() => {
const activeEntity = ref(null);
const hideChain = ref(false);
const showOnlyChanged = ref(false);
// Show only rows skipped due to missing contract.reference in keyref mode (contract/account)
const showOnlyKeyrefSkipped = ref(false);
watch(
entitiesWithRows,
(val) => {
@@ -156,6 +169,15 @@ const visibleRows = computed(() => {
.filter((r) => {
if (!r.entities || !r.entities[activeEntity.value]) return false;
const ent = r.entities[activeEntity.value];
// Filter: only rows explicitly skipped due to keyref missing
if (showOnlyKeyrefSkipped.value) {
if (Array.isArray(ent)) {
const anySkipped = ent.some((i) => i && i.skipped_due_to_keyref);
if (!anySkipped) return false;
} else {
if (!ent.skipped_due_to_keyref) return false;
}
}
if (!Array.isArray(ent)) {
if (hideChain.value && ent.existing_chain) return false;
}
@@ -286,7 +308,7 @@ function referenceOf(entityName, ent) {
class="text-[11px] px-2 py-1 rounded border bg-white hover:bg-gray-50"
@click="toggleVerbose"
>
{{ verbose ? "Manj" : "Več" }} podrobnosti
{{ props.verbose ? "Manj" : "Več" }} podrobnosti
</button>
<label class="flex items-center gap-1 text-[11px] text-gray-600">
<input type="checkbox" v-model="hideChain" class="rounded border-gray-300" />
@@ -300,6 +322,14 @@ function referenceOf(entityName, ent) {
/>
Samo spremenjeni
</label>
<label class="flex items-center gap-1 text-[11px] text-gray-600" title="Prikaži le vrstice preskočene zaradi manjkajoče contract.reference v načinu keyref (pogodbe/računi)">
<input
type="checkbox"
v-model="showOnlyKeyrefSkipped"
class="rounded border-gray-300"
/>
Samo preskočene (keyref)
</label>
<button
type="button"
class="text-[11px] px-2 py-1 rounded bg-gray-800 text-white hover:bg-gray-700"