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 @@