Skip to content

Commit

Permalink
Merge branch 'develop' into Move-show-populated-to-backend
Browse files Browse the repository at this point in the history
  • Loading branch information
kflemin authored Nov 1, 2024
2 parents d7b33fb + 0264539 commit 034667e
Show file tree
Hide file tree
Showing 33 changed files with 963 additions and 110 deletions.
Binary file modified locale/en_US/LC_MESSAGES/django.mo
Binary file not shown.
14 changes: 7 additions & 7 deletions locale/en_US/LC_MESSAGES/django.po
Original file line number Diff line number Diff line change
Expand Up @@ -1556,7 +1556,7 @@ msgid "FILE_TYPES_SUPPORTED"
msgstr "File types supported: <strong>.csv</strong>, <strong>.xls</strong>, <strong>.xlsx</strong>, <strong>.xml</strong>, <strong>.zip</strong>, <strong>.geojson</strong>, and <strong>.json</strong>."

msgid "FOSSIL_FUEL_EUI_HELP"
msgstr "Fossil Fuel EUI Goal for the building (includes Gas, Etc.)"
msgstr "Fossil Fuel EUI Threshold for the building (includes Gas, Etc.)"

msgid "Failed to delete inventory"
msgstr "Failed to delete inventory"
Expand Down Expand Up @@ -1653,8 +1653,8 @@ msgstr "For direct help on a specific problem, please fill out a request on the
msgid "Forgot password?"
msgstr "Forgot password?"

msgid "Fossil Fuel EUI Goal"
msgstr "Fossil Fuel EUI Goal"
msgid "Fossil Fuel EUI Threshold"
msgstr "Fossil Fuel EUI Threshold"

msgid "Fossil Fuel-Fired Equipment RSL Threshold"
msgstr "Fossil Fuel-Fired Equipment RSL Threshold"
Expand Down Expand Up @@ -3755,7 +3755,7 @@ msgid "THERMAL_CONV_ASSUMPTION_TITLE"
msgstr "Thermal Conversion Assumption"

msgid "TOTAL_EUI_HELP"
msgstr "Total EUI Goal for the building (includes Electricity, Gas, etc.)"
msgstr "Total EUI Threshold for the building (includes Electricity, Gas, etc.)"

msgid "TWO_FACTOR_DISABLED_TEXT"
msgstr "Choosing this option will disable two-factor authentication for your account, making it less secure."
Expand Down Expand Up @@ -4034,8 +4034,8 @@ msgstr "Token Generator"
msgid "Total EUI Field"
msgstr "Total EUI Field"

msgid "Total EUI Goal"
msgstr "Total EUI Goal"
msgid "Total EUI Threshold"
msgstr "Total EUI Threshold"

msgid "Total Properties"
msgstr "Total Properties"
Expand Down Expand Up @@ -4424,7 +4424,7 @@ msgid "X_VERSUS_Y"
msgstr "{x_axis_label} vs. {y_axis_label}"

msgid "X_VERSUS_Y_AGGREGATED"
msgstr "{x_axis_label} vs. {y_axis_label} (Aggregated)"
msgstr "{x_axis_label} vs. {y_axis_label} (Averaged)"

msgid "Y Axis"
msgstr "Y Axis"
Expand Down
Binary file modified locale/es/LC_MESSAGES/django.mo
Binary file not shown.
18 changes: 7 additions & 11 deletions locale/es/LC_MESSAGES/django.po
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ msgstr ""
"Content-Transfer-Encoding: 8bit\n"
"X-Generator: lokalise.com\n"
"Project-Id-Version: SEED Platform\n"
"PO-Revision-Date: 2024-09-26 20:00\n"
"PO-Revision-Date: 2024-10-31 19:47\n"
"Last-Translator: lokalise.com\n"
"Language-Team: lokalise.com\n\n"
"Language: es\n"
Expand Down Expand Up @@ -2036,9 +2036,8 @@ msgstr "Nombres de campo para la correspondencia"
msgid "FILE_TYPES_SUPPORTED"
msgstr "Tipos de archivo admitidos: <strong>.csv</strong>, <strong>.xls</strong>, <strong>.xlsx</strong>, <strong>.xml</strong>, <strong>.zip</strong>, <strong>.geojson</strong>y <strong>.json</strong>."

