Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions projects/core/src/consts/lists/education-info-list.const.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,9 @@ export const educationUserLevel = [
value: "Высшее образование – аспирантура",
label: "высшее образование – аспирантура",
},
// {
// id: 5,
// value: "Дополнительное профессиональное образования",
// label: "дополнительное профессиональное образования"
// },
];
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,6 @@ export class CourseDetailComponent implements OnInit {
}

redirectToProgram(): void {
this.router.navigate([`/office/program/${this.course()?.partnerProgramId}`], {
queryParams: { courseId: this.course()?.id },
});
this.router.navigateByUrl(`/office/program/${this.course()?.partnerProgramId}`);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -181,11 +181,8 @@
участники
</app-button>
</a>
} @else { @if (info().courseId || queryCourseId()) {
<a
class="info__contacts"
[routerLink]="'/office/courses/' + (info().courseId || queryCourseId())"
>
} @else { @if (info().courses?.length) {
<a class="info__contacts" [routerLink]="'/office/courses/' + info().courses[0].id">
<app-button appearance="outline" size="medium" customTypographyClass="text-body-12">
перейти в курс
</app-button>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@ export class DeatilComponent implements OnInit, OnDestroy {
profile?: User;
profileProjects = signal<User["projects"]>([]);
listType: "project" | "program" | "profile" = "project";
queryCourseId = signal<number | null>(null);

// Переменная для подсказок
isTooltipVisible = false;
Expand Down Expand Up @@ -159,12 +158,6 @@ export class DeatilComponent implements OnInit, OnDestroy {
this.listType = data["listType"];
});

const queryParamsSub$ = this.route.queryParams.subscribe(params => {
const courseId = params["courseId"];
this.queryCourseId.set(courseId ? +courseId : null);
});
this.subscriptions.push(queryParamsSub$);

this.initializeBackPath();

this.updatePageStates();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import { FileService } from "@core/services/file.service";
import { nanoid } from "nanoid";
import { expandElement } from "@utils/expand-element";
import { FileModel } from "@models/file.model";
import { forkJoin, noop, Observable, tap } from "rxjs";
import { catchError, forkJoin, noop, Observable, of, tap } from "rxjs";
import { ButtonComponent, IconComponent } from "@ui/components";
import { FileItemComponent } from "@ui/components/file-item/file-item.component";
import { FileUploadItemComponent } from "@ui/components/file-upload-item/file-upload-item.component";
Expand Down Expand Up @@ -279,6 +279,11 @@ export class NewsCardComponent implements OnInit {
fileObj.src = file.url;
fileObj.loading = false;
fileObj.tempFile = null;
}),
catchError(() => {
fileObj.loading = false;
fileObj.error = true;
return of(null);
})
)
);
Expand All @@ -301,6 +306,11 @@ export class NewsCardComponent implements OnInit {
fileObj.loading = false;
fileObj.src = file.url;
fileObj.tempFile = null;
}),
catchError(() => {
fileObj.loading = false;
fileObj.error = "Ошибка загрузки";
return of(null);
})
)
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { FormBuilder, FormGroup, ReactiveFormsModule, Validators } from "@angula
import { ValidationService } from "projects/core";
import { nanoid } from "nanoid";
import { FileService } from "@core/services/file.service";
import { forkJoin, noop, Observable, tap } from "rxjs";
import { catchError, forkJoin, noop, Observable, of, tap } from "rxjs";
import { FileUploadItemComponent } from "@ui/components/file-upload-item/file-upload-item.component";
import { IconComponent, InputComponent } from "@ui/components";
import { AutosizeModule } from "ngx-autosize";
Expand Down Expand Up @@ -76,13 +76,16 @@ export class NewsFormComponent implements OnInit {
...this.messageForm.value,
files: [...this.imagesList.map(f => f.src), ...this.filesList.map(f => f.src)],
});

this.onResetForm();
}

/**
* Сброс формы и очистка списков файлов
*/
onResetForm() {
this.imagesList = [];
this.filesList = [];
this.messageForm.reset();
}

