Архивация списков (#9)
Tests / frontend-test (push) Successful in 1m12s

Co-authored-by: gorbenko.pavel <gorbenko.pavel@tansu.kz>
Reviewed-on: http://git.tnsu.kz/timur.gorodetskiy/request-portal/pulls/9
This commit was merged in pull request #9.
This commit is contained in:
2026-08-19 09:07:53 +00:00
parent 3a71d0df1f
commit 6f789f8f1c
67 changed files with 2617 additions and 901 deletions
@@ -2,6 +2,7 @@ import * as React from 'react';
import type { WebPartContext } from '@microsoft/sp-webpart-base';
import styles from './ApproveFeature.module.scss';
import { getViewComponent } from '../../forms/viewRegistry';
import { isConfirmedStaleListId } from '../../shared/approval';
export interface IApproveFeatureProps {
context: WebPartContext;
@@ -9,18 +10,29 @@ export interface IApproveFeatureProps {
formKey: string;
/** RowID заявки из URL. */
itemId: number;
/** Партиция, где лежит заявка (см. IRoute.listId) — не задана у ссылок старого формата. */
listId?: string;
}
// Фича «Согласование»: открывается по ссылке из потока (mode=approve&type=&id=).
// Показывает заявку в режиме чтения; панель решения добавим следующим шагом.
const ApproveFeature: React.FC<IApproveFeatureProps> = ({ context, formKey, itemId }) => {
const ApproveFeature: React.FC<IApproveFeatureProps> = ({ context, formKey, itemId, listId }) => {
const ViewComponent = getViewComponent(formKey);
// Партиция указана и реестр ТОЧНО знает, что её там нет — см. тот же
// комментарий в EditFeature (isConfirmedStaleListId).
const partitionError =
listId && isConfirmedStaleListId(formKey, listId)
? `Не удалось открыть заявку: список «${listId}» не найден в реестре партиций. Ссылка могла устареть — попробуйте открыть заявку заново из списка.`
: undefined;
return (
<div className={styles.content}>
{ViewComponent ? (
{partitionError ? (
<div className={styles.state}>{partitionError}</div>
) : ViewComponent ? (
<React.Suspense fallback={<div className={styles.state}>Загрузка…</div>}>
<ViewComponent context={context} itemId={itemId} formKey={formKey} />
<ViewComponent context={context} itemId={itemId} formKey={formKey} listId={listId} />
</React.Suspense>
) : (
<div className={styles.state}>Для формы «{formKey}» режим согласования пока не настроен.</div>