Обходной лист (#7)
Tests / frontend-test (push) Successful in 1m16s

Co-authored-by: gorbenko.pavel <gorbenko.pavel@tansu.kz>
Reviewed-on: http://git.tnsu.kz/timur.gorodetskiy/request-portal/pulls/7
This commit was merged in pull request #7.
This commit is contained in:
2026-08-17 05:43:38 +00:00
parent a937e33f2e
commit 364835eaf7
47 changed files with 1962 additions and 359 deletions
@@ -13,10 +13,13 @@ import RequestPortal from './components/RequestPortal';
import { IRequestPortalProps } from './components/IRequestPortalProps';
import { initSP } from './shared/pnp/pnpjs';
import { installErrorLogging } from './shared/diagnostics';
import { setImpersonatedEmail } from './shared/impersonation';
import { ErrorOverlay } from './shared/ui';
export interface IRequestPortalWebPartProps {
description: string;
/** Отладочная подмена личности — см. shared/impersonation.ts. На бою пусто. */
debugUserEmail: string;
}
export default class RequestPortalWebPart extends BaseClientSideWebPart<IRequestPortalWebPartProps> {
@@ -25,6 +28,10 @@ export default class RequestPortalWebPart extends BaseClientSideWebPart<IRequest
private _environmentMessage: string = '';
public render(): void {
// Именно здесь, а не в onInit: свойство меняется в панели без перезапуска
// веб-части, и render вызывается на каждое такое изменение.
setImpersonatedEmail(this.properties.debugUserEmail);
const element: React.ReactElement = React.createElement(
ErrorOverlay,
undefined,
@@ -117,6 +124,11 @@ export default class RequestPortalWebPart extends BaseClientSideWebPart<IRequest
groupFields: [
PropertyPaneTextField('description', {
label: strings.DescriptionFieldLabel
}),
PropertyPaneTextField('debugUserEmail', {
label: strings.DebugUserEmailFieldLabel,
description: strings.DebugUserEmailFieldDescription,
placeholder: 'employee@tnsu.kz'
})
]
}