Compare commits
18 Commits
mai/brunel
...
967f2f6d09
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
967f2f6d09 | ||
|
|
e5387734aa | ||
|
|
6cb87c6868 | ||
|
|
d38719db2f | ||
|
|
b21efccfb5 | ||
|
|
f51d189a3b | ||
|
|
481b299e03 | ||
|
|
68d48100b9 | ||
|
|
40a11a4c49 | ||
|
|
eca0cde5e7 | ||
|
|
cf3711b2e4 | ||
|
|
dea49f6f8e | ||
|
|
5e401d2eac | ||
|
|
3f90904e0c | ||
|
|
f285d4451d | ||
|
|
bf1b1cdd82 | ||
|
|
9d89b97ad5 | ||
|
|
2f572fafc9 |
@@ -18,7 +18,7 @@ frontend/ Next.js 15 (TypeScript, Tailwind CSS, App Router)
|
|||||||
|
|
||||||
- **Frontend:** Next.js 15 with TypeScript, Tailwind CSS v4, App Router, Bun
|
- **Frontend:** Next.js 15 with TypeScript, Tailwind CSS v4, App Router, Bun
|
||||||
- **Backend:** Go (standard library HTTP server)
|
- **Backend:** Go (standard library HTTP server)
|
||||||
- **Database:** Supabase (PostgreSQL) — `kanzlai` schema in flexsiebels instance
|
- **Database:** Supabase (PostgreSQL) — `mgmt` schema in youpc.org instance
|
||||||
- **Deploy:** Dokploy on mLake, domain: kanzlai.msbls.de
|
- **Deploy:** Dokploy on mLake, domain: kanzlai.msbls.de
|
||||||
|
|
||||||
## Development
|
## Development
|
||||||
|
|||||||
@@ -5,7 +5,6 @@ import (
|
|||||||
"net/http"
|
"net/http"
|
||||||
"os"
|
"os"
|
||||||
|
|
||||||
"github.com/jmoiron/sqlx"
|
|
||||||
_ "github.com/lib/pq"
|
_ "github.com/lib/pq"
|
||||||
|
|
||||||
"mgit.msbls.de/m/KanzlAI-mGMT/internal/auth"
|
"mgit.msbls.de/m/KanzlAI-mGMT/internal/auth"
|
||||||
@@ -34,21 +33,6 @@ func main() {
|
|||||||
|
|
||||||
authMW := auth.NewMiddleware(cfg.SupabaseJWTSecret, database)
|
authMW := auth.NewMiddleware(cfg.SupabaseJWTSecret, database)
|
||||||
|
|
||||||
// Optional: connect to youpc.org database for similar case finder
|
|
||||||
var youpcDB *sqlx.DB
|
|
||||||
if cfg.YouPCDatabaseURL != "" {
|
|
||||||
youpcDB, err = sqlx.Connect("postgres", cfg.YouPCDatabaseURL)
|
|
||||||
if err != nil {
|
|
||||||
slog.Warn("failed to connect to youpc.org database — similar case finder disabled", "error", err)
|
|
||||||
youpcDB = nil
|
|
||||||
} else {
|
|
||||||
youpcDB.SetMaxOpenConns(5)
|
|
||||||
youpcDB.SetMaxIdleConns(2)
|
|
||||||
defer youpcDB.Close()
|
|
||||||
slog.Info("connected to youpc.org database for similar case finder")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Start CalDAV sync service
|
// Start CalDAV sync service
|
||||||
calDAVSvc := services.NewCalDAVService(database)
|
calDAVSvc := services.NewCalDAVService(database)
|
||||||
calDAVSvc.Start()
|
calDAVSvc.Start()
|
||||||
@@ -59,7 +43,7 @@ func main() {
|
|||||||
notifSvc.Start()
|
notifSvc.Start()
|
||||||
defer notifSvc.Stop()
|
defer notifSvc.Stop()
|
||||||
|
|
||||||
handler := router.New(database, authMW, cfg, calDAVSvc, notifSvc, youpcDB)
|
handler := router.New(database, authMW, cfg, calDAVSvc, notifSvc, database)
|
||||||
|
|
||||||
slog.Info("starting KanzlAI API server", "port", cfg.Port)
|
slog.Info("starting KanzlAI API server", "port", cfg.Port)
|
||||||
if err := http.ListenAndServe(":"+cfg.Port, handler); err != nil {
|
if err := http.ListenAndServe(":"+cfg.Port, handler); err != nil {
|
||||||
|
|||||||
@@ -14,7 +14,13 @@ type Config struct {
|
|||||||
SupabaseJWTSecret string
|
SupabaseJWTSecret string
|
||||||
AnthropicAPIKey string
|
AnthropicAPIKey string
|
||||||
FrontendOrigin string
|
FrontendOrigin string
|
||||||
YouPCDatabaseURL string // read-only connection to youpc.org Supabase for similar case finder
|
|
||||||
|
// SMTP settings (optional — email sending disabled if SMTPHost is empty)
|
||||||
|
SMTPHost string
|
||||||
|
SMTPPort string
|
||||||
|
SMTPUser string
|
||||||
|
SMTPPass string
|
||||||
|
MailFrom string
|
||||||
}
|
}
|
||||||
|
|
||||||
func Load() (*Config, error) {
|
func Load() (*Config, error) {
|
||||||
@@ -27,7 +33,12 @@ func Load() (*Config, error) {
|
|||||||
SupabaseJWTSecret: os.Getenv("SUPABASE_JWT_SECRET"),
|
SupabaseJWTSecret: os.Getenv("SUPABASE_JWT_SECRET"),
|
||||||
AnthropicAPIKey: os.Getenv("ANTHROPIC_API_KEY"),
|
AnthropicAPIKey: os.Getenv("ANTHROPIC_API_KEY"),
|
||||||
FrontendOrigin: getEnv("FRONTEND_ORIGIN", "https://kanzlai.msbls.de"),
|
FrontendOrigin: getEnv("FRONTEND_ORIGIN", "https://kanzlai.msbls.de"),
|
||||||
YouPCDatabaseURL: os.Getenv("YOUPC_DATABASE_URL"),
|
|
||||||
|
SMTPHost: os.Getenv("SMTP_HOST"),
|
||||||
|
SMTPPort: getEnv("SMTP_PORT", "465"),
|
||||||
|
SMTPUser: os.Getenv("SMTP_USER"),
|
||||||
|
SMTPPass: os.Getenv("SMTP_PASS"),
|
||||||
|
MailFrom: getEnv("MAIL_FROM", "mgmt@msbls.de"),
|
||||||
}
|
}
|
||||||
|
|
||||||
if cfg.DatabaseURL == "" {
|
if cfg.DatabaseURL == "" {
|
||||||
|
|||||||
@@ -13,8 +13,8 @@ func Connect(databaseURL string) (*sqlx.DB, error) {
|
|||||||
return nil, fmt.Errorf("connecting to database: %w", err)
|
return nil, fmt.Errorf("connecting to database: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set search_path so queries use kanzlai schema by default
|
// Set search_path so queries use mgmt schema by default
|
||||||
if _, err := db.Exec("SET search_path TO kanzlai, public"); err != nil {
|
if _, err := db.Exec("SET search_path TO mgmt, public"); err != nil {
|
||||||
db.Close()
|
db.Close()
|
||||||
return nil, fmt.Errorf("setting search_path: %w", err)
|
return nil, fmt.Errorf("setting search_path: %w", err)
|
||||||
}
|
}
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -20,6 +20,7 @@ type UserTenant struct {
|
|||||||
UserID uuid.UUID `db:"user_id" json:"user_id"`
|
UserID uuid.UUID `db:"user_id" json:"user_id"`
|
||||||
TenantID uuid.UUID `db:"tenant_id" json:"tenant_id"`
|
TenantID uuid.UUID `db:"tenant_id" json:"tenant_id"`
|
||||||
Role string `db:"role" json:"role"`
|
Role string `db:"role" json:"role"`
|
||||||
|
Email string `db:"email" json:"email"`
|
||||||
CreatedAt time.Time `db:"created_at" json:"created_at"`
|
CreatedAt time.Time `db:"created_at" json:"created_at"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -215,10 +215,10 @@ func New(db *sqlx.DB, authMW *auth.Middleware, cfg *config.Config, calDAVSvc *se
|
|||||||
scoped.HandleFunc("GET /api/caldav/status", calDAVH.GetStatus)
|
scoped.HandleFunc("GET /api/caldav/status", calDAVH.GetStatus)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Reports — billing permission (partners + owners)
|
// Reports — cases/deadlines/workload open to all, billing restricted
|
||||||
scoped.HandleFunc("GET /api/reports/cases", perm(auth.PermManageBilling, reportH.Cases))
|
scoped.HandleFunc("GET /api/reports/cases", reportH.Cases)
|
||||||
scoped.HandleFunc("GET /api/reports/deadlines", perm(auth.PermManageBilling, reportH.Deadlines))
|
scoped.HandleFunc("GET /api/reports/deadlines", reportH.Deadlines)
|
||||||
scoped.HandleFunc("GET /api/reports/workload", perm(auth.PermManageBilling, reportH.Workload))
|
scoped.HandleFunc("GET /api/reports/workload", reportH.Workload)
|
||||||
scoped.HandleFunc("GET /api/reports/billing", perm(auth.PermManageBilling, reportH.Billing))
|
scoped.HandleFunc("GET /api/reports/billing", perm(auth.PermManageBilling, reportH.Billing))
|
||||||
|
|
||||||
// Time entries — all can view/create, tied to cases
|
// Time entries — all can view/create, tied to cases
|
||||||
|
|||||||
@@ -2,9 +2,12 @@ package services
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
"crypto/tls"
|
||||||
"fmt"
|
"fmt"
|
||||||
"log/slog"
|
"log/slog"
|
||||||
"os/exec"
|
"net"
|
||||||
|
"net/smtp"
|
||||||
|
"os"
|
||||||
"strings"
|
"strings"
|
||||||
"sync"
|
"sync"
|
||||||
"time"
|
"time"
|
||||||
@@ -457,18 +460,85 @@ type UpdatePreferencesInput struct {
|
|||||||
DailyDigest bool `json:"daily_digest"`
|
DailyDigest bool `json:"daily_digest"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// SendEmail sends an email using the `m mail send` CLI command.
|
// SendEmail sends an email via direct SMTP over TLS.
|
||||||
|
// Requires SMTP_HOST, SMTP_USER, SMTP_PASS env vars. Falls back to no-op if unconfigured.
|
||||||
func SendEmail(to, subject, body string) error {
|
func SendEmail(to, subject, body string) error {
|
||||||
cmd := exec.Command("m", "mail", "send",
|
host := os.Getenv("SMTP_HOST")
|
||||||
"--to", to,
|
port := os.Getenv("SMTP_PORT")
|
||||||
"--subject", subject,
|
user := os.Getenv("SMTP_USER")
|
||||||
"--body", body,
|
pass := os.Getenv("SMTP_PASS")
|
||||||
"--yes")
|
from := os.Getenv("MAIL_FROM")
|
||||||
output, err := cmd.CombinedOutput()
|
|
||||||
if err != nil {
|
if port == "" {
|
||||||
return fmt.Errorf("m mail send failed: %w (output: %s)", err, string(output))
|
port = "465"
|
||||||
}
|
}
|
||||||
slog.Info("email sent", "to", to, "subject", subject)
|
if from == "" {
|
||||||
|
from = "mgmt@msbls.de"
|
||||||
|
}
|
||||||
|
|
||||||
|
if host == "" || user == "" || pass == "" {
|
||||||
|
slog.Warn("SMTP not configured, skipping email", "to", to, "subject", subject)
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// Build RFC 2822 message
|
||||||
|
msg := fmt.Sprintf("From: \"KanzlAI-mGMT\" <%s>\r\n"+
|
||||||
|
"To: %s\r\n"+
|
||||||
|
"Subject: [KanzlAI] %s\r\n"+
|
||||||
|
"MIME-Version: 1.0\r\n"+
|
||||||
|
"Content-Type: text/plain; charset=utf-8\r\n"+
|
||||||
|
"Date: %s\r\n"+
|
||||||
|
"\r\n%s",
|
||||||
|
from, to, subject,
|
||||||
|
time.Now().Format(time.RFC1123Z),
|
||||||
|
body)
|
||||||
|
|
||||||
|
addr := net.JoinHostPort(host, port)
|
||||||
|
|
||||||
|
// Connect with implicit TLS (port 465)
|
||||||
|
tlsConfig := &tls.Config{ServerName: host}
|
||||||
|
conn, err := tls.Dial("tcp", addr, tlsConfig)
|
||||||
|
if err != nil {
|
||||||
|
return fmt.Errorf("smtp tls dial: %w", err)
|
||||||
|
}
|
||||||
|
|
||||||
|
client, err := smtp.NewClient(conn, host)
|
||||||
|
if err != nil {
|
||||||
|
conn.Close()
|
||||||
|
return fmt.Errorf("smtp new client: %w", err)
|
||||||
|
}
|
||||||
|
defer client.Close()
|
||||||
|
|
||||||
|
// Authenticate
|
||||||
|
auth := smtp.PlainAuth("", user, pass, host)
|
||||||
|
if err := client.Auth(auth); err != nil {
|
||||||
|
return fmt.Errorf("smtp auth: %w", err)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Send
|
||||||
|
if err := client.Mail(from); err != nil {
|
||||||
|
return fmt.Errorf("smtp mail from: %w", err)
|
||||||
|
}
|
||||||
|
if err := client.Rcpt(to); err != nil {
|
||||||
|
return fmt.Errorf("smtp rcpt to: %w", err)
|
||||||
|
}
|
||||||
|
|
||||||
|
w, err := client.Data()
|
||||||
|
if err != nil {
|
||||||
|
return fmt.Errorf("smtp data: %w", err)
|
||||||
|
}
|
||||||
|
if _, err := w.Write([]byte(msg)); err != nil {
|
||||||
|
return fmt.Errorf("smtp write: %w", err)
|
||||||
|
}
|
||||||
|
if err := w.Close(); err != nil {
|
||||||
|
return fmt.Errorf("smtp close data: %w", err)
|
||||||
|
}
|
||||||
|
|
||||||
|
if err := client.Quit(); err != nil {
|
||||||
|
slog.Warn("smtp quit error (non-fatal)", "error", err)
|
||||||
|
}
|
||||||
|
|
||||||
|
slog.Info("email sent via SMTP", "from", from, "to", to, "subject", subject)
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -139,7 +139,11 @@ func (s *TenantService) FirstTenantForUser(ctx context.Context, userID uuid.UUID
|
|||||||
func (s *TenantService) ListMembers(ctx context.Context, tenantID uuid.UUID) ([]models.UserTenant, error) {
|
func (s *TenantService) ListMembers(ctx context.Context, tenantID uuid.UUID) ([]models.UserTenant, error) {
|
||||||
var members []models.UserTenant
|
var members []models.UserTenant
|
||||||
err := s.db.SelectContext(ctx, &members,
|
err := s.db.SelectContext(ctx, &members,
|
||||||
`SELECT user_id, tenant_id, role, created_at FROM user_tenants WHERE tenant_id = $1 ORDER BY created_at`,
|
`SELECT ut.user_id, ut.tenant_id, ut.role, ut.created_at, COALESCE(au.email, '') as email
|
||||||
|
FROM user_tenants ut
|
||||||
|
LEFT JOIN auth.users au ON au.id = ut.user_id
|
||||||
|
WHERE ut.tenant_id = $1
|
||||||
|
ORDER BY ut.created_at`,
|
||||||
tenantID,
|
tenantID,
|
||||||
)
|
)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
-- Creates 1 test tenant, 5 cases with deadlines and appointments
|
-- Creates 1 test tenant, 5 cases with deadlines and appointments
|
||||||
-- Run with: psql $DATABASE_URL -f demo_data.sql
|
-- Run with: psql $DATABASE_URL -f demo_data.sql
|
||||||
|
|
||||||
SET search_path TO kanzlai, public;
|
SET search_path TO mgmt, public;
|
||||||
|
|
||||||
-- Demo tenant
|
-- Demo tenant
|
||||||
INSERT INTO tenants (id, name, slug, settings) VALUES
|
INSERT INTO tenants (id, name, slug, settings) VALUES
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
-- UPC Proceeding Timeline: Full event tree with conditional deadlines
|
-- UPC Proceeding Timeline: Full event tree with conditional deadlines
|
||||||
-- Ported from youpc.org migrations 039 + 040
|
-- Ported from youpc.org migrations 039 + 040
|
||||||
-- Run against kanzlai schema in flexsiebels Supabase instance
|
-- Run against mgmt schema in youpc.org Supabase instance
|
||||||
|
|
||||||
-- ========================================
|
-- ========================================
|
||||||
-- 1. Add is_spawn + spawn_label columns
|
-- 1. Add is_spawn + spawn_label columns
|
||||||
|
|||||||
@@ -1,16 +1,14 @@
|
|||||||
"use client";
|
"use client";
|
||||||
|
|
||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
|
import { useQuery } from "@tanstack/react-query";
|
||||||
|
import { api } from "@/lib/api";
|
||||||
|
import type { ProceedingType } from "@/lib/types";
|
||||||
|
|
||||||
const TYPE_OPTIONS = [
|
const JURISDICTION_LABELS: Record<string, string> = {
|
||||||
{ value: "", label: "-- Typ wählen --" },
|
UPC: "UPC-Verfahren",
|
||||||
{ value: "INF", label: "Verletzungsklage (INF)" },
|
DE: "Deutsche Patentverfahren",
|
||||||
{ value: "REV", label: "Widerruf (REV)" },
|
};
|
||||||
{ value: "CCR", label: "Einstweilige Verfügung (CCR)" },
|
|
||||||
{ value: "APP", label: "Berufung (APP)" },
|
|
||||||
{ value: "PI", label: "Vorläufiger Rechtsschutz (PI)" },
|
|
||||||
{ value: "ZPO_CIVIL", label: "ZPO Zivilverfahren" },
|
|
||||||
];
|
|
||||||
|
|
||||||
export interface CaseFormData {
|
export interface CaseFormData {
|
||||||
case_number: string;
|
case_number: string;
|
||||||
@@ -34,6 +32,10 @@ export function CaseForm({
|
|||||||
isSubmitting,
|
isSubmitting,
|
||||||
submitLabel = "Akte anlegen",
|
submitLabel = "Akte anlegen",
|
||||||
}: CaseFormProps) {
|
}: CaseFormProps) {
|
||||||
|
const { data: proceedingTypes } = useQuery({
|
||||||
|
queryKey: ["proceeding-types"],
|
||||||
|
queryFn: () => api.get<ProceedingType[]>("/proceeding-types"),
|
||||||
|
});
|
||||||
const [form, setForm] = useState<CaseFormData>({
|
const [form, setForm] = useState<CaseFormData>({
|
||||||
case_number: initialData?.case_number ?? "",
|
case_number: initialData?.case_number ?? "",
|
||||||
title: initialData?.title ?? "",
|
title: initialData?.title ?? "",
|
||||||
@@ -139,11 +141,24 @@ export function CaseForm({
|
|||||||
onChange={(e) => update("case_type", e.target.value)}
|
onChange={(e) => update("case_type", e.target.value)}
|
||||||
className={inputClass}
|
className={inputClass}
|
||||||
>
|
>
|
||||||
{TYPE_OPTIONS.map((o) => (
|
<option value="">-- Typ wählen --</option>
|
||||||
<option key={o.value} value={o.value}>
|
{(() => {
|
||||||
{o.label}
|
const grouped = new Map<string, ProceedingType[]>();
|
||||||
|
for (const pt of proceedingTypes ?? []) {
|
||||||
|
const key = pt.jurisdiction ?? "Sonstige";
|
||||||
|
if (!grouped.has(key)) grouped.set(key, []);
|
||||||
|
grouped.get(key)!.push(pt);
|
||||||
|
}
|
||||||
|
return Array.from(grouped.entries()).map(([jurisdiction, types]) => (
|
||||||
|
<optgroup key={jurisdiction} label={JURISDICTION_LABELS[jurisdiction] ?? jurisdiction}>
|
||||||
|
{types.map((pt) => (
|
||||||
|
<option key={pt.id} value={pt.code}>
|
||||||
|
{pt.name} ({pt.code})
|
||||||
</option>
|
</option>
|
||||||
))}
|
))}
|
||||||
|
</optgroup>
|
||||||
|
));
|
||||||
|
})()}
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
|
|||||||
@@ -35,7 +35,9 @@ const inputClass =
|
|||||||
|
|
||||||
export function DeadlineCalculator() {
|
export function DeadlineCalculator() {
|
||||||
const [proceedingType, setProceedingType] = useState("");
|
const [proceedingType, setProceedingType] = useState("");
|
||||||
const [triggerDate, setTriggerDate] = useState("");
|
const [triggerDate, setTriggerDate] = useState(
|
||||||
|
new Date().toISOString().split("T")[0],
|
||||||
|
);
|
||||||
|
|
||||||
const { data: proceedingTypes, isLoading: typesLoading } = useQuery({
|
const { data: proceedingTypes, isLoading: typesLoading } = useQuery({
|
||||||
queryKey: ["proceeding-types"],
|
queryKey: ["proceeding-types"],
|
||||||
@@ -83,11 +85,27 @@ export function DeadlineCalculator() {
|
|||||||
className={inputClass}
|
className={inputClass}
|
||||||
>
|
>
|
||||||
<option value="">Bitte wählen...</option>
|
<option value="">Bitte wählen...</option>
|
||||||
{proceedingTypes?.map((pt) => (
|
{(() => {
|
||||||
|
const grouped = new Map<string, ProceedingType[]>();
|
||||||
|
for (const pt of proceedingTypes ?? []) {
|
||||||
|
const key = pt.jurisdiction ?? "Sonstige";
|
||||||
|
if (!grouped.has(key)) grouped.set(key, []);
|
||||||
|
grouped.get(key)!.push(pt);
|
||||||
|
}
|
||||||
|
const labels: Record<string, string> = {
|
||||||
|
UPC: "UPC-Verfahren",
|
||||||
|
DE: "Deutsche Patentverfahren",
|
||||||
|
};
|
||||||
|
return Array.from(grouped.entries()).map(([jurisdiction, types]) => (
|
||||||
|
<optgroup key={jurisdiction} label={labels[jurisdiction] ?? jurisdiction}>
|
||||||
|
{types.map((pt) => (
|
||||||
<option key={pt.id} value={pt.code}>
|
<option key={pt.id} value={pt.code}>
|
||||||
{pt.name} ({pt.code})
|
{pt.name} ({pt.code})
|
||||||
</option>
|
</option>
|
||||||
))}
|
))}
|
||||||
|
</optgroup>
|
||||||
|
));
|
||||||
|
})()}
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
|
|||||||
@@ -276,13 +276,30 @@ export function DeadlineWizard() {
|
|||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="mt-4 grid grid-cols-2 gap-2 sm:grid-cols-3 lg:grid-cols-6">
|
<div className="mt-4 space-y-4">
|
||||||
{typesLoading ? (
|
{typesLoading ? (
|
||||||
<div className="col-span-full flex justify-center py-4">
|
<div className="flex justify-center py-4">
|
||||||
<Loader2 className="h-5 w-5 animate-spin text-neutral-400" />
|
<Loader2 className="h-5 w-5 animate-spin text-neutral-400" />
|
||||||
</div>
|
</div>
|
||||||
) : (
|
) : (
|
||||||
proceedingTypes?.map((pt) => (
|
(() => {
|
||||||
|
const grouped = new Map<string, ProceedingType[]>();
|
||||||
|
for (const pt of proceedingTypes ?? []) {
|
||||||
|
const key = pt.jurisdiction ?? "Sonstige";
|
||||||
|
if (!grouped.has(key)) grouped.set(key, []);
|
||||||
|
grouped.get(key)!.push(pt);
|
||||||
|
}
|
||||||
|
const labels: Record<string, string> = {
|
||||||
|
UPC: "UPC-Verfahren",
|
||||||
|
DE: "Deutsche Patentverfahren",
|
||||||
|
};
|
||||||
|
return Array.from(grouped.entries()).map(([jurisdiction, types]) => (
|
||||||
|
<div key={jurisdiction}>
|
||||||
|
<div className="mb-2 text-xs font-medium text-neutral-500">
|
||||||
|
{labels[jurisdiction] ?? jurisdiction}
|
||||||
|
</div>
|
||||||
|
<div className="grid grid-cols-2 gap-2 sm:grid-cols-3 lg:grid-cols-6">
|
||||||
|
{types.map((pt) => (
|
||||||
<button
|
<button
|
||||||
key={pt.id}
|
key={pt.id}
|
||||||
onClick={() => handleTypeSelect(pt.code)}
|
onClick={() => handleTypeSelect(pt.code)}
|
||||||
@@ -301,7 +318,11 @@ export function DeadlineWizard() {
|
|||||||
</div>
|
</div>
|
||||||
<div className="mt-1 text-xs leading-tight opacity-80">{pt.name}</div>
|
<div className="mt-1 text-xs leading-tight opacity-80">{pt.name}</div>
|
||||||
</button>
|
</button>
|
||||||
))
|
))}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
));
|
||||||
|
})()
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -444,7 +465,7 @@ export function DeadlineWizard() {
|
|||||||
<Scale className="h-6 w-6 text-neutral-400" />
|
<Scale className="h-6 w-6 text-neutral-400" />
|
||||||
</div>
|
</div>
|
||||||
<p className="mt-3 text-sm font-medium text-neutral-700">
|
<p className="mt-3 text-sm font-medium text-neutral-700">
|
||||||
UPC-Fristenbestimmung
|
Fristenbestimmung
|
||||||
</p>
|
</p>
|
||||||
<p className="mt-1 max-w-sm text-xs text-neutral-500">
|
<p className="mt-1 max-w-sm text-xs text-neutral-500">
|
||||||
Waehlen Sie die Verfahrensart und geben Sie das Datum des ausloesenden Ereignisses ein.
|
Waehlen Sie die Verfahrensart und geben Sie das Datum des ausloesenden Ereignisses ein.
|
||||||
|
|||||||
@@ -164,7 +164,7 @@ export function TeamSettings() {
|
|||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<p className="text-sm font-medium text-neutral-900">
|
<p className="text-sm font-medium text-neutral-900">
|
||||||
{member.user_id.slice(0, 8)}...
|
{member.email || member.user_id.slice(0, 8) + "..."}
|
||||||
</p>
|
</p>
|
||||||
<p className="text-xs text-neutral-500">{roleInfo.label}</p>
|
<p className="text-xs text-neutral-500">{roleInfo.label}</p>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ export interface UserTenant {
|
|||||||
user_id: string;
|
user_id: string;
|
||||||
tenant_id: string;
|
tenant_id: string;
|
||||||
role: string;
|
role: string;
|
||||||
|
email: string;
|
||||||
created_at: string;
|
created_at: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user