Add the ability to pass custom defaults to createGitlabApi constructor
Signed-off-by: Jake Crews <jake.crews@daveramsey.com>
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
---
|
||||
'@backstage/plugin-cicd-statistics-module-gitlab': patch
|
||||
---
|
||||
|
||||
add the ability to add cicd default options to createGitlabApi constructor
|
||||
@@ -18,6 +18,7 @@ import {
|
||||
CicdStatisticsApi,
|
||||
CicdState,
|
||||
CicdConfiguration,
|
||||
CicdDefaults,
|
||||
Build,
|
||||
FetchBuildsOptions,
|
||||
Stage,
|
||||
@@ -47,9 +48,14 @@ export type GitlabClient = {
|
||||
*/
|
||||
export class CicdStatisticsApiGitlab implements CicdStatisticsApi {
|
||||
readonly #gitLabAuthApi: OAuthApi;
|
||||
readonly #cicdDefaults: Partial<CicdDefaults>;
|
||||
|
||||
constructor(gitLabAuthApi: OAuthApi) {
|
||||
constructor(
|
||||
gitLabAuthApi: OAuthApi,
|
||||
cicdDefaults: Partial<CicdDefaults> = {},
|
||||
) {
|
||||
this.#gitLabAuthApi = gitLabAuthApi;
|
||||
this.#cicdDefaults = cicdDefaults;
|
||||
}
|
||||
|
||||
public async createGitlabApi(
|
||||
@@ -154,6 +160,7 @@ export class CicdStatisticsApiGitlab implements CicdStatisticsApi {
|
||||
'expired',
|
||||
'unknown',
|
||||
] as const,
|
||||
defaults: this.#cicdDefaults,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user