mirror of
https://github.com/Unleash/unleash.git
synced 2025-09-05 17:53:12 +02:00
chore: update frontend schema - technicalDebt (#10098)
generated with `api:gen`
This commit is contained in:
parent
1e7d022b5a
commit
d5acbea711
@ -4,7 +4,6 @@ import { useProjectColor } from './useProjectColor.js';
|
||||
import { useTheme } from '@mui/material';
|
||||
import type { GroupedDataByProject } from './useGroupedProjectTrends.js';
|
||||
import useProjects from 'hooks/api/getters/useProjects/useProjects';
|
||||
import { useFlag } from '@unleash/proxy-client-react';
|
||||
|
||||
type ProjectFlagTrends = InstanceInsightsSchema['projectFlagTrends'];
|
||||
|
||||
@ -26,7 +25,6 @@ export const useProjectChartData = (
|
||||
projectFlagTrends: GroupedDataByProject<ProjectFlagTrends>,
|
||||
) => {
|
||||
const theme = useTheme();
|
||||
const healthToTechDebtEnabled = useFlag('healthToTechDebt');
|
||||
const getProjectColor = useProjectColor();
|
||||
const { projects } = useProjects();
|
||||
const projectNames = new Map(
|
||||
@ -39,17 +37,7 @@ export const useProjectChartData = (
|
||||
const color = getProjectColor(project);
|
||||
return {
|
||||
label: projectNames.get(project) || project,
|
||||
data: trends.map((item) => ({
|
||||
...item,
|
||||
|
||||
...(healthToTechDebtEnabled
|
||||
? {
|
||||
technicalDebt: item.total
|
||||
? calculateTechDebt(item)
|
||||
: undefined,
|
||||
}
|
||||
: {}),
|
||||
})),
|
||||
data: trends,
|
||||
borderColor: color,
|
||||
backgroundColor: color,
|
||||
fill: false,
|
||||
|
@ -14,6 +14,9 @@ const placeholderData: ProjectStatusSchema = {
|
||||
health: {
|
||||
current: 0,
|
||||
},
|
||||
technicalDebt: {
|
||||
current: 0,
|
||||
},
|
||||
lifecycleSummary: {
|
||||
initial: {
|
||||
currentFlags: 0,
|
||||
|
@ -37,7 +37,10 @@ export interface HealthOverviewSchema {
|
||||
featureNaming?: CreateFeatureNamingPatternSchema;
|
||||
/** An array containing an overview of all the features of the project and their individual status */
|
||||
features: FeatureSchema[];
|
||||
/** The overall [health rating](https://docs.getunleash.io/reference/technical-debt#project-status) of the project. */
|
||||
/**
|
||||
* Use `technicalDebt` instead.
|
||||
* @deprecated
|
||||
*/
|
||||
health: number;
|
||||
/**
|
||||
* The number of users/members in the project.
|
||||
@ -50,6 +53,12 @@ export interface HealthOverviewSchema {
|
||||
name: string;
|
||||
/** Project statistics */
|
||||
stats?: ProjectStatsSchema;
|
||||
/**
|
||||
* An indicator of the [project's technical debt](https://docs.getunleash.io/reference/technical-debt#project-status) on a scale from 0 to 100
|
||||
* @minimum 0
|
||||
* @maximum 100
|
||||
*/
|
||||
technicalDebt: number;
|
||||
/**
|
||||
* When the project was last updated.
|
||||
* @nullable
|
||||
|
@ -39,7 +39,10 @@ export interface HealthReportSchema {
|
||||
featureNaming?: CreateFeatureNamingPatternSchema;
|
||||
/** An array containing an overview of all the features of the project and their individual status */
|
||||
features: FeatureSchema[];
|
||||
/** The overall [health rating](https://docs.getunleash.io/reference/technical-debt#project-status) of the project. */
|
||||
/**
|
||||
* Use `technicalDebt` instead.
|
||||
* @deprecated
|
||||
*/
|
||||
health: number;
|
||||
/**
|
||||
* The number of users/members in the project.
|
||||
@ -56,6 +59,12 @@ export interface HealthReportSchema {
|
||||
staleCount: number;
|
||||
/** Project statistics */
|
||||
stats?: ProjectStatsSchema;
|
||||
/**
|
||||
* An indicator of the [project's technical debt](https://docs.getunleash.io/reference/technical-debt#project-status) on a scale from 0 to 100
|
||||
* @minimum 0
|
||||
* @maximum 100
|
||||
*/
|
||||
technicalDebt: number;
|
||||
/**
|
||||
* When the project was last updated.
|
||||
* @nullable
|
||||
|
@ -1066,6 +1066,7 @@ export * from './projectFlagCreatorsSchemaItem.js';
|
||||
export * from './projectInsightsSchema.js';
|
||||
export * from './projectInsightsSchemaHealth.js';
|
||||
export * from './projectInsightsSchemaMembers.js';
|
||||
export * from './projectInsightsSchemaTechnicalDebt.js';
|
||||
export * from './projectLinkTemplateSchema.js';
|
||||
export * from './projectOverviewSchema.js';
|
||||
export * from './projectOverviewSchemaMode.js';
|
||||
@ -1100,6 +1101,7 @@ export * from './projectStatusSchemaLifecycleSummaryLive.js';
|
||||
export * from './projectStatusSchemaLifecycleSummaryPreLive.js';
|
||||
export * from './projectStatusSchemaResources.js';
|
||||
export * from './projectStatusSchemaStaleFlags.js';
|
||||
export * from './projectStatusSchemaTechnicalDebt.js';
|
||||
export * from './projectUsersSchema.js';
|
||||
export * from './projectsSchema.js';
|
||||
export * from './provideFeedbackSchema.js';
|
||||
|
@ -9,7 +9,10 @@ export type InstanceInsightsSchemaProjectFlagTrendsItem = {
|
||||
active: number;
|
||||
/** A UTC date when the stats were captured. Time is the very end of a given day. */
|
||||
date: string;
|
||||
/** An indicator of the [project's health](https://docs.getunleash.io/reference/technical-debt#health-rating) on a scale from 0 to 100 */
|
||||
/**
|
||||
* Use `technicalDebt` instead.
|
||||
* @deprecated
|
||||
*/
|
||||
health: number;
|
||||
/** The number of time calculated potentially stale flags on a particular day */
|
||||
potentiallyStale: number;
|
||||
@ -17,6 +20,12 @@ export type InstanceInsightsSchemaProjectFlagTrendsItem = {
|
||||
project: string;
|
||||
/** The number of user marked stale flags on a particular day */
|
||||
stale: number;
|
||||
/**
|
||||
* An indicator of the [project's technical debt](https://docs.getunleash.io/reference/technical-debt) on a scale from 0 to 100
|
||||
* @minimum 0
|
||||
* @maximum 100
|
||||
*/
|
||||
technicalDebt?: number;
|
||||
/** The average time from when a feature was created to when it was enabled in the "production" environment during the current window */
|
||||
timeToProduction?: number;
|
||||
/** The number of all flags on a particular day */
|
||||
|
@ -26,7 +26,8 @@ export type PersonalDashboardProjectDetailsSchemaInsights = {
|
||||
*/
|
||||
avgHealthPastWindow: number | null;
|
||||
/**
|
||||
* The project's current health score
|
||||
* Use `technicalDebt` instead.
|
||||
* @deprecated
|
||||
* @minimum 0
|
||||
*/
|
||||
health: number;
|
||||
@ -40,6 +41,12 @@ export type PersonalDashboardProjectDetailsSchemaInsights = {
|
||||
* @minimum 0
|
||||
*/
|
||||
staleFlags: number;
|
||||
/**
|
||||
* An indicator of the [project's technical debt](https://docs.getunleash.io/reference/technical-debt#project-status) on a scale from 0 to 100
|
||||
* @minimum 0
|
||||
* @maximum 100
|
||||
*/
|
||||
technicalDebt: number;
|
||||
/**
|
||||
* The current number of non-archived flags
|
||||
* @minimum 0
|
||||
|
@ -11,7 +11,8 @@ export type PersonalDashboardSchemaProjectsItem = {
|
||||
*/
|
||||
featureCount: number;
|
||||
/**
|
||||
* An indicator of the [project's health](https://docs.getunleash.io/reference/technical-debt#project-status) on a scale from 0 to 100
|
||||
* Use `technicalDebt` instead.
|
||||
* @deprecated
|
||||
* @minimum 0
|
||||
*/
|
||||
health: number;
|
||||
@ -24,4 +25,10 @@ export type PersonalDashboardSchemaProjectsItem = {
|
||||
memberCount: number;
|
||||
/** The name of the project */
|
||||
name: string;
|
||||
/**
|
||||
* An indicator of the [project's technical debt](https://docs.getunleash.io/reference/technical-debt#project-status) on a scale from 0 to 100
|
||||
* @minimum 0
|
||||
* @maximum 100
|
||||
*/
|
||||
technicalDebt: number;
|
||||
};
|
||||
|
@ -8,6 +8,7 @@ import type { ProjectInsightsSchemaHealth } from './projectInsightsSchemaHealth.
|
||||
import type { ProjectDoraMetricsSchema } from './projectDoraMetricsSchema.js';
|
||||
import type { ProjectInsightsSchemaMembers } from './projectInsightsSchemaMembers.js';
|
||||
import type { ProjectStatsSchema } from './projectStatsSchema.js';
|
||||
import type { ProjectInsightsSchemaTechnicalDebt } from './projectInsightsSchemaTechnicalDebt.js';
|
||||
|
||||
/**
|
||||
* A high-level overview of a project insights. It contains information such as project statistics, overall health, types of flags, members overview, change requests overview.
|
||||
@ -15,7 +16,10 @@ import type { ProjectStatsSchema } from './projectStatsSchema.js';
|
||||
export interface ProjectInsightsSchema {
|
||||
/** The number of features of each type */
|
||||
featureTypeCounts: FeatureTypeCountSchema[];
|
||||
/** Health summary of the project */
|
||||
/**
|
||||
* Use `technicalDebt` instead. Summary of the project health
|
||||
* @deprecated
|
||||
*/
|
||||
health: ProjectInsightsSchemaHealth;
|
||||
/** Lead time (DORA) metrics */
|
||||
leadTime: ProjectDoraMetricsSchema;
|
||||
@ -23,4 +27,6 @@ export interface ProjectInsightsSchema {
|
||||
members: ProjectInsightsSchemaMembers;
|
||||
/** Project statistics */
|
||||
stats: ProjectStatsSchema;
|
||||
/** Summary of the projects technical debt */
|
||||
technicalDebt: ProjectInsightsSchemaTechnicalDebt;
|
||||
}
|
||||
|
@ -5,14 +5,15 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
* Health summary of the project
|
||||
* Use `technicalDebt` instead. Summary of the project health
|
||||
* @deprecated
|
||||
*/
|
||||
export type ProjectInsightsSchemaHealth = {
|
||||
/** The number of active feature flags. */
|
||||
activeCount: number;
|
||||
/** The number of potentially stale feature flags. */
|
||||
potentiallyStaleCount: number;
|
||||
/** An indicator of the [project's health](https://docs.getunleash.io/reference/technical-debt#project-status) on a scale from 0 to 100 */
|
||||
/** An indicator of the [project's technical debt](https://docs.getunleash.io/reference/technical-debt#project-status) on a scale from 0 to 100 */
|
||||
rating: number;
|
||||
/** The number of stale feature flags. */
|
||||
staleCount: number;
|
||||
|
@ -0,0 +1,23 @@
|
||||
/**
|
||||
* Generated by Orval
|
||||
* Do not edit manually.
|
||||
* See `gen:api` script in package.json
|
||||
*/
|
||||
|
||||
/**
|
||||
* Summary of the projects technical debt
|
||||
*/
|
||||
export type ProjectInsightsSchemaTechnicalDebt = {
|
||||
/** The number of active feature flags. */
|
||||
activeCount: number;
|
||||
/** The number of potentially stale feature flags. */
|
||||
potentiallyStaleCount: number;
|
||||
/**
|
||||
* An indicator of the [project's technical debt](https://docs.getunleash.io/reference/technical-debt#project-status) on a scale from 0 to 100
|
||||
* @minimum 0
|
||||
* @maximum 100
|
||||
*/
|
||||
rating: number;
|
||||
/** The number of stale feature flags. */
|
||||
staleCount: number;
|
||||
};
|
@ -44,7 +44,10 @@ export interface ProjectOverviewSchema {
|
||||
featureNaming?: CreateFeatureNamingPatternSchema;
|
||||
/** The number of features of each type that are in this project */
|
||||
featureTypeCounts?: FeatureTypeCountSchema[];
|
||||
/** An indicator of the [project's health](https://docs.getunleash.io/reference/technical-debt#project-status) on a scale from 0 to 100 */
|
||||
/**
|
||||
* Use `technicalDebt` instead.
|
||||
* @deprecated
|
||||
*/
|
||||
health?: number;
|
||||
/** A list of templates for links that will be automatically added to new feature flags. */
|
||||
linkTemplates?: ProjectLinkTemplateSchema[];
|
||||
@ -58,6 +61,12 @@ export interface ProjectOverviewSchema {
|
||||
onboardingStatus: ProjectOverviewSchemaOnboardingStatus;
|
||||
/** Project statistics */
|
||||
stats?: ProjectStatsSchema;
|
||||
/**
|
||||
* An indicator of the [project's technical debt](https://docs.getunleash.io/reference/technical-debt#project-status) on a scale from 0 to 100
|
||||
* @minimum 0
|
||||
* @maximum 100
|
||||
*/
|
||||
technicalDebt?: number;
|
||||
/**
|
||||
* When the project was last updated.
|
||||
* @nullable
|
||||
|
@ -37,7 +37,10 @@ export interface ProjectSchema {
|
||||
favorite?: boolean;
|
||||
/** The number of features this project has */
|
||||
featureCount?: number;
|
||||
/** An indicator of the [project's health](https://docs.getunleash.io/reference/technical-debt#project-status) on a scale from 0 to 100 */
|
||||
/**
|
||||
* Use `technicalDebt` instead.
|
||||
* @deprecated
|
||||
*/
|
||||
health?: number;
|
||||
/** The id of this project */
|
||||
id: string;
|
||||
@ -69,6 +72,12 @@ export interface ProjectSchema {
|
||||
* @deprecated
|
||||
*/
|
||||
staleFeatureCount?: number;
|
||||
/**
|
||||
* An indicator of the [project's technical debt](https://docs.getunleash.io/reference/technical-debt#project-status) on a scale from 0 to 100
|
||||
* @minimum 0
|
||||
* @maximum 100
|
||||
*/
|
||||
technicalDebt?: number;
|
||||
/**
|
||||
* When this project was last updated.
|
||||
* @deprecated
|
||||
|
@ -8,6 +8,7 @@ import type { ProjectStatusSchemaHealth } from './projectStatusSchemaHealth.js';
|
||||
import type { ProjectStatusSchemaLifecycleSummary } from './projectStatusSchemaLifecycleSummary.js';
|
||||
import type { ProjectStatusSchemaResources } from './projectStatusSchemaResources.js';
|
||||
import type { ProjectStatusSchemaStaleFlags } from './projectStatusSchemaStaleFlags.js';
|
||||
import type { ProjectStatusSchemaTechnicalDebt } from './projectStatusSchemaTechnicalDebt.js';
|
||||
|
||||
/**
|
||||
* Schema representing the overall status of a project, including an array of activity records. Each record in the activity array contains a date and a count, providing a snapshot of the project’s activity level over time.
|
||||
@ -23,4 +24,6 @@ export interface ProjectStatusSchema {
|
||||
resources: ProjectStatusSchemaResources;
|
||||
/** Information on stale and potentially stale flags in this project. */
|
||||
staleFlags: ProjectStatusSchemaStaleFlags;
|
||||
/** Information about the project's health rating */
|
||||
technicalDebt: ProjectStatusSchemaTechnicalDebt;
|
||||
}
|
||||
|
@ -0,0 +1,17 @@
|
||||
/**
|
||||
* Generated by Orval
|
||||
* Do not edit manually.
|
||||
* See `gen:api` script in package.json
|
||||
*/
|
||||
|
||||
/**
|
||||
* Information about the project's health rating
|
||||
*/
|
||||
export type ProjectStatusSchemaTechnicalDebt = {
|
||||
/**
|
||||
* The project's current health score, based on the ratio of healthy flags to stale and potentially stale flags.
|
||||
* @minimum 0
|
||||
* @maximum 100
|
||||
*/
|
||||
current: number;
|
||||
};
|
Loading…
Reference in New Issue
Block a user