Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Cross Cycle Tabular View for Portfolio Summary Goals #4440

Merged
merged 88 commits into from
Jan 26, 2024

Conversation

perryr16
Copy link
Contributor

@perryr16 perryr16 commented Dec 8, 2023

Any background context you want to provide?

Create a new view for displaying cross-cycle tabular data in a format requested by Better Buildings.

What's this PR do?

  • A new Portfolio Summary page to view individual and aggregated EUI improvement between 2 cycles.

  • A New Goal database table with the following attributes:

    • Organization
    • Baseline Cycle
    • Current Cycle
    • Access Level Instance
    • Area Column
    • EUI Column 1
    • EUI Column 2 (optional)
    • EUI Column 3 (optional)
    • Name
    • Target Percentage
  • Access Level Instance controls: Users cannot view properties or access level names that are 'above' themselves in the tree. For example, a parent user can see its own and its children's properties. A child user can only see its properties, not its sibling's or parent's.

  • EUI Columns: Any column that has an EUI data type may be selected as a Goal EUI column. Extra data fields are eligible if their data type has been changed, however, derived columns are not. A primary column must be selected, however secondary and tertiary columns are not required. If a primary column data entry for a property state is empty the next EUI column will be used. If none is found it is ignored.

  • Goals cannot be created that violate database or UI constraints.

    • Names must be unique
    • Cycles must be unique
    • Baseline cycle must proceed Current cycle
    • Access Level Instance must be within a user's tree permissions
    • Columns must be unique
    • Target % must be integer 0-100
  • Speed and Optimization: Serializing 100 PropertyViews for frontend use takes approximately 1 second. Cycles can contain thousands of PropertyViews leading to several minute loading times. Pagination has been introduced to reduce load times to less than 10 seconds, however, it requires two separate database queries to retrieve the correct set of properties from the two Cycles. The first query will retrieve the first 50 PropertyViews that meet the sorting and filter requirements from the Portfolio Summary table for a certain cycle. Then using the list of Property IDs from the first response, a second database query is executed to retrieve PropertyViews from the other cycle using the shared Property ID value as a database filter. Because there are two queries, SEED can only sort or filter on one Cycle at a time. In the event of a conflict (a filter on a baseline column and a current column), the newer filter will be used

  • Table Features

    • Sorting: Supports sorting on a single column.
    • Filtering: Supports multiple filters on shared cycle columns, however, the table can only filter on either baseline or current specific columns. If there is a conflict the newer filter will used.
    • Access Level Instances can be hidden
    • EUI values are found based on Goal EUI column priority. If the primary EUI is missing for a PropertyState the secondary EUI column will be used. If both are missing, the tertiary EUI column will be used.
    • Columns not moveable for readability.
    • Labels are displayed per Cycle
    • CSV downloads of the current page

How should this be manually tested?

  • Create an ALI tree
  • Create 3 cycles
  • Import the same base set of properties to each cycle, however, the EUI values for each cycle should be varied. Optionally include an extra data column.
  • Go to Insights > Portfolio Summary > New Goal
  • Create a few goals. Ensure safeguards are in place - Names must be unique, cycles must be unique, baseline cycle must precede current cycle, access levels are limited to users tree permissions, EUI columns must be unique, EUI columns 2 and 3 are optional, target percentage must be an integer 0-100
  • load the new goals, and ensure quick load times. check pagination, filtering, and sorting.

Sample Test Files

ALI Tree: * must first make 'Sector', 'SubSector', and 'Partner' Access Levels (+ > Access Level Tree > Edit/Add Access Levels). Then click Upload Access Level Instances and select the file below.
ali_tree_better_buildings_lite.xlsx

Baseline Data
AH_BB_1000props120.xlsx

Middle Data
AH_BB_1000props100.xlsx

Current Data
AH_BB_1000props70.xlsx

What are the relevant tickets?

#4456

Screenshots (if appropriate)

Screenshot 2023-12-12 at 2 03 17 PM Screenshot 2023-12-12 at 2 17 22 PM Screenshot 2023-12-12 at 2 51 31 PM Screenshot 2023-12-12 at 2 16 56 PM

@perryr16 perryr16 changed the title Ah/cctv db goals Add Cross Cycle Tabular View for Portfolio Summary Goals Dec 26, 2023
@perryr16 perryr16 marked this pull request as ready for review January 2, 2024 15:22
Copy link
Contributor

@kflemin kflemin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🏆

@kflemin kflemin merged commit aa41bf8 into AH/develop Jan 26, 2024
8 checks passed
@kflemin kflemin deleted the AH/CCTV-db-goals branch January 26, 2024 21:30
@RDmitchell
Copy link

Wow this looks really great.

So I guess when this gets deployed, it will be available to everyone, not just Better Buildings, right?

@perryr16
Copy link
Contributor Author

Yeah, anyone with access to AH will have access to this

