From e6787dc9a585597badd2c0e6e1af6c15638c8302 Mon Sep 17 00:00:00 2001 From: Krish Vora Date: Wed, 23 Nov 2022 21:56:14 -0800 Subject: [PATCH 1/2] Issue #3 Revenue Fix --- src/ui.js | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/ui.js b/src/ui.js index 5682dea..02b348d 100644 --- a/src/ui.js +++ b/src/ui.js @@ -1,11 +1,11 @@ -import {fetchCompanies} from "./api"; +import { fetchCompanies } from "./api"; import { ACCOUNT_EXECUTIVE_FIELD_NAME, COMPANIES_TABLE_HEADERS, COMPANY_NAME_FIELD_NAME, CREATED_AT_FIELD_NAME, REVENUE_YTD_FIELD_NAME, - STATUS_FIELD_NAME + STATUS_FIELD_NAME, } from "./constants"; export const makeTable = async () => { @@ -20,13 +20,14 @@ export const makeTable = async () => { companiesToDisplay.push(COMPANIES_TABLE_HEADERS); // Here we simply rearrange company fields in the order in which we want to display them in UI - companies.map(company => { + companies.map((company) => { const row = []; + row.push( company[COMPANY_NAME_FIELD_NAME], company[STATUS_FIELD_NAME], company[CREATED_AT_FIELD_NAME], - company[REVENUE_YTD_FIELD_NAME], + company[REVENUE_YTD_FIELD_NAME].toLocaleString("en", { maximumSignificantDigits: 3 }), company[ACCOUNT_EXECUTIVE_FIELD_NAME] ); companiesToDisplay.push(row); @@ -36,12 +37,12 @@ export const makeTable = async () => { const table = document.createElement("table"); document.body.appendChild(table); // Drew the main table node on the document - companiesToDisplay.forEach(row => { + companiesToDisplay.forEach((row) => { const tr = table.insertRow(); //Create a new row - row.forEach(column => { + row.forEach((column) => { const td = tr.insertCell(); td.innerText = column; // Take string from placeholder variable and append it to node }); }); -}; \ No newline at end of file +}; From 737e11ff0bcdf291ae708b23b62b6ba98ae6b250 Mon Sep 17 00:00:00 2001 From: Krish Vora Date: Wed, 23 Nov 2022 22:01:19 -0800 Subject: [PATCH 2/2] Issue #1 Name Render --- src/ui.js | 1 - 1 file changed, 1 deletion(-) diff --git a/src/ui.js b/src/ui.js index 02b348d..fea0de3 100644 --- a/src/ui.js +++ b/src/ui.js @@ -22,7 +22,6 @@ export const makeTable = async () => { // Here we simply rearrange company fields in the order in which we want to display them in UI companies.map((company) => { const row = []; - row.push( company[COMPANY_NAME_FIELD_NAME], company[STATUS_FIELD_NAME],