Skip to content

Commit

Permalink
center dash text-alignment and give planned spending columns type 'do…
Browse files Browse the repository at this point in the history
…llar'
  • Loading branch information
HSenarath committed Sep 10, 2024
1 parent 2252718 commit 5c69c2f
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 7 deletions.
14 changes: 10 additions & 4 deletions client/src/components/DisplayTable/DisplayTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -333,14 +333,20 @@ export class _DisplayTable extends React.Component<
);

const determine_text_align = (row: DisplayTableData, col: string) => {
console.log(row, col);
const current_col_formatter = col_configs_with_defaults[col].formatter;
const current_col_plain_formatter =
col_configs_with_defaults[col].plain_formatter;
return (_.isString(current_col_formatter) && _.isNumber(row[col])) ||

if (
(_.isString(current_col_formatter) && _.isNumber(row[col])) ||
_.isNumber(current_col_plain_formatter(row[col]))
? "right"
: "left";
) {
return "right";
} else if (current_col_plain_formatter(row[col]) === "-") {
return "center";
} else {
return "left";
}
};

const clean_search_string = (search_string: CellValue) =>
Expand Down
2 changes: 0 additions & 2 deletions client/src/rpb/granular_view.js
Original file line number Diff line number Diff line change
Expand Up @@ -208,8 +208,6 @@ class GranularView extends React.Component {
),
};

console.log(table_data);
console.log(column_configs);
return (
<DisplayTable
data={table_data}
Expand Down
2 changes: 1 addition & 1 deletion client/src/tables/programSpending.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ export default {
_.each(planning_years, (header) => {
this.add_col(header).add_child([
{
type: "big_int",
type: "dollar",
nick: header,
header: {
en: "Planned Spending",
Expand Down

0 comments on commit 5c69c2f

Please sign in to comment.