+ Регламенты отдела +
++ Документы, требующие ознакомления сотрудников отдела. +
+Документы
++ {activeSection === "regulations" ? "Регламенты" : "Документы"} +
+ Требование ознакомления +
+ {([ + { + key: "all" as const, + label: "Все отделы", + unread: unreadRegulationCount, + }, + ...(companyRegulationCount > 0 + ? [{ + key: "company" as const, + label: "Вся компания", + unread: unreadCompanyRegulationCount, + }] + : []), + ] as Array<{ + key: "all" | "company"; + label: string; + unread?: number; + }>).map((option) => ( ++ Отделов с регламентами нет +
+ )} +
{activeSection === "regulations"
- ? `${filteredDocuments.length} регл.`
+ ? (
+ <>
+ {visibleRegulationDepartments.length > 0
+ ? `${visibleRegulationDepartments.length} отд.`
+ : ""}
+ {visibleRegulationDepartments.length > 0 && filteredDocuments.length > 0
+ ? " · "
+ : ""}
+ {filteredDocuments.length > 0 ? `${filteredDocuments.length} регл.` : ""}
+ {unreadRegulationCount > 0
+ ? ` · ${unreadRegulationCount} нов.`
+ : ""}
+ {unreadPersonalRegulationCount > 0
+ ? ` (${unreadPersonalRegulationCount} лично)`
+ : ""}
+ >
+ )
: (
<>
{visibleFolders.length > 0 ? `${visibleFolders.length} пап.` : ""}
@@ -1239,6 +1502,52 @@ function DocumentsPageContent() {
);
})}
+ {/* Regulation Department Cards */}
+ {visibleRegulationDepartments.map(({ department, regulationCount, unreadCount }) => {
+ const source = `department:${department.id}` as RegulationSourceFilter;
+
+ return (
+
+ {regulationScope}
+
+ {regulationScope}
+
{timestamp ? formatDistanceToNow(new Date(timestamp), {
addSuffix: true,
@@ -295,6 +302,7 @@ export function NotificationPanel({ onClose }: { onClose?: () => void }) {
const timestamp = getNotificationTimestamp(notification);
const title = getNotificationTitle(notification);
const message = getNotificationMessage(notification);
+ const regulationScope = getRegulationNotificationScopeLabel(notification);
return (
{message}
+ {regulationScope}
+
{timestamp ? formatDistanceToNow(new Date(timestamp), { addSuffix: true, locale: ru }) : 'Только что'}
{isAcknowledgement
? "Выберите сотрудников, которые должны подтвердить ознакомление."
- : "Выберите сотрудников, которые смогут открыть документ."}
+ : `Выберите сотрудников, которые смогут открыть ${resourceAccusative}.`}
{doc.title}
{title}
- {isAcknowledgement ? "Требование ознакомления" : "Доступ к документу"}
+ {isAcknowledgement ? "Требование ознакомления" : `Доступ к ${resourceDative}`}