Skip to content

Commit

Permalink
Implementing review fixes.
Browse files Browse the repository at this point in the history
  • Loading branch information
lublagg committed Sep 20, 2023
1 parent cf66a33 commit 9afc224
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/components/dropdown.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ import classnames from "classnames";
import { PlaceOptions } from "./place-options";
import { defaultSelectedOptions } from "../constants/constants";
import { AttributeOptions } from "./attribute-options";

import css from "./dropdown.scss";
import { YearsOptions } from "./years-options";
import { Summary } from "./summary";

import css from "./dropdown.scss";

interface IProps {
category: string
sectionAltText: string
Expand Down
2 changes: 1 addition & 1 deletion src/components/summary.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export const Summary: React.FC<IProps> = ({category, selectedOptions}) => {
const valueIsDefined = typeof value === "string" && value;
const label = attr.label && (valueIsArrayWithLength || valueIsDefined) ? `${attr.label}: ` : "";

if (Array.isArray(value) && value.length > 0) {
if (valueIsArrayWithLength) {
return `${label}${value.join(", ")}`;
} else if (value) {
return `${attr.label}: ${value}`;
Expand Down
4 changes: 2 additions & 2 deletions src/scripts/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ export const fetchDataWithRetry = async (req: string, maxRetries = 3) => {
const json = await response.json();
return json;
} catch (error) {
// eslint-disable-next-line

Check failure on line 38 in src/scripts/api.ts

View workflow job for this annotation

GitHub Actions / Build and Run Jest Tests

Unexpected unlimited 'eslint-disable-next-line' comment. Specify some rule names to disable
console.log(`Request attempt ${retries + 1} failed:`, error);
retries++;
}
Expand Down Expand Up @@ -108,7 +109,6 @@ export const createTableFromSelections = async (selectedOptions: IStateOptions)
const {short_desc} = queryParams;
if (Array.isArray(short_desc)) {
for (const desc of short_desc) {
console.log({desc});
const codapColumnName = attrToCODAPColumnName[desc].attributeNameInCodapTable;
allAttrs.push(codapColumnName);
}
Expand Down Expand Up @@ -229,7 +229,7 @@ const getAttrData = async (params: IGetAttrDataParams) => {
return values[codapColumnName] = dataItem.Value;
});
} else {
console.log("error");
console.log(`Error: did not receive response for item with these params: ${params}`);

Check warning on line 232 in src/scripts/api.ts

View workflow job for this annotation

GitHub Actions / Build and Run Jest Tests

Unexpected console statement
}
return values;
};

0 comments on commit 9afc224

Please sign in to comment.