fix(cicd-statistics): Made FilterBranchType and FilterStatusType not be parameterized
Signed-off-by: Gustaf Räntilä <g.rantila@gmail.com>
This commit is contained in:
@@ -58,7 +58,7 @@ export interface CicdDefaults {
|
||||
// (undocumented)
|
||||
filterStatus: Array<FilterStatusType>;
|
||||
// (undocumented)
|
||||
filterType: FilterBranchType<'all'>;
|
||||
filterType: FilterBranchType | 'all';
|
||||
lowercaseNames: boolean;
|
||||
normalizeTimeRange: boolean;
|
||||
// (undocumented)
|
||||
@@ -117,9 +117,9 @@ export interface FetchBuildsOptions {
|
||||
// (undocumented)
|
||||
entity: Entity;
|
||||
// (undocumented)
|
||||
filterStatus: Array<FilterStatusType<'all'>>;
|
||||
filterStatus: Array<FilterStatusType | 'all'>;
|
||||
// (undocumented)
|
||||
filterType: FilterBranchType<'all'>;
|
||||
filterType: FilterBranchType | 'all';
|
||||
// (undocumented)
|
||||
timeFrom: Date;
|
||||
// (undocumented)
|
||||
@@ -131,16 +131,12 @@ export interface FetchBuildsOptions {
|
||||
// Warning: (ae-missing-release-tag) "FilterBranchType" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
|
||||
//
|
||||
// @public
|
||||
export type FilterBranchType<Extra extends string = never> =
|
||||
| Extra
|
||||
| 'master'
|
||||
| 'branch';
|
||||
export type FilterBranchType = 'master' | 'branch';
|
||||
|
||||
// Warning: (ae-missing-release-tag) "FilterStatusType" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
|
||||
//
|
||||
// @public
|
||||
export type FilterStatusType<Extra extends string = never> =
|
||||
| Extra
|
||||
export type FilterStatusType =
|
||||
| 'unknown'
|
||||
| 'enqueued'
|
||||
| 'scheduled'
|
||||
|
||||
@@ -22,8 +22,7 @@ import { Entity } from '@backstage/catalog-model';
|
||||
* If all of these aren't applicable to the underlying CI/CD, these can be
|
||||
* configured to be hidden, using the `availableStatuses` in `CicdConfiguration`.
|
||||
*/
|
||||
export type FilterStatusType<Extra extends string = never> =
|
||||
| Extra
|
||||
export type FilterStatusType =
|
||||
| 'unknown'
|
||||
| 'enqueued'
|
||||
| 'scheduled'
|
||||
@@ -52,10 +51,7 @@ export const statusTypes: Array<FilterStatusType> = [
|
||||
* something like 'release' or 'main' or 'trunk' in the underlying CI/CD system,
|
||||
* which is then up to the Api to map accordingly.
|
||||
*/
|
||||
export type FilterBranchType<Extra extends string = never> =
|
||||
| Extra
|
||||
| 'master'
|
||||
| 'branch';
|
||||
export type FilterBranchType = 'master' | 'branch';
|
||||
export const branchTypes: Array<FilterBranchType> = ['master', 'branch'];
|
||||
|
||||
/**
|
||||
@@ -122,7 +118,7 @@ export interface CicdDefaults {
|
||||
timeFrom: Date;
|
||||
timeTo: Date;
|
||||
filterStatus: Array<FilterStatusType>;
|
||||
filterType: FilterBranchType<'all'>;
|
||||
filterType: FilterBranchType | 'all';
|
||||
|
||||
/** Lower-case all stage names (to potentially merge stages with different cases) */
|
||||
lowercaseNames: boolean;
|
||||
@@ -219,8 +215,8 @@ export interface FetchBuildsOptions {
|
||||
abortSignal: AbortSignal;
|
||||
timeFrom: Date;
|
||||
timeTo: Date;
|
||||
filterStatus: Array<FilterStatusType<'all'>>;
|
||||
filterType: FilterBranchType<'all'>;
|
||||
filterStatus: Array<FilterStatusType | 'all'>;
|
||||
filterType: FilterBranchType | 'all';
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -74,7 +74,7 @@ const useStyles = makeStyles<Theme>(
|
||||
},
|
||||
);
|
||||
|
||||
export type BranchSelection = FilterBranchType<'all'>;
|
||||
export type BranchSelection = FilterBranchType | 'all';
|
||||
export type StatusSelection = FilterStatusType;
|
||||
|
||||
export interface ChartFilter {
|
||||
|
||||
@@ -33,8 +33,8 @@ export interface UseCicdStatisticsOptions {
|
||||
abortController: AbortController;
|
||||
timeFrom: Date;
|
||||
timeTo: Date;
|
||||
filterStatus: Array<FilterStatusType<'all'>>;
|
||||
filterType: FilterBranchType<'all'>;
|
||||
filterStatus: Array<FilterStatusType | 'all'>;
|
||||
filterType: FilterBranchType | 'all';
|
||||
}
|
||||
|
||||
export function useCicdStatistics(
|
||||
|
||||
Reference in New Issue
Block a user