Skip to content

Commit a67fa77

Browse files
committed
Merge remote-tracking branch 'origin/master' into update-edit-project
2 parents 1a5b347 + 79a72aa commit a67fa77

6 files changed

Lines changed: 26 additions & 14 deletions

File tree

projects/skills/src/app/profile/home/profile-home.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
@if(type === 'months') {
1111
<app-month-block [months]="mockMonts" class="profile__month"></app-month-block>
1212
} @else {
13-
<app-trajectory-block class="profile__month"></app-trajectory-block>
13+
<!-- <app-trajectory-block class="profile__month"></app-trajectory-block> -->
1414
}
1515
<app-skills-block class="profile__skills"></app-skills-block>
1616
<app-progress-block></app-progress-block>

projects/skills/src/app/trajectories/track-career/detail/info/info.component.scss

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -227,11 +227,13 @@
227227
&__description {
228228
height: auto;
229229
padding: 18px 25px;
230+
overflow-y: auto;
230231
border: 1px solid var(--grey-button);
231232
border-radius: 15px;
232233

233234
@include responsive.apply-desktop {
234235
height: 235px;
236+
overflow-y: auto;
235237
}
236238
}
237239
}
Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
<!-- @format -->
22

33
<div class="list">
4-
@if (trajectoriesList().length) { @for(trajectory of trajectoriesList(); track $index){
4+
@if (hasItems()) { @if (type() === 'all') { @for (trajectory of trajectoriesList().slice(0, 2);
5+
track $index) {
56
<app-trajectory [trajectory]="trajectory"></app-trajectory>
7+
} } @else if (type() === 'my') {
8+
<app-trajectory [trajectory]="userTrajectory()!"></app-trajectory>
69
} }
710
</div>

projects/skills/src/app/trajectories/track-career/list/list.component.ts

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import {
44
type AfterViewInit,
55
ChangeDetectorRef,
66
Component,
7+
computed,
78
inject,
89
type OnDestroy,
910
type OnInit,
@@ -37,6 +38,7 @@ export class TrajectoriesListComponent implements OnInit, AfterViewInit, OnDestr
3738

3839
totalItemsCount = signal(0);
3940
trajectoriesList = signal<Trajectory[]>([]);
41+
userTrajectory = signal<Trajectory | undefined>(undefined);
4042
trajectoriesPage = signal(1);
4143
perFetchTake = signal(20);
4244

@@ -49,20 +51,17 @@ export class TrajectoriesListComponent implements OnInit, AfterViewInit, OnDestr
4951
* Определяет тип списка (all/my) и загружает начальные данные
5052
*/
5153
ngOnInit(): void {
52-
this.type.set(this.router.url.split("/").slice(-1)[0] as "all" | "my");
54+
const currentType = this.router.url.split("/").pop() as "all" | "my";
55+
this.type.set(currentType);
5356

54-
const routeData$ = this.route.data.pipe(map(r => r["data"]));
55-
56-
const subscription = routeData$.subscribe((trajectories: Trajectory[]) => {
57-
if (this.type() === "all") {
58-
this.trajectoriesList.set(trajectories);
59-
this.totalItemsCount.set(trajectories.length);
57+
this.route.data.pipe(map(r => r["data"])).subscribe(data => {
58+
if (currentType === "all") {
59+
this.trajectoriesList.set(data as Trajectory[]);
60+
this.totalItemsCount.set((data as Trajectory[]).length);
6061
} else {
61-
this.trajectoriesList.set(trajectories);
62+
this.userTrajectory.set(data as Trajectory);
6263
}
6364
});
64-
65-
this.subscriptions$().push(subscription);
6665
}
6766

6867
/**
@@ -130,4 +129,8 @@ export class TrajectoriesListComponent implements OnInit, AfterViewInit, OnDestr
130129
map(res => res)
131130
);
132131
}
132+
133+
hasItems = computed(() => {
134+
return this.type() === "all" ? this.trajectoriesList().length > 0 : !!this.userTrajectory();
135+
});
133136
}

projects/skills/src/app/trajectories/trajectories.service.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ export class TrajectoriesService {
5151
return this.apiService.get<Trajectory[]>(this.TRAJECTORY_URL).pipe(
5252
map(track => {
5353
const choosedTrajctory = track.find(trajectory => trajectory.isActiveForUser === true);
54-
return [choosedTrajctory];
54+
return choosedTrajctory;
5555
})
5656
);
5757
}

projects/social_platform/src/app/office/program/detail/main/main.component.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import {
99
ViewChild,
1010
} from "@angular/core";
1111
import { ProgramService } from "@office/program/services/program.service";
12-
import { ActivatedRoute, Router } from "@angular/router";
12+
import { ActivatedRoute, Router, RouterModule } from "@angular/router";
1313
import {
1414
concatMap,
1515
fromEvent,
@@ -39,6 +39,7 @@ import { ProjectAdditionalService } from "@office/projects/edit/services/project
3939
import { SoonCardComponent } from "@office/shared/soon-card/soon-card.component";
4040
import { NewsFormComponent } from "@office/features/news-form/news-form.component";
4141
import { AsyncPipe } from "@angular/common";
42+
import { AvatarComponent } from "@uilib";
4243

4344
@Component({
4445
selector: "app-main",
@@ -59,6 +60,9 @@ import { AsyncPipe } from "@angular/common";
5960
NewsFormComponent,
6061
ModalComponent,
6162
MatProgressBarModule,
63+
AvatarComponent,
64+
TagComponent,
65+
RouterModule,
6266
],
6367
})
6468
export class ProgramDetailMainComponent implements OnInit, OnDestroy {

0 commit comments

Comments
 (0)