#, fuzzy
msgid "FOSSIL_FUEL_EUI_HELP"
msgstr "Objetivo EUI de combustibles fósiles para el edificio (incluye gas, etc.)"
msgstr "Umbral EUI de combustibles fósiles para el edificio (incluye gas, etc.)"

#, fuzzy
msgid "Failed to delete inventory"
Expand Down Expand Up @@ -2162,9 +2161,8 @@ msgstr "Para obtener ayuda directa sobre un problema concreto, rellene una solic
msgid "Forgot password?"
msgstr "¿Ha olvidado su contraseña?"

#, fuzzy
msgid "Fossil Fuel EUI Goal"
msgstr "Objetivo EUI de combustibles fósiles"
msgid "Fossil Fuel EUI Threshold"
msgstr "Umbral EUI de combustibles fósiles"

#, fuzzy
msgid "Fossil Fuel-Fired Equipment RSL Threshold"
Expand Down Expand Up @@ -4925,9 +4923,8 @@ msgstr "Se requiere al menos uno de los siguientes campos de Lote fiscal"
msgid "THERMAL_CONV_ASSUMPTION_TITLE"
msgstr "Hipótesis de conversión térmica"

#, fuzzy
msgid "TOTAL_EUI_HELP"
msgstr "Objetivo EUI total del edificio (incluye electricidad, gas, etc.)"
msgstr "Umbral EUI total del edificio (incluye electricidad, gas, etc.)"

#, fuzzy
msgid "TWO_FACTOR_DISABLED_TEXT"
Expand Down Expand Up @@ -5289,9 +5286,8 @@ msgstr "Generador de fichas"
msgid "Total EUI Field"
msgstr "Total EUI Campo"

#, fuzzy
msgid "Total EUI Goal"
msgstr "Objetivo EUI total"
msgid "Total EUI Threshold"
msgstr "Umbral EUI total"

#, fuzzy
msgid "Total Properties"
Expand Down
Binary file modified locale/fr_CA/LC_MESSAGES/django.mo
Binary file not shown.
13 changes: 7 additions & 6 deletions locale/fr_CA/LC_MESSAGES/django.po
Original file line number Diff line number Diff line change
Expand Up @@ -1570,7 +1570,7 @@ msgid "FILE_TYPES_SUPPORTED"
msgstr "Types de fichiers pris en charge: <strong>.csv</strong>, <strong>.xls</strong>, <strong>.xlsx</strong>, <strong>.xml</strong>, <strong>.zip</strong>, <strong>.geojson</strong>, et <strong>.json</strong>."

msgid "FOSSIL_FUEL_EUI_HELP"
msgstr "Objectif d'IEC en matière de combustibles fossiles pour le bâtiment (y compris le gaz, etc.)"
msgstr "Le seuil d'IEC en matière de combustibles fossiles pour le bâtiment (y compris le gaz, etc.)"

msgid "Failed to delete inventory"
msgstr "Échec de la suppression de l'inventaire"
Expand Down Expand Up @@ -1668,8 +1668,8 @@ msgstr "Pour obtenir une aide directe sur un problème spécifique, veuillez rem
msgid "Forgot password?"
msgstr "mot de passe oublié?"

msgid "Fossil Fuel EUI Goal"
msgstr "Objectif de l'UEI sur les combustibles fossiles"
msgid "Fossil Fuel EUI Threshold"
msgstr "Le seuil de l'UEI sur les combustibles fossiles"

msgid "Fossil Fuel-Fired Equipment RSL Threshold"
msgstr "Seuil RSL pour les équipements alimentés aux combustibles fossiles"
Expand Down Expand Up @@ -3785,7 +3785,7 @@ msgid "THERMAL_CONV_ASSUMPTION_TITLE"
msgstr "Choix de Conversion Thermique"

msgid "TOTAL_EUI_HELP"
msgstr "Objectif EUI total pour le bâtiment (comprend l'électricité, le gaz, etc.)"
msgstr "Le seuil EUI total pour le bâtiment (comprend l'électricité, le gaz, etc.)"

