Skip to content

Commit ab679cf

Browse files
committed
merge resolved conflicts between branches & fix some components instead
2 parents 33169aa + c6c8fa5 commit ab679cf

102 files changed

Lines changed: 1642 additions & 502 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

projects/core/src/consts/lists/education-info-list.const.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,4 +44,9 @@ export const educationUserLevel = [
4444
value: "Высшее образование – аспирантура",
4545
label: "высшее образование – аспирантура",
4646
},
47+
// {
48+
// id: 5,
49+
// value: "Дополнительное профессиональное образования",
50+
// label: "дополнительное профессиональное образования"
51+
// },
4752
];
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
/** @format */
2+
3+
import { Injectable } from "@angular/core";
4+
5+
@Injectable({
6+
providedIn: "root",
7+
})
8+
export class AnalyticsService {
9+
private loaded = false;
10+
11+
loadAnalytics(): void {
12+
if (this.loaded) return;
13+
if (window.location.hostname !== "app.procollab.ru") return;
14+
15+
this.loaded = true;
16+
this.loadYandexMetrika();
17+
this.loadMailRuCounter("3622531");
18+
19+
if (window.location.href === "https://app.procollab.ru/auth/register") {
20+
this.loadMailRuCounter("3543687");
21+
}
22+
}
23+
24+
private loadYandexMetrika(): void {
25+
const w = window as any;
26+
w.ym =
27+
w.ym ||
28+
function (...args: any[]) {
29+
(w.ym.a = w.ym.a || []).push(args);
30+
};
31+
w.ym.l = new Date().getTime();
32+
33+
const script = document.createElement("script");
34+
script.async = true;
35+
script.src = "https://cdn.jsdelivr.net/npm/yandex-metrica-watch/tag.js";
36+
document.head.appendChild(script);
37+
38+
w.ym(91871365, "init", {
39+
clickmap: true,
40+
trackLinks: true,
41+
accurateTrackBounce: true,
42+
webvisor: true,
43+
trackHash: true,
44+
});
45+
}
46+
47+
private loadMailRuCounter(id: string): void {
48+
const w = window as any;
49+
const tmr = (w._tmr = w._tmr || []);
50+
tmr.push({ id, type: "pageView", start: new Date().getTime() });
51+
52+
if (document.getElementById("tmr-code")) return;
53+
54+
const script = document.createElement("script");
55+
script.type = "text/javascript";
56+
script.async = true;
57+
script.id = "tmr-code";
58+
script.src = "https://top-fwz1.mail.ru/js/code.js";
59+
document.head.appendChild(script);
60+
}
61+
}

projects/social_platform/src/app/api/auth/facades/auth-register.service.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,4 +73,11 @@ export class AuthRegisterService {
7373
)
7474
.subscribe(state => this.register$.set(state));
7575
}
76+
77+
downloadPolicy(): void {
78+
const link = document.createElement("a");
79+
link.href = "/assets/downloads/auth/shared/privacy_policy_2022.docx";
80+
link.download = "Политика обработки персональных данных 2022.docx";
81+
link.click();
82+
}
7683
}

projects/social_platform/src/app/api/courses/facades/lesson-info.service.ts

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,19 @@ export class LessonInfoService {
3333
this.lessonUIInfoService.answerBody.set(value);
3434
}
3535

