Refactor ManagementPanel and PeoplePanel to remove unused painted property and streamline card painting logic. Updated paintCard method to use a more concise function for determining card placement.
ci / server (push) Failing after 3m47s
ci / client (push) Successful in 27s

This commit is contained in:
Leonid Pershin
2026-08-20 04:19:43 +03:00
parent 47241a5bd4
commit 36b46774a7
2 changed files with 2 additions and 6 deletions
+1 -3
View File
@@ -63,7 +63,6 @@ export class ManagementPanel {
private cardToken = 0; private cardToken = 0;
private busy = false; private busy = false;
private locate: ((id: string) => string) | null = null; private locate: ((id: string) => string) | null = null;
private painted: PersonCard | null = null;
private poolDialog: ApplicantsDialog | null = null; private poolDialog: ApplicantsDialog | null = null;
private readonly cardHost = new PersonCardHost(); private readonly cardHost = new PersonCardHost();
@@ -402,7 +401,6 @@ export class ManagementPanel {
} }
private paintCard(card: PersonCard | null): void { private paintCard(card: PersonCard | null): void {
this.painted = card;
if (card === null) { if (card === null) {
clear(this.card); clear(this.card);
this.card.append(el('p', { class: 'panel__empty', text: t('staffPickHint') })); this.card.append(el('p', { class: 'panel__empty', text: t('staffPickHint') }));
@@ -413,7 +411,7 @@ export class ManagementPanel {
this.card, this.card,
card, card,
(id) => void this.openRelative(id), (id) => void this.openRelative(id),
this.placeOf(card.id), (id) => this.placeOf(id),
(overview, painted) => { (overview, painted) => {
this.mountPersonTimetable(overview, painted); this.mountPersonTimetable(overview, painted);
this.appendActions(overview, painted.id); this.appendActions(overview, painted.id);
+1 -3
View File
@@ -62,7 +62,6 @@ export class PeoplePanel {
private token = 0; private token = 0;
private cardToken = 0; private cardToken = 0;
private locate: ((id: string) => string) | null = null; private locate: ((id: string) => string) | null = null;
private painted: PersonCard | null = null;
private readonly cardHost = new PersonCardHost(); private readonly cardHost = new PersonCardHost();
constructor(private readonly options: PeoplePanelOptions) { constructor(private readonly options: PeoplePanelOptions) {
@@ -364,7 +363,6 @@ export class PeoplePanel {
} }
private paintCard(card: PersonCard | null): void { private paintCard(card: PersonCard | null): void {
this.painted = card;
if (card === null) { if (card === null) {
clear(this.card); clear(this.card);
this.card.append(el('p', { class: 'panel__empty', text: t('peoplePickHint') })); this.card.append(el('p', { class: 'panel__empty', text: t('peoplePickHint') }));
@@ -375,7 +373,7 @@ export class PeoplePanel {
this.card, this.card,
card, card,
(id) => void this.openCard(id), (id) => void this.openCard(id),
this.placeOf(card.id), (id) => this.placeOf(id),
(overview, painted) => this.mountPersonTimetable(overview, painted), (overview, painted) => this.mountPersonTimetable(overview, painted),
); );
} }