msgid "TWO_FACTOR_DISABLED_TEXT"
msgstr "Choisir cette option désactivera l’authentification à deux facteurs pour votre compte, le rendant moins sécurisé."
Expand Down Expand Up @@ -4066,8 +4066,8 @@ msgstr "Générateur de jetons"
msgid "Total EUI Field"
msgstr "Champ de l'UEI totale"

msgid "Total EUI Goal"
msgstr "Objectif total de l'UEI"
msgid "Total EUI Threshold"
msgstr "Le seuil total de l'UEI"

msgid "Total Properties"
msgstr "Total des propriétés"
Expand Down Expand Up @@ -4459,6 +4459,7 @@ msgstr "Texte accentée. <script>alert(\"XSS FAIL IN BASE TRANSLATION STRING\");
msgid "X_VERSUS_Y"
msgstr "{x_axis_label} contre {y_axis_label}"

#, fuzzy
msgid "X_VERSUS_Y_AGGREGATED"
msgstr "{x_axis_label} contre {y_axis_label} (agrégé)"

Expand Down
10 changes: 2 additions & 8 deletions seed/analysis_pipelines/upgrade_recommendation.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,19 +68,13 @@ def _finish_preparation(self, analysis_view_ids_by_property_view_id, analysis_id

def _get_views_upgrade_recommendation_category(property_view, config):
column_params = config.get("column_params", {})
print(f" column params: {column_params}")
columns_by_id = {
c.id: {"name": c.column_name, "is_extra_data": c.is_extra_data} for c in Column.objects.filter(id__in=column_params.values())
}

def get_value(name):
print("@@@@@@@@@@@@@@@@@@@@@@@@")
print(f" getting value for: {name}")
column_id = column_params.get(name)
print(f" id: {id}")
column = columns_by_id[column_id]
print(f" column: {column}")
print(f" STATE DATA extradata: {property_view.state.extra_data}")
if column["is_extra_data"]:
val = None
if column["name"] in property_view.state.extra_data:
Expand All @@ -90,9 +84,9 @@ def get_value(name):
return getattr(property_view.state, column["name"])

total_eui = get_value("total_eui")
print(f" total EUI: {total_eui}")
# print(f" total EUI: {total_eui}")
gas_eui = get_value("gas_eui")
print(f" gas EUI: {gas_eui}")
# print(f" gas EUI: {gas_eui}")
electric_eui = get_value("electric_eui")
target_gas_eui = get_value("target_gas_eui")
target_electric_eui = get_value("target_electric_eui")
Expand Down
2 changes: 2 additions & 0 deletions seed/api/v3/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@
from seed.views.v3.property_view_labels import PropertyViewLabelViewSet
from seed.views.v3.property_views import PropertyViewViewSet
from seed.views.v3.public import PublicCycleViewSet, PublicOrganizationViewSet
from seed.views.v3.report_configurations import ReportConfigurationViewSet
from seed.views.v3.salesforce_configs import SalesforceConfigViewSet
from seed.views.v3.salesforce_mappings import SalesforceMappingViewSet
from seed.views.v3.sensors import SensorViewSet
Expand Down Expand Up @@ -104,6 +105,7 @@
api_v3_router.register(r"properties", PropertyViewSet, basename="properties")
api_v3_router.register(r"property_view_labels", PropertyViewLabelViewSet, basename="property_view_labels")
api_v3_router.register(r"property_views", PropertyViewViewSet, basename="property_views")
api_v3_router.register(r"report_configurations", ReportConfigurationViewSet, basename="report_configurations")
api_v3_router.register(r"salesforce_configs", SalesforceConfigViewSet, basename="salesforce_configs")
api_v3_router.register(r"salesforce_mappings", SalesforceMappingViewSet, basename="salesforce_mappings")
api_v3_router.register(r"tax_lot_properties", TaxLotPropertyViewSet, basename="tax_lot_properties")
Expand Down
46 changes: 46 additions & 0 deletions seed/migrations/0232_reportconfiguration.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# Generated by Django 3.2.25 on 2024-10-22 15:39

import django.db.models.deletion
from django.db import migrations, models


class Migration(migrations.Migration):
dependencies = [
("orgs", "0039_alter_organization_ubid_threshold"),
("seed", "0231_column_is_updating"),
]

operations = [
migrations.CreateModel(
name="ReportConfiguration",
fields=[
("id", models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name="ID")),
("name", models.CharField(max_length=255)),
(
"access_level_instance",
models.ForeignKey(
null=True,
on_delete=django.db.models.deletion.CASCADE,
related_name="report_configurations",
to="orgs.accesslevelinstance",
),
),
("access_level_depth", models.IntegerField(null=True)),
("cycles", models.ManyToManyField(related_name="report_configurations", to="seed.Cycle")),
(
"filter_group",
models.ForeignKey(
null=True, on_delete=django.db.models.deletion.CASCADE, related_name="report_configurations", to="seed.filtergroup"
),
),
(
"organization",
models.ForeignKey(
on_delete=django.db.models.deletion.CASCADE, related_name="report_configurations", to="orgs.organization"
),
),
("x_column", models.CharField(max_length=255, null=True)),
("y_column", models.CharField(max_length=255, null=True)),
],
),
]
1 change: 1 addition & 0 deletions seed/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,3 +47,4 @@
from .audit_template_configs import *