Expand Down Expand Up @@ -128,6 +131,11 @@ export class NewsFormComponent implements OnInit {
fileObj.src = file.url;
fileObj.loading = false;
fileObj.tempFile = null;
}),
catchError(() => {
fileObj.loading = false;
fileObj.error = true;
return of(null);
})
)
);
Expand All @@ -145,6 +153,11 @@ export class NewsFormComponent implements OnInit {
tap(file => {
fileObj.loading = false;
fileObj.src = file.url;
}),
catchError(() => {
fileObj.loading = false;
fileObj.error = "Ошибка загрузки";
return of(null);
})
)
);
Expand Down
15 changes: 13 additions & 2 deletions projects/social_platform/src/app/office/feed/feed.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,18 @@ import { CommonModule } from "@angular/common";
import { NewProjectComponent } from "@office/feed/shared/new-project/new-project.component";
import { ActivatedRoute } from "@angular/router";
import { FeedItem, FeedItemType } from "@office/feed/models/feed-item.model";
import { concatMap, fromEvent, map, noop, of, skip, Subscription, tap, throttleTime } from "rxjs";
import {
catchError,
concatMap,
fromEvent,
map,
noop,
of,
skip,
Subscription,
tap,
throttleTime,
} from "rxjs";
import { ApiPagination } from "@models/api-pagination.model";
import { FeedService } from "@office/feed/services/feed.service";
import { ProjectNewsService } from "@office/projects/detail/services/project-news.service";
Expand Down Expand Up @@ -99,7 +110,7 @@ export class FeedComponent implements OnInit, AfterViewInit, OnDestroy {
if (target) {
const scrollEvents$ = fromEvent(target, "scroll")
.pipe(
concatMap(() => this.onScroll()),
concatMap(() => this.onScroll().pipe(catchError(() => of({})))),
throttleTime(500)
)
.subscribe(noop);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import {
import { ActivatedRoute, Router, RouterLink } from "@angular/router";
import {
BehaviorSubject,
catchError,
concatMap,
debounceTime,
distinctUntilChanged,
Expand Down Expand Up @@ -204,8 +205,8 @@ export class MembersComponent implements OnInit, OnDestroy, AfterViewInit {
if (target) {
const scrollEvents$ = fromEvent(target, "scroll")
.pipe(
concatMap(() => this.onScroll()),
throttleTime(500) // Ограничиваем частоту обработки прокрутки
concatMap(() => this.onScroll().pipe(catchError(() => of({})))),
throttleTime(500)
)
.subscribe(noop);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,23 @@ import {
ViewChild,
} from "@angular/core";
import { ActivatedRoute, RouterLink } from "@angular/router";
import { concatMap, fromEvent, map, noop, of, Subscription, tap, throttleTime } from "rxjs";
import {
catchError,
concatMap,
fromEvent,
map,
noop,
of,
Subscription,
tap,
throttleTime,
} from "rxjs";
import { AuthService } from "@auth/services";
import { User } from "@auth/models/user.model";
import { NavService } from "@services/nav.service";
import { FormBuilder, FormGroup, Validators } from "@angular/forms";
import { containerSm } from "@utils/responsive";
import { MemberService } from "@services/member.service";
import { MemberCardComponent } from "../shared/member-card/member-card.component";
import { ApiPagination } from "@models/api-pagination.model";

/**
Expand Down Expand Up @@ -99,7 +108,7 @@ export class MentorsComponent implements OnInit, OnDestroy, AfterViewInit {
if (target)
fromEvent(target, "scroll")
.pipe(
concatMap(() => this.onScroll()),
concatMap(() => this.onScroll().pipe(catchError(() => of({})))),
throttleTime(500)
)
.subscribe(noop);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,17 @@ <h1 class="profile__title">редактирование профиля</h1>
<div class="profile__wrapper">
@if(editingStep === 'main'){
<div class="profile__wrapper--main">
<div class="profile__main-text--grid">
<label for="avatar" class="field-label" style="text-align: center">фото</label>

<label class="field-label text-body-12" for="coverImageAddress" style="text-align: center"
>обложка для профиля</label
>
</div>

<div class="profile__row">
@if (profileForm.get("avatar"); as avatar) {
<div>
<label for="avatar" class="field-label" style="text-align: center">фото</label>
<fieldset class="profile__avatar">
<app-avatar-control
id="avatar"
Expand All @@ -103,12 +110,6 @@ <h1 class="profile__title">редактирование профиля</h1>
</div>
} @if (profileForm.get("coverImageAddress"); as coverImageAddress) {
<fieldset class="profile__file">
<label
class="field-label text-body-12"
for="coverImageAddress"
style="text-align: center"
>обложка для профиля</label
>
<app-upload-file
formControlName="coverImageAddress"
accept=".jpg,.png,.jpeg"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,12 @@
}
}

.profile__main-text--grid {
display: grid;
grid-template-columns: 0.1fr 2fr 1fr 1fr;
grid-gap: 20px;
}

.profile__main--grid {
display: grid;
grid-template-columns: 3fr 3fr 4fr;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -639,7 +639,6 @@ export class ProfileEditComponent implements OnInit, OnDestroy, AfterViewInit {
title: achievementItem.title,
status: achievementItem.status,
year: achievementItem.year,
files: achievementItem.files,
});
this.editIndex.set(index);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import { expandElement } from "@utils/expand-element";
import { FileModel } from "@office/models/file.model";
import { nanoid } from "nanoid";
import { FileService } from "@core/services/file.service";
import { forkJoin, noop, Observable, tap } from "rxjs";
import { catchError, forkJoin, noop, Observable, of, tap } from "rxjs";
import { DayjsPipe, FormControlPipe, ParseLinksPipe, ValidationService } from "projects/core";
import { FileItemComponent } from "@ui/components/file-item/file-item.component";
import { ButtonComponent, IconComponent } from "@ui/components";
Expand Down Expand Up @@ -266,6 +266,11 @@ export class ProgramNewsCardComponent implements OnInit, AfterViewInit {
fileObj.src = file.url;
fileObj.loading = false;
fileObj.tempFile = null;
}),
catchError(() => {
fileObj.loading = false;
fileObj.error = true;
return of(null);
})
)
);
Expand All @@ -288,6 +293,11 @@ export class ProgramNewsCardComponent implements OnInit, AfterViewInit {
fileObj.loading = false;
fileObj.src = file.url;
fileObj.tempFile = null;
}),
catchError(() => {
fileObj.loading = false;
fileObj.error = "Ошибка загрузки";
return of(null);
})
)
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ export class Program {
isUserMember!: boolean;
publishProjectsAfterFinish!: boolean;
courseId!: number | null;
courses!: { id: number; title: string; isAvailable: boolean }[];

static default(): Program {
return {
Expand Down Expand Up @@ -88,6 +89,7 @@ export class Program {
isUserManager: false,
publishProjectsAfterFinish: false,
courseId: null,
courses: [],
};
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ export class ProgramService {
url += `?${params.toString()}`;
}

return this.apiService.post(url, { filters: filters });
return this.apiService.post(url, { filters });
}

submitCompettetiveProject(relationId: number): Observable<Project> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ export class ProjectRatingService {
url += `?${params.toString()}`;
}

return this.apiService.post(url, { filters: filters });
return this.apiService.post(url, { filters });
}

rate(projectId: number, scores: ProjectRatingCriterionOutput[]): Observable<void> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import {
} from "@angular/core";
import { ActivatedRoute, NavigationEnd, Params, Router, RouterLink } from "@angular/router";
import {
catchError,
concatMap,
distinctUntilChanged,
fromEvent,
Expand Down Expand Up @@ -192,7 +193,7 @@ export class ProjectsListComponent implements OnInit, AfterViewInit, OnDestroy {
if (target) {
const scrollEvent$ = fromEvent(target, "scroll")
.pipe(
concatMap(() => this.onScroll()),
concatMap(() => this.onScroll().pipe(catchError(() => of({})))),
throttleTime(500)
)
.subscribe(noop);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import { Component, inject, signal } from "@angular/core";
import { CommonModule } from "@angular/common";
import {
catchError,
concatMap,
debounceTime,
fromEvent,
Expand Down Expand Up @@ -124,7 +125,7 @@ export class VacanciesListComponent {
if (target) {
const scrollEvents$ = fromEvent(target, "scroll")
.pipe(
concatMap(() => this.onScroll()),
concatMap(() => this.onScroll().pipe(catchError(() => of({})))),
throttleTime(500)
)
.subscribe(noop);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@
<div class="cancel__cropper-container">
<image-cropper
[imageChangedEvent]="imageChangedEvent"
[imageBase64]="correctedImageBase64"
[maintainAspectRatio]="false"
[aspectRatio]="1"
[resizeToWidth]="600"
Expand Down
Loading
Loading