Skip to content

Commit 1500aa2

Browse files
committed
fix naming of program add program & modal logic from edit project
1 parent 12969e0 commit 1500aa2

2 files changed

Lines changed: 14 additions & 6 deletions

File tree

projects/social_platform/src/app/office/features/detail/detail.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@
9292
(click)="isProjectAssigned ? null : addNewProject()"
9393
customTypographyClass="text-body-12 bar__add-project"
9494
>
95-
<span>{{ isProjectAssigned ? "вы подали проект" : "подать проект" }}</span>
95+
<span>{{ isProjectAssigned ? "вы подали проект" : "создать заявку" }}</span>
9696
<i appIcon icon="plus" appSquare="10"></i>
9797
</app-button>
9898
} @if ((isUserManager || isUserExpert) && isUserMember) {

projects/social_platform/src/app/office/projects/edit/edit.component.ts

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -484,21 +484,29 @@ export class ProjectEditComponent implements OnInit, AfterViewInit, OnDestroy {
484484
this.isAssignProjectToProgramModalOpen.set(false);
485485
}
486486

487-
private getFromProgramSeenKey(): string {
488-
return `project_fromProgram_modal_seen_${this.profileId}`;
487+
private getFromProgramSeenKey(type: "program" | "project"): string {
488+
if (type === "program") {
489+
return `project_fromProgram_modal_seen_${this.profileId}`;
490+
} else return `project_modal_seen_${this.profileId}`;
489491
}
490492

491493
private hasSeenFromProgramModal(): boolean {
492494
try {
493-
return !!localStorage.getItem(this.getFromProgramSeenKey());
495+
if (this.fromProgram) {
496+
return !!localStorage.getItem(this.getFromProgramSeenKey("program"));
497+
}
498+
return !!localStorage.getItem(this.getFromProgramSeenKey("project"));
494499
} catch (e) {
495500
return false;
496501
}
497502
}
498503

499504
private markSeenFromProgramModal(): void {
500505
try {
501-
localStorage.setItem(this.getFromProgramSeenKey(), "1");
506+
if (this.fromProgram) {
507+
localStorage.setItem(this.getFromProgramSeenKey("program"), "1");
508+
}
509+
localStorage.setItem(this.getFromProgramSeenKey("project"), "1");
502510
} catch (e) {}
503511
}
504512

@@ -679,7 +687,7 @@ export class ProjectEditComponent implements OnInit, AfterViewInit, OnDestroy {
679687
this.fromProgram = params["fromProgram"];
680688

681689
const seen = this.hasSeenFromProgramModal();
682-
if (this.fromProgram && !seen) {
690+
if (!seen) {
683691
this.fromProgramOpen.set(true);
684692
this.markSeenFromProgramModal();
685693
} else {

0 commit comments

Comments
 (0)