Skip to content

Commit d033e35

Browse files
committed
add form & initialization for task-detail, add dropdown, create-tag component, fix websockets to subprotocol
1 parent d4e74c3 commit d033e35

60 files changed

Lines changed: 2372 additions & 1620 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.
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
/** @format */
2+
3+
export const actionTypeList = [
4+
{
5+
id: 1,
6+
value: "action",
7+
label: "действие",
8+
additionalInfo: "task",
9+
},
10+
{
11+
id: 2,
12+
value: "call",
13+
label: "звонок",
14+
additionalInfo: "phone",
15+
},
16+
{
17+
id: 3,
18+
value: "meet",
19+
label: "встреча",
20+
additionalInfo: "people-bold",
21+
},
22+
];

projects/core/src/consts/lists/priority-info-list.const.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,37 +10,37 @@
1010
export const priorityInfoList = [
1111
{
1212
id: 0,
13-
name: "бэклог",
13+
label: "бэклог",
1414
color: "#322299",
1515
priorityType: 0,
1616
},
1717
{
1818
id: 1,
19-
name: "в ближайшие часы",
19+
label: "в ближайшие часы",
2020
color: "#A63838",
2121
priorityType: 1,
2222
},
2323
{
2424
id: 2,
25-
name: "высокий",
25+
label: "высокий",
2626
color: "#D48A9E",
2727
priorityType: 2,
2828
},
2929
{
3030
id: 3,
31-
name: "средний",
31+
label: "средний",
3232
color: "#E5B25D",
3333
priorityType: 3,
3434
},
3535
{
3636
id: 4,
37-
name: "низкий",
37+
label: "низкий",
3838
color: "#297373",
3939
priorityType: 4,
4040
},
4141
{
4242
id: 5,
43-
name: "улучшение",
43+
label: "улучшение",
4444
color: "#88C9A1",
4545
priorityType: 5,
4646
},
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
/** @format */
2+
3+
export const tagColorsList = [
4+
{
5+
id: 1,
6+
color: "#8A63E6",
7+
},
8+
{
9+
id: 2,
10+
color: "#9764BA",
11+
},
12+
{
13+
id: 3,
14+
color: "#2F36AA",
15+
},
16+
{
17+
id: 4,
18+
color: "#4CD9F1",
19+
},
20+
{
21+
id: 5,
22+
color: "#88C9A1",
23+
},
24+
{
25+
id: 6,
26+
color: "#D48A9E",
27+
},
28+
{
29+
id: 7,
30+
color: "#E5B25D",
31+
},
32+
{
33+
id: 8,
34+
color: "#297373",
35+
},
36+
];

projects/core/src/lib/services/token.service.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { map, Observable } from "rxjs";
55
import { RefreshResponse } from "@auth/models/http.model";
66
import { plainToInstance } from "class-transformer";
77
import { Tokens } from "@auth/models/tokens.model";
8-
import Cookies from "js-cookie";
8+
import Cookies, { CookieAttributes } from "js-cookie";
99
import { ApiService, PRODUCTION } from "@corelib";
1010

1111
/**
@@ -66,11 +66,13 @@ export class TokenService {
6666
* - Используются дефолтные настройки браузера
6767
* - Cookies привязаны к текущему домену
6868
*/
69-
getCookieOptions() {
69+
getCookieOptions(): CookieAttributes {
7070
if (this.production) {
7171
return {
7272
domain: ".procollab.ru", // Домен для production окружения
7373
expires: new Date(Date.now() + 1000 * 60 * 60 * 24 * 30), // 30 дней
74+
secure: true,
75+
sameSite: "None",
7476
};
7577
}
7678

projects/social_platform/src/app/core/services/websocket.service.ts

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
/** @format */
2-
import { Injectable } from "@angular/core";
2+
import { inject, Injectable } from "@angular/core";
33
import { filter, map, Observable, Observer, retry, Subject } from "rxjs";
44
import { environment } from "@environment";
55
import * as snakecaseKeys from "snakecase-keys";
66
import camelcaseKeys from "camelcase-keys";
7+
import { TokenService } from "@corelib";
78

89
/**
910
* Сервис для работы с WebSocket соединениями
@@ -20,6 +21,8 @@ export class WebsocketService {
2021
/** Subject для обработки входящих сообщений */
2122
private messages$ = new Subject<MessageEvent>();
2223

24+
private readonly tokenService = inject(TokenService);
25+
2326
/** Флаг состояния соединения */
2427
public isConnected = false;
2528

@@ -36,7 +39,11 @@ export class WebsocketService {
3639
*/
3740
public connect(path: string): Observable<void> {
3841
return new Observable((observer: Observer<void>) => {
39-
this.socket = new WebSocket(environment.websocketUrl + path);
42+
const tokens = this.tokenService.getTokens();
43+
44+
const tokenAccess = tokens?.access ? tokens.access : "";
45+
46+
this.socket = new WebSocket(environment.websocketUrl + path, ["Bearer", tokenAccess]);
4047

4148
this.socket.onopen = () => {
4249
this.isConnected = true;
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<!-- @format -->
2+
3+
<ul
4+
#contextMenu
5+
class="context-menu"
6+
[class]="customClass"
7+
[style.opacity]="isOpen ? 1 : 0"
8+
[style.pointer-events]="isOpen ? 'auto' : 'none'"
9+
[style.min-width.px]="minWidth"
10+
(clickOutside)="onClickOutside()"
11+
tabindex="-1"
12+
>
13+
@for (item of visibleItems; track item.id) {
14+
<li
15+
class="context-menu__item text-body-10"
16+
[class]="item.className"
17+
(click)="onItemClick($event, item.id)"
18+
>
19+
{{ item.label }}
20+
</li>
21+
@if (item.divider && !$last) {
22+
<li class="context-menu__divider"></li>
23+
} }
24+
</ul>
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
/** @format */
2+
3+
.context-menu {
4+
position: fixed;
5+
z-index: 9999;
6+
7+
background-color: white;
8+
border-radius: 8px;
9+
box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
10+
11+
padding: 8px 0;
12+
margin: 0;
13+
list-style: none;
14+
15+
transition: opacity 0.15s ease;
16+
outline: none;
17+
18+
&__item {
19+
padding: 10px 16px;
20+
cursor: pointer;
21+
white-space: nowrap;
22+
user-select: none;
23+
transition: background-color 0.15s ease;
24+
25+
&:hover {
26+
background-color: rgba(0, 0, 0, 0.04);
27+
}
28+
29+
&:active {
30+
background-color: rgba(0, 0, 0, 0.08);
31+
}
32+
33+
&--red {
34+
color: #f44336;
35+
36+
&:hover {
37+
background-color: rgba(244, 67, 54, 0.08);
38+
}
39+
40+
&:active {
41+
background-color: rgba(244, 67, 54, 0.16);
42+
}
43+
}
44+
45+
&--primary {
46+
color: #2196f3;
47+
}
48+
49+
&--disabled {
50+
opacity: 0.5;
51+
cursor: not-allowed;
52+
pointer-events: none;
53+
}
54+
}
55+
56+
&__divider {
57+
height: 1px;
58+
margin: 8px 0;
59+
background-color: rgba(0, 0, 0, 0.08);
60+
}
61+
}

0 commit comments

Comments
 (0)