36+
onSelectTask(task: Task): void {
37+
if (!this.lessonUIInfoService.isClickable(task)) return;
38+
39+
this.lessonUIInfoService.currentTaskId.set(task.id);
40+
this.lessonUIInfoService.answerBody.set(null);
41+
this.lessonUIInfoService.success.set(false);
42+
this.lessonUIInfoService.hasError.set(false);
43+
44+
if (this.lessonUIInfoService.isComplete()) {
45+
this.router.navigate(["./"], { relativeTo: this.route });
46+
}
47+
}
48+
3649
onSubmitAnswer(): void {
3750
const task = this.lessonUIInfoService.currentTask();
3851
if (!task) return;
@@ -86,6 +99,7 @@ export class LessonInfoService {
8699

87100
if (nextId) {
88101
this.lessonUIInfoService.currentTaskId.set(nextId);
102+
this.lessonUIInfoService.activeTaskId.set(nextId);
89103
this.lessonUIInfoService.success.set(false);
90104
this.lessonUIInfoService.answerBody.set(null);
91105
} else {
@@ -132,6 +146,7 @@ export class LessonInfoService {
132146

133147
if (onResultsPage && !allCompleted) {
134148
this.lessonUIInfoService.currentTaskId.set(nextTaskId);
149+
this.lessonUIInfoService.activeTaskId.set(nextTaskId);
135150
setTimeout(() => {
136151
this.lessonUIInfoService.loading.set(false);
137152
this.router.navigate(["./"], { relativeTo: this.route });
@@ -143,6 +158,7 @@ export class LessonInfoService {
143158
}, 500);
144159
} else {
145160
this.lessonUIInfoService.currentTaskId.set(nextTaskId);
161+
this.lessonUIInfoService.activeTaskId.set(nextTaskId);
146162
setTimeout(() => this.lessonUIInfoService.loading.set(false), 500);
147163
}
148164
},

projects/social_platform/src/app/api/courses/facades/ui/lesson-ui-info.service.ts

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
/** @format */
22

3-
import { computed, Injectable, signal } from "@angular/core";
3+
import { computed, inject, Injectable, signal } from "@angular/core";
44
import { CourseLesson, Task } from "@domain/courses/courses.model";
55
import { AsyncState, initial, isSuccess } from "@domain/shared/async-state";
6+
import { CourseDetailUIInfoService } from "./course-detail-ui-info.service";
67

78
@Injectable()
89
export class LessonUIInfoService {
10+
private readonly courseDetailUIInfoService = inject(CourseDetailUIInfoService);
911
readonly lesson$ = signal<AsyncState<CourseLesson>>(initial());
1012
readonly submitAnswer$ = signal<AsyncState<void>>(initial());
1113

@@ -16,6 +18,7 @@ export class LessonUIInfoService {
1618

1719
readonly isComplete = signal<boolean>(false);
1820
readonly currentTaskId = signal<number | null>(null);
21+
readonly activeTaskId = signal<number | null>(null);
1922

2023
/** Transition loading — управляется фасадом вручную (с setTimeout delay) */
2124
readonly loading = signal(false);
@@ -65,4 +68,25 @@ export class LessonUIInfoService {
6568
isDone(task: Task): boolean {
6669
return task.isCompleted || this.completedTaskIds().has(task.id);
6770
}
71+
72+
readonly isViewingCompleted = computed(() => {
73+
const task = this.currentTask();
74+
return task ? this.isDone(task) : false;
75+
});
76+
77+
isClickable(task: Task): boolean {
78+
return this.isDone(task) || task.id === this.activeTaskId();
79+
}
80+
81+
readonly lessonOrder = computed<number | null>(() => {
82+
const lesson = this.lessonInfo();
83+
const structure = this.courseDetailUIInfoService.courseStructure();
84+
if (!lesson || !structure) return null;
85+
86+
for (const mod of structure.modules) {
87+
const found = mod.lessons.find(l => l.id === lesson.id);
88+
if (found) return found.order;
89+
}
90+
return null;
91+
});
6892
}

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,4 @@
77
>
88
</mat-progress-bar>
99
<router-outlet></router-outlet>
10+
<app-cookie-consent></app-cookie-consent>

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@ import {
1515
} from "rxjs";
1616
import { MatProgressBarModule } from "@angular/material/progress-bar";
1717
import { AsyncPipe, NgIf } from "@angular/common";
18-
import { TokenService } from "@corelib";
18+
import { LoggerService, TokenService } from "@corelib";
19+
import { CookieConsentComponent } from "@ui/widgets/cookie-consent/cookie-consent.component";
20+
import { AuthRepositoryPort } from "@domain/auth/ports/auth.repository.port";
1921
import { LoadingService } from "@ui/services/loading/loading.service";
20-
import { LoggerService } from "@core/lib/services/logger/logger.service";
2122
import { takeUntilDestroyed } from "@angular/core/rxjs-interop";
22-
import { AuthRepositoryPort } from "@domain/auth/ports/auth.repository.port";
2323
import { AppRoutes } from "@api/paths/app-routes";
2424

2525
/**
@@ -33,7 +33,7 @@ import { AppRoutes } from "@api/paths/app-routes";
3333
templateUrl: "./app.component.html",
3434
styleUrls: ["./app.component.scss"],
3535
standalone: true,
36-
imports: [NgIf, MatProgressBarModule, RouterOutlet, AsyncPipe],
36+
imports: [NgIf, MatProgressBarModule, RouterOutlet, AsyncPipe, CookieConsentComponent],
3737
changeDetection: ChangeDetectionStrategy.OnPush,
3838
})
3939
export class AppComponent implements OnInit {

projects/social_platform/src/app/domain/program/program.model.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ export class Program {
5959
isUserMember!: boolean;
6060
publishProjectsAfterFinish!: boolean;
6161
courseId!: number | null;
62+
courses!: { id: number; title: string; isAvailable: boolean }[];
6263

6364
static default(): Program {
6465
return {
@@ -88,6 +89,7 @@ export class Program {
8889
isUserManager: false,
8990
publishProjectsAfterFinish: false,
9091
courseId: null,
92+
courses: [],
9193
};
9294
}
9395
}

projects/social_platform/src/app/domain/vacancy/ports/vacancy.repository.port.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ export abstract class VacancyRepositoryPort {
2020
salary?: string,
2121
searchValue?: string
2222
): Observable<Vacancy[]>;
23+
2324
abstract getMyVacancies(limit: number, offset: number): Observable<VacancyResponse[]>;
2425
abstract getOne(vacancyId: number): Observable<Vacancy>;
2526
abstract postVacancy(projectId: number, vacancy: CreateVacancyDto): Observable<Vacancy>;

projects/social_platform/src/app/ui/pages/auth/register/register.component.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -273,8 +273,8 @@
273273
<app-checkbox [(checked)]="registerAgreement"></app-checkbox>
274274
<span (click)="registerAgreement.set(!registerAgreement())">
275275
я прочитал соглашение и даю согласие на
276-
<a href="/assets/downloads/auth/shared/Политика_обработки_перс_данных_2022.docx" download
277-
>обработку персональных данных</a
276+
<span class="register__policy-link" (click)="downloadPolicy($event)"
277+
>обработку персональных данных</span
278278
>
279279
</span>
280280
</div>

0 commit comments

Comments
 (0)