chore(review): address comments

Signed-off-by: Phil Kuang <pkuang@factset.com>
This commit is contained in:
Phil Kuang
2023-02-13 09:38:48 -05:00
parent a3c86a7ed2
commit dfbe698743
11 changed files with 42 additions and 32 deletions
@@ -17,8 +17,8 @@
import { createApiRef } from '@backstage/core-plugin-api';
import {
EntityRatingsData,
FeedbackResponse,
Rating,
Response,
} from '@backstage/plugin-entity-feedback-common';
/**
@@ -42,8 +42,10 @@ export interface EntityFeedbackApi {
recordResponse(
entityRef: string,
response: Omit<Response, 'entityRef' | 'userRef'>,
response: Omit<FeedbackResponse, 'entityRef' | 'userRef'>,
): Promise<void>;
getResponses(entityRef: string): Promise<Omit<Response, 'entityRef'>[]>;
getResponses(
entityRef: string,
): Promise<Omit<FeedbackResponse, 'entityRef'>[]>;
}
@@ -18,8 +18,8 @@ import { DiscoveryApi, FetchApi } from '@backstage/core-plugin-api';
import { ResponseError } from '@backstage/errors';
import {
EntityRatingsData,
FeedbackResponse,
Rating,
Response,
} from '@backstage/plugin-entity-feedback-common';
import { EntityFeedbackApi } from './EntityFeedbackApi';
@@ -99,7 +99,7 @@ export class EntityFeedbackClient implements EntityFeedbackApi {
async recordResponse(
entityRef: string,
response: Omit<Response, 'entityRef' | 'userRef'>,
response: Omit<FeedbackResponse, 'entityRef' | 'userRef'>,
) {
const baseUrl = await this.discoveryApi.getBaseUrl('entity-feedback');
const resp = await this.fetchApi.fetch(
@@ -118,7 +118,7 @@ export class EntityFeedbackClient implements EntityFeedbackApi {
async getResponses(
entityRef: string,
): Promise<Omit<Response, 'entityRef'>[]> {
): Promise<Omit<FeedbackResponse, 'entityRef'>[]> {
const baseUrl = await this.discoveryApi.getBaseUrl('entity-feedback');
const resp = await this.fetchApi.fetch(
`${baseUrl}/responses/${encodeURIComponent(entityRef)}`,
@@ -18,7 +18,7 @@ import { parseEntityRef } from '@backstage/catalog-model';
import { ErrorPanel, Table } from '@backstage/core-components';
import { useApi } from '@backstage/core-plugin-api';
import { humanizeEntityRef } from '@backstage/plugin-catalog-react';
import { Response } from '@backstage/plugin-entity-feedback-common';
import { FeedbackResponse } from '@backstage/plugin-entity-feedback-common';
import { BackstageTheme } from '@backstage/theme';
import { Chip, makeStyles } from '@material-ui/core';
import CheckIcon from '@material-ui/icons/Check';
@@ -27,7 +27,7 @@ import useAsync from 'react-use/lib/useAsync';
import { entityFeedbackApiRef } from '../../api';
type ResponseRow = Omit<Response, 'entityRef'>;
type ResponseRow = Omit<FeedbackResponse, 'entityRef'>;
const useStyles = makeStyles<BackstageTheme>(theme => ({
consentCheck: {