Skip to content

Commit d4a45c4

Browse files
authored
Version 1.1.0
Version 1.1.0
2 parents 3d110de + 1ae7035 commit d4a45c4

12 files changed

Lines changed: 94 additions & 48 deletions

File tree

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "vernite",
3-
"version": "1.0.3",
3+
"version": "1.1.0",
44
"scripts": {
55
"@------ WORKFLOW SCRIPTS --------": "",
66
"postinstall": "husky install",

src/app/_main/components/dialog-outlet/dialog-outlet.component.scss

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,30 @@
66
transition: width .4s ease;
77
}
88

9-
.dialog-outlet {
9+
:host .dialog-outlet {
1010
width: 100%;
1111
height: 100%;
12+
padding: 0;
1213
border-radius: 0;
13-
overflow-y: auto;
14-
}
14+
15+
::ng-deep>* {
16+
display: flex;
17+
height: 100%;
18+
flex-direction: column;
19+
20+
.mat-dialog-title {
21+
display: block;
22+
padding: 2rem 2rem 0 2rem;
23+
}
24+
25+
.mat-dialog-content {
26+
overflow: auto;
27+
flex: 1;
28+
padding: 0 2rem;
29+
}
30+
31+
.mat-dialog-actions {
32+
padding: 2rem 2rem 2rem 2rem;
33+
}
34+
}
35+
}

src/app/_main/dialogs/manual/manual.dialog.scss

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
11
:host {
22
position: relative;
33
display: block;
4-
width: calc(100% + 4rem);
5-
height: calc(100% + 4rem);
6-
margin: -2rem;
74
}
85

96
.mat-dialog-content {
107
height: 100%;
8+
margin: 0 -2rem;
119
}
1210

1311
.close-button {
@@ -25,4 +23,4 @@
2523
height: 100%;
2624
align-items: center;
2725
justify-content: center;
28-
}
26+
}

src/app/_main/pipes/markdown/markdown.pipe.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { DomSanitizer, SafeHtml } from '@angular/platform-browser';
2-
import { PipeTransform, Pipe } from '@angular/core';
1+
import { DomSanitizer } from '@angular/platform-browser';
2+
import { PipeTransform, Pipe, SecurityContext } from '@angular/core';
33
import { marked, Renderer } from 'marked';
44
import { Marked } from '@main/libs/marked/marked.lib';
55

