Skip to content

Commit 0856626

Browse files
committed
change avatar issue for skip registration, fix open vacancy component, feed routes, service
1 parent 7eeb5b0 commit 0856626

9 files changed

Lines changed: 66 additions & 35 deletions

File tree

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

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
class="info__avatar"
2424
(click)="redirectDetailInfo()"
2525
[class.info__avatar--program]="listType === 'program'"
26+
[style.width]="listType === 'project' || listType === 'profile' ? '110px' : '123px'"
2627
>
2728
@if (chatService.userOnlineStatusCache | async; as cache) {
2829
<app-avatar
@@ -37,7 +38,11 @@
3738
[isOnline]="cache[info().id] !== undefined ? cache[info().id] : info().isOnline"
3839
></app-avatar>
3940
@if (listType === 'project' || listType === 'profile') {
40-
<h1 class="info__title text-body-12">
41+
<h1
42+
class="info__title text-body-12"
43+
[style.width]="listType === 'project' || listType === 'profile' ? '300px' : '100%'"
44+
[class.info__title--project]="listType === 'project' || listType === 'profile'"
45+
>
4146
{{
4247
listType === "project"
4348
? info().name
@@ -252,18 +257,18 @@ <h1 class="info__title text-body-12">
252257
</ng-template>
253258

254259
<ng-template #projectTpl>
255-
@if (!isInProject && profile?.userType !== 1) { @if (info().presentationAddress) {
260+
@if (isInProject) {
261+
<app-button appearance="outline" size="medium" customTypographyClass="text-body-12">
262+
рабочая зона
263+
</app-button>
264+
} @else {
256265
<a class="info__presentation" [href]="info().presentationAddress" target="_blank">
257266
<app-button appearance="outline" size="medium" customTypographyClass="text-body-12">
258267
<span>презентация</span>
259268
<i appIcon icon="arrow-down" appSquare="6"></i>
260269
</app-button>
261270
</a>
262-
} } @else {
263-
<app-button appearance="outline" size="medium" customTypographyClass="text-body-12">
264-
рабочая зона
265-
</app-button>
266-
} @if (profile) { @if (!isInProject) {
271+
} @if (!isInProject) {
267272
<app-button
268273
[disabled]="true"
269274
style="opacity: 0.5"
@@ -283,7 +288,7 @@ <h1 class="info__title text-body-12">
283288
>
284289
чат проекта
285290
</app-button>
286-
} }
291+
}
287292

288293
<div class="info__divider"></div>
289294

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,10 @@ $detail-bar-mb: 12px;
101101
color: var(--black);
102102
text-align: center;
103103
text-overflow: ellipsis;
104+
105+
&--project {
106+
transform: translateX(-31%);
107+
}
104108
}
105109

106110
&__text {

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

Lines changed: 20 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -331,12 +331,13 @@ export class DeatilComponent implements OnInit, OnDestroy {
331331
}
332332
});
333333

334+
this.isInProfileInfo();
335+
334336
this.subscriptions.push(projectSub$);
335337
} else if (this.listType === "program") {
336338
const program$ = this.programDataService.program$
337339
.pipe(
338340
filter(program => !!program),
339-
340341
tap(program => {
341342
if (program) {
342343
this.info.set(program);
@@ -369,17 +370,7 @@ export class DeatilComponent implements OnInit, OnDestroy {
369370
},
370371
});
371372

372-
const profileInfoSub$ = this.authService.profile.subscribe({
373-
next: profile => {
374-
this.profile = profile;
375-
376-
if (this.info()) {
377-
this.isInProject = this.info()
378-
?.collaborators.map((person: Collaborator) => person.userId)
379-
.includes(profile.id);
380-
}
381-
},
382-
});
373+
this.isInProfileInfo();
383374

384375
const profileIdDataSub$ = this.profileDataService
385376
.getProfileId()
@@ -394,10 +385,26 @@ export class DeatilComponent implements OnInit, OnDestroy {
394385
this.isSubscriptionActive.set(r.isSubscribed);
395386
});
396387

397-
this.subscriptions.push(profileDataSub$, profileIdDataSub$, profileInfoSub$);
388+
this.subscriptions.push(profileDataSub$, profileIdDataSub$);
398389
}
399390
}
400391

392+
private isInProfileInfo(): void {
393+
const profileInfoSub$ = this.authService.profile.subscribe({
394+
next: profile => {
395+
this.profile = profile;
396+
397+
if (this.info()) {
398+
this.isInProject = this.info()
399+
?.collaborators.map((person: Collaborator) => person.userId)
400+
.includes(profile.id);
401+
}
402+
},
403+
});
404+
405+
this.subscriptions.push(profileInfoSub$);
406+
}
407+
401408
/**
402409
* Инициализация строки для back компонента в зависимости от типа данных
403410
*/

projects/social_platform/src/app/office/feed/feed.resolver.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,6 @@ export const FeedResolver: ResolveFn<ApiPagination<FeedItem>> = route => {
2929
return feedService.getFeed(
3030
0,
3131
20,
32-
route.queryParams["includes"] ?? ["vacancy", "news", "project"]
32+
route.queryParams["includes"] ?? ["vacancy", "news", "projects"]
3333
);
3434
};

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ export class FeedService {
7070
// Обработка различных форматов параметра type
7171
if (type.length === 0) {
7272
// Если фильтры не выбраны, загружаем все типы по умолчанию
73-
reqType = ["vacancy", "news", "project"].join(this.FILTER_SPLIT_SYMBOL);
73+
reqType = ["vacancy", "news", "projects"].join(this.FILTER_SPLIT_SYMBOL);
7474
} else if (Array.isArray(type)) {
7575
// Если передан массив типов, объединяем их через разделитель
7676
reqType = type.join(this.FILTER_SPLIT_SYMBOL);

projects/social_platform/src/app/office/feed/shared/open-vacancy/open-vacancy.component.html

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,25 @@
11
<!-- @format -->
22

3+
@if (feedItem) {
34
<div class="card">
4-
<a class="card__head head" [routerLink]="['/office/projects', feedItem.project.id]">
5-
<img class="head__avatar" [src]="feedItem.project.imageAddress" alt="newsItem.name" />
5+
<a class="card__head head" [routerLink]="['/office/projects', feedItem.project?.id]">
6+
<img class="head__avatar" [src]="feedItem.project?.imageAddress" alt="newsItem.name" />
67
<div>
7-
<div class="head__name">{{ feedItem.project.name }}</div>
8+
<div class="head__name">{{ feedItem.project?.name }}</div>
89
<div class="head__date text-body-14">
910
{{ feedItem.datetimeCreated | dayjs: "format":"DD MMMM YYYY, HH:mm" }}
1011
</div>
1112
</div>
1213
</a>
1314
<h3 class="card__title">
1415
<span>Тебя ищут в проект</span>
15-
<a [routerLink]="['/office/projects', feedItem.project.id]" class="card__project">{{
16-
feedItem.project.name
16+
<a [routerLink]="['/office/projects', feedItem.project?.id]" class="card__project">{{
17+
feedItem.project?.name
1718
}}</a>
1819
</h3>
1920

2021
<div class="card__skills skills">
21-
@if (feedItem.requiredSkills.length; as skillsLength) {
22+
@if (feedItem.requiredSkills?.length; as skillsLength) {
2223
<div class="skills__title">Необходимые навыки</div>
2324
@if (feedItem.requiredSkills; as requiredSkills) { @if (requiredSkills) {
2425
<ul class="skills__list">
@@ -69,3 +70,4 @@ <h3 class="card__title">
6970
>
7071
</div>
7172
</div>
73+
}

projects/social_platform/src/app/office/office.routes.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ export const OFFICE_ROUTES: Routes = [
3434
{
3535
path: "",
3636
pathMatch: "full",
37-
redirectTo: "projects",
37+
redirectTo: "feed",
3838
},
3939
{
4040
path: "feed",

projects/social_platform/src/app/office/onboarding/stage-zero/stage-zero.component.ts

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -733,7 +733,23 @@ export class OnboardingStageZeroComponent implements OnInit, OnDestroy {
733733
return;
734734
}
735735

736-
this.completeRegistration(3);
736+
const onboardingSkipInfo = {
737+
avatar: this.stageForm.get("avatar")?.value,
738+
city: this.stageForm.get("city")?.value,
739+
};
740+
741+
this.skipSubmitting.set(true);
742+
this.authService
743+
.saveProfile(onboardingSkipInfo)
744+
.pipe(concatMap(() => this.authService.setOnboardingStage(3)))
745+
.subscribe({
746+
next: () => this.completeRegistration(3),
747+
error: error => {
748+
this.skipSubmitting.set(false);
749+
this.isModalErrorYear.set(true);
750+
this.isModalErrorYearText.set(error.error?.message || "Ошибка сохранения");
751+
},
752+
});
737753
}
738754

739755
onSubmit(): void {

projects/social_platform/src/app/office/projects/edit/shared/project-main-step/project-main-step.component.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -97,10 +97,7 @@ export class ProjectMainStepComponent implements OnInit, OnDestroy {
9797
return this.projectGoalsService.getForm();
9898
}
9999

100-
ngOnInit(): void {
101-
console.log(this.hasGoals || this.hasLinks);
102-
console.log(this.hasGoals, this.hasLinks);
103-
}
100+
ngOnInit(): void {}
104101

105102
ngOnDestroy(): void {
106103
this.subscription.unsubscribe();

0 commit comments

Comments
 (0)