axelstudios added a commit that referenced this pull request Mar 14, 2024
* Init Accountability Hierarchy (#4068)

* Init Accountibilty Hiarchary

* Clean up

* Fix tests

* Fix tests

* Fix tests

* Fix max depth test

---------

Co-authored-by: Alex Swindler <[email protected]>

* AH test case class, decorator, and compliance_metric tests (#4108)

* start of perm test

* fix factories

* add new ALI test helpers and decorator, fix compliance_metric tests

* add decorator to update and destroy endpoints

* cleanup

* small fixes

* Default to root in fake property

* add ali tests for compliance-metric update and delete endpoints

* Fix isort

---------

Co-authored-by: Nicholas Long <[email protected]>
Co-authored-by: Hannah Eslinger <[email protected]>

* Add Permisions for DataLoggerViewSet (#4099)

* Add Permisions for DataLoggerViewSet

* Clean merge

* Add AH Permissions to MeterViewSet (#4116)

* Add AH Permissions to MeterViewSet

* Fix test

* Add AH Permissions to Scenarios (#4115)

* Import ah from file (#4061)

* css updates

* start of upload access level instances file

* process access level instances from file

* add test and edit access level capabilities

* cleanup

* ran translation scripts

* cleanup print statements!!

* error when headers are missing and check for blank cells in import

* updates to support bad files and additional access levels

* Add permissions to CycleViewSet (#4118)

* Add permissions to CycleViewSet

* Use permissions

* Apply suggestions from code review

Co-authored-by: Katherine Fleming <[email protected]>

---------

Co-authored-by: Katherine Fleming <[email protected]>

* Add permissions to ColumnListProfileViewSet (#4121)

* Add permissions to ColumnListProfileViewSet

* Update seed/tests/test_column_list_profiles_views.py

Co-authored-by: Katherine Fleming <[email protected]>

---------

Co-authored-by: Katherine Fleming <[email protected]>

* Add Permissions to ColumnViewSet (#4119)

* Add Permissions to ColumnViewSet

* Fix other tests

* Update seed/tests/test_column_views.py

Co-authored-by: Katherine Fleming <[email protected]>

---------

Co-authored-by: Katherine Fleming <[email protected]>

* Accountability Hierarchy Page Formatting (#4067)

* wip not working accordion tree

* working tree

* Add permissions to FilterGroup (#4129)

* Fix FilterGroup Tests

* Ah permissions/import file view set (#4126)

* Add Ah to import process

* Add Permissions to ImportFileViewSet

* Apply suggestions from code review

Co-authored-by: Katherine Fleming <[email protected]>

* Fix typo

* Enforce inclusion of root

* Add new case

---------

Co-authored-by: Katherine Fleming <[email protected]>

* Add permissions to DataViewViewSet (#4131)

* Ah bug fixes (#4138)

* update typos; fix ali dropdown in new member modal

* display ali in top right of app

* fix tests

* Fix

---------

Co-authored-by: Hannah Eslinger <[email protected]>

* Add aln contraints (#4134)

* Add aln contraints

* Fix

* Fix

* Add permissions to DerivedColumnViewSet (#4140)

* Add permissions to DerivedColumnViewSet

* fix comments

* Fix ali rename (#4141)

* Add access level instance visualisation to inventory list and detail (#4133)

* add ali serializer into to property serailizer

* ali table on inv det

* display ali on inv list

* basic filtering on ALI

* refactor

* sorting functional with errors

* filtering on !=

* functional but needs refactoring

* basic filter testing for alis

* refactor the filter expression logic for clarity

* show hide alis on inv list

* update ali pinning levels

* update tests for sorting

* test empty annotations

* precommit

* Update seed/models/tax_lot_properties.py

Co-authored-by: Hannah Eslinger <[email protected]>

* refactor for alns with spaces

* precommit

* mypy fix

* precommit

* add inventory_type as argument to accomodate p/tl

* test for taxlot ali filter

* Update seed/utils/inventory_filter.py

Co-authored-by: Hannah Eslinger <[email protected]>

* cleanup

* remove org key form ali path on inv detail

* guard for tests

* guard against undefined

* simplify ali path

* precommit

* remove alis from current columns

* developer note

---------

Co-authored-by: Hannah Eslinger <[email protected]>

* Add permissions to ColumnMappingProfileViewSet (#4127)

* Add permissions to ColumnMappingProfileViewSet

* Loosen permissions

* Ah/fix tests (#4182)

* Fix Tests

* Format

* Remove print

* Add permission LabelViewSet (#4163)

* Clean

* Add AH Permissions to PropertyViewSet (#4157)

* Add AH Permissions to PropertyViewSet

* Permission tests for salesforce workflow (#4161)

* adding permission tests for salesforce workflow

* fix tests

---------

Co-authored-by: Hannah Eslinger <[email protected]>

---------

Co-authored-by: Katherine Fleming <[email protected]>

* Add permissions to MeterReadingViewSet (#4193)

* Add permissions to datasetviewset (#4189)

* Add permissions to PropertyMeasuresViewSet (#4183)

* Add permissions to PropertyMesauresViewSet

* Fix frontend

* Ah permissions/note view set (#4191)

* WIP

* Fix for taxlot

* Delete test_green_assessments.py

* Fix

* Add access level name/ column display name constraints (#4171)

* Ah permissions/green assessments view sets (#4194)

* Add permissions to GreenAssessmentViewSet

* Add permissions to GreenAssessmentURLViewSet

* Add permissions to GreenAssessmentPropertyViewSet

* Ah/disallow nonroot owners (#4196)

* Disallow non root owners

* Fix typo

* Add permissions to postofficeviewset (#4201)

* Fix loading ALI to be foreground task only (#4230)

* WIP

* WIP

* remove background task when loading ALI data

* additional fixes to restore functionality

---------

Co-authored-by: Hannah Eslinger <[email protected]>
Co-authored-by: kflemin <[email protected]>

* Ah permissions/salesforce (#4204)

Make salesforce owner only

* Ah permissions/analysis view set (#4224)

* Add Analysis permissions

* Give permissions to analysis message and views

* Clean

* Add TaxLotProperty constraints (#4212)

* Add Permissions to GBRPropertyViewSet (#4205)

* Add Permissions to GBRPropertyViewSet

* Clean

* Add permissions to some org endpoints (#4216)

* Add permissions to some org endpoints

* Fix test?

* Add permissions to TaxlotViewSet (#4162)

* Add AH Permissions to PropertyViewSet

* Add permissions to TaxlotViewSet

* Fix merge

* Clean

* Fix test?

* Remove test

* Add permissions to Taxlot Properties (#4234)

* Add permissions to GeocodeViewSet (#4241)

* Add more Permissions (#4248)

* Add permissions to LabelInventoryViewSet (#4246)

* Ah/import frontend (#4170)

* Add ah info to import front end

* Fix

* Clean

* Fix tests

* Fix user creation bug (#4235)

* http request type

* user creation updates

* superuser page to have dynamic ali selection

* precommit

* style

* unused property

* naming

* update tests:

* update tests

* new user role is owner not member

* Renumber migrations

* Lint fixes

* Ah fix analysis list (#4285)

Fix list analysis?

* Build docker container for accountability branch (#4283)

* build docker container for AH

* build docker container for AH

* Fix tests (#4303)

* Fix tests

* Fix more tests

* Add option to delete alis (#4284)

* Add option to delete alis

* Add delete AL button

---------

Co-authored-by: kflemin <[email protected]>

* update modal step ID (#4289)

* Remove unauthorized items from + menu for lower-level users (#4290)

* update modal step ID

* remove options from + menu for non-root users

* Permission UploadViewSet (#4297)

* Permission UploadViewSet

* Fix

---------

Co-authored-by: kflemin <[email protected]>

* Add Permissions to TaxlotViewViewSet (#4298)

Co-authored-by: kflemin <[email protected]>

* Display error message on failed invite (#4370)

display error message on failed invite

* Ah permissions/ubid view set (#4302)

* get and create tested

* destroy tested

* update existing tests

* test decode by ids

* test ubid list endpoint

* test ubid decode_results endpoint

* test ubids by view and add taxlot testing

* remove unused args

* precommit

* formatting

* update tests

* filter over decorate

* precommit

---------

Co-authored-by: Hannah Eslinger <[email protected]>

* Fix upload (#4392)

* Disallow nonroot user from CUD column list profile (#4271)

* Disallow nonroot user from CUD column list profile

* Throw on a couple more

* Fix test

* Squash migrations (#4395)

* Test disallow nonroot users to create columns (#4394)

* Clean up _column_fields_to_columns

* Disallow column creation while mapping data

* Disallow column creation while mapping data

* add access_level_names to fake org

---------

Co-authored-by: Ross Perry <[email protected]>

* Fix analysis bug (#4383)

* 4137 fix anl error message (#4417)

* 4137 Fix anl error message

* Update message

* Remove hannahs docker images

* Fix ali tree permissions (#4435)

* Fix ali tree permissions

* Filter tree names

* Include ancestors

* Add permissions to BuildingFile (#4443)

* Add permissions to BuildingFile

* Fix test

* FIx 4450 (#4451)

* Fix ah import messages (#4445)

* Fix ah import messages

* Remove old function

* Fix Tests (#4457)

* Fix column names errors (#4455)

* Fix test

* UX updates - access tree view updates (#4486)

* update UX for access level tree setup

* fix 0-based levels in modal

* Update ALI table on inventory details page (#4489)

update ali table on ininv details page

* Enable force ali delete (#4492)

* Enable force ali delete

* style the warning

---------

Co-authored-by: kflemin <[email protected]>

* AH - update dialog text on Upload ALIs modal and collapse help section by default (#4493)

* hide cycle msg on modal for ali import

* default access tree help section to collapsed

* update import access levels dialog text

* AH UI Fixes for access level modals (#4501)

* ah ui fixes

* Small fixes

---------

Co-authored-by: Alex Swindler <[email protected]>

* Add Cross Cycle Tabular View for Portfolio Summary Goals (#4440)

* import data review frontend

* filter for ALI properties

* naming

* data review controller

* starting labels functional

* displaying labels by property not property_view

* dynamically add starting and ending labels

* formatting

* ending style

* styles

* rename data review to portfolio summary

* reorganize - functional

* pm property id sorted as number

* endpoint for summary stats

* change starting ending to baseline current

* debugging

* loading for both tables

* refactor for faster load times

* returning 100 matching properties

* pagination working, sorting not

* sorting working on cannonical columns

* ali as an argument for get properties

* portfolio endpoint using ali argument

* change site_eui for source_eui with prefered order for summary

* generic eui display

* formatting

* list endpoints for goal db table

* goal delete tested

* goal create tested

* update endpoint and decorators for standard endpoints

* goal crud tested

* begin development on portfolio_summary endpoint

* portfolio_summary endpoint

* reusing filter endpoint for second cycle property call

* imports

* base for goal modal

* update column validation

* create endpoint from frontned

* goal serializes level name, delete and list integrated into frontend modal

* update goal via modal

* troubleshooting org ownership

* functional goal select, needs refactoring

* reformat goal details display

* reformat goal details display

* goal passed between parent page and child modal

* guard against organization mismatches

* cleanup, using backend logic  over frontend logic

* filtering on cycle_sqft and cycle_eui

* on modal close

* portfolio summary with extra data

* save sort and filters

* display goal errors

* allow filtering one one cycle column at a time

* extra data tested

* precommit

* cleanup

* no goals and error display

* remove restricted level names

* oneline

* formatting

* column ids over profile and initialize columns refactor

* protect against null values in summary

* label click bug

* dc's cannot be filtered or sorted

* clarify naming

* export current page to csv

* precommit

* toast notifications on save and delete

* rename goal column to eui_column

* add area column selection to goal

* add units and unit conversion - still fails with extra data

* guard against none values for kbtu and area

* migration order

* provide links to update column in column settings

* precommit

* precommit

* added help text and translations

* visibility issues, sorting, info text

* phrasing

* units

* precommit

* type check

---------

Co-authored-by: kflemin <[email protected]>

* AH - Fix label creation UI (#4510)

* fix add label modal

* remove duplicate ngif

* Hierarchy tree/modal improvements (#4515)

Fixed several issues with the AH tree and modals

* Restrict leaf user permissions for goals (#4512)

* add user.is_ali_leaf

* remove frontend permissions for leaves

* decorator to deny leaf user permissions

* precommit

* cleanup

* Add year built to goal table (#4514)

* add year built to table

* prefer non-null values for cross cycle columns

* Set default property if goal property is undefined (#4516)

set default if property is undefined

* Ah/fix ali assignment (#4517)

* AH refinements and bug fixes

* cleanup

* Hierarchy data type improvements (#4518)

* Optimized ali help image

* Lint fixes

* Fixed is_ali_root/is_ali_leaf data types

---------

Co-authored-by: Katherine Fleming <[email protected]>

* Rename goal detail headers (#4520)

naming

* Add Permissions to PropertyViewSet (#4202)

* Add Permissions to PropertyViewSet

* fix test

* fix failing test

* Fix test

---------

Co-authored-by: kflemin <[email protected]>

* Enable background progress for uploading AH levels (#4522)

Enable background processing and progress for the hierarchy levels upload

* Disallow manual merge of records with different alis (#4495)

* Disallow manual merge of records with different alis

* Fix error catch

* Does match merge link records with different alis

* Disallow merge of records with different alis

* Disallow merges that cause bad links

* Disallow  match merge link records with different ali

* Disallow updates that cause bad merges and links

* Handle ali links during import (#4519)

* Make match_merge_link take state

* Change link_views to link_states

* Communicate links in import process

* WIP

* Fix function name

* reorder migrations
migration order

* Mypy fixes

* Fix test_unicode_matching test

* AH - display matching criteria warning when user uploads data to the org for the first time (#4540)

* add deprecation warning

* add matching criteria warning on data upload modal

* display column settings link when user has owner permissions

* restores seed/utils/inventory_filter.py

* add ci to ah/develop

* update tests

* formatting

* restore test_filter_groups.py

---------

Co-authored-by: Hannah Eslinger <[email protected]>
Co-authored-by: Ross Perry <[email protected]>

* AH - Add deprecation warning when user creates a Sub Organization (#4536)

* add deprecation warning

* update translations

* AH - Fix level 1 Access Level display in Inventory Details Page table (#4541)

fix inventory details page access levels table display

* Add notes related to goals (#4532)

* add year built to table

* prefer non-null values for cross cycle columns

* base for goal notes

* goal crd tested

* update tested

* refactor to only permit update

* attatch goal note to property on goal property filter and display

* permissioning

* backfill historical notes

* post save goal to create goal notes

* create historical notes on property creation

* historical note view

* precommit

* access historical notes and refactor ui grid edit cells

* precommit

* migration order

* migration order

* migration order

* update property retrieval

* precommit

* colors

---------

Co-authored-by: Hannah Eslinger <[email protected]>

* Fix default report X and Y axis selectors (#4542)

* fix default reports and code duplication in inventory_filter

* fix default dropdown selections

* remove old test

---------

Co-authored-by: Hannah Eslinger <[email protected]>

* Delete alis with als (#4543)

* Delete alis with als

* add translation, make label clickable

---------

Co-authored-by: kflemin <[email protected]>

* Several AH bug fixes (#4546)

Several AH fixes

* Handle empty cycles on portfolio summary (#4554)

* refactors for empty cycles

* precommit

* documentation

* formatting

* documentation

* documentation

---------

Co-authored-by: Hannah Eslinger <[email protected]>

* AH - Revise analysis permissions for creating columns (#4551)

* update analyses to only create columns for root owner

* update to allow root owners and members to create analysis columns

* restore co2 analysis modal

* fix test

* make can_create a method on analysis class

* tox

* fix test

* can_create function call

* Allow change of ali (#4552)

* Allow change of ali

* update tests

* fix typo

* chain user updates

* fix test

* precommit

* update tests

---------

Co-authored-by: Ross Perry <[email protected]>
Co-authored-by: Katherine Fleming <[email protected]>

* review viewer permissions (#4556)

* review viewer permissions

* update ubid create ali arg

* Fix note permissions

* pass menu object in notes modal

* Fixed notes permissions for viewers

* pin left permission for viewers

* Fixed column list settings permissions for viewers

* De-duplicated users list code

---------

Co-authored-by: Hannah Eslinger <[email protected]>
Co-authored-by: Ross Perry <[email protected]>
Co-authored-by: Alex Swindler <[email protected]>

* Disallow changing nonroot users to owner (#4545)

* Disallow changing nonroot users to owner

* Fix new member modal

* update tests

---------

Co-authored-by: Ross Perry <[email protected]>

* Fix portfolio summary editable cells (#4557)

* refactor editable cell permissions

* precommit

* 2nd filter also contains goal note details

* Permission (#4378)

Co-authored-by: kflemin <[email protected]>

* Squash Accountability Hierarchy Migrations (#4560)

* Reject import file if it contains braces (#4537)

reject import file if it contains braces

* Update default dates on data quality rules (#4538)

* new default dates for dq rules

* make year dynamic

---------

Co-authored-by: Katherine Fleming <[email protected]>

* Apply unit conversion to extra data (#4496)

* eeej small files

* option 1

* precommit

* revert

* apply optional units to serialized properties

* precommit

* import unit lookup and apply to mapping

* precommit

* formatting

* taxlots

* precommit

---------

Co-authored-by: Katherine Fleming <[email protected]>

* Fix unit conversion for non numeric values (#4555)

* guard against none

* guard against all exceptions

* more robust type checking

* db patterns

* Fixed several issues with tests

---------

Co-authored-by: Alex Swindler <[email protected]>

* Update GitHub Actions for Node v20 (#4550)

* squash AH migrations

* Fixed precommit issues

* Added missing run_python code to AH migrations

* Improve AH migration performance

* Additional performance improvements

---------

Co-authored-by: Ross Perry <[email protected]>
Co-authored-by: Nicholas Long <[email protected]>
Co-authored-by: Alex Swindler <[email protected]>

* Fixed typos (#4564)

* Fixed historical note backfilling

* Fix portfolio summary layout (#4566)

* Several miscellaneous fixes

---------

Co-authored-by: Alex Swindler <[email protected]>
Co-authored-by: Katherine Fleming <[email protected]>
Co-authored-by: Nicholas Long <[email protected]>
Co-authored-by: Ross Perry <[email protected]>
Co-authored-by: Nicholas Long <[email protected]>
dhaley pushed a commit that referenced this pull request Mar 18, 2024
* Init Accountability Hierarchy (#4068)

* Init Accountibilty Hiarchary

* Clean up

* Fix tests

* Fix tests

* Fix tests

* Fix max depth test

---------

Co-authored-by: Alex Swindler <[email protected]>

* AH test case class, decorator, and compliance_metric tests (#4108)

* start of perm test

* fix factories

* add new ALI test helpers and decorator, fix compliance_metric tests

* add decorator to update and destroy endpoints

* cleanup

* small fixes

* Default to root in fake property

* add ali tests for compliance-metric update and delete endpoints

* Fix isort

---------

Co-authored-by: Nicholas Long <[email protected]>
Co-authored-by: Hannah Eslinger <[email protected]>

* Add Permisions for DataLoggerViewSet (#4099)

* Add Permisions for DataLoggerViewSet

* Clean merge

* Add AH Permissions to MeterViewSet (#4116)

* Add AH Permissions to MeterViewSet

* Fix test

* Add AH Permissions to Scenarios (#4115)

* Import ah from file (#4061)

* css updates

* start of upload access level instances file

* process access level instances from file

* add test and edit access level capabilities

* cleanup

* ran translation scripts

* cleanup print statements!!

* error when headers are missing and check for blank cells in import

* updates to support bad files and additional access levels

* Add permissions to CycleViewSet (#4118)

* Add permissions to CycleViewSet

* Use permissions

* Apply suggestions from code review

Co-authored-by: Katherine Fleming <[email protected]>

---------

Co-authored-by: Katherine Fleming <[email protected]>

* Add permissions to ColumnListProfileViewSet (#4121)

* Add permissions to ColumnListProfileViewSet

* Update seed/tests/test_column_list_profiles_views.py

Co-authored-by: Katherine Fleming <[email protected]>

---------

Co-authored-by: Katherine Fleming <[email protected]>

* Add Permissions to ColumnViewSet (#4119)

* Add Permissions to ColumnViewSet

* Fix other tests

* Update seed/tests/test_column_views.py

Co-authored-by: Katherine Fleming <[email protected]>

---------

Co-authored-by: Katherine Fleming <[email protected]>

* Accountability Hierarchy Page Formatting (#4067)

* wip not working accordion tree

* working tree

* Add permissions to FilterGroup (#4129)

* Fix FilterGroup Tests

* Ah permissions/import file view set (#4126)

* Add Ah to import process

* Add Permissions to ImportFileViewSet

* Apply suggestions from code review

Co-authored-by: Katherine Fleming <[email protected]>

* Fix typo

* Enforce inclusion of root

* Add new case

---------

Co-authored-by: Katherine Fleming <[email protected]>

* Add permissions to DataViewViewSet (#4131)

* Ah bug fixes (#4138)

* update typos; fix ali dropdown in new member modal

* display ali in top right of app

* fix tests

* Fix

---------

Co-authored-by: Hannah Eslinger <[email protected]>

* Add aln contraints (#4134)

* Add aln contraints

* Fix

* Fix

* Add permissions to DerivedColumnViewSet (#4140)

* Add permissions to DerivedColumnViewSet

* fix comments

* Fix ali rename (#4141)

* Add access level instance visualisation to inventory list and detail (#4133)

* add ali serializer into to property serailizer

* ali table on inv det

* display ali on inv list

* basic filtering on ALI

* refactor

* sorting functional with errors

* filtering on !=

* functional but needs refactoring

* basic filter testing for alis

* refactor the filter expression logic for clarity

* show hide alis on inv list

* update ali pinning levels

* update tests for sorting

* test empty annotations

* precommit

* Update seed/models/tax_lot_properties.py

Co-authored-by: Hannah Eslinger <[email protected]>

* refactor for alns with spaces

* precommit

* mypy fix

* precommit

* add inventory_type as argument to accomodate p/tl

* test for taxlot ali filter

* Update seed/utils/inventory_filter.py

Co-authored-by: Hannah Eslinger <[email protected]>

* cleanup

* remove org key form ali path on inv detail

* guard for tests

* guard against undefined

* simplify ali path

* precommit

* remove alis from current columns

* developer note

---------

Co-authored-by: Hannah Eslinger <[email protected]>

* Add permissions to ColumnMappingProfileViewSet (#4127)

* Add permissions to ColumnMappingProfileViewSet

* Loosen permissions

* Ah/fix tests (#4182)

* Fix Tests

* Format

* Remove print

* Add permission LabelViewSet (#4163)

* Clean

* Add AH Permissions to PropertyViewSet (#4157)

* Add AH Permissions to PropertyViewSet

* Permission tests for salesforce workflow (#4161)

* adding permission tests for salesforce workflow

* fix tests

---------

Co-authored-by: Hannah Eslinger <[email protected]>

---------

Co-authored-by: Katherine Fleming <[email protected]>

* Add permissions to MeterReadingViewSet (#4193)

* Add permissions to datasetviewset (#4189)

* Add permissions to PropertyMeasuresViewSet (#4183)

* Add permissions to PropertyMesauresViewSet

* Fix frontend

* Ah permissions/note view set (#4191)

* WIP

* Fix for taxlot

* Delete test_green_assessments.py

* Fix

* Add access level name/ column display name constraints (#4171)

* Ah permissions/green assessments view sets (#4194)

* Add permissions to GreenAssessmentViewSet

* Add permissions to GreenAssessmentURLViewSet

* Add permissions to GreenAssessmentPropertyViewSet

* Ah/disallow nonroot owners (#4196)

* Disallow non root owners

* Fix typo

* Add permissions to postofficeviewset (#4201)

* Fix loading ALI to be foreground task only (#4230)

* WIP

* WIP

* remove background task when loading ALI data

* additional fixes to restore functionality

---------

Co-authored-by: Hannah Eslinger <[email protected]>
Co-authored-by: kflemin <[email protected]>

* Ah permissions/salesforce (#4204)

Make salesforce owner only

* Ah permissions/analysis view set (#4224)

* Add Analysis permissions

* Give permissions to analysis message and views

* Clean

* Add TaxLotProperty constraints (#4212)

* Add Permissions to GBRPropertyViewSet (#4205)

* Add Permissions to GBRPropertyViewSet

* Clean

* Add permissions to some org endpoints (#4216)

* Add permissions to some org endpoints

* Fix test?

* Add permissions to TaxlotViewSet (#4162)

* Add AH Permissions to PropertyViewSet

* Add permissions to TaxlotViewSet

* Fix merge

* Clean

* Fix test?

* Remove test

* Add permissions to Taxlot Properties (#4234)

* Add permissions to GeocodeViewSet (#4241)

* Add more Permissions (#4248)

* Add permissions to LabelInventoryViewSet (#4246)

* Ah/import frontend (#4170)

* Add ah info to import front end

* Fix

* Clean

* Fix tests

* Fix user creation bug (#4235)

* http request type

* user creation updates

* superuser page to have dynamic ali selection

* precommit

* style

* unused property

* naming

* update tests:

* update tests

* new user role is owner not member

* Renumber migrations

* Lint fixes

* Ah fix analysis list (#4285)

Fix list analysis?

* Build docker container for accountability branch (#4283)

* build docker container for AH

* build docker container for AH

* Fix tests (#4303)

* Fix tests

* Fix more tests

* Add option to delete alis (#4284)

* Add option to delete alis

* Add delete AL button

---------

Co-authored-by: kflemin <[email protected]>

* update modal step ID (#4289)

* Remove unauthorized items from + menu for lower-level users (#4290)

* update modal step ID

* remove options from + menu for non-root users

* Permission UploadViewSet (#4297)

* Permission UploadViewSet

* Fix

---------

Co-authored-by: kflemin <[email protected]>

* Add Permissions to TaxlotViewViewSet (#4298)

Co-authored-by: kflemin <[email protected]>

* Display error message on failed invite (#4370)

display error message on failed invite

* Ah permissions/ubid view set (#4302)

* get and create tested

* destroy tested

* update existing tests

* test decode by ids

* test ubid list endpoint

* test ubid decode_results endpoint

* test ubids by view and add taxlot testing

* remove unused args

* precommit

* formatting

* update tests

* filter over decorate

* precommit

---------

Co-authored-by: Hannah Eslinger <[email protected]>

* Fix upload (#4392)

* Disallow nonroot user from CUD column list profile (#4271)

* Disallow nonroot user from CUD column list profile

* Throw on a couple more

* Fix test

* Squash migrations (#4395)

* Test disallow nonroot users to create columns (#4394)

* Clean up _column_fields_to_columns

* Disallow column creation while mapping data

* Disallow column creation while mapping data

* add access_level_names to fake org

---------

Co-authored-by: Ross Perry <[email protected]>

* Fix analysis bug (#4383)

* 4137 fix anl error message (#4417)

* 4137 Fix anl error message

* Update message

* Remove hannahs docker images

* Fix ali tree permissions (#4435)

* Fix ali tree permissions

* Filter tree names

* Include ancestors

* Add permissions to BuildingFile (#4443)

* Add permissions to BuildingFile

* Fix test

* FIx 4450 (#4451)

* Fix ah import messages (#4445)

* Fix ah import messages

* Remove old function

* Fix Tests (#4457)

* Fix column names errors (#4455)

* Fix test

* UX updates - access tree view updates (#4486)

* update UX for access level tree setup

* fix 0-based levels in modal

* Update ALI table on inventory details page (#4489)

update ali table on ininv details page

* Enable force ali delete (#4492)

* Enable force ali delete

* style the warning

---------

Co-authored-by: kflemin <[email protected]>

* AH - update dialog text on Upload ALIs modal and collapse help section by default (#4493)

* hide cycle msg on modal for ali import

* default access tree help section to collapsed

* update import access levels dialog text

* AH UI Fixes for access level modals (#4501)

* ah ui fixes

* Small fixes

---------

Co-authored-by: Alex Swindler <[email protected]>

* Add Cross Cycle Tabular View for Portfolio Summary Goals (#4440)

* import data review frontend

* filter for ALI properties

* naming

* data review controller

* starting labels functional

* displaying labels by property not property_view

* dynamically add starting and ending labels

* formatting

* ending style

* styles

* rename data review to portfolio summary

* reorganize - functional

* pm property id sorted as number

* endpoint for summary stats

* change starting ending to baseline current

* debugging

* loading for both tables

* refactor for faster load times

* returning 100 matching properties

* pagination working, sorting not

* sorting working on cannonical columns

* ali as an argument for get properties

* portfolio endpoint using ali argument

* change site_eui for source_eui with prefered order for summary

* generic eui display

* formatting

* list endpoints for goal db table

* goal delete tested

* goal create tested

* update endpoint and decorators for standard endpoints

* goal crud tested

* begin development on portfolio_summary endpoint

* portfolio_summary endpoint

* reusing filter endpoint for second cycle property call

* imports

* base for goal modal

* update column validation

* create endpoint from frontned

* goal serializes level name, delete and list integrated into frontend modal

* update goal via modal

* troubleshooting org ownership

* functional goal select, needs refactoring

* reformat goal details display

* reformat goal details display

* goal passed between parent page and child modal

* guard against organization mismatches

* cleanup, using backend logic  over frontend logic

* filtering on cycle_sqft and cycle_eui

* on modal close

* portfolio summary with extra data

* save sort and filters

* display goal errors

* allow filtering one one cycle column at a time

* extra data tested

* precommit

* cleanup

* no goals and error display

* remove restricted level names

* oneline

* formatting

* column ids over profile and initialize columns refactor

* protect against null values in summary

* label click bug

* dc's cannot be filtered or sorted

* clarify naming

* export current page to csv

* precommit

* toast notifications on save and delete

* rename goal column to eui_column

* add area column selection to goal

* add units and unit conversion - still fails with extra data

* guard against none values for kbtu and area

* migration order

* provide links to update column in column settings

* precommit

* precommit

* added help text and translations

* visibility issues, sorting, info text

* phrasing

* units

* precommit

* type check

---------

Co-authored-by: kflemin <[email protected]>

* AH - Fix label creation UI (#4510)

* fix add label modal

* remove duplicate ngif

* Hierarchy tree/modal improvements (#4515)

Fixed several issues with the AH tree and modals

* Restrict leaf user permissions for goals (#4512)

* add user.is_ali_leaf

* remove frontend permissions for leaves

* decorator to deny leaf user permissions

* precommit

* cleanup

* Add year built to goal table (#4514)

* add year built to table

* prefer non-null values for cross cycle columns

* Set default property if goal property is undefined (#4516)

set default if property is undefined

* Ah/fix ali assignment (#4517)

* AH refinements and bug fixes

* cleanup

* Hierarchy data type improvements (#4518)

* Optimized ali help image

* Lint fixes

* Fixed is_ali_root/is_ali_leaf data types

---------

Co-authored-by: Katherine Fleming <[email protected]>

* Rename goal detail headers (#4520)

naming

* Add Permissions to PropertyViewSet (#4202)

* Add Permissions to PropertyViewSet

* fix test

* fix failing test

* Fix test

---------

Co-authored-by: kflemin <[email protected]>

* Enable background progress for uploading AH levels (#4522)

Enable background processing and progress for the hierarchy levels upload

* Disallow manual merge of records with different alis (#4495)

* Disallow manual merge of records with different alis

* Fix error catch

* Does match merge link records with different alis

* Disallow merge of records with different alis

* Disallow merges that cause bad links

* Disallow  match merge link records with different ali

* Disallow updates that cause bad merges and links

* Handle ali links during import (#4519)

* Make match_merge_link take state

* Change link_views to link_states

* Communicate links in import process

* WIP

* Fix function name

* reorder migrations
migration order

* Mypy fixes

* Fix test_unicode_matching test

* AH - display matching criteria warning when user uploads data to the org for the first time (#4540)

* add deprecation warning

* add matching criteria warning on data upload modal

* display column settings link when user has owner permissions

* restores seed/utils/inventory_filter.py

* add ci to ah/develop

* update tests

* formatting

* restore test_filter_groups.py

---------

Co-authored-by: Hannah Eslinger <[email protected]>
Co-authored-by: Ross Perry <[email protected]>

* AH - Add deprecation warning when user creates a Sub Organization (#4536)

* add deprecation warning

* update translations

* AH - Fix level 1 Access Level display in Inventory Details Page table (#4541)

fix inventory details page access levels table display

* Add notes related to goals (#4532)

* add year built to table

* prefer non-null values for cross cycle columns

* base for goal notes

* goal crd tested

* update tested

* refactor to only permit update

* attatch goal note to property on goal property filter and display

* permissioning

* backfill historical notes

* post save goal to create goal notes

* create historical notes on property creation

* historical note view

* precommit

* access historical notes and refactor ui grid edit cells

* precommit

* migration order

* migration order

* migration order

* update property retrieval

* precommit

* colors

---------

Co-authored-by: Hannah Eslinger <[email protected]>

* Fix default report X and Y axis selectors (#4542)

* fix default reports and code duplication in inventory_filter

* fix default dropdown selections

* remove old test

---------

Co-authored-by: Hannah Eslinger <[email protected]>

* Delete alis with als (#4543)

* Delete alis with als

* add translation, make label clickable

---------

Co-authored-by: kflemin <[email protected]>

* Several AH bug fixes (#4546)

Several AH fixes

* Handle empty cycles on portfolio summary (#4554)

* refactors for empty cycles

* precommit

* documentation

* formatting

* documentation

* documentation

---------

Co-authored-by: Hannah Eslinger <[email protected]>

* AH - Revise analysis permissions for creating columns (#4551)

* update analyses to only create columns for root owner

* update to allow root owners and members to create analysis columns

* restore co2 analysis modal

* fix test

* make can_create a method on analysis class

* tox

* fix test

* can_create function call

* Allow change of ali (#4552)

* Allow change of ali

* update tests

* fix typo

* chain user updates

* fix test

* precommit

* update tests

---------

Co-authored-by: Ross Perry <[email protected]>
Co-authored-by: Katherine Fleming <[email protected]>

* review viewer permissions (#4556)

* review viewer permissions

* update ubid create ali arg

* Fix note permissions

* pass menu object in notes modal

* Fixed notes permissions for viewers

* pin left permission for viewers

* Fixed column list settings permissions for viewers

* De-duplicated users list code

---------

Co-authored-by: Hannah Eslinger <[email protected]>
Co-authored-by: Ross Perry <[email protected]>
Co-authored-by: Alex Swindler <[email protected]>

* Disallow changing nonroot users to owner (#4545)

* Disallow changing nonroot users to owner

* Fix new member modal

* update tests

---------

Co-authored-by: Ross Perry <[email protected]>

* Fix portfolio summary editable cells (#4557)

* refactor editable cell permissions

* precommit

* 2nd filter also contains goal note details

* Permission (#4378)

Co-authored-by: kflemin <[email protected]>

* Squash Accountability Hierarchy Migrations (#4560)

* Reject import file if it contains braces (#4537)

reject import file if it contains braces

* Update default dates on data quality rules (#4538)

* new default dates for dq rules

* make year dynamic

---------

Co-authored-by: Katherine Fleming <[email protected]>

* Apply unit conversion to extra data (#4496)

* eeej small files

* option 1

* precommit

* revert

* apply optional units to serialized properties

* precommit

* import unit lookup and apply to mapping

* precommit

* formatting

* taxlots

* precommit

---------

Co-authored-by: Katherine Fleming <[email protected]>

* Fix unit conversion for non numeric values (#4555)

* guard against none

* guard against all exceptions

* more robust type checking

* db patterns

* Fixed several issues with tests

---------

Co-authored-by: Alex Swindler <[email protected]>

* Update GitHub Actions for Node v20 (#4550)

* squash AH migrations

* Fixed precommit issues

* Added missing run_python code to AH migrations

* Improve AH migration performance

* Additional performance improvements

---------

Co-authored-by: Ross Perry <[email protected]>
Co-authored-by: Nicholas Long <[email protected]>
Co-authored-by: Alex Swindler <[email protected]>

* Fixed typos (#4564)

* Fixed historical note backfilling

* Fix portfolio summary layout (#4566)

* Several miscellaneous fixes

---------

Co-authored-by: Alex Swindler <[email protected]>
Co-authored-by: Katherine Fleming <[email protected]>
Co-authored-by: Nicholas Long <[email protected]>
Co-authored-by: Ross Perry <[email protected]>
Co-authored-by: Nicholas Long <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature Add this label to new features. This will be reflected in the change log when generated.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants