{ "ListFormCode": "App.DeveloperKit.CustomComponents", "KeyFieldName": "Id", "GeneratedAt": "2026-10-04T15:00:00Z", "Order": 0, "Rows": [ { "Id": "3b7b16c6-aa96-5765-8e19-fe5e727feb52", "Name": "TeamLeaveWidget", "RoutePath": null, "Description": "Intranet panosu: departman müdürünün onayını bekleyen izin talepleri ve bugün izinde olanlar", "IsActive": true, "Dependencies": [], "Code": "// Departman muduru icin ekibin izin ozeti. Satirlar ekranin kendi sorgusundan gelir: liste\n// yalniz muduru oldugu departmanin taleplerini dondurur (ManagerIds suzmesi ListForm'da).\nconst REQUESTS = 'App.Hr.TeamLeaveRequest'\nconst MANAGER_STEP = 'Müdür Onayı'\nconst APPROVED = 'Onaylandı'\n\nconst loadRows = async (listFormCode) => {\n const response = await apiService.fetchData({\n method: 'GET',\n url: '/api/app/list-form-select/select',\n params: { listFormCode, take: 500 },\n })\n return response.data?.data ?? []\n}\n\nconst formatDays = (value) => {\n const number = Number(value ?? 0)\n return Number.isInteger(number) ? String(number) : number.toFixed(1)\n}\n\nconst formatDate = (value) => {\n if (!value) return '-'\n const [year, month, day] = String(value).slice(0, 10).split('-')\n return `${day}.${month}.${year}`\n}\n\nconst Stat = ({ label, value, className }) => (\n
\n
{value}
\n
{label}
\n
\n)\n\nconst TeamLeaveWidget = () => {\n const [rows, setRows] = useState([])\n const [loading, setLoading] = useState(true)\n\n useEffect(() => {\n let active = true\n loadRows(REQUESTS)\n .then((result) => active && setRows(result))\n .catch(() => {})\n .finally(() => active && setLoading(false))\n return () => {\n active = false\n }\n }, [])\n\n const today = new Date().toISOString().slice(0, 10)\n const awaiting = rows\n .filter((row) => row.ApprovalStatus === MANAGER_STEP)\n .sort((a, b) => String(a.StartDate).localeCompare(String(b.StartDate)))\n const onLeave = rows.filter(\n (row) =>\n row.ApprovalStatus === APPROVED &&\n String(row.StartDate).slice(0, 10) <= today &&\n String(row.EndDate).slice(0, 10) >= today,\n )\n\n return (\n
\n
\n \n

\n {translate('::App.DashboardWidget.TeamLeave')}\n

\n
\n
\n {loading ? (\n
...
\n ) : (\n <>\n
\n \n \n
\n {awaiting.length === 0 ? (\n
\n {translate('::App.DashboardWidget.Leave.NoPending')}\n
\n ) : (\n \n )}\n \n )}\n
\n \n {translate('::App.DashboardWidget.Leave.OpenApprovals')} →\n \n
\n
\n
\n )\n}\n\nexport default TeamLeaveWidget\n", "Props": null, "DataSources": [], "SeoTitle": null, "SeoDescription": null, "SeoKeywords": null, "SeoOgImage": null, "SeoCanonicalUrl": null, "SeoNoIndex": true, "SeoIncludeInSitemap": false, "SeoChangeFrequency": null, "SeoPriority": null, "SeoStructuredData": null } ] }