refactor: Consume types from @backstage/plugin-azure-devops-common.
Signed-off-by: Marley Powell <Marley.Powell@exclaimer.com>
This commit is contained in:
@@ -2,4 +2,4 @@
|
||||
'@backstage/plugin-azure-devops': patch
|
||||
---
|
||||
|
||||
refactor(`@backstage/plugin-azure-devops`): Consume re-exported types from `@backstage/plugin-azure-devops-backend`.
|
||||
refactor(`@backstage/plugin-azure-devops`): Consume types from `@backstage/plugin-azure-devops-common`.
|
||||
|
||||
@@ -37,7 +37,7 @@
|
||||
"@backstage/core-components": "^0.7.2",
|
||||
"@backstage/core-plugin-api": "^0.1.12",
|
||||
"@backstage/errors": "^0.1.4",
|
||||
"@backstage/plugin-azure-devops-backend": "^0.1.4",
|
||||
"@backstage/plugin-azure-devops-common": "^0.0.1",
|
||||
"@backstage/plugin-catalog-react": "^0.6.2",
|
||||
"@backstage/theme": "^0.2.12",
|
||||
"@material-ui/core": "^4.12.2",
|
||||
|
||||
@@ -14,7 +14,11 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { RepoBuild, RepoBuildOptions } from './types';
|
||||
import {
|
||||
RepoBuild,
|
||||
RepoBuildOptions,
|
||||
} from '@backstage/plugin-azure-devops-common';
|
||||
|
||||
import { createApiRef } from '@backstage/core-plugin-api';
|
||||
|
||||
export const azureDevOpsApiRef = createApiRef<AzureDevOpsApi>({
|
||||
|
||||
@@ -14,9 +14,13 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { AzureDevOpsApi } from './AzureDevOpsApi';
|
||||
import { RepoBuild, RepoBuildOptions } from './types';
|
||||
import { DiscoveryApi, IdentityApi } from '@backstage/core-plugin-api';
|
||||
import {
|
||||
RepoBuild,
|
||||
RepoBuildOptions,
|
||||
} from '@backstage/plugin-azure-devops-common';
|
||||
|
||||
import { AzureDevOpsApi } from './AzureDevOpsApi';
|
||||
import { ResponseError } from '@backstage/errors';
|
||||
|
||||
export class AzureDevOpsClient implements AzureDevOpsApi {
|
||||
|
||||
@@ -1,34 +0,0 @@
|
||||
/*
|
||||
* Copyright 2021 The Backstage Authors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import {
|
||||
BuildResult,
|
||||
BuildStatus,
|
||||
} from '@backstage/plugin-azure-devops-backend';
|
||||
|
||||
export type RepoBuild = {
|
||||
id?: number;
|
||||
title: string;
|
||||
link?: string;
|
||||
status?: BuildStatus;
|
||||
result?: BuildResult;
|
||||
queueTime?: Date;
|
||||
source: string;
|
||||
};
|
||||
|
||||
export type RepoBuildOptions = {
|
||||
top?: number;
|
||||
};
|
||||
@@ -17,7 +17,7 @@
|
||||
import {
|
||||
BuildResult,
|
||||
BuildStatus,
|
||||
} from '@backstage/plugin-azure-devops-backend';
|
||||
} from '@backstage/plugin-azure-devops-common';
|
||||
import { getBuildResultComponent, getBuildStateComponent } from './BuildTable';
|
||||
|
||||
import { renderInTestApp } from '@backstage/test-utils';
|
||||
|
||||
@@ -18,7 +18,8 @@ import { Box, Typography } from '@material-ui/core';
|
||||
import {
|
||||
BuildResult,
|
||||
BuildStatus,
|
||||
} from '@backstage/plugin-azure-devops-backend';
|
||||
RepoBuild,
|
||||
} from '@backstage/plugin-azure-devops-common';
|
||||
import {
|
||||
Link,
|
||||
ResponseErrorPanel,
|
||||
@@ -34,7 +35,6 @@ import {
|
||||
|
||||
import { DateTime } from 'luxon';
|
||||
import React from 'react';
|
||||
import { RepoBuild } from '../../api/types';
|
||||
|
||||
export const getBuildResultComponent = (result: number | undefined) => {
|
||||
switch (result) {
|
||||
|
||||
Reference in New Issue
Block a user