From 5547a7c4196a2ba80acb704250c0a76d9e1101c1 Mon Sep 17 00:00:00 2001 From: Manfred Steyer Date: Fri, 27 Sep 2024 22:20:25 +0200 Subject: [PATCH] feat: add limits store to team alignment and hotspots --- .detective/hash | 2 +- .detective/log | 16 ++++++++-------- .../app/features/hotspot/hotspot.component.html | 7 ++++++- .../app/features/hotspot/hotspot.component.ts | 9 ++++++++- .../team-alignment/team-alignment.component.html | 7 ++++++- .../team-alignment/team-alignment.component.ts | 8 +++++++- apps/frontend/src/index.html | 2 +- 7 files changed, 37 insertions(+), 14 deletions(-) diff --git a/.detective/hash b/.detective/hash index afa55a4..faf9cf1 100644 --- a/.detective/hash +++ b/.detective/hash @@ -1 +1 @@ -bf3b350647d4b87dda725cc854504af6a0779b6d, v1.1.2 \ No newline at end of file +631a11342bb6aa1a99689435044d9deb25e8d4e6, v1.1.2 \ No newline at end of file diff --git a/.detective/log b/.detective/log index ca7538d..0215c91 100644 --- a/.detective/log +++ b/.detective/log @@ -1,12 +1,12 @@ -"Manfred Steyer ,Fri Sep 27 21:59:41 2024 +0200 719f061ae9dfba3795d03390d5e0e297f256cd71,feat: add store for limits" +"Manfred Steyer ,Fri Sep 27 21:59:41 2024 +0200 2f9b490469e722542cea8ac38eeabe02c5ea78e1,feat: add store for limits" 1 1 .detective/hash -10 0 .detective/log -19 0 apps/frontend/src/app/data/limits.store.ts -8 1 apps/frontend/src/app/features/coupling/coupling.component.html -21 8 apps/frontend/src/app/features/coupling/coupling.component.ts -2 0 apps/frontend/src/app/model/limits.ts -2 2 apps/frontend/src/app/ui/limits/limits.component.html -5 7 apps/frontend/src/app/ui/limits/limits.component.ts +22 0 .detective/log +15 0 apps/frontend/src/app/data/limits.store.ts +6 1 apps/frontend/src/app/features/coupling/coupling.component.html +16 8 apps/frontend/src/app/features/coupling/coupling.component.ts +4 0 apps/frontend/src/app/model/limits.ts +5 2 apps/frontend/src/app/ui/limits/limits.component.html +9 17 apps/frontend/src/app/ui/limits/limits.component.ts 32 0 package-lock.json 2 0 package.json diff --git a/apps/frontend/src/app/features/hotspot/hotspot.component.html b/apps/frontend/src/app/features/hotspot/hotspot.component.html index 81bb6d0..d989f4d 100644 --- a/apps/frontend/src/app/features/hotspot/hotspot.component.html +++ b/apps/frontend/src/app/features/hotspot/hotspot.component.html @@ -29,7 +29,12 @@ - + +
diff --git a/apps/frontend/src/app/features/hotspot/hotspot.component.ts b/apps/frontend/src/app/features/hotspot/hotspot.component.ts index 38bdbeb..af86098 100644 --- a/apps/frontend/src/app/features/hotspot/hotspot.component.ts +++ b/apps/frontend/src/app/features/hotspot/hotspot.component.ts @@ -29,6 +29,7 @@ import { } from 'rxjs'; import { HotspotService } from '../../data/hotspot.service'; +import { LimitsStore } from '../../data/limits.store'; import { StatusStore } from '../../data/status.store'; import { AggregatedHotspot, @@ -82,6 +83,8 @@ type LoadHotspotOptions = LoadAggregateOptions & { styleUrl: './hotspot.component.css', }) export class HotspotComponent { + private limitsStore = inject(LimitsStore); + private hotspotService = inject(HotspotService); private eventService = inject(EventService); @@ -100,7 +103,7 @@ export class HotspotComponent { totalCommits = this.statusStore.commits; minScoreControl = signal(10); - limits = signal(initLimits); + limits = this.limitsStore.limits; metric = signal('Length'); metricOptions: Option[] = [ @@ -164,6 +167,10 @@ export class HotspotComponent { }); } + updateLimits(limits: Limits) { + this.limitsStore.updateLimits(limits); + } + selectRow(row: AggregatedHotspot, index: number) { const selectModule = this.aggregatedResult().aggregated[index].module; this.selectedRow = row; diff --git a/apps/frontend/src/app/features/team-alignment/team-alignment.component.html b/apps/frontend/src/app/features/team-alignment/team-alignment.component.html index cb7fb72..c4078d0 100644 --- a/apps/frontend/src/app/features/team-alignment/team-alignment.component.html +++ b/apps/frontend/src/app/features/team-alignment/team-alignment.component.html @@ -18,7 +18,12 @@ help_outline
- + +
    diff --git a/apps/frontend/src/app/features/team-alignment/team-alignment.component.ts b/apps/frontend/src/app/features/team-alignment/team-alignment.component.ts index 5cd1979..322d166 100644 --- a/apps/frontend/src/app/features/team-alignment/team-alignment.component.ts +++ b/apps/frontend/src/app/features/team-alignment/team-alignment.component.ts @@ -15,6 +15,7 @@ import { of, } from 'rxjs'; +import { LimitsStore } from '../../data/limits.store'; import { StatusStore } from '../../data/status.store'; import { TeamAlignmentService } from '../../data/team-alignment.service'; import { initLimits, Limits } from '../../model/limits'; @@ -51,13 +52,14 @@ type LoadTeamAlignmentOptions = { styleUrl: './team-alignment.component.css', }) export class TeamAlignmentComponent { + private limitsStore = inject(LimitsStore); private taService = inject(TeamAlignmentService); private eventService = inject(EventService); private statusStore = inject(StatusStore); private showError = injectShowError(); totalCommits = this.statusStore.commits; - limits = signal(initLimits); + limits = this.limitsStore.limits; byUser = signal(false); alignment$ = combineLatest({ @@ -76,6 +78,10 @@ export class TeamAlignmentComponent { toAlignmentChartConfigs(this.teamAlignmentResult(), this.colors()) ); + updateLimits(limits: Limits) { + this.limitsStore.updateLimits(limits); + } + private toColors(count: number): string[] { return quantize(interpolateRainbow, count + 1); } diff --git a/apps/frontend/src/index.html b/apps/frontend/src/index.html index 52e07bb..243d1d8 100644 --- a/apps/frontend/src/index.html +++ b/apps/frontend/src/index.html @@ -2,7 +2,7 @@ - Frontend + Detective