{field}
@@ -38,6 +38,6 @@ interface GridProps {
export const DataValueGridItem = (props: DataValueProps & GridProps) => (
-
+
);
diff --git a/plugins/xcmetrics/src/components/DataValue/index.ts b/plugins/xcmetrics/src/components/DataValue/index.ts
new file mode 100644
index 0000000000..99658f96b1
--- /dev/null
+++ b/plugins/xcmetrics/src/components/DataValue/index.ts
@@ -0,0 +1,16 @@
+/*
+ * 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.
+ */
+export { DataValue, DataValueGridItem } from './DataValue';
diff --git a/plugins/xcmetrics/src/components/DatePickerComponent/DatePickerComponent.test.tsx b/plugins/xcmetrics/src/components/DatePicker/DatePicker.test.tsx
similarity index 81%
rename from plugins/xcmetrics/src/components/DatePickerComponent/DatePickerComponent.test.tsx
rename to plugins/xcmetrics/src/components/DatePicker/DatePicker.test.tsx
index 74633fe786..924e83da7e 100644
--- a/plugins/xcmetrics/src/components/DatePickerComponent/DatePickerComponent.test.tsx
+++ b/plugins/xcmetrics/src/components/DatePicker/DatePicker.test.tsx
@@ -15,15 +15,13 @@
*/
import React from 'react';
import { renderInTestApp } from '@backstage/test-utils';
-import { DatePickerComponent } from './DatePickerComponent';
+import { DatePicker } from './DatePicker';
import userEvent from '@testing-library/user-event';
-describe('DatePickerComponent', () => {
+describe('DatePicker', () => {
it('should render', async () => {
const label = 'label';
- const rendered = await renderInTestApp(
-
,
- );
+ const rendered = await renderInTestApp(
);
expect(rendered.getByText(label)).toBeInTheDocument();
});
@@ -31,7 +29,7 @@ describe('DatePickerComponent', () => {
const label = 'label';
const callback = jest.fn();
const rendered = await renderInTestApp(
-
,
+
,
);
const input = rendered.getByLabelText(label);
@@ -43,7 +41,7 @@ describe('DatePickerComponent', () => {
const label = 'label';
const callback = jest.fn();
const rendered = await renderInTestApp(
-
,
+
,
);
const input = rendered.getByLabelText(label);
diff --git a/plugins/xcmetrics/src/components/DatePickerComponent/DatePickerComponent.tsx b/plugins/xcmetrics/src/components/DatePicker/DatePicker.tsx
similarity index 98%
rename from plugins/xcmetrics/src/components/DatePickerComponent/DatePickerComponent.tsx
rename to plugins/xcmetrics/src/components/DatePicker/DatePicker.tsx
index 854fbbd87f..b524243ff7 100644
--- a/plugins/xcmetrics/src/components/DatePickerComponent/DatePickerComponent.tsx
+++ b/plugins/xcmetrics/src/components/DatePicker/DatePicker.tsx
@@ -63,7 +63,7 @@ interface DatePickerProps {
onDateChange?: (date: string) => void;
}
-export const DatePickerComponent = ({
+export const DatePicker = ({
label,
onDateChange,
...inputProps
diff --git a/plugins/xcmetrics/src/components/OverviewComponent/index.ts b/plugins/xcmetrics/src/components/DatePicker/index.ts
similarity index 93%
rename from plugins/xcmetrics/src/components/OverviewComponent/index.ts
rename to plugins/xcmetrics/src/components/DatePicker/index.ts
index 58b284e6f1..599f24510f 100644
--- a/plugins/xcmetrics/src/components/OverviewComponent/index.ts
+++ b/plugins/xcmetrics/src/components/DatePicker/index.ts
@@ -13,4 +13,4 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-export * from './OverviewComponent';
+export { DatePicker } from './DatePicker';
diff --git a/plugins/xcmetrics/src/components/OverviewComponent/OverviewComponent.test.tsx b/plugins/xcmetrics/src/components/Overview/Overview.test.tsx
similarity index 84%
rename from plugins/xcmetrics/src/components/OverviewComponent/OverviewComponent.test.tsx
rename to plugins/xcmetrics/src/components/Overview/Overview.test.tsx
index fb5ef42cd8..3d24d2a422 100644
--- a/plugins/xcmetrics/src/components/OverviewComponent/OverviewComponent.test.tsx
+++ b/plugins/xcmetrics/src/components/Overview/Overview.test.tsx
@@ -17,26 +17,26 @@ import React from 'react';
import { renderInTestApp } from '@backstage/test-utils';
import { xcmetricsApiRef } from '../../api';
import { ApiProvider, ApiRegistry } from '@backstage/core-app-api';
-import { OverviewComponent } from './OverviewComponent';
+import { Overview } from './Overview';
jest.mock('../../api/XcmetricsClient');
const client = require('../../api/XcmetricsClient');
-jest.mock('../OverviewTrendsComponent', () => ({
- OverviewTrendsComponent: () => 'OverviewTrendsComponent',
+jest.mock('../OverviewTrends', () => ({
+ OverviewTrends: () => 'OverviewTrends',
}));
-jest.mock('../StatusMatrixComponent', () => ({
- StatusMatrixComponent: () => 'StatusMatrixComponent',
+jest.mock('../StatusMatrix', () => ({
+ StatusMatrix: () => 'StatusMatrix',
}));
-describe('OverviewComponent', () => {
+describe('Overview', () => {
it('should render', async () => {
const rendered = await renderInTestApp(
-
+
,
);
@@ -50,7 +50,7 @@ describe('OverviewComponent', () => {
const rendered = await renderInTestApp(
-
+
,
);
@@ -65,7 +65,7 @@ describe('OverviewComponent', () => {
const rendered = await renderInTestApp(
-
+
,
);
diff --git a/plugins/xcmetrics/src/components/OverviewComponent/OverviewComponent.tsx b/plugins/xcmetrics/src/components/Overview/Overview.tsx
similarity index 89%
rename from plugins/xcmetrics/src/components/OverviewComponent/OverviewComponent.tsx
rename to plugins/xcmetrics/src/components/Overview/Overview.tsx
index b293c2a99c..e7a9a1d705 100644
--- a/plugins/xcmetrics/src/components/OverviewComponent/OverviewComponent.tsx
+++ b/plugins/xcmetrics/src/components/Overview/Overview.tsx
@@ -26,12 +26,12 @@ import { useApi } from '@backstage/core-plugin-api';
import { xcmetricsApiRef } from '../../api';
import { useAsync } from 'react-use';
import { Alert } from '@material-ui/lab';
-import { StatusMatrixComponent } from '../StatusMatrixComponent';
+import { StatusMatrix } from '../StatusMatrix';
import { Grid } from '@material-ui/core';
-import { OverviewTrendsComponent } from '../OverviewTrendsComponent';
+import { OverviewTrends } from '../OverviewTrends';
import { overviewColumns } from '../BuildTableColumns';
-export const OverviewComponent = () => {
+export const Overview = () => {
const client = useApi(xcmetricsApiRef);
const {
value: builds,
@@ -74,14 +74,14 @@ export const OverviewComponent = () => {
title={
<>
Latest Builds
-
+
>
}
/>
-
+
diff --git a/plugins/xcmetrics/src/components/DataValueComponent/index.ts b/plugins/xcmetrics/src/components/Overview/index.ts
similarity index 93%
rename from plugins/xcmetrics/src/components/DataValueComponent/index.ts
rename to plugins/xcmetrics/src/components/Overview/index.ts
index cbf0ffe851..77685905e9 100644
--- a/plugins/xcmetrics/src/components/DataValueComponent/index.ts
+++ b/plugins/xcmetrics/src/components/Overview/index.ts
@@ -13,4 +13,4 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-export * from './DataValueComponent';
+export { Overview } from './Overview';
diff --git a/plugins/xcmetrics/src/components/OverviewTrendsComponent/OverviewTrendsComponent.test.tsx b/plugins/xcmetrics/src/components/OverviewTrends/OverviewTrends.test.tsx
similarity index 91%
rename from plugins/xcmetrics/src/components/OverviewTrendsComponent/OverviewTrendsComponent.test.tsx
rename to plugins/xcmetrics/src/components/OverviewTrends/OverviewTrends.test.tsx
index cb33be1451..76b47f4943 100644
--- a/plugins/xcmetrics/src/components/OverviewTrendsComponent/OverviewTrendsComponent.test.tsx
+++ b/plugins/xcmetrics/src/components/OverviewTrends/OverviewTrends.test.tsx
@@ -14,7 +14,7 @@
* limitations under the License.
*/
import React from 'react';
-import { OverviewTrendsComponent } from './OverviewTrendsComponent';
+import { OverviewTrends } from './OverviewTrends';
import { renderInTestApp } from '@backstage/test-utils';
import { xcmetricsApiRef } from '../../api';
import { ApiProvider, ApiRegistry } from '@backstage/core-app-api';
@@ -23,13 +23,13 @@ import userEvent from '@testing-library/user-event';
jest.mock('../../api/XcmetricsClient');
const client = require('../../api/XcmetricsClient');
-describe('OverviewTrendsComponent', () => {
+describe('OverviewTrends', () => {
it('should render', async () => {
const rendered = await renderInTestApp(
-
+
,
);
expect(rendered.getByText('Trends for')).toBeInTheDocument();
@@ -43,7 +43,7 @@ describe('OverviewTrendsComponent', () => {
const rendered = await renderInTestApp(
-
+
,
);
expect(rendered.getByText('--')).toBeInTheDocument();
@@ -54,7 +54,7 @@ describe('OverviewTrendsComponent', () => {
-
+
,
);
@@ -77,7 +77,7 @@ describe('OverviewTrendsComponent', () => {
const rendered = await renderInTestApp(
-
+
,
);
expect(rendered.getByText(buildCountError)).toBeInTheDocument();
diff --git a/plugins/xcmetrics/src/components/OverviewTrendsComponent/OverviewTrendsComponent.tsx b/plugins/xcmetrics/src/components/OverviewTrends/OverviewTrends.tsx
similarity index 95%
rename from plugins/xcmetrics/src/components/OverviewTrendsComponent/OverviewTrendsComponent.tsx
rename to plugins/xcmetrics/src/components/OverviewTrends/OverviewTrends.tsx
index 52ac632cc3..8b16d689bb 100644
--- a/plugins/xcmetrics/src/components/OverviewTrendsComponent/OverviewTrendsComponent.tsx
+++ b/plugins/xcmetrics/src/components/OverviewTrends/OverviewTrends.tsx
@@ -16,12 +16,12 @@
import { Grid, makeStyles, useTheme } from '@material-ui/core';
import React, { useState } from 'react';
import { Progress, Select } from '@backstage/core-components';
-import { TrendComponent } from '../TrendComponent';
+import { Trend } from '../Trend';
import { Alert, AlertTitle } from '@material-ui/lab';
import { xcmetricsApiRef } from '../../api';
import { useAsync } from 'react-use';
import { useApi } from '@backstage/core-plugin-api';
-import { DataValueGridItem } from '../DataValueComponent';
+import { DataValueGridItem } from '../DataValue';
import {
formatDuration,
formatPercentage,
@@ -49,7 +49,7 @@ const DAYS_SELECT_ITEMS = [
{ label: '60 days', value: 60 },
];
-export const OverviewTrendsComponent = () => {
+export const OverviewTrends = () => {
const [days, setDays] = useState(14);
const theme = useTheme
();
const classes = useStyles();
@@ -103,17 +103,17 @@ export const OverviewTrendsComponent = () => {
)}
{(!buildCountsResult.error || !buildTimesResult.error) && (
-
e.durationP50, buildTimesResult.value)}
/>
-
- e.builds, buildCountsResult.value)}
diff --git a/plugins/xcmetrics/src/components/OverviewTrends/index.ts b/plugins/xcmetrics/src/components/OverviewTrends/index.ts
new file mode 100644
index 0000000000..7a3e7e62b9
--- /dev/null
+++ b/plugins/xcmetrics/src/components/OverviewTrends/index.ts
@@ -0,0 +1,16 @@
+/*
+ * 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.
+ */
+export { OverviewTrends } from './OverviewTrends';
diff --git a/plugins/xcmetrics/src/components/OverviewTrendsComponent/index.ts b/plugins/xcmetrics/src/components/OverviewTrendsComponent/index.ts
deleted file mode 100644
index 778a4bf503..0000000000
--- a/plugins/xcmetrics/src/components/OverviewTrendsComponent/index.ts
+++ /dev/null
@@ -1,16 +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.
- */
-export * from './OverviewTrendsComponent';
diff --git a/plugins/xcmetrics/src/components/PreformattedTextComponent/PreformattedTextComponent.tsx b/plugins/xcmetrics/src/components/PreformattedText/PreformattedText.tsx
similarity index 98%
rename from plugins/xcmetrics/src/components/PreformattedTextComponent/PreformattedTextComponent.tsx
rename to plugins/xcmetrics/src/components/PreformattedText/PreformattedText.tsx
index b73e2cead5..c2c3f8ce25 100644
--- a/plugins/xcmetrics/src/components/PreformattedTextComponent/PreformattedTextComponent.tsx
+++ b/plugins/xcmetrics/src/components/PreformattedText/PreformattedText.tsx
@@ -65,7 +65,7 @@ interface NonExpandableProps extends PreformattedTextProps {
title?: string;
}
-export const PreformattedTextComponent = ({
+export const PreformattedText = ({
text,
maxChars,
expandable,
diff --git a/plugins/xcmetrics/src/components/PreformattedText/index.ts b/plugins/xcmetrics/src/components/PreformattedText/index.ts
new file mode 100644
index 0000000000..9a03d821b2
--- /dev/null
+++ b/plugins/xcmetrics/src/components/PreformattedText/index.ts
@@ -0,0 +1,16 @@
+/*
+ * 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.
+ */
+export { PreformattedText } from './PreformattedText';
diff --git a/plugins/xcmetrics/src/components/PreformattedTextComponent/index.ts b/plugins/xcmetrics/src/components/PreformattedTextComponent/index.ts
deleted file mode 100644
index dbc27dd869..0000000000
--- a/plugins/xcmetrics/src/components/PreformattedTextComponent/index.ts
+++ /dev/null
@@ -1,16 +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.
- */
-export { PreformattedTextComponent } from './PreformattedTextComponent';
diff --git a/plugins/xcmetrics/src/components/StatusCellComponent/StatusCellComponent.test.tsx b/plugins/xcmetrics/src/components/StatusCell/StatusCell.test.tsx
similarity index 93%
rename from plugins/xcmetrics/src/components/StatusCellComponent/StatusCellComponent.test.tsx
rename to plugins/xcmetrics/src/components/StatusCell/StatusCell.test.tsx
index 6ee832ceb8..cac111d13e 100644
--- a/plugins/xcmetrics/src/components/StatusCellComponent/StatusCellComponent.test.tsx
+++ b/plugins/xcmetrics/src/components/StatusCell/StatusCell.test.tsx
@@ -17,20 +17,20 @@ import React from 'react';
import { renderInTestApp } from '@backstage/test-utils';
import { ApiProvider, ApiRegistry } from '@backstage/core-app-api';
import userEvent from '@testing-library/user-event';
-import { StatusCellComponent } from './StatusCellComponent';
+import { StatusCell } from './StatusCell';
import { xcmetricsApiRef } from '../../api';
import { formatDuration, formatStatus } from '../../utils';
jest.mock('../../api/XcmetricsClient');
const client = require('../../api/XcmetricsClient');
-describe('StatusCellComponent', () => {
+describe('StatusCell', () => {
it('should render', async () => {
const rendered = await renderInTestApp(
- (theme => ({
} as StatusStyle),
}));
-export const StatusCellComponent = (props: StatusCellProps) => {
+export const StatusCell = (props: StatusCellProps) => {
const classes = useStyles(props);
const { buildStatus } = props;
diff --git a/plugins/xcmetrics/src/components/StatusCell/index.ts b/plugins/xcmetrics/src/components/StatusCell/index.ts
new file mode 100644
index 0000000000..60008aeacf
--- /dev/null
+++ b/plugins/xcmetrics/src/components/StatusCell/index.ts
@@ -0,0 +1,16 @@
+/*
+ * 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.
+ */
+export { StatusCell } from './StatusCell';
diff --git a/plugins/xcmetrics/src/components/StatusCellComponent/index.ts b/plugins/xcmetrics/src/components/StatusCellComponent/index.ts
deleted file mode 100644
index e1d4f81e34..0000000000
--- a/plugins/xcmetrics/src/components/StatusCellComponent/index.ts
+++ /dev/null
@@ -1,16 +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.
- */
-export * from './StatusCellComponent';
diff --git a/plugins/xcmetrics/src/components/StatusIconComponent/StatusIconComponent.test.tsx b/plugins/xcmetrics/src/components/StatusIcon/StatusIcon.test.tsx
similarity index 74%
rename from plugins/xcmetrics/src/components/StatusIconComponent/StatusIconComponent.test.tsx
rename to plugins/xcmetrics/src/components/StatusIcon/StatusIcon.test.tsx
index 8833d828f0..a208432f59 100644
--- a/plugins/xcmetrics/src/components/StatusIconComponent/StatusIconComponent.test.tsx
+++ b/plugins/xcmetrics/src/components/StatusIcon/StatusIcon.test.tsx
@@ -16,23 +16,19 @@
import React from 'react';
import { renderInTestApp } from '@backstage/test-utils';
-import { StatusIconComponent } from './StatusIconComponent';
+import { StatusIcon } from './StatusIcon';
-describe('StatusIconComponent', () => {
+describe('StatusIcon', () => {
it('should render', async () => {
let rendered = await renderInTestApp(
- ,
+ ,
);
expect(rendered.getByLabelText('Status ok')).toBeInTheDocument();
- rendered = await renderInTestApp(
- ,
- );
+ rendered = await renderInTestApp();
expect(rendered.getByLabelText('Status error')).toBeInTheDocument();
- rendered = await renderInTestApp(
- ,
- );
+ rendered = await renderInTestApp();
expect(rendered.getByLabelText('Status warning')).toBeInTheDocument();
});
});
diff --git a/plugins/xcmetrics/src/components/StatusIconComponent/StatusIconComponent.tsx b/plugins/xcmetrics/src/components/StatusIcon/StatusIcon.tsx
similarity index 93%
rename from plugins/xcmetrics/src/components/StatusIconComponent/StatusIconComponent.tsx
rename to plugins/xcmetrics/src/components/StatusIcon/StatusIcon.tsx
index f680003ff4..610575b817 100644
--- a/plugins/xcmetrics/src/components/StatusIconComponent/StatusIconComponent.tsx
+++ b/plugins/xcmetrics/src/components/StatusIcon/StatusIcon.tsx
@@ -31,5 +31,5 @@ interface StatusIconProps {
buildStatus: BuildStatus;
}
-export const StatusIconComponent = ({ buildStatus }: StatusIconProps) =>
+export const StatusIcon = ({ buildStatus }: StatusIconProps) =>
STATUS_ICONS[buildStatus];
diff --git a/plugins/xcmetrics/src/components/StatusIcon/index.ts b/plugins/xcmetrics/src/components/StatusIcon/index.ts
new file mode 100644
index 0000000000..597caaca89
--- /dev/null
+++ b/plugins/xcmetrics/src/components/StatusIcon/index.ts
@@ -0,0 +1,16 @@
+/*
+ * 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.
+ */
+export { StatusIcon } from './StatusIcon';
diff --git a/plugins/xcmetrics/src/components/StatusIconComponent/index.ts b/plugins/xcmetrics/src/components/StatusIconComponent/index.ts
deleted file mode 100644
index b69415bd78..0000000000
--- a/plugins/xcmetrics/src/components/StatusIconComponent/index.ts
+++ /dev/null
@@ -1,16 +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.
- */
-export { StatusIconComponent } from './StatusIconComponent';
diff --git a/plugins/xcmetrics/src/components/StatusMatrixComponent/StatusMatrixComponent.test.tsx b/plugins/xcmetrics/src/components/StatusMatrix/StatusMatrix.test.tsx
similarity index 89%
rename from plugins/xcmetrics/src/components/StatusMatrixComponent/StatusMatrixComponent.test.tsx
rename to plugins/xcmetrics/src/components/StatusMatrix/StatusMatrix.test.tsx
index aac029a919..7d3854bbda 100644
--- a/plugins/xcmetrics/src/components/StatusMatrixComponent/StatusMatrixComponent.test.tsx
+++ b/plugins/xcmetrics/src/components/StatusMatrix/StatusMatrix.test.tsx
@@ -16,19 +16,19 @@
import React from 'react';
import { renderInTestApp } from '@backstage/test-utils';
import { ApiProvider, ApiRegistry } from '@backstage/core-app-api';
-import { StatusMatrixComponent } from './StatusMatrixComponent';
+import { StatusMatrix } from './StatusMatrix';
import { xcmetricsApiRef } from '../../api';
jest.mock('../../api/XcmetricsClient');
const client = require('../../api/XcmetricsClient');
-describe('StatusMatrixComponent', () => {
+describe('StatusMatrix', () => {
it('should render', async () => {
const rendered = await renderInTestApp(
-
+
,
);
diff --git a/plugins/xcmetrics/src/components/StatusMatrixComponent/StatusMatrixComponent.tsx b/plugins/xcmetrics/src/components/StatusMatrix/StatusMatrix.tsx
similarity index 89%
rename from plugins/xcmetrics/src/components/StatusMatrixComponent/StatusMatrixComponent.tsx
rename to plugins/xcmetrics/src/components/StatusMatrix/StatusMatrix.tsx
index 503c0b7ed4..e7f3294e6d 100644
--- a/plugins/xcmetrics/src/components/StatusMatrixComponent/StatusMatrixComponent.tsx
+++ b/plugins/xcmetrics/src/components/StatusMatrix/StatusMatrix.tsx
@@ -21,7 +21,7 @@ import { useAsync, useMeasure } from 'react-use';
import { cn } from '../../utils';
import { useApi } from '@backstage/core-plugin-api';
import { Alert } from '@material-ui/lab';
-import { StatusCellComponent } from '../StatusCellComponent';
+import { StatusCell } from '../StatusCell';
const CELL_SIZE = 12;
const CELL_MARGIN = 4;
@@ -44,7 +44,7 @@ const useStyles = makeStyles(theme => ({
},
}));
-export const StatusMatrixComponent = () => {
+export const StatusMatrix = () => {
const classes = useStyles();
const [measureRef, { width: rootWidth }] = useMeasure();
const client = useApi(xcmetricsApiRef);
@@ -68,11 +68,7 @@ export const StatusMatrixComponent = () => {
{loading &&
[...new Array(cols * MAX_ROWS)].map((_, index) => {
return (
-
+
);
})}
@@ -80,7 +76,7 @@ export const StatusMatrixComponent = () => {
builds
.slice(0, cols * MAX_ROWS)
.map((buildStatus, index) => (
- {
+describe('Trend', () => {
it('should render', async () => {
const data = [1, 2, 3, 4];
const title = 'testTitle';
const rendered = await renderInTestApp(
- ,
+ ,
);
expect(rendered.findAllByText('testTitle')).toBeTruthy();
});
@@ -30,7 +30,7 @@ describe('TrendComponent', () => {
it('should render empty state', async () => {
const title = 'testTitle';
const rendered = await renderInTestApp(
- ,
+ ,
);
expect(rendered.findAllByText('testTitle')).toBeTruthy();
});
diff --git a/plugins/xcmetrics/src/components/TrendComponent/TrendComponent.tsx b/plugins/xcmetrics/src/components/Trend/Trend.tsx
similarity index 93%
rename from plugins/xcmetrics/src/components/TrendComponent/TrendComponent.tsx
rename to plugins/xcmetrics/src/components/Trend/Trend.tsx
index ece6acfd6c..575872e813 100644
--- a/plugins/xcmetrics/src/components/TrendComponent/TrendComponent.tsx
+++ b/plugins/xcmetrics/src/components/Trend/Trend.tsx
@@ -23,7 +23,7 @@ interface TrendProps {
color: string;
}
-export const TrendComponent = ({ data, title, color }: TrendProps) => {
+export const Trend = ({ data, title, color }: TrendProps) => {
const emptyData = [0, 0];
const max = Math.max(...(data ?? emptyData));
diff --git a/plugins/xcmetrics/src/components/TrendComponent/index.ts b/plugins/xcmetrics/src/components/Trend/index.ts
similarity index 94%
rename from plugins/xcmetrics/src/components/TrendComponent/index.ts
rename to plugins/xcmetrics/src/components/Trend/index.ts
index 69dce3ff7f..5e32e2fe3c 100644
--- a/plugins/xcmetrics/src/components/TrendComponent/index.ts
+++ b/plugins/xcmetrics/src/components/Trend/index.ts
@@ -13,4 +13,4 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-export * from './TrendComponent';
+export { Trend } from './Trend';
diff --git a/plugins/xcmetrics/src/components/XcmetricsLayout/XcmetricsLayout.test.tsx b/plugins/xcmetrics/src/components/XcmetricsLayout/XcmetricsLayout.test.tsx
index b0d81757a9..84bd25624c 100644
--- a/plugins/xcmetrics/src/components/XcmetricsLayout/XcmetricsLayout.test.tsx
+++ b/plugins/xcmetrics/src/components/XcmetricsLayout/XcmetricsLayout.test.tsx
@@ -23,12 +23,12 @@ import userEvent from '@testing-library/user-event';
jest.mock('../../api/XcmetricsClient');
const client = require('../../api/XcmetricsClient');
-jest.mock('../OverviewComponent', () => ({
- OverviewComponent: () => 'OverviewComponent',
+jest.mock('../Overview', () => ({
+ Overview: () => 'OverviewComponent',
}));
-jest.mock('../BuildListComponent', () => ({
- BuildListComponent: () => 'BuildListComponent',
+jest.mock('../BuildList', () => ({
+ BuildList: () => 'BuildList',
}));
describe('XcmetricsLayout', () => {
@@ -45,7 +45,18 @@ describe('XcmetricsLayout', () => {
expect(rendered.getByText('Builds')).toBeInTheDocument();
expect(rendered.getByText('OverviewComponent')).toBeInTheDocument();
+ });
+
+ it('should show a list of builds when the Builds tab is selected', async () => {
+ const rendered = await renderInTestApp(
+
+
+ ,
+ );
+
userEvent.click(rendered.getByText('Builds'));
- expect(await rendered.findByText('BuildListComponent')).toBeInTheDocument();
+ expect(await rendered.findByText('BuildList')).toBeInTheDocument();
});
});
diff --git a/plugins/xcmetrics/src/components/XcmetricsLayout/XcmetricsLayout.tsx b/plugins/xcmetrics/src/components/XcmetricsLayout/XcmetricsLayout.tsx
index 33e9d64c6b..53545890a4 100644
--- a/plugins/xcmetrics/src/components/XcmetricsLayout/XcmetricsLayout.tsx
+++ b/plugins/xcmetrics/src/components/XcmetricsLayout/XcmetricsLayout.tsx
@@ -21,7 +21,7 @@ import {
Page,
TabbedLayout,
} from '@backstage/core-components';
-import { OverviewComponent } from '../OverviewComponent';
+import { Overview } from '../Overview';
import { buildsRouteRef, rootRouteRef } from '../../routes';
import { RouteRef, SubRouteRef } from '@backstage/core-plugin-api';
import { BuildsPage } from '../BuildsPage';
@@ -36,7 +36,7 @@ const TABS: TabConfig[] = [
{
routeRef: rootRouteRef,
title: 'Overview',
- component: ,
+ component: ,
},
{
routeRef: buildsRouteRef,
diff --git a/plugins/xcmetrics/src/components/XcmetricsLayout/index.ts b/plugins/xcmetrics/src/components/XcmetricsLayout/index.ts
index eaaadcbaea..aa7cd4b8dc 100644
--- a/plugins/xcmetrics/src/components/XcmetricsLayout/index.ts
+++ b/plugins/xcmetrics/src/components/XcmetricsLayout/index.ts
@@ -13,4 +13,4 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-export * from './XcmetricsLayout';
+export { XcmetricsLayout } from './XcmetricsLayout';