Addressed PR comments
This commit is contained in:
@@ -62,7 +62,7 @@ export class CatalogClient implements CatalogApi {
|
||||
const { location, entities } = await response.json();
|
||||
|
||||
if (!location || entities.length === 0)
|
||||
throw new Error(`'Location wasn't added: ${target}`);
|
||||
throw new Error(`Location wasn't added: ${target}`);
|
||||
|
||||
return {
|
||||
location,
|
||||
|
||||
@@ -25,8 +25,7 @@ export const catalogApiRef = createApiRef<CatalogApi>({
|
||||
export interface CatalogApi {
|
||||
getEntities(): Promise<Entity[]>;
|
||||
getEntityByName(name: string): Promise<Entity>;
|
||||
addLocation(
|
||||
type: string,
|
||||
target: string,
|
||||
): Promise<{ location: Location; entities: Entity[] }>;
|
||||
addLocation(type: string, target: string): Promise<AddLocationResponse>;
|
||||
}
|
||||
|
||||
export type AddLocationResponse = { location: Location; entities: Entity[] };
|
||||
|
||||
@@ -14,15 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Hi!
|
||||
*
|
||||
* Note that this is an EXAMPLE Backstage backend. Please check the README.
|
||||
*
|
||||
* Happy hacking!
|
||||
*/
|
||||
|
||||
import { createRouteRef } from '@backstage/core';
|
||||
import { createRouteRef } from '@backstage/core';
|
||||
|
||||
const NoIcon = () => null;
|
||||
|
||||
|
||||
+4
-2
@@ -43,7 +43,7 @@ describe('RegisterComponentResultDialog', () => {
|
||||
it('should render', () => {
|
||||
const { rendered } = setup();
|
||||
expect(
|
||||
rendered.getByText('Component registration result'),
|
||||
rendered.getByText('Component Registration Result'),
|
||||
).toBeInTheDocument();
|
||||
});
|
||||
});
|
||||
@@ -73,7 +73,9 @@ it('should show a list of components if success', async () => {
|
||||
});
|
||||
|
||||
expect(
|
||||
rendered.getByText('Following components have been succefully created:'),
|
||||
rendered.getByText(
|
||||
'The following components have been succefully created:',
|
||||
),
|
||||
).toBeInTheDocument();
|
||||
expect(rendered.getByText('Component1')).toBeInTheDocument();
|
||||
expect(rendered.getByText('Component2')).toBeInTheDocument();
|
||||
|
||||
+2
-2
@@ -48,10 +48,10 @@ export const RegisterComponentResultDialog: FC<Props> = ({
|
||||
entities,
|
||||
}) => (
|
||||
<Dialog open onClose={onClose} classes={classes}>
|
||||
<DialogTitle>Component registration result</DialogTitle>
|
||||
<DialogTitle>Component Registration Result</DialogTitle>
|
||||
<DialogContent>
|
||||
<DialogContentText>
|
||||
Following components have been succefully created:
|
||||
The following components have been succefully created:
|
||||
</DialogContentText>
|
||||
<List>
|
||||
{entities.map((entity: any, index: number) => (
|
||||
|
||||
Reference in New Issue
Block a user