Skip to content

Commit

Permalink
Mapping review and line length bug fixes (#4906)
Browse files Browse the repository at this point in the history
  • Loading branch information
axelstudios authored Dec 13, 2024
1 parent bfc6b0f commit ab5519a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 9 deletions.
2 changes: 1 addition & 1 deletion seed/static/seed/js/controllers/mapping_controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -870,7 +870,7 @@ angular.module('SEED.controller.mapping', []).controller('mapping_controller', [
const display_cached_column_mappings = () => {
const cached_mappings = JSON.parse($scope.import_file.cached_mapped_columns);
_.forEach($scope.mappings, (col) => {
const cached_col = _.find(cached_mappings, { from_field: col.name });
const cached_col = cached_mappings.find((mapping) => mapping.from_field === col.name) ?? {};
col.suggestion_column_name = cached_col.to_field;
col.suggestion_table_name = cached_col.to_table_name;
col.from_units = cached_col.from_units;
Expand Down
14 changes: 6 additions & 8 deletions seed/static/seed/js/controllers/program_setup_controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,12 @@ angular.module('SEED.controller.program_setup', []).controller('program_setup_co
$scope.valid_column_data_types = ['number', 'float', 'integer', 'ghg', 'ghg_intensity', 'area', 'eui', 'boolean'];
$scope.valid_x_axis_data_types = ['number', 'string', 'float', 'integer', 'ghg', 'ghg_intensity', 'area', 'eui', 'boolean'];

$scope.property_columns = _.reject(property_columns, (item) => (
(item.related || !$scope.valid_column_data_types.includes(item.data_type)) &&
item.derived_column == null
)).sort((a, b) => naturalSort(a.displayName, b.displayName));
$scope.x_axis_columns = _.reject(property_columns, (item) => (
(item.related || !$scope.valid_x_axis_data_types.includes(item.data_type)) &&
item.derived_column == null
)).sort((a, b) => naturalSort(a.displayName, b.displayName));
$scope.property_columns = property_columns
.filter((col) => !((col.related || !$scope.valid_column_data_types.includes(col.data_type)) && col.derived_column == null))
.sort((a, b) => naturalSort(a.displayName, b.displayName));
$scope.x_axis_columns = property_columns
.filter((col) => !((col.related || !$scope.valid_x_axis_data_types.includes(col.data_type)) && col.derived_column == null))
.sort((a, b) => naturalSort(a.displayName, b.displayName));
$scope.x_axis_selection = '';
$scope.cycle_selection = '';
$scope.compliance_metrics_error = [];
Expand Down

0 comments on commit ab5519a

Please sign in to comment.