Skip to content

Commit 12b69a5

Browse files
committed
fix routing from program to create project & program registration date
1 parent e4cc13c commit 12b69a5

5 files changed

Lines changed: 20 additions & 4 deletions

File tree

projects/social_platform/src/app/app.config.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import { ReactiveFormsModule } from "@angular/forms";
88
import { BrowserModule } from "@angular/platform-browser";
99
import { GlobalErrorHandlerService } from "@error/services/global-error-handler.service";
1010
import { HTTP_INTERCEPTORS, provideHttpClient, withInterceptorsFromDi } from "@angular/common/http";
11-
import { provideRouter } from "@angular/router";
11+
import { provideRouter, withRouterConfig } from "@angular/router";
1212
import { APP_ROUTES } from "./app.routes";
1313
import {
1414
API_URL,
@@ -56,7 +56,12 @@ export const APP_CONFIG: ApplicationConfig = {
5656
useClass: GlobalErrorHandlerService,
5757
},
5858
provideHttpClient(withInterceptorsFromDi()),
59-
provideRouter(APP_ROUTES),
59+
provideRouter(
60+
APP_ROUTES,
61+
withRouterConfig({
62+
onSameUrlNavigation: "reload",
63+
})
64+
),
6065
provideAnimations(),
6166
],
6267
};

projects/social_platform/src/app/office/program/shared/program-card/program-card.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
!registerDateExpired && (!program.isUserMember || !program.isUserManager)
2222
? "Регистрация до:" + " " + (program.datetimeRegistrationEnds | date: "dd MMMM")
2323
: registerDateExpired
24-
? "программа завершена"
24+
? "регистрация завершена"
2525
: "ты уже участвуешь!"
2626
}}
2727
</p>

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,12 @@ <h3 class="text-bold-body-16">📢 внимание!</h3>
9393
<strong>подсвечены&nbsp;<span>красным</span></strong
9494
>). Если вы пока не знаете что написать, можно сохранить черновик проекта и заполнить поля
9595
позже :&#41;
96+
97+
{{
98+
fromProgram || isProjectAssignToProgram
99+
? 'также проверь вкладку "данные для конкурсов"'
100+
: ""
101+
}}
96102
</p>
97103
<app-button
98104
size="medium"

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,8 @@ export class ProjectEditComponent implements OnInit, AfterViewInit, OnDestroy {
212212
// Id Лидера проекта
213213
leaderId = 0;
214214

215+
fromProgram = "";
216+
215217
// Маркер того является ли проект привязанный к конкурсной программе
216218
isCompetitive = false;
217219
isProjectAssignToProgram = false;
@@ -621,6 +623,7 @@ export class ProjectEditComponent implements OnInit, AfterViewInit, OnDestroy {
621623

622624
const editingStepSub$ = this.route.queryParams.subscribe(params => {
623625
const step = params["editingStep"] as EditStep;
626+
this.fromProgram = params["fromProgram"];
624627
if (step && step !== this.editingStep) {
625628
this.projectStepService.setStepFromRoute(step);
626629
}

projects/social_platform/src/app/office/projects/services/projects.service.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,9 @@ export class ProjectsService {
1919
});
2020

2121
this.router
22-
.navigateByUrl(`/office/projects/${project.id}/edit?editingStep=main`)
22+
.navigate([`/office/projects/${project.id}/edit`], {
23+
queryParams: { editingStep: "main", fromProgram: true },
24+
})
2325
.then(() => console.debug("Route change from ProjectsComponent"));
2426
});
2527
}

0 commit comments

Comments
 (0)