Merge branch 'backstage:master' into delete-icon-playlist-color
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
---
|
||||
'@backstage/plugin-entity-feedback': patch
|
||||
---
|
||||
|
||||
Improve README to note that Backstage identity is required to be configured
|
||||
@@ -0,0 +1,5 @@
|
||||
---
|
||||
'@backstage/plugin-scaffolder-backend': patch
|
||||
---
|
||||
|
||||
Fixed the plugin and module ID of the alpha `catalogModuleTemplateKind` export.
|
||||
@@ -0,0 +1,5 @@
|
||||
---
|
||||
'@backstage/plugin-catalog-backend-module-azure': patch
|
||||
---
|
||||
|
||||
Remove duplications from Azure search before committing the new locations to the catalog.
|
||||
@@ -0,0 +1,5 @@
|
||||
---
|
||||
'@backstage/plugin-entity-feedback-backend': patch
|
||||
---
|
||||
|
||||
Improve backend logging if method calls fail
|
||||
@@ -0,0 +1,5 @@
|
||||
---
|
||||
'@backstage/core-components': patch
|
||||
---
|
||||
|
||||
Add loading indicator to Table
|
||||
@@ -27,3 +27,11 @@ jobs:
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GH_SERVICE_ACCOUNT_TOKEN }}
|
||||
HUSKY: '0'
|
||||
|
||||
- name: Discord notification
|
||||
if: ${{ failure() }}
|
||||
uses: Ilshidur/action-discord@0.3.2
|
||||
env:
|
||||
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
|
||||
with:
|
||||
args: 'Version Packages Sync Failed https://github.com/{{GITHUB_REPOSITORY}}/actions/runs/{{GITHUB_RUN_ID}}'
|
||||
|
||||
@@ -1356,6 +1356,8 @@ export interface TableProps<T extends object = {}>
|
||||
// (undocumented)
|
||||
initialState?: TableState;
|
||||
// (undocumented)
|
||||
isLoading?: boolean;
|
||||
// (undocumented)
|
||||
onStateChange?: (state: TableState) => any;
|
||||
// (undocumented)
|
||||
subtitle?: string;
|
||||
|
||||
@@ -89,6 +89,43 @@ export const DefaultTable = () => {
|
||||
);
|
||||
};
|
||||
|
||||
export const LoadingTable = () => {
|
||||
const classes = useStyles();
|
||||
const columns: TableColumn[] = [
|
||||
{
|
||||
title: 'Column 1',
|
||||
field: 'col1',
|
||||
highlight: true,
|
||||
},
|
||||
{
|
||||
title: 'Column 2',
|
||||
field: 'col2',
|
||||
},
|
||||
{
|
||||
title: 'Numeric value',
|
||||
field: 'number',
|
||||
type: 'numeric',
|
||||
},
|
||||
{
|
||||
title: 'A Date',
|
||||
field: 'date',
|
||||
type: 'date',
|
||||
},
|
||||
];
|
||||
|
||||
return (
|
||||
<div className={classes.container}>
|
||||
<Table
|
||||
options={{ paging: false }}
|
||||
data={[]}
|
||||
columns={columns}
|
||||
isLoading
|
||||
title="Backstage Table"
|
||||
/>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
export const EmptyTable = () => {
|
||||
const classes = useStyles();
|
||||
const columns: TableColumn[] = [
|
||||
|
||||
@@ -48,6 +48,11 @@ describe('<Table />', () => {
|
||||
expect(rendered.getByText('second value, second row')).toBeInTheDocument();
|
||||
});
|
||||
|
||||
it('renders loading without exploding', async () => {
|
||||
const rendered = await renderInTestApp(<Table {...minProps} isLoading />);
|
||||
expect(rendered.getByTestId('loading-indicator')).toBeInTheDocument();
|
||||
});
|
||||
|
||||
describe('with style rows', () => {
|
||||
describe('with CSS Properties object', () => {
|
||||
const styledColumn2 = {
|
||||
|
||||
@@ -53,6 +53,7 @@ import React, {
|
||||
|
||||
import { SelectProps } from '../Select/Select';
|
||||
import { Filter, Filters, SelectedFilters, Without } from './Filters';
|
||||
import CircularProgress from '@material-ui/core/CircularProgress';
|
||||
|
||||
// Material-table is not using the standard icons available in in material-ui. https://github.com/mbrn/material-table/issues/51
|
||||
const tableIcons: Icons = {
|
||||
@@ -236,6 +237,7 @@ export interface TableProps<T extends object = {}>
|
||||
filters?: TableFilter[];
|
||||
initialState?: TableState;
|
||||
emptyContent?: ReactNode;
|
||||
isLoading?: boolean;
|
||||
onStateChange?: (state: TableState) => any;
|
||||
}
|
||||
|
||||
@@ -309,6 +311,7 @@ export function Table<T extends object = {}>(props: TableProps<T>) {
|
||||
emptyContent,
|
||||
onStateChange,
|
||||
components,
|
||||
isLoading: isLoading,
|
||||
...restProps
|
||||
} = props;
|
||||
const tableClasses = useTableStyles();
|
||||
@@ -470,6 +473,28 @@ export function Table<T extends object = {}>(props: TableProps<T>) {
|
||||
const columnCount = columns.length;
|
||||
const Body = useCallback(
|
||||
bodyProps => {
|
||||
if (isLoading) {
|
||||
return (
|
||||
<tbody data-testid="loading-indicator">
|
||||
<tr>
|
||||
<td colSpan={columnCount}>
|
||||
<Box
|
||||
sx={{
|
||||
display: 'flex',
|
||||
justifyContent: 'center',
|
||||
alignItems: 'center',
|
||||
width: '100%',
|
||||
minHeight: '15rem',
|
||||
}}
|
||||
>
|
||||
<CircularProgress size="5rem" />
|
||||
</Box>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
);
|
||||
}
|
||||
|
||||
if (emptyContent && hasNoRows) {
|
||||
return (
|
||||
<tbody>
|
||||
@@ -482,7 +507,7 @@ export function Table<T extends object = {}>(props: TableProps<T>) {
|
||||
|
||||
return <MTableBody {...bodyProps} />;
|
||||
},
|
||||
[hasNoRows, emptyContent, columnCount],
|
||||
[hasNoRows, emptyContent, columnCount, isLoading],
|
||||
);
|
||||
|
||||
return (
|
||||
|
||||
@@ -148,7 +148,10 @@ export class AzureDevOpsEntityProvider implements EntityProvider {
|
||||
|
||||
logger.info(`Discovered ${files.length} catalog files`);
|
||||
|
||||
const locations = files.map(key => this.createLocationSpec(key));
|
||||
const targets = files.map(key => this.createObjectUrl(key));
|
||||
const locations = Array.from(new Set(targets)).map(key =>
|
||||
this.createLocationSpec(key),
|
||||
);
|
||||
|
||||
await this.connection.applyMutation({
|
||||
type: 'full',
|
||||
@@ -165,9 +168,7 @@ export class AzureDevOpsEntityProvider implements EntityProvider {
|
||||
);
|
||||
}
|
||||
|
||||
private createLocationSpec(file: CodeSearchResultItem): LocationSpec {
|
||||
const target = this.createObjectUrl(file);
|
||||
|
||||
private createLocationSpec(target: string): LocationSpec {
|
||||
return {
|
||||
type: 'url',
|
||||
target: target,
|
||||
|
||||
@@ -4,6 +4,10 @@ Welcome to the entity-feedback backend plugin!
|
||||
|
||||
## Installation
|
||||
|
||||
Note: this plugin requires authentication and identity configured so Backstage can identify
|
||||
which user has rated the entity. If you are using the guest identity provider which comes
|
||||
out of the box, this plugin will not work when you test it.
|
||||
|
||||
### Install the package
|
||||
|
||||
```bash
|
||||
|
||||
@@ -134,6 +134,9 @@ export async function createRouter(
|
||||
const user = await identity.getIdentity({ request: req });
|
||||
const rating = req.body.rating;
|
||||
if (!user || !rating) {
|
||||
logger.warn(
|
||||
`Can't save rating because there is not enough info: user=${user}, rating=${rating}`,
|
||||
);
|
||||
res.status(400).end();
|
||||
return;
|
||||
}
|
||||
@@ -188,6 +191,7 @@ export async function createRouter(
|
||||
const { response, comments, consent } = req.body;
|
||||
|
||||
if (!user) {
|
||||
logger.warn(`Could not identify user to save responses, user=${user}`);
|
||||
res.status(400).end();
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -36,7 +36,11 @@ This plugin allows you give and view feedback on entities available in the Backs
|
||||
|
||||
## Setup
|
||||
|
||||
The following sections will help you get the Entity Feedback plugin setup and running
|
||||
The following sections will help you get the Entity Feedback plugin setup and running.
|
||||
|
||||
Note: this plugin requires authentication and identity configured so Backstage can identify
|
||||
which user has rated the entity. If you are using the guest identity provider which comes
|
||||
out of the box, this plugin will not work when you test it.
|
||||
|
||||
### Backend
|
||||
|
||||
@@ -133,4 +137,4 @@ const groupPage = (
|
||||
);
|
||||
```
|
||||
|
||||
Note: For a full example of this you can look at [this EntityPage](../../packages/app/src/components/catalog/EntityPage.tsx)
|
||||
Note: For a full example of this you can look at [this EntityPage](../../packages/app/src/components/catalog/EntityPage.tsx).
|
||||
|
||||
@@ -24,8 +24,8 @@ import { ScaffolderEntitiesProcessor } from '../processor';
|
||||
* @alpha
|
||||
*/
|
||||
export const catalogModuleTemplateKind = createBackendModule({
|
||||
moduleId: 'scaffolder',
|
||||
pluginId: 'templateKind',
|
||||
moduleId: 'templateKind',
|
||||
pluginId: 'catalog',
|
||||
register(env) {
|
||||
env.registerInit({
|
||||
deps: {
|
||||
|
||||
Reference in New Issue
Block a user