Skip to content

Commit 24146bb

Browse files
committed
Merge branch 'master' into kanban-board
2 parents 49e2604 + 07cc6ea commit 24146bb

591 files changed

Lines changed: 5032 additions & 16868 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.

.claude/commands/explain.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<!-- @format -->
2+
3+
Выполни последовательно:
4+
5+
1. Изучи тему, какую я скажу, полностью как теоретически так и практически
6+
2. Расскажи мне о ней максимально понятно и подробно
7+
3. Приведи примеры на основе моего проекта или из той теории и практики что ты знаешь
8+
4. Описание и пояснения могут быть выполнын в формате списков/графов/формы и т.д
9+
5. Сделай все максимально интерактивно и интересно

.claude/commands/push.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<!-- @format -->
2+
3+
Выполни последовательно:
4+
5+
1. Запусти `npm run format` для форматирования кода
6+
2. Выполни `git add --all -- ':!.claude'` чтобы добавить все изменения кроме папки .claude
7+
3. Посмотри `git diff --cached --stat` и на основе изменений сгенерируй осмысленный коммит-месседж на английском языке
8+
4. Выполни `git commit -m "<сгенерированный месседж>"`
9+
5. Выполни `git push`

.github/workflows/pull_request.yml

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -33,20 +33,8 @@ jobs:
3333
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_ACCESS_TOKEN }}
3434
NETLIFY_PREVIEW_APP: true # or perhaps like this
3535
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
36-
NETLIFY_PR_ID: ${{ github.pr_id }}-social
37-
- name: Publish preview skills
38-
uses: netlify/actions/cli@master
39-
id: publish_preview_skills
40-
with:
41-
args: deploy --dir=./dist/skills
42-
env:
43-
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SKILLS_SITE_ID }}
44-
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_ACCESS_TOKEN }}
45-
NETLIFY_PREVIEW_APP: true # or perhaps like this
46-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
47-
NETLIFY_PR_ID: ${{ github.pr_id }}-skills
36+
NETLIFY_PR_ID: ${{ github.event.pull_request.number }}-social
4837
- uses: mshick/add-pr-comment@v2
4938
with:
5039
message: |
5140
Social platform url - ${{steps.publish_preview_social.outputs.NETLIFY_URL}}
52-
Skills platform url - ${{steps.publish_preview_skills.outputs.NETLIFY_URL}}

angular.json