@@ -23,7 +23,7 @@ export class MarkdownPipe implements PipeTransform {
2323
* @param value - markdown to display
2424
* @returns markdown
2525
*/
26-
transform(value: string): SafeHtml {
26+
transform(value: string): string {
2727
// const innerHTML = marked.parse(value || '', { renderer: this.renderer });
2828
// TODO: Add hljs to the marked options (https://marked.js.org/using_advanced)
2929
// this.output.nativeElement
@@ -32,6 +32,6 @@ export class MarkdownPipe implements PipeTransform {
3232
// hljs.highlightElement(c);
3333
// });
3434

35-
return this.sanitizer.bypassSecurityTrustHtml(marked(value));
35+
return this.sanitizer.sanitize(SecurityContext.HTML, marked(value)) || '';
3636
}
3737
}

src/app/dashboard/interfaces/project.interface.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { ProjectMember } from './project-member.interface';
22
import { JSONParsable } from './../../_main/interfaces/json-parsable.interface';
33
import { ApiFile } from '@main/interfaces/api-file.interface';
4+
import { Status } from '../../tasks/interfaces/status.interface';
45

56
export interface Project extends JSONParsable {
67
/**
@@ -34,4 +35,6 @@ export interface Project extends JSONParsable {
3435
* Logo file metadata
3536
*/
3637
logo?: ApiFile;
38+
39+
statuses: Status[];
3740
}

src/app/dashboard/modules/widgets/components/widget-tasks/widget-tasks.component.ts

Lines changed: 19 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
11
import { Component, OnInit } from '@angular/core';
22
import { TaskService } from '../../../../../tasks/services/task/task.service';
3-
import { map, Observable, switchMap, forkJoin, of, EMPTY } from 'rxjs';
3+
import { Observable, forkJoin, EMPTY, map } from 'rxjs';
44
import { MemberService } from '../../../../services/member/member.service';
55
import { ProjectMember } from '../../../../interfaces/project-member.interface';
66
import { Status } from '../../../../../tasks/interfaces/status.interface';
77
import { Task } from '@tasks/interfaces/task.interface';
88
import { ProjectService } from '../../../../services/project/project.service';
99
import { StatusService } from '../../../../../tasks/services/status/status.service';
1010
import { Project } from '../../../../interfaces/project.interface';
11-
import { TaskFilters } from '../../../../../tasks/filters/task.filters';
1211
import { UserService } from '../../../../../auth/services/user/user.service';
1312
import { Loader } from '../../../../../_main/classes/loader/loader.class';
1413
import { withLoader } from '../../../../../_main/operators/loader.operator';
@@ -45,24 +44,27 @@ export class WidgetTasksComponent implements OnInit {
4544
}
4645

4746
private loadProjects() {
48-
return this.projectService.list().pipe(
49-
switchMap((projects) => {
50-
return forkJoin(projects.map((project) => this.loadProject(project)));
47+
return forkJoin({
48+
projects: this.projectService.list(),
49+
tasks: this.taskService.listTasksAssignedToMe(),
50+
}).pipe(
51+
map(({ projects, tasks }) => {
52+
return projects.map((project) =>
53+
this.loadProject(
54+
project,
55+
tasks.filter((task) => task.projectId === project.id),
56+
),
57+
);
5158
}),
52-
map((projects) => projects.filter((project) => project.tasks.length > 0)),
5359
);
5460
}
5561

56-
private loadProject(project: Project) {
57-
return this.userService.getMyself().pipe(
58-
switchMap((user) => {
59-
return forkJoin({
60-
project: of(project),
61-
members: this.memberService.map(project.id),
62-
statuses: this.statusService.list(project.id),
63-
tasks: this.taskService.list(project.id, TaskFilters.ASSIGNEE_ID(user.id)),
64-
});
65-
}),
66-
);
62+
private loadProject(project: Project, tasks: Task[]) {
63+
return {
64+
project: project,
65+
members: new Map(),
66+
statuses: project.statuses,
67+
tasks: tasks,
68+
};
6769
}
6870
}

src/app/messages/interfaces/slack.interface.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ export interface SlackChannel extends JSONParsable {
4848
/** Interface to represent Slack channel with user */
4949
export interface SlackChannelWithUser extends Omit<SlackChannel, 'user'> {
5050
/** The user the slack channel is with */
51-
user?: SlackUser;
51+
user?: SlackUser | null;
5252
}
5353

5454
/** Interface to represent Slack integration */

src/app/messages/services/slack-integration.service.ts

Lines changed: 25 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,21 @@ export class SlackIntegrationService extends BaseService<
134134
);
135135
}
136136

137+
/**
138+
* Get slack users by integration id
139+
* @param slackId Slack integration id
140+
* @returns Observable with users list
141+
*/
142+
@Cache()
143+
public getUsers(slackId: number): Observable<SlackUser[]> {
144+
return this.apiService.get(`/user/integration/slack/${slackId}/user`).pipe(
145+
this.validate({
146+
404: 'INTEGRATION_NOT_FOUND',
147+
409: 'CONFLICT',
148+
}),
149+
);
150+
}
151+
137152
/**
138153
* Get messages from slack channel
139154
* @param slackId Slack integration id
@@ -182,21 +197,16 @@ export class SlackIntegrationService extends BaseService<
182197
* @returns list of slack channels joined with users
183198
*/
184199
public getChannelsWithUsers(slackId: number) {
185-
return this.getChannels(slackId).pipe(
186-
switchMap((channels) => {
187-
return forkJoin(
188-
channels.map((channel) => {
189-
if (!channel.user) return of(channel as SlackChannelWithUser);
190-
191-
return this.getUser(slackId, channel.user).pipe(
192-
map((user) => ({
193-
...channel,
194-
user,
195-
})),
196-
);
197-
}),
198-
);
199-
}),
200+
return forkJoin({
201+
channels: this.getChannels(slackId),
202+
users: this.getUsers(slackId),
203+
}).pipe(
204+
map(({ channels, users }) =>
205+
channels.map((channel) => ({
206+
...channel,
207+
user: (channel.user && users.find((user) => user.id === channel.user)) || null,
208+
})),
209+
),
200210
);
201211
}
202212

src/app/tasks/pages/task/task.page.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,4 +114,4 @@ <h4 class="text-lg font-bold mt-5" i18n>Dates</h4>
114114
</div>
115115
</div>
116116

117-
</div>
117+
</div>

src/app/tasks/services/task/task.service.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -381,4 +381,12 @@ export class TaskService extends BaseService<
381381
map((tasks) => tasks.filter((task) => task.type === TaskType.EPIC)),
382382
);
383383
}
384+
385+
/**
386+
* List all tasks assigned to current user
387+
* @returns Observable with list of tasks assigned to current user
388+
*/
389+
public listTasksAssignedToMe(): Observable<(Task & { projectId: number })[]> {
390+
return this.apiService.get('/me/tasks');
391+
}
384392
}

0 commit comments

Comments
 (0)