From a75aa382081271d0f34b7ec3e74a31a65f2ad528 Mon Sep 17 00:00:00 2001 From: Hannah Eslinger Date: Tue, 16 Jan 2024 10:54:21 -0700 Subject: [PATCH] Allow omitted fields on the mapping page to be unfilled (#4471) Fix #4361 Co-authored-by: Katherine Fleming <2205659+kflemin@users.noreply.github.com> --- .../seed/js/controllers/mapping_controller.js | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/seed/static/seed/js/controllers/mapping_controller.js b/seed/static/seed/js/controllers/mapping_controller.js index 1abd25c03f..d87f75573a 100644 --- a/seed/static/seed/js/controllers/mapping_controller.js +++ b/seed/static/seed/js/controllers/mapping_controller.js @@ -598,15 +598,24 @@ angular.module('BE.seed.controller.mapping', []).controller('mapping_controller' /** * empty_units_present: used to disable or enable the 'Map Your Data' button if any units are empty */ - $scope.empty_units_present = () => Boolean(_.find($scope.mappings, (field) => field.suggestion_table_name === 'PropertyState' && field.from_units === null && ($scope.is_area_column(field) || $scope.is_eui_column(field)))); + $scope.empty_units_present = () => { + return $scope.mappings.some((field) => ( + !field.isOmitted && + field.suggestion_table_name === 'PropertyState' && + field.from_units === null && + ($scope.is_area_column(field) || $scope.is_eui_column(field)) + )) + }; /** * empty_fields_present: used to disable or enable the 'show & review * mappings' button. No warning associated as users "aren't done" listing their mapping settings. */ const suggestions_not_provided_yet = () => { - const no_suggestion_value = Boolean(_.find($scope.mappings, { suggestion: undefined })); - const no_suggestion_table_name = Boolean(_.find($scope.mappings, { suggestion_table_name: undefined })); + const non_omitted_mappings = $scope.mappings.filter(m => !m.isOmitted) + const no_suggestion_value = Boolean(_.find(non_omitted_mappings, { suggestion: undefined })); + const no_suggestion_table_name = Boolean(_.find(non_omitted_mappings, { suggestion_table_name: undefined })); + return no_suggestion_value || no_suggestion_table_name; };