from .certification import GreenAssessment, GreenAssessmentProperty, GreenAssessmentURL
from .report_configurations import *
2 changes: 1 addition & 1 deletion seed/models/data_quality.py
Original file line number Diff line number Diff line change
Expand Up @@ -989,7 +989,7 @@ def append_to_apply_labels():
return
value = baseline if cycle_key == "baseline" else current
if rule.condition == rule.RULE_RANGE:
if value:
if value is not None:
result = check_range()
results.append(result)
append_to_apply_labels()
Expand Down
23 changes: 23 additions & 0 deletions seed/models/report_configurations.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
"""
SEED Platform (TM), Copyright (c) Alliance for Sustainable Energy, LLC, and other contributors.
See also https://github.com/SEED-platform/seed/blob/main/LICENSE.md
"""

from django.db import models

from seed.lib.superperms.orgs.models import AccessLevelInstance, Organization
from seed.models.cycles import Cycle
from seed.models.filter_group import FilterGroup


class ReportConfiguration(models.Model):
name = models.CharField(max_length=255)
organization = models.ForeignKey(Organization, on_delete=models.CASCADE, related_name="report_configurations", null=False)
x_column = models.CharField(max_length=255, null=True)
y_column = models.CharField(max_length=255, null=True)
cycles = models.ManyToManyField(Cycle, related_name="report_configurations")
filter_group = models.ForeignKey(FilterGroup, on_delete=models.CASCADE, related_name="report_configurations", null=True)
access_level_instance = models.ForeignKey(
AccessLevelInstance, on_delete=models.CASCADE, related_name="report_configurations", null=True
)
access_level_depth = models.IntegerField(null=True)
20 changes: 20 additions & 0 deletions seed/serializers/report_configurations.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
"""
SEED Platform (TM), Copyright (c) Alliance for Sustainable Energy, LLC, and other contributors.
See also https://github.com/SEED-platform/seed/blob/main/LICENSE.md
"""

from rest_framework import serializers

from seed.models import ReportConfiguration


class ReportConfigurationSerializer(serializers.ModelSerializer):
class Meta:
model = ReportConfiguration
fields = ("name", "cycles", "id", "x_column", "y_column", "filter_group_id", "access_level_instance_id", "access_level_depth")
extra_kwargs = {"user": {"read_only": True}, "organization": {"read_only": True}, "organization_id": {"read_only": True}}

def to_representation(self, instance):
ret = super().to_representation(instance)

return ret
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ angular.module('SEED.controller.inventory_detail_analyses_modal', []).controller
$scope.cycles = cycles;
$scope.user = user;
$scope.all_columns = all_columns;
$scope.eui_columns = $scope.all_columns.filter((o) => o.data_type === 'eui');

$scope.new_analysis = {
name: null,
Expand Down
Loading

0 comments on commit 034667e

Please sign in to comment.