chore(release): bump version to 2.3.26
This commit is contained in:
parent
ca23ac1f2b
commit
48f7b80c49
@ -4,10 +4,11 @@ Invoice Error Finder frontend views.
|
|||||||
import logging
|
import logging
|
||||||
from typing import Any, Dict
|
from typing import Any, Dict
|
||||||
|
|
||||||
from fastapi import APIRouter, Request
|
from fastapi import APIRouter, Depends, Request
|
||||||
from fastapi.responses import HTMLResponse
|
from fastapi.responses import HTMLResponse
|
||||||
from fastapi.templating import Jinja2Templates
|
from fastapi.templating import Jinja2Templates
|
||||||
|
|
||||||
|
from app.core.auth_dependencies import require_permission
|
||||||
from app.core.database import execute_query
|
from app.core.database import execute_query
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
@ -39,7 +40,10 @@ def _fetch_customers() -> list:
|
|||||||
|
|
||||||
|
|
||||||
@router.get("/invoice-error-finder", response_class=HTMLResponse)
|
@router.get("/invoice-error-finder", response_class=HTMLResponse)
|
||||||
async def dashboard(request: Request):
|
async def dashboard(
|
||||||
|
request: Request,
|
||||||
|
current_user: dict = Depends(require_permission("invoice_error_finder.view")),
|
||||||
|
):
|
||||||
return templates.TemplateResponse(
|
return templates.TemplateResponse(
|
||||||
"modules/invoice_error_finder/templates/dashboard.html",
|
"modules/invoice_error_finder/templates/dashboard.html",
|
||||||
{
|
{
|
||||||
@ -49,7 +53,10 @@ async def dashboard(request: Request):
|
|||||||
|
|
||||||
|
|
||||||
@router.get("/invoice-error-finder/issues", response_class=HTMLResponse)
|
@router.get("/invoice-error-finder/issues", response_class=HTMLResponse)
|
||||||
async def issues_list(request: Request):
|
async def issues_list(
|
||||||
|
request: Request,
|
||||||
|
current_user: dict = Depends(require_permission("invoice_error_finder.view")),
|
||||||
|
):
|
||||||
return templates.TemplateResponse(
|
return templates.TemplateResponse(
|
||||||
"modules/invoice_error_finder/templates/issues.html",
|
"modules/invoice_error_finder/templates/issues.html",
|
||||||
{
|
{
|
||||||
|
|||||||
@ -151,7 +151,22 @@
|
|||||||
async function loadDashboard() {
|
async function loadDashboard() {
|
||||||
try {
|
try {
|
||||||
const res = await fetch('/api/v1/invoice-error-finder/dashboard');
|
const res = await fetch('/api/v1/invoice-error-finder/dashboard');
|
||||||
if (!res.ok) throw new Error('Kunne ikke hente dashboard');
|
if (!res.ok) {
|
||||||
|
let detail = 'Kunne ikke hente dashboard';
|
||||||
|
try {
|
||||||
|
const payload = await res.json();
|
||||||
|
if (res.status === 403) {
|
||||||
|
detail = 'Du mangler adgang til Faktura-fejl-finder';
|
||||||
|
} else if (payload?.detail) {
|
||||||
|
detail = payload.detail;
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
if (res.status === 403) {
|
||||||
|
detail = 'Du mangler adgang til Faktura-fejl-finder';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
throw new Error(detail);
|
||||||
|
}
|
||||||
const data = await res.json();
|
const data = await res.json();
|
||||||
|
|
||||||
document.getElementById('missingLineCount').textContent = data.missing_line?.count ?? 0;
|
document.getElementById('missingLineCount').textContent = data.missing_line?.count ?? 0;
|
||||||
|
|||||||
@ -0,0 +1,17 @@
|
|||||||
|
-- Repair migration: ensure invoice error finder import permission exists on older prod databases
|
||||||
|
-- and is granted to the intended operator groups.
|
||||||
|
|
||||||
|
INSERT INTO permissions (code, description, category)
|
||||||
|
VALUES (
|
||||||
|
'invoice_error_finder.run_import',
|
||||||
|
'Trigger invoice/error data imports',
|
||||||
|
'invoice_error_finder'
|
||||||
|
)
|
||||||
|
ON CONFLICT (code) DO NOTHING;
|
||||||
|
|
||||||
|
INSERT INTO group_permissions (group_id, permission_id)
|
||||||
|
SELECT g.id, p.id
|
||||||
|
FROM groups g
|
||||||
|
JOIN permissions p ON p.code = 'invoice_error_finder.run_import'
|
||||||
|
WHERE g.name IN ('Administrators', 'Managers')
|
||||||
|
ON CONFLICT DO NOTHING;
|
||||||
@ -649,7 +649,7 @@
|
|||||||
|
|
||||||
// Primary source: active drift events filtered client-side by blacklist.
|
// Primary source: active drift events filtered client-side by blacklist.
|
||||||
const [eventsRes, blacklistRes] = await Promise.all([
|
const [eventsRes, blacklistRes] = await Promise.all([
|
||||||
fetch('/api/v1/drift/events?status=active&limit=500', {
|
fetch('/api/v1/drift/events?status=active&limit=200', {
|
||||||
credentials: 'include',
|
credentials: 'include',
|
||||||
headers: { 'Accept': 'application/json' }
|
headers: { 'Accept': 'application/json' }
|
||||||
}),
|
}),
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user