Skip to content

Commit

Permalink
chore: cleanup export names
Browse files Browse the repository at this point in the history
  • Loading branch information
pbastia committed Feb 3, 2025
1 parent 084ab04 commit fbc6ca3
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -353,10 +353,10 @@ def reverse_configuration_element_data(apps, schema_monitor):
).delete()


#### METHODOLOGY REPORTING FIELDS DATA ####
#### CONFIGURATION ELEMENTS REPORTING FIELDS DATA ####


def init_methodology_reporting_fields_data(apps, schema_monitor):
def init_configuration_element_reporting_fields_data(apps, schema_monitor):
ConfigurationElement = apps.get_model("reporting", "ConfigurationElement")
Configuration = apps.get_model("reporting", "Configuration")
Activity = apps.get_model("registration", "Activity")
Expand All @@ -381,7 +381,7 @@ def init_methodology_reporting_fields_data(apps, schema_monitor):
element.reporting_fields.add(ReportingField.objects.get(field_name="Description", field_units__isnull=True))


def reverse_methodology_reporting_fields_data(apps, schema_monitor):
def reverse_configuration_element_reporting_fields_data(apps, schema_monitor):
ConfigurationElement = apps.get_model("reporting", "ConfigurationElement")
Configuration = apps.get_model("reporting", "Configuration")
Activity = apps.get_model("registration", "Activity")
Expand Down Expand Up @@ -553,8 +553,8 @@ class Migration(migrations.Migration):
reverse_configuration_element_data,
),
migrations.RunPython(
init_methodology_reporting_fields_data,
reverse_methodology_reporting_fields_data,
init_configuration_element_reporting_fields_data,
reverse_configuration_element_reporting_fields_data,
),
migrations.RunPython(init_activity_schema_data, reverse_activity_schema_data),
migrations.RunPython(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ import NestedArrayFieldTemplate from "@bciers/components/form/fields/NestedArray
import SourceTypeBoxTemplate from "@bciers/components/form/fields/SourceTypeBoxTemplate";
import CheckboxWidgetLeft from "@bciers/components/form/widgets/CheckboxWidgetLeft";

/**
* Common Ui Schema fragments for building an activity's Ui Schema.
* Mostly applicable to O&G activities as these have a lot of source types with similar requirements.
*/

export const emissionsFieldsUiSchema = {
"ui:ArrayFieldTemplate": NestedArrayFieldTemplate,
"ui:FieldTemplate": FieldTemplate,
Expand Down Expand Up @@ -63,7 +68,7 @@ export const fuelsFieldsUiSchema = {
},
};

export const sourceTypeBoxUiSchema = {
export const sourceTypeCheckboxUiSchema = {
"ui:FieldTemplate": FieldTemplate,
"ui:widget": CheckboxWidgetLeft,
"ui:options": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {
emissionsOnlyUiSchema,
sourceSubTypeWithFuelUiSchema,
sourceSubTypeWithoutFuelUiSchema,
sourceTypeBoxUiSchema,
sourceTypeCheckboxUiSchema,
} from "./common";
import SourceTypeBoxTemplate from "@bciers/components/form/fields/SourceTypeBoxTemplate";
import NestedArrayFieldTemplate from "@bciers/components/form/fields/NestedArrayFieldTemplate";
Expand All @@ -13,18 +13,19 @@ import { InlineFieldTemplate } from "@bciers/components/form/fields";
const uiSchema = {
"ui:FieldTemplate": FieldTemplate,
"ui:classNames": "form-heading-label",
naturalGasPneumatciHighBleedDeviceVenting: sourceTypeBoxUiSchema,
naturalGasPneumaticPumpVenting: sourceTypeBoxUiSchema,
naturalGasPneumaticLowBleedDeviceVenting: sourceTypeBoxUiSchema,
naturalGasPneumaticIntermittentBleedDeviceVenting: sourceTypeBoxUiSchema,
blowdownVenting: sourceTypeBoxUiSchema,
flaringStacks: sourceTypeBoxUiSchema,
equipmentLeaksDetectedLearkerEmissionFactorMethods: sourceTypeBoxUiSchema,
populationCountSources: sourceTypeBoxUiSchema,
transmissionStorageTanks: sourceTypeBoxUiSchema,
otherVentingSources: sourceTypeBoxUiSchema,
otherFugitiveSources: sourceTypeBoxUiSchema,
thirdPartyLineHitsWithReleaseOfGas: sourceTypeBoxUiSchema,
naturalGasPneumatciHighBleedDeviceVenting: sourceTypeCheckboxUiSchema,
naturalGasPneumaticPumpVenting: sourceTypeCheckboxUiSchema,
naturalGasPneumaticLowBleedDeviceVenting: sourceTypeCheckboxUiSchema,
naturalGasPneumaticIntermittentBleedDeviceVenting: sourceTypeCheckboxUiSchema,
blowdownVenting: sourceTypeCheckboxUiSchema,
flaringStacks: sourceTypeCheckboxUiSchema,
equipmentLeaksDetectedLearkerEmissionFactorMethods:
sourceTypeCheckboxUiSchema,
populationCountSources: sourceTypeCheckboxUiSchema,
transmissionStorageTanks: sourceTypeCheckboxUiSchema,
otherVentingSources: sourceTypeCheckboxUiSchema,
otherFugitiveSources: sourceTypeCheckboxUiSchema,
thirdPartyLineHitsWithReleaseOfGas: sourceTypeCheckboxUiSchema,
sourceTypes: {
"ui:FieldTemplate": FieldTemplate,
"ui:options": {
Expand Down

0 comments on commit fbc6ca3

Please sign in to comment.