Skip to content
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
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ export default function Page() {
}}
className="bg-brand text-white px-5 py-2.5 rounded-xl text-sm font-bold hover:opacity-90 shadow-sm transition-all"
>
+ Adaugă
Adaugă
</button>
</div>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -459,7 +459,7 @@ export default function ConturiPage() {
setIsModalOpen(true);
}}
>
Modifică
Editează
</button>
<button
type="button"
Expand Down Expand Up @@ -505,7 +505,7 @@ export default function ConturiPage() {
}}
className="bg-brand text-white text-xs font-bold px-4 py-2.5 rounded-xl hover:opacity-90 cursor-pointer shadow-xs whitespace-nowrap h-[42px] flex items-center flex-shrink-0"
>
+ Adaugă Cont Nou
Adaugă Cont Nou
</button>
</div>

Expand Down Expand Up @@ -646,7 +646,7 @@ export default function ConturiPage() {
</div>

<div>
<label className="block text-xs font-semibold text-foreground mb-1">Facultate / Departament</label>
<label className="block text-xs font-semibold text-foreground mb-1">Facultate/Departament</label>
<select
required
disabled={isSaving}
Expand Down
26 changes: 13 additions & 13 deletions Frontend/Dashboard/dashboard-insideugal/app/facultati/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -256,11 +256,11 @@ export default function Page() {
},
{ header: "Nume facultate", key: "name", render: (item) => <span className="font-semibold text-foreground">{item.name}</span> },
{ header: "Descriere", key: "description", render: (item) => <span className="block max-w-xs truncate text-muted">{item.description || "-"}</span> },
{ header: "Adresa", key: "address", render: (item) => <span className="text-muted">{item.address || "-"}</span> },
{ header: "Adresă", key: "address", render: (item) => <span className="text-muted">{item.address || "-"}</span> },
{ header: "Telefon", key: "phone", render: (item) => <span className="text-muted whitespace-nowrap">{item.phone || "-"}</span> },
{ header: "Website", key: "website", render: (item) => item.website ? <a href={item.website} target="_blank" rel="noreferrer" className="text-blue-600 hover:underline">{item.website}</a> : <span className="text-muted">-</span> },
{
header: "Actiuni",
header: "Acțiuni",
key: "actions",
render: (item) => (
<div className="flex space-x-3 text-xs" onClick={(event) => event.stopPropagation()}>
Expand All @@ -280,7 +280,7 @@ export default function Page() {
{ header: "Nume cladire", key: "name", render: (item) => <span className="font-semibold text-foreground">{item.name}</span> },
{ header: "Locatie", key: "location", render: (item) => <span className="text-muted">{item.location}</span> },
{
header: "Facultati",
header: "Facultăți",
key: "faculties",
render: (item) => (
<div className="flex flex-wrap gap-1">
Expand All @@ -291,7 +291,7 @@ export default function Page() {
),
},
{
header: "Actiuni",
header: "Acțiuni",
key: "actions",
render: (item) => (
<div className="flex space-x-3 text-xs" onClick={(event) => event.stopPropagation()}>
Expand All @@ -313,10 +313,10 @@ export default function Page() {
<div className="p-6 max-w-7xl mx-auto space-y-6">
<div className="flex flex-col md:flex-row md:justify-between md:items-center gap-4">
<div className="flex bg-background p-1 rounded-xl border border-border/60 w-fit">
<button type="button" onClick={() => setActiveTab("facultati")} className={`px-4 py-2 text-xs font-bold rounded-lg cursor-pointer transition-all ${activeTab === "facultati" ? "bg-card text-foreground shadow-xs" : "text-muted hover:text-foreground"}`}>Facultati</button>
<button type="button" onClick={() => setActiveTab("cladiri")} className={`px-4 py-2 text-xs font-bold rounded-lg cursor-pointer transition-all ${activeTab === "cladiri" ? "bg-card text-foreground shadow-xs" : "text-muted hover:text-foreground"}`}>Cladiri</button>
<button type="button" onClick={() => setActiveTab("facultati")} className={`px-4 py-2 text-xs font-bold rounded-lg cursor-pointer transition-all ${activeTab === "facultati" ? "bg-card text-foreground shadow-xs" : "text-muted hover:text-foreground"}`}>Facultăți</button>
<button type="button" onClick={() => setActiveTab("cladiri")} className={`px-4 py-2 text-xs font-bold rounded-lg cursor-pointer transition-all ${activeTab === "cladiri" ? "bg-card text-foreground shadow-xs" : "text-muted hover:text-foreground"}`}>Clădiri</button>
</div>
<button type="button" onClick={handleOpenAddModal} className="bg-brand text-white px-5 py-2.5 rounded-xl text-sm font-bold cursor-pointer hover:opacity-90 transition-all shadow-md self-end md:self-auto">Adauga</button>
<button type="button" onClick={handleOpenAddModal} className="bg-brand text-white px-5 py-2.5 rounded-xl text-sm font-bold cursor-pointer hover:opacity-90 transition-all shadow-md self-end md:self-auto">Adaugă</button>
</div>

{errorMessage && (
Expand All @@ -339,17 +339,17 @@ export default function Page() {
<form onSubmit={handleSave} className="space-y-4 text-sm">
{activeModal === "add" && (
<select value={targetType} onChange={(event) => setTargetType(event.target.value as "facultati" | "cladiri")} className="w-full border border-border p-2 rounded-lg bg-background">
<option value="facultati">Facultati</option>
<option value="cladiri">Cladiri</option>
<option value="facultati">Facultăți</option>
<option value="cladiri">Clădiri</option>
</select>
)}

{targetType === "facultati" ? (
<>
<input value={facultyForm.name || ""} onChange={(event) => setFacultyForm({ ...facultyForm, name: event.target.value })} placeholder="Nume facultate" className="w-full border border-border p-2 rounded-lg bg-background" required />
<input value={facultyForm.abbreviation || ""} onChange={(event) => setFacultyForm({ ...facultyForm, abbreviation: event.target.value })} placeholder="Abreviere" className="w-full border border-border p-2 rounded-lg bg-background" />
<textarea value={facultyForm.description || ""} onChange={(event) => setFacultyForm({ ...facultyForm, description: event.target.value })} placeholder="Descriere scurta" className="w-full border border-border p-2 rounded-lg bg-background h-20" />
<input value={facultyForm.address || ""} onChange={(event) => setFacultyForm({ ...facultyForm, address: event.target.value })} placeholder="Adresa" className="w-full border border-border p-2 rounded-lg bg-background" />
<textarea value={facultyForm.description || ""} onChange={(event) => setFacultyForm({ ...facultyForm, description: event.target.value })} placeholder="Descriere" className="w-full border border-border p-2 rounded-lg bg-background h-20" />
<input value={facultyForm.address || ""} onChange={(event) => setFacultyForm({ ...facultyForm, address: event.target.value })} placeholder="Adresă" className="w-full border border-border p-2 rounded-lg bg-background" />
<input value={facultyForm.phone || ""} onChange={(event) => setFacultyForm({ ...facultyForm, phone: event.target.value })} placeholder="Telefon" className="w-full border border-border p-2 rounded-lg bg-background" />
<input type="url" value={facultyForm.website || ""} onChange={(event) => setFacultyForm({ ...facultyForm, website: event.target.value })} placeholder="Website" className="w-full border border-border p-2 rounded-lg bg-background" />
<input type="url" value={facultyForm.logoUrl || ""} onChange={(event) => setFacultyForm({ ...facultyForm, logoUrl: event.target.value })} placeholder="URL logo" className="w-full border border-border p-2 rounded-lg bg-background" />
Expand All @@ -369,8 +369,8 @@ export default function Page() {
)}

<div className="flex justify-end space-x-2 pt-4 border-t border-border">
<button type="button" onClick={() => setActiveModal(null)} className="px-4 py-2 border border-border rounded-lg text-muted text-xs">Anuleaza</button>
<button type="submit" className="px-4 py-2 bg-brand text-white rounded-lg text-xs font-bold">Salveaza</button>
<button type="button" onClick={() => setActiveModal(null)} className="px-4 py-2 border border-border rounded-lg text-muted text-xs">Anulează</button>
<button type="submit" className="px-4 py-2 bg-brand text-white rounded-lg text-xs font-bold">Salvează</button>
</div>
</form>
</Modal>
Expand Down
40 changes: 12 additions & 28 deletions Frontend/Dashboard/dashboard-insideugal/app/harti/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -94,10 +94,6 @@
<label className="block text-xs font-bold text-muted uppercase mb-1">Denumire</label>
<input value={formState.name} onChange={(event) => setFormState({ ...formState, name: event.target.value })} className="w-full p-2 rounded-lg border border-border bg-background text-sm" />
</div>
<div>
<label className="block text-xs font-bold text-muted uppercase mb-1">Faculty IDs</label>
<input value={formState.faculty_ids} onChange={(event) => setFormState({ ...formState, faculty_ids: event.target.value })} placeholder="Ex: 1, 4, 10" className="w-full p-2 rounded-lg border border-border bg-background text-sm" />
</div>
<div className="grid grid-cols-2 gap-4">
<div>
<label className="block text-xs font-bold text-muted uppercase mb-1">Latitudine</label>
Expand All @@ -114,8 +110,8 @@
</div>

<div className="flex justify-end gap-2 pt-4 bg-card border-t border-border flex-shrink-0">
<button type="button" onClick={onCancel} className="px-4 py-2 text-sm font-medium text-muted hover:text-foreground">Anuleaza</button>
<button type="button" onClick={onSave} className="px-4 py-2 bg-sidebar text-white rounded-lg text-sm font-medium hover:opacity-90">Salveaza</button>
<button type="button" onClick={onCancel} className="px-4 py-2 text-sm font-medium text-muted hover:text-foreground">Anulează</button>
<button type="button" onClick={onSave} className="px-4 py-2 bg-sidebar text-white rounded-lg text-sm font-medium hover:opacity-90">Salvează</button>
</div>
</div>
);
Expand All @@ -130,7 +126,7 @@
const [cladiri, setCladiri] = useState<Cladire[]>([]);
const [loading, setLoading] = useState(false);
const [errorMessage, setErrorMessage] = useState<string | null>(null);
const [selectedFacultyId, setSelectedFacultyId] = useState<string>("");

Check warning on line 129 in Frontend/Dashboard/dashboard-insideugal/app/harti/page.tsx

View workflow job for this annotation

GitHub Actions / Frontend Dashboard (22)

'setSelectedFacultyId' is assigned a value but never used
const [addForm, setAddForm] = useState<FormState>(emptyForm);
const [editForm, setEditForm] = useState<FormState>(emptyForm);

Expand Down Expand Up @@ -238,7 +234,7 @@
? cladiri.filter((cladire) => cladire.faculty_ids.includes(parseInt(selectedFacultyId, 10)))
: cladiri;

const facultyFilterOptions = Array.from(new Set(cladiri.flatMap((cladire) => cladire.faculty_ids))).sort((a, b) => a - b);

Check warning on line 237 in Frontend/Dashboard/dashboard-insideugal/app/harti/page.tsx

View workflow job for this annotation

GitHub Actions / Frontend Dashboard (22)

'facultyFilterOptions' is assigned a value but never used

const cladiriForMap = filteredCladiri
.filter((cladire) => cladire.coordinates)
Expand All @@ -254,7 +250,7 @@

const columns: Column<Cladire>[] = [
{
header: "Cladire",
header: "Clădire",
key: "name",
render: (item) => (
<div className="flex flex-col">
Expand All @@ -275,12 +271,12 @@
),
},
{
header: "Actiuni",
header: "Acțiuni",
key: "id",
render: (item) => (
<div className="flex items-center gap-3">
<button type="button" onClick={() => handleEditOpen(item)} className="text-blue-600 hover:text-blue-700 text-xs font-medium">Editare</button>
<button type="button" onClick={() => void handleDelete(item.id)} className="text-rose-600 hover:text-rose-700 text-xs font-medium">Stergere</button>
<button type="button" onClick={() => void handleDelete(item.id)} className="text-rose-600 hover:text-rose-700 text-xs font-medium">Ștergere</button>
</div>
),
},
Expand All @@ -292,23 +288,11 @@
<div className="space-y-6">
<div className="flex justify-between items-center">
<div className="flex gap-2 p-1 bg-background border border-border rounded-xl">
<button type="button" onClick={() => setTab("locatii")} className={`px-4 py-1.5 text-sm font-medium rounded-lg transition-colors ${tab === "locatii" ? "bg-sidebar text-white" : "text-muted hover:text-foreground"}`}>Locatii</button>
<button type="button" onClick={() => setTab("harta")} className={`px-4 py-1.5 text-sm font-medium rounded-lg transition-colors ${tab === "harta" ? "bg-sidebar text-white" : "text-muted hover:text-foreground"}`}>Harta</button>
</div>
{tab === "harta" && (
<select
value={selectedFacultyId}
onChange={(event) => setSelectedFacultyId(event.target.value)}
className="rounded-lg border border-border bg-background px-3 py-2 text-sm text-foreground"
>
<option value="">Toate facultatile</option>
<option value="facilities">Facilitati</option>
{facultyFilterOptions.map((facultyId) => (
<option key={facultyId} value={facultyId}>Facultatea {facultyId}</option>
))}
</select>
)}
<button type="button" onClick={() => { setAddForm(emptyForm); setShowAddModal(true); }} className="px-4 py-2 bg-sidebar text-white rounded-lg text-sm font-medium hover:opacity-90">+ Adauga cladire</button>
<button type="button" onClick={() => setTab("locatii")} className={`px-4 py-1.5 text-sm font-medium rounded-lg transition-colors ${tab === "locatii" ? "bg-card text-foreground shadow-sm" : "text-muted hover:text-foreground"}`}>Locații</button>
<button type="button" onClick={() => setTab("harta")} className={`px-4 py-1.5 text-sm font-medium rounded-lg transition-colors ${tab === "harta" ? "bg-card text-foreground shadow-sm" : "text-muted hover:text-foreground"}`}>Hartă</button>
</div>

<button type="button" onClick={() => { setAddForm(emptyForm); setShowAddModal(true); }} className="px-4 py-2 bg-sidebar text-white rounded-lg text-sm font-medium hover:opacity-90">Adaugă Clădire</button>
</div>

{errorMessage && (
Expand All @@ -335,11 +319,11 @@
</div>
)}

<Modal isOpen={showAddModal} onClose={() => setShowAddModal(false)} title="Adauga cladire" className="max-w-lg">
<Modal isOpen={showAddModal} onClose={() => setShowAddModal(false)} title="Adaugă Clădire" className="max-w-lg">
<CladireForm formState={addForm} setFormState={setAddForm} onSave={() => void handleAdd()} onCancel={() => setShowAddModal(false)} />
</Modal>

<Modal isOpen={showEditModal} onClose={() => setShowEditModal(false)} title="Editare cladire" className="max-w-lg">
<Modal isOpen={showEditModal} onClose={() => setShowEditModal(false)} title="Editare Clădire" className="max-w-lg">
<CladireForm formState={editForm} setFormState={setEditForm} onSave={() => void handleEditSave()} onCancel={() => setShowEditModal(false)} />
</Modal>
</div>
Expand Down
4 changes: 2 additions & 2 deletions Frontend/Dashboard/dashboard-insideugal/app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
CardTitle
} from "./components/ui/Card";
import DashboardCalendar from "./components/ui/DashboardCalendar";
import { CalendarPlus, Bell, Megaphone, X } from "lucide-react";

Check warning on line 12 in Frontend/Dashboard/dashboard-insideugal/app/page.tsx

View workflow job for this annotation

GitHub Actions / Frontend Dashboard (22)

'X' is defined but never used

Check warning on line 12 in Frontend/Dashboard/dashboard-insideugal/app/page.tsx

View workflow job for this annotation

GitHub Actions / Frontend Dashboard (22)

'Bell' is defined but never used

// Importăm hook-urile din fișierul tău de API
import { useAnnouncements, useComplaints } from "@/hooks/useDashboardApi";
Expand All @@ -26,8 +26,8 @@
export default function Page() {
const router = useRouter();

const [isNotificationOpen, setIsNotificationOpen] = useState(false);

Check warning on line 29 in Frontend/Dashboard/dashboard-insideugal/app/page.tsx

View workflow job for this annotation

GitHub Actions / Frontend Dashboard (22)

'setIsNotificationOpen' is assigned a value but never used

Check warning on line 29 in Frontend/Dashboard/dashboard-insideugal/app/page.tsx

View workflow job for this annotation

GitHub Actions / Frontend Dashboard (22)

'isNotificationOpen' is assigned a value but never used
const [notificationData, setNotificationData] = useState({

Check warning on line 30 in Frontend/Dashboard/dashboard-insideugal/app/page.tsx

View workflow job for this annotation

GitHub Actions / Frontend Dashboard (22)

'notificationData' is assigned a value but never used
titlu: "",
continut: "",
actiune: "",
Expand Down Expand Up @@ -139,7 +139,7 @@
onClick={() => router.push("/noutati")}
>
<CardHeader className="pb-2">
<CardTitle>Anunțuri Noi</CardTitle>
<CardTitle>Număr Noutăți</CardTitle>
</CardHeader>
<CardContent>
<div className="text-3xl font-bold tracking-tight text-foreground">
Expand All @@ -149,7 +149,7 @@
stats.anunturi
)}
</div>
<p className="mt-1 text-xs text-muted">Noutăți și anunțuri publicate</p>
<p className="mt-1 text-xs text-muted">Noutăți publicate</p>
</CardContent>
</Card>
</section>
Expand Down
Loading
Loading