Lines changed: 0 additions & 88 deletions
Original file line numberDiff line numberDiff line change
@@ -137,94 +137,6 @@
137137
}
138138
}
139139
},
140-
"skills": {
141-
"projectType": "application",
142-
"schematics": {
143-
"@schematics/angular:component": {
144-
"style": "scss"
145-
}
146-
},
147-
"root": "projects/skills",
148-
"sourceRoot": "projects/skills/src",
149-
"prefix": "app",
150-
"architect": {
151-
"build": {
152-
"builder": "@angular-devkit/build-angular:browser",
153-
"options": {
154-
"outputPath": "dist/skills",
155-
"index": "projects/skills/src/index.html",
156-
"main": "projects/skills/src/main.ts",
157-
"polyfills": ["zone.js"],
158-
"tsConfig": "projects/skills/tsconfig.app.json",
159-
"inlineStyleLanguage": "scss",
160-
"assets": ["projects/skills/src/favicon.ico", "projects/skills/src/assets"],
161-
"styles": ["projects/skills/src/styles.scss"],
162-
"scripts": [],
163-
"stylePreprocessorOptions": {
164-
"includePaths": ["projects/skills/src"]
165-
}
166-
},
167-
"configurations": {
168-
"production": {
169-
"fileReplacements": [
170-
{
171-
"replace": "projects/skills/src/environments/environment.ts",
172-
"with": "projects/skills/src/environments/environment.prod.ts"
173-
}
174-
],
175-
"budgets": [
176-
{
177-
"type": "initial",
178-
"maximumWarning": "500kb",
179-
"maximumError": "1mb"
180-
},
181-
{
182-
"type": "anyComponentStyle",
183-
"maximumWarning": "6kb",
184-
"maximumError": "12kb"
185-
}
186-
],
187-
"outputHashing": "all"
188-
},
189-
"development": {
190-
"optimization": false,
191-
"extractLicenses": false,
192-
"sourceMap": true
193-
}
194-
},
195-
"defaultConfiguration": "production"
196-
},
197-
"serve": {
198-
"builder": "@angular-devkit/build-angular:dev-server",
199-
"configurations": {
200-
"production": {
201-
"buildTarget": "skills:build:production"
202-
},
203-
"development": {
204-
"buildTarget": "skills:build:development"
205-
}
206-
},
207-
"defaultConfiguration": "development"
208-
},
209-
"extract-i18n": {
210-
"builder": "@angular-devkit/build-angular:extract-i18n",
211-
"options": {
212-
"buildTarget": "skills:build"
213-
}
214-
},
215-
"test": {
216-
"builder": "@angular-devkit/build-angular:karma",
217-
"options": {
218-
"polyfills": ["zone.js", "zone.js/testing"],
219-
"tsConfig": "projects/skills/tsconfig.spec.json",
220-
"inlineStyleLanguage": "scss",
221-
"assets": ["projects/skills/src/favicon.ico", "projects/skills/src/assets"],
222-
"styles": ["projects/skills/src/styles.scss"],
223-
"scripts": []
224-
}
225-
}
226-
}
227-
},
228140
"ui": {
229141
"projectType": "library",
230142
"root": "projects/ui",

package.json

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,12 @@
44
"scripts": {
55
"ng": "ng",
66
"start:social": "ng serve social_platform --open",
7-
"start:skills": "ng serve skills --open",
87
"build:social:dev": "npm run build:sprite && ng build social_platform --configuration=development",
98
"build:social:prod": "npm run build:sprite && ng build social_platform --configuration=production",
10-
"build:skills:prod": "ng build skills --configuration=production",
11-
"build:skills:dev": "ng build skills --configuration=development",
12-
"build:prod": "npm run build:social:prod && npm run build:skills:prod",
13-
"build:pr": "npm run build:social:dev && npm run build:skills:dev",
9+
"build:prod": "npm run build:social:prod",
10+
"build:pr": "npm run build:social:dev",
1411
"watch": "ng build --watch social_platform --configuration=development",
15-
"build:sprite-social": "svg-sprite -s --dest=projects/social_platform/src/assets/icons 'projects/social_platform/src/assets/icons/svg/**/*.svg'",
16-
"build:sprite-skills": "svg-sprite -s --dest=projects/skills/src/assets/icons 'projects/skills/src/assets/icons/svg/**/*.svg'",
17-
"build:sprite": "npm run build:sprite-skills && npm run build:sprite-social",
12+
"build:sprite": "svg-sprite -s --dest=projects/social_platform/src/assets/icons 'projects/social_platform/src/assets/icons/svg/**/*.svg'",
1813
"test": "ng test",
1914
"test:ci": "ng test --browsers=Headless --no-watch",
2015
"lint:ts": "eslint projects/**/*.ts",

projects/core/src/lib/guards/auth/auth-required.guard.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
import { inject } from "@angular/core";
44
import { CanActivateFn, Router } from "@angular/router";
55
import { catchError, map } from "rxjs";
6-
import { TokenService } from "@corelib";
7-
import { AuthRepository } from "projects/social_platform/src/app/infrastructure/repository/auth/auth.repository";
6+
import { AuthRepositoryPort } from "@domain/auth/ports/auth.repository.port";
7+
import { TokenService } from "../../services/tokens/token.service";
88

99
/**
1010
* Guard для проверки аутентификации пользователя
@@ -22,7 +22,7 @@ import { AuthRepository } from "projects/social_platform/src/app/infrastructure/
2222
*/
2323
export const AuthRequiredGuard: CanActivateFn = () => {
2424
const tokenService = inject(TokenService);
25-
const authRepository = inject(AuthRepository);
25+
const authRepository = inject(AuthRepositoryPort);
2626
const router = inject(Router);
2727

2828
if (tokenService.getTokens() === null) {

projects/core/src/lib/guards/kanban/kanban.guard.ts

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,24 +2,24 @@
22

33
import { inject } from "@angular/core";
44
import { ActivatedRouteSnapshot, CanActivateFn, Router, UrlTree } from "@angular/router";
5-
import { User } from "projects/social_platform/src/app/domain/auth/user.model";
6-
import { Collaborator } from "projects/social_platform/src/app/domain/project/collaborator.model";
5+
import { User } from "@domain/auth/user.model";
6+
import { AuthRepositoryPort } from "@domain/auth/ports/auth.repository.port";
7+
import { Collaborator } from "@domain/project/collaborator.model";
8+
import { ProjectRepositoryPort } from "@domain/project/ports/project.repository.port";
79
import { catchError, map, Observable, of, switchMap } from "rxjs";
8-
import { ProjectRepository } from "projects/social_platform/src/app/infrastructure/repository/project/project.repository";
9-
import { AuthRepository } from "projects/social_platform/src/app/infrastructure/repository/auth/auth.repository";
1010

1111
export const KanbanBoardGuard: CanActivateFn = (
1212
route: ActivatedRouteSnapshot
1313
): Observable<UrlTree | boolean> => {
1414
const router = inject(Router);
15-
const projectRepository = inject(ProjectRepository);
16-
const authRepository = inject(AuthRepository);
15+
const projectRepository = inject(ProjectRepositoryPort);
16+
const authRepository = inject(AuthRepositoryPort);
1717

1818
const projectId = Number(route.parent?.params["projectId"]);
1919

2020
if (!projectId) return of(router.createUrlTree([`/office/projects/${projectId}/`]));
2121

22-
return authRepository.profile.pipe(
22+
return authRepository.fetchProfile().pipe(
2323
switchMap((user: User) =>
2424
projectRepository.getOne(projectId).pipe(
2525
map(project => {
@@ -31,6 +31,7 @@ export const KanbanBoardGuard: CanActivateFn = (
3131
}),
3232
catchError(() => of(router.createUrlTree(["/office/projects"])))
3333
)
34-
)
34+
),
35+
catchError(() => of(router.createUrlTree(["/auth/login"])))
3536
);
3637
};
Lines changed: 10 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,22 @@
11
/** @format */
22

3-
import { inject, signal } from "@angular/core";
3+
import { inject } from "@angular/core";
44
import { ActivatedRouteSnapshot, CanActivateFn, Router, UrlTree } from "@angular/router";
5-
import { AuthService } from "projects/social_platform/src/app/api/auth";
6-
import { Observable, of } from "rxjs";
5+
import { AuthRepositoryPort } from "@domain/auth/ports/auth.repository.port";
6+
import { catchError, map, Observable, of } from "rxjs";
77

88
export const ProfileEditRequiredGuard: CanActivateFn = (
99
route: ActivatedRouteSnapshot
1010
): Observable<boolean | UrlTree> => {
1111
const router = inject(Router);
12-
const authService = inject(AuthService);
13-
14-
const loggedUserId = signal<number | undefined>(undefined);
15-
16-
authService.profile.subscribe({
17-
next: profile => {
18-
loggedUserId.set(profile.id);
19-
},
20-
});
12+
const authRepository = inject(AuthRepositoryPort);
2113

2214
const profileId = Number(route.paramMap.get("id"));
23-
if (profileId !== loggedUserId()) {
24-
return of(router.createUrlTree([`/office/profile/${profileId}/`]));
25-
}
2615

27-
return of(router.createUrlTree([`/office/profel/${profileId}/`]));
16+
return authRepository.fetchProfile().pipe(
17+
map(profile =>
18+
profile.id === profileId ? true : router.createUrlTree([`/office/profile/${profileId}/`])
19+
),
20+
catchError(() => of(router.createUrlTree(["/auth/login"])))
21+
);
2822
};

projects/core/src/lib/guards/projects-edit/projects-edit.guard.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@
22

33
import { inject } from "@angular/core";
44
import { ActivatedRouteSnapshot, CanActivateFn, Router, UrlTree } from "@angular/router";
5-
import { ProjectRepository } from "projects/social_platform/src/app/infrastructure/repository/project/project.repository";
5+
import { ProjectRepositoryPort } from "@domain/project/ports/project.repository.port";
66
import { Observable, of } from "rxjs";
77
import { catchError, map } from "rxjs/operators";
88

99
export const ProjectEditRequiredGuard: CanActivateFn = (
1010
route: ActivatedRouteSnapshot
1111
): Observable<boolean | UrlTree> => {
1212
const router = inject(Router);
13-
const projectRepository = inject(ProjectRepository);
13+
const projectRepository = inject(ProjectRepositoryPort);
1414

1515
const projectId = Number(route.paramMap.get("projectId"));
1616
if (isNaN(projectId)) {

projects/core/src/lib/interceptors/camelcase.interceptor.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import {
1111
import { map, type Observable } from "rxjs";
1212
import * as snakecaseKeys from "snakecase-keys";
1313
import camelcaseKeys from "camelcase-keys";
14-
import { LoggerService } from "@corelib";
14+
import { LoggerService } from "../services/logger/logger.service";
1515

1616
/**
1717
* HTTP интерцептор для автоматического преобразования стиля именования ключей объектов

0 commit comments

Comments
 (0)