diff --git a/seed/lib/superperms/orgs/migrations/0045_organization_max_data_charted.py b/seed/lib/superperms/orgs/migrations/0045_organization_max_data_charted.py new file mode 100644 index 0000000000..7e5e80c82c --- /dev/null +++ b/seed/lib/superperms/orgs/migrations/0045_organization_max_data_charted.py @@ -0,0 +1,17 @@ +# Generated by Django 4.2.26 on 2026-01-08 21:06 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + dependencies = [ + ("orgs", "0044_add_bb_salesforce_enabled"), + ] + + operations = [ + migrations.AddField( + model_name="organization", + name="max_data_charted", + field=models.IntegerField(default=3000), + ), + ] diff --git a/seed/lib/superperms/orgs/models.py b/seed/lib/superperms/orgs/models.py index a479df7ed5..fdcc3d2980 100644 --- a/seed/lib/superperms/orgs/models.py +++ b/seed/lib/superperms/orgs/models.py @@ -260,6 +260,7 @@ class Meta: created = models.DateTimeField(auto_now_add=True, null=True) modified = models.DateTimeField(auto_now=True, null=True) + max_data_charted = models.IntegerField(blank=False, null=False, default=3000) # Default preferred all meter units to kBtu display_meter_units = models.JSONField(default=_get_default_meter_units) diff --git a/seed/static/seed/js/controllers/insights_property_controller.js b/seed/static/seed/js/controllers/insights_property_controller.js index 6d2b8344ee..e6cb18be09 100644 --- a/seed/static/seed/js/controllers/insights_property_controller.js +++ b/seed/static/seed/js/controllers/insights_property_controller.js @@ -212,7 +212,7 @@ angular.module('SEED.controller.insights_property', []).controller('insights_pro // if there's +3k properties, dont even bother charting them. $scope.chartStatusMessage = ''; const num_properties = Object.values($scope.data.properties_by_cycles).reduce((acc, curr) => acc + curr.length, 0); - if (num_properties > 3000) { + if (num_properties > $scope.organization.max_data_charted) { $scope.data.properties_by_cycles = Object.keys($scope.data.properties_by_cycles).reduce((acc, k) => ({ ...acc, [k]: [] }), {}); $scope.chartStatusMessage = 'Too much data, try a different ali'; } diff --git a/seed/static/seed/partials/organization_settings.html b/seed/static/seed/partials/organization_settings.html index 2bbac311c6..32b8e22cb0 100644 --- a/seed/static/seed/partials/organization_settings.html +++ b/seed/static/seed/partials/organization_settings.html @@ -997,6 +997,25 @@

Taxlot Display Field

+
+
+

Max number of properties to chart

+
+
+
+ +
+
+
+
+
+

Columns to Include in Reports x axis options

diff --git a/seed/views/v3/organizations.py b/seed/views/v3/organizations.py index adc672e928..429015051c 100644 --- a/seed/views/v3/organizations.py +++ b/seed/views/v3/organizations.py @@ -184,6 +184,7 @@ def _dict_org(request, organizations): Column.objects.filter(organization=o, table_name="PropertyState", is_option_for_reports_y_axis=True), many=True ).data, "require_2fa": o.require_2fa, + "max_data_charted": o.max_data_charted, } orgs.append(org) @@ -755,6 +756,10 @@ def warn_bad_units(kind, unit_string): # if salesforce_enabled was toggled, must start/stop auto sync functionality toggle_salesforce_sync(salesforce_enabled, org.id) + max_data_charted = posted_org.get("max_data_charted", False) + if max_data_charted != org.max_data_charted: + org.max_data_charted = max_data_charted + bb_salesforce_enabled = posted_org.get("bb_salesforce_enabled", False) if bb_salesforce_enabled != org.bb_salesforce_enabled: org.bb_salesforce_enabled = bb_salesforce_enabled