diff --git a/apps/red-ui/src/app/screens/project-listing-screen/project-listing-screen.component.html b/apps/red-ui/src/app/screens/project-listing-screen/project-listing-screen.component.html index a0cf36f71..d3c0285a4 100644 --- a/apps/red-ui/src/app/screens/project-listing-screen/project-listing-screen.component.html +++ b/apps/red-ui/src/app/screens/project-listing-screen/project-listing-screen.component.html @@ -20,7 +20,7 @@
- {{'projects.table-header.title.label'| translate:{length: appStateService.allProjects?.length || 0} }} + {{'projects.table-header.title.label'| translate:{ length: appStateService.allProjects?.length || 0 } }}
@@ -79,11 +79,36 @@
- +
+ + +
+
+ +
+
1324
+
Analyzed pages
+
+
+ +
+ +
+
240
+
Total people
+
+
+
+
+
+ +
diff --git a/apps/red-ui/src/app/screens/project-listing-screen/project-listing-screen.component.scss b/apps/red-ui/src/app/screens/project-listing-screen/project-listing-screen.component.scss index 064f81453..bdfae4da8 100644 --- a/apps/red-ui/src/app/screens/project-listing-screen/project-listing-screen.component.scss +++ b/apps/red-ui/src/app/screens/project-listing-screen/project-listing-screen.component.scss @@ -15,3 +15,42 @@ color: $white; } } + + +.right-fixed-container { + display: flex; + width: 470px; + padding-top: 50px; + + > div { + flex: 1; + display: flex; + flex-direction: column; + align-items: center; + } + + .project-stats-container { + width: fit-content; + + .project-stats-item { + display: flex; + width: fit-content; + gap: 5px; + margin-top: 25px; + + &:first-of-type { + margin-top: 50px; + } + + mat-icon { + height: 16px; + width: 16px; + margin-top: 3px; + } + } + } +} + +.left-container { + width: calc(100vw - #{$right-container-width} - 130px); +} diff --git a/apps/red-ui/src/app/screens/project-listing-screen/project-listing-screen.component.ts b/apps/red-ui/src/app/screens/project-listing-screen/project-listing-screen.component.ts index f593f255e..901b6acf3 100644 --- a/apps/red-ui/src/app/screens/project-listing-screen/project-listing-screen.component.ts +++ b/apps/red-ui/src/app/screens/project-listing-screen/project-listing-screen.component.ts @@ -8,7 +8,7 @@ import { NotificationService } from '../../notification/notification.service'; import { AppStateService, ProjectWrapper } from '../../state/app-state.service'; import { UserService } from '../../user/user.service'; import { ProjectDetailsDialogComponent } from '../project-overview-screen/project-details-dialog/project-details-dialog.component'; -import { DataSeries } from '../../simple-doughnut-chart/simple-doughnut-chart.component'; +import { DoughnutChartConfig } from '../../simple-doughnut-chart/simple-doughnut-chart.component'; @Component({ selector: 'redaction-project-listing-screen', @@ -16,7 +16,8 @@ import { DataSeries } from '../../simple-doughnut-chart/simple-doughnut-chart.co styleUrls: ['./project-listing-screen.component.scss'] }) export class ProjectListingScreenComponent implements OnInit { - projectsChartData: DataSeries [] = []; + projectsChartData: DoughnutChartConfig [] = []; + documentsChartData: DoughnutChartConfig [] = []; constructor( public readonly appStateService: AppStateService, @@ -34,10 +35,14 @@ export class ProjectListingScreenComponent implements OnInit { ngOnInit(): void { this.appStateService.reset(); this.projectsChartData = [ - // {value: this.activeProjects, color: '#DD4D50', label: 'active-projects'}, - // {value: this.inactiveProjects, color: '#f8eded', label: 'Archived'}]; - { value: 3, color: 'active', label: 'active-projects' }, - { value: 7, color: 'archived', label: 'Archived' }]; + { value: this.activeProjects, color: 'active', label: 'active-projects' }, + { value: this.inactiveProjects, color: 'archived', label: 'Archived' } + ]; + this.documentsChartData = [ + { value: 20, color: 'unassigned', label: 'unassigned' }, + { value: 40, color: 'under-review', label: 'under review' }, + { value: 16, color: 'under-approval', label: 'under approval' }, + ] } openAddProjectDialog(project?: Project): void { diff --git a/apps/red-ui/src/app/simple-doughnut-chart/simple-doughnut-chart.component.html b/apps/red-ui/src/app/simple-doughnut-chart/simple-doughnut-chart.component.html index 3039d2652..887c2bdb2 100644 --- a/apps/red-ui/src/app/simple-doughnut-chart/simple-doughnut-chart.component.html +++ b/apps/red-ui/src/app/simple-doughnut-chart/simple-doughnut-chart.component.html @@ -1,6 +1,6 @@
- +
-
{{ title }}
+
{{ dataTotal }}
{{ subtitle }}
-
+
+ [config]="[{ length: val.value, color: val.color, label: val.value + ' ' + val.label}]">
diff --git a/apps/red-ui/src/app/simple-doughnut-chart/simple-doughnut-chart.component.scss b/apps/red-ui/src/app/simple-doughnut-chart/simple-doughnut-chart.component.scss index eb2072a28..1c934d546 100644 --- a/apps/red-ui/src/app/simple-doughnut-chart/simple-doughnut-chart.component.scss +++ b/apps/red-ui/src/app/simple-doughnut-chart/simple-doughnut-chart.component.scss @@ -1,7 +1,10 @@ @import "../../assets/styles/red-variables"; .container { - position: absolute; + position: relative; + display: flex; + flex-direction: column; + align-items: center; } .text-container { diff --git a/apps/red-ui/src/app/simple-doughnut-chart/simple-doughnut-chart.component.ts b/apps/red-ui/src/app/simple-doughnut-chart/simple-doughnut-chart.component.ts index b44c1826b..f5da6aa3d 100644 --- a/apps/red-ui/src/app/simple-doughnut-chart/simple-doughnut-chart.component.ts +++ b/apps/red-ui/src/app/simple-doughnut-chart/simple-doughnut-chart.component.ts @@ -1,7 +1,7 @@ import {Component, Input, OnInit} from '@angular/core'; import { Color } from '../utils/types'; -export class DataSeries { +export class DoughnutChartConfig { value: number; color: Color; label: string; @@ -14,11 +14,10 @@ export class DataSeries { }) export class SimpleDoughnutChartComponent implements OnInit { - @Input() title: string; @Input() subtitle: string; - @Input() data: DataSeries[] = []; + @Input() config: DoughnutChartConfig[] = []; @Input() angleOffset = -90; - @Input() radius = 80; + @Input() radius = 85; @Input() strokeWidth = 20; public chartData: any[] = []; @@ -46,11 +45,11 @@ export class SimpleDoughnutChartComponent implements OnInit { }; get dataTotal() { - return this.data.map(v => v.value).reduce((acc, val) => acc + val, 0); + return this.config.map(v => v.value).reduce((acc, val) => acc + val, 0); }; calculateChartData() { - this.data.forEach((dataVal) => { + this.config.forEach((dataVal) => { const data = { degrees: this.angleOffset, } @@ -71,4 +70,9 @@ export class SimpleDoughnutChartComponent implements OnInit { returnCircleTransformValue(index) { return `rotate(${this.chartData[index].degrees}, ${this.cx}, ${this.cy})`; } + + // Eliminate items with value = 0 + public get parsedConfig() { + return this.config.filter((el) => el.value); + } }