Skip to content

Commit 8a7bf12

Browse files
committed
add changes & testing of main platform
1 parent 882fa5d commit 8a7bf12

28 files changed

Lines changed: 388 additions & 49 deletions

projects/skills/src/app/app.component.scss

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,10 @@
4646
&__notifications-toggle {
4747
position: relative;
4848
display: flex;
49+
gap: 20px;
4950
align-items: center;
5051
justify-content: center;
51-
width: 40px;
52+
width: 60px;
5253
height: 40px;
5354
color: var(--black);
5455
cursor: pointer;

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

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

3-
import { ApplicationConfig, ErrorHandler, importProvidersFrom } from "@angular/core";
3+
import { ApplicationConfig, ErrorHandler, importProvidersFrom, LOCALE_ID } from "@angular/core";
44
import { MatProgressBarModule } from "@angular/material/progress-bar";
55
import { provideAnimations } from "@angular/platform-browser/animations";
66
import { NgxMaskModule } from "ngx-mask";
@@ -12,9 +12,14 @@ import { provideRouter } from "@angular/router";
1212
import { APP_ROUTES } from "./app.routes";
1313
import { API_URL, BearerTokenInterceptor, CamelcaseInterceptor, PRODUCTION } from "@corelib";
1414
import { environment } from "@environment";
15+
import { registerLocaleData } from "@angular/common";
16+
import localeRu from "@angular/common/locales/ru";
17+
18+
registerLocaleData(localeRu, "ru-RU");
1519

1620
export const APP_CONFIG: ApplicationConfig = {
1721
providers: [
22+
{ provide: LOCALE_ID, useValue: "ru-RU" },
1823
importProvidersFrom(
1924
BrowserModule,
2025
ReactiveFormsModule,

projects/social_platform/src/app/office/members/filters/members-filters.component.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
display: flex;
55
flex-direction: column;
66
gap: 24px;
7-
margin-bottom: 63px;
7+
margin-bottom: 40px;
88

99
&__toggle {
1010
display: flex;

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ export class OfficeComponent implements OnInit, OnDestroy {
110110
navItems = [
111111
{ name: "Новости", icon: "feed", link: "feed" },
112112
{ name: "Проекты", icon: "projects-filled", link: "projects" },
113-
{ name: "Программы", icon: "program", link: "program/list" },
113+
{ name: "Программы", icon: "program", link: "program" },
114114
{ name: "Участники", icon: "people-bold", link: "members" },
115115
{ name: "Эксперты", icon: "two-people", link: "mentors" },
116116
{ name: "Вакансии", icon: "search-sidebar", link: "vacancies" },

projects/social_platform/src/app/office/profile/detail/profile-detail.component.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ $detail-bar-mb: 12px;
5959
&__cover {
6060
position: relative;
6161
height: 230px;
62-
background: url("/assets/images/office/profile/detail/cover-new.png");
62+
background: url("/assets/images/office/profile/detail/cover.png");
6363
background-position: top;
6464
background-size: cover;
6565
border-radius: 15px 15px 0 0;

projects/social_platform/src/app/office/profile/edit/edit.component.scss

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -239,6 +239,7 @@
239239

240240
&__info {
241241
display: flex;
242+
gap: 20px;
242243
align-items: center;
243244
justify-content: space-between;
244245
width: 90%;
@@ -259,6 +260,7 @@
259260
}
260261

261262
.edit {
263+
width: 10%;
262264
color: var(--dark-grey);
263265
}
264266

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

Lines changed: 0 additions & 15 deletions
This file was deleted.

projects/social_platform/src/app/office/program/list/main/main.component.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
<!-- @format -->
22

33
<div class="programs">
4-
@if (programs$ | async; as programs) {
4+
@if (programs) {
55
<div class="programs__list">
6-
@for (p of programs; track p.id) {
6+
@for (p of searchedPrograms; track p.id) {
77
<a [routerLink]="['/office/program', p.id]">
88
<app-program-card [program]="p"></app-program-card>
99
</a>
Lines changed: 36 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
/** @format */
22

3-
import { Component, OnInit } from "@angular/core";
3+
import { Component, OnDestroy, OnInit } from "@angular/core";
44
import { ActivatedRoute, RouterLink } from "@angular/router";
5-
import { map, Observable } from "rxjs";
5+
import { map, Observable, Subscription } from "rxjs";
66
import { Program } from "@office/program/models/program.model";
77
import { ProgramCardComponent } from "../../shared/program-card/program-card.component";
88
import { AsyncPipe } from "@angular/common";
9+
import { NavService } from "@office/services/nav.service";
10+
import Fuse from "fuse.js";
911

1012
@Component({
1113
selector: "app-main",
@@ -14,13 +16,38 @@ import { AsyncPipe } from "@angular/common";
1416
standalone: true,
1517
imports: [RouterLink, ProgramCardComponent, AsyncPipe],
1618
})
17-
export class ProgramMainComponent implements OnInit {
18-
constructor(private readonly route: ActivatedRoute) {}
19+
export class ProgramMainComponent implements OnInit, OnDestroy {
20+
constructor(private readonly route: ActivatedRoute, private readonly navService: NavService) {}
1921

20-
programs$: Observable<Program[]> = this.route.data.pipe(
21-
map(r => r["data"]),
22-
map(r => r["results"])
23-
);
22+
programCount = 0;
2423

25-
ngOnInit(): void {}
24+
programs: Program[] = [];
25+
searchedPrograms: Program[] = [];
26+
subscriptions$: Subscription[] = [];
27+
28+
ngOnInit(): void {
29+
this.navService.setNavTitle("Программы");
30+
31+
const querySearch$ = this.route.queryParams.pipe(map(q => q["search"])).subscribe(search => {
32+
const fuse = new Fuse(this.programs, {
33+
keys: ["name"],
34+
});
35+
36+
this.searchedPrograms = search ? fuse.search(search).map(el => el.item) : this.programs;
37+
});
38+
39+
querySearch$ && this.subscriptions$.push(querySearch$);
40+
41+
const programs$ = this.route.data.pipe(map(r => r["data"])).subscribe(programs => {
42+
this.programCount = programs.count;
43+
this.programs = programs.results ?? [];
44+
this.searchedPrograms = programs.results ?? [];
45+
});
46+
47+
programs$ && this.subscriptions$.push(programs$);
48+
}
49+
50+
ngOnDestroy(): void {
51+
this.subscriptions$.forEach($ => $?.unsubscribe());
52+
}
2653
}
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
<!-- @format -->
2+
3+
<!-- {
4+
link: '/office/program/my',
5+
linkText: 'Мои программы',
6+
isRouterLinkActiveOptions: true,
7+
8+
}, -->
9+
10+
<main class="page">
11+
<div class="page__bar">
12+
<app-bar
13+
[backHave]="true"
14+
[links]="[
15+
{
16+
link: '/office/program/all',
17+
linkText: 'Все программы',
18+
isRouterLinkActiveOptions: false,
19+
20+
},
21+
]"
22+
>
23+
<div class="bar__right">
24+
<!-- @if (isAll) { -->
25+
<form [formGroup]="searchForm">
26+
<app-search formControlName="search"></app-search>
27+
</form>
28+
<!-- } -->
29+
</div>
30+
</app-bar>
31+
</div>
32+
33+
<router-outlet></router-outlet>
34+
</main>

0 commit comments

Comments
 (0)