diff --git a/src/webparts/requestPortal/forms/ServiceRequest/approval/provisioning.json b/src/webparts/requestPortal/forms/ServiceRequest/approval/provisioning.json index 18bb7b5..eafb929 100644 --- a/src/webparts/requestPortal/forms/ServiceRequest/approval/provisioning.json +++ b/src/webparts/requestPortal/forms/ServiceRequest/approval/provisioning.json @@ -9,6 +9,8 @@ { "internalName": "StepOrder", "title": "Порядок", "type": "Number" }, { "internalName": "AllowReassignToOtherApprovers", "title": "Можно перепоручать", "type": "Boolean" }, { "internalName": "Phase", "title": "Фаза", "type": "Choice", "choices": ["Согласование", "Исполнение"] }, + { "internalName": "SLAhours", "title": "SLA, часов", "type": "Number" }, + { "internalName": "AskOverdueReason", "title": "Опрос причины просрочки", "type": "Boolean" }, { "internalName": "DelegatedBy", "title": "Кем переназначено", "type": "User", "userSelectionMode": "PeopleOnly" } ] } diff --git a/src/webparts/requestPortal/forms/TmcTransfer/approval/provisioning.json b/src/webparts/requestPortal/forms/TmcTransfer/approval/provisioning.json index 2ad169b..3ebe166 100644 --- a/src/webparts/requestPortal/forms/TmcTransfer/approval/provisioning.json +++ b/src/webparts/requestPortal/forms/TmcTransfer/approval/provisioning.json @@ -9,6 +9,8 @@ { "internalName": "StepOrder", "title": "Порядок", "type": "Number" }, { "internalName": "AllowReassignToOtherApprovers", "title": "Можно перепоручать", "type": "Boolean" }, { "internalName": "Phase", "title": "Фаза", "type": "Choice", "choices": ["Согласование", "Исполнение"] }, + { "internalName": "SLAhours", "title": "SLA, часов", "type": "Number" }, + { "internalName": "AskOverdueReason", "title": "Опрос причины просрочки", "type": "Boolean" }, { "internalName": "DelegatedBy", "title": "Кем переназначено", "type": "User", "userSelectionMode": "PeopleOnly" } ] } diff --git a/src/webparts/requestPortal/shared/approval/useMatrixEditor.ts b/src/webparts/requestPortal/shared/approval/useMatrixEditor.ts index 46c5b87..9d516a2 100644 --- a/src/webparts/requestPortal/shared/approval/useMatrixEditor.ts +++ b/src/webparts/requestPortal/shared/approval/useMatrixEditor.ts @@ -1,4 +1,5 @@ import { useState, useEffect } from 'react'; +import { friendlyErrorMessage } from '../diagnostics'; import { IMatrixRow } from './models/IMatrixRow'; import { ISiteUser } from './models/ISiteUser'; @@ -175,7 +176,11 @@ export function useMatrixEditor( }) .catch((err: Error) => { if (!active) return; - setError(err.message); + // Через friendlyErrorMessage, а не err.message: PnPjs кладёт в message + // тело ответа SharePoint целиком, и кириллица в нём остаётся + // \u-escape-последовательностями — пользователь видел «Поле или + // свойство…» набором «Поле». + setError(friendlyErrorMessage(err)); setLoading(false); }); return () => { diff --git a/src/webparts/requestPortal/shared/approval/useRequestTypeId.ts b/src/webparts/requestPortal/shared/approval/useRequestTypeId.ts index 6880679..940b20e 100644 --- a/src/webparts/requestPortal/shared/approval/useRequestTypeId.ts +++ b/src/webparts/requestPortal/shared/approval/useRequestTypeId.ts @@ -1,5 +1,6 @@ import { useEffect, useState } from 'react'; import type { WebPartContext } from '@microsoft/sp-webpart-base'; +import { friendlyErrorMessage } from '../diagnostics'; import { getRequestTypeIdByPageUrl } from './approvalRoute.service'; export interface IRequestTypeIdState { @@ -33,7 +34,9 @@ export function useRequestTypeId(context: WebPartContext, pageUrl: string): IReq }) .catch((e: Error) => { if (alive) { - setError(e.message); + // См. useMatrixEditor: сырой message от PnPjs/SharePoint показывает + // кириллицу \u-escape-последовательностями. + setError(friendlyErrorMessage(e)); setLoading(false); } });