Skip to content

Commit

Permalink
add dashes for empty values
Browse files Browse the repository at this point in the history
  • Loading branch information
HSenarath committed Sep 10, 2024
1 parent fdf09e9 commit 2252718
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 10 deletions.
13 changes: 5 additions & 8 deletions client/src/components/DisplayTable/DisplayTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -333,6 +333,7 @@ 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;
Expand Down Expand Up @@ -383,15 +384,11 @@ export class _DisplayTable extends React.Component<
.map((row) => row[sort_by])
.thru(([value_a, value_b]) =>
sort_func(
value_a === "Not Applicable"
? -1
: plain_formatter(value_a),
value_b === "Not Applicable"
? -1
: plain_formatter(value_b),
value_a === "-" ? -1 : plain_formatter(value_a),
value_b === "-" ? -1 : plain_formatter(value_b),
descending,
value_a === "Not Applicable" ? -1 : value_a,
value_b === "Not Applicable" ? -1 : value_b
value_a === "-" ? -1 : value_a,
value_b === "-" ? -1 : value_b
)
)
.value()
Expand Down
5 changes: 3 additions & 2 deletions client/src/rpb/granular_view.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,7 @@ class GranularView extends React.Component {
// remove planned spending projections from crown corps
if (org.inst_form_id === "crown_corp") {
planning_years.forEach((year) => {
if (year in filtered_columns)
filtered_columns[year] = "Not Applicable";
if (year in filtered_columns) filtered_columns[year] = "-";
});
}

Expand Down Expand Up @@ -209,6 +208,8 @@ class GranularView extends React.Component {
),
};

console.log(table_data);
console.log(column_configs);
return (
<DisplayTable
data={table_data}
Expand Down

0 comments on commit 2252718

Please sign in to comment.