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

Report v2 #201

Merged
merged 42 commits into from
Apr 4, 2023
Merged

Report v2 #201

merged 42 commits into from
Apr 4, 2023

Conversation

Exilliar
Copy link
Collaborator

@Exilliar Exilliar commented Jan 24, 2023

Fairly large pr making an update to the report object. Contains a couple of changes:

  1. Update to include material carbon totals in the object so that child objects do not need to be pulled down into most pages (no pages require child objects atm, the assessment view page might at some point), reducing load times.
  2. Added a "version" property to the object. This is the version of the object that is being used, not the version of the users report. This version number is used to let Act know how to load the report. It allows us to support both this new version of the report object and also the old version (and any new versions that we make).
  3. Adds a new version of the model to the report, this version has the carbon values added to the model as new parameters. This allows us to more easily display a heat map on the report view page (which is also a new feature in this pr). Generating this model can take quite a while, so the time to save a report has increased. But I think that the trade-off is worth it.

More info on some of these changes here #180.

User's pre-update reports will not be directly updated as that would have a high chance of causing issues. Instead, any new reports that are created post-update will be made using this version of the report.

To test:

  1. Create a new report and check that it loads properly (with the heat map and everything)
  2. Edit a v1 report and see if that update works
  3. There is meant to be full backwards compatibility with v1 reports, so check that the report view page still works on v1 reports

@Exilliar Exilliar requested a review from ro-sa January 24, 2023 14:13
@Exilliar Exilliar marked this pull request as draft January 24, 2023 18:30
@Exilliar Exilliar marked this pull request as ready for review March 28, 2023 16:06
title: "Object parameter grouping",
subtitle: `You can now group your objects for material selection by any parameter on your model.`,
title: "Report Object v2",
subtitle: `The way that we store your carbon reports has now changed. The updates allow for faster loading, carbon heat maps, and makes it easier to access your data.`,
Copy link
Collaborator

Choose a reason for hiding this comment

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

"make" instead of "makes"

value: "parameters.Construction Carbon A5.value"
},
{
name: "Materials",
Copy link
Collaborator

Choose a reason for hiding this comment

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

move this to the start of the array, to make the Materials the default category shown

@@ -21,7 +24,7 @@ export interface SpeckleObjectFormComplete {
id: string;
speckle_type: string;
formData: ObjectFormDataComplete;
reportData?: ReportData;
reportData?: ReportDataChild;
}

export interface ObjectFormDataComplete {
Copy link
Collaborator

Choose a reason for hiding this comment

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

can we make this more DRY, please?

SpeckeleObject, ObjectFromData, and ObjectFormDataComplete are the same. ObjectFromData and ObjectFormDataComplete are also not used anywhere

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

  • SpeckleObject is used in the ObjectsObj type, which is used on the Assessment.vue view.
  • ObjectFormData is used in the SpeckleObject interface.
  • ObjectFormDataComplete is used in SpeckleObjectFormComplete which is used in the Assessment.vue view and the carbonCalculator.ts file.
  • ObjectFormData is used in the SpeckleObject interface.
  • ObjectFormDataComplete is used in SpeckleObjectFormComplete.

If I remember right, a lot of these exist, and appear to be the same, because I wanted to have interfaces that both could/couldn't contain some fields, and interfaces that definitely would contain the same fields. I think that this was mainly done to make things easier in the Assessment.vue view.

A lot of this file/folder is heavily linked to the Assessment.vue view, which is incredibly messy and is difficult to figure out. It's the type of file where you can change on thing and that causes things elsewhere to break without you realising. Really that file needs a whole re-write, but that would be a massive job at this point. I might try to pull together some diagrams and stuff to help us better understand what's going on.

@ro-sa ro-sa self-requested a review April 4, 2023 14:43
title: "Object parameter grouping",
subtitle: `You can now group your objects for material selection by any parameter on your model.`,
title: "Report Object v2",
subtitle: `The way that we store your carbon reports has now changed. The updates allow for faster loading, carbon heat maps, and gives you easier to access your data.`,
Copy link
Collaborator

Choose a reason for hiding this comment

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

please rephrase and gives you easier to access your data. :D

@ro-sa ro-sa self-requested a review April 4, 2023 15:46
@Exilliar Exilliar merged commit 478141c into dev Apr 4, 2023
@Exilliar Exilliar deleted the report-v2 branch April 4, 2023 15:46
Exilliar added a commit that referenced this pull request Apr 11, 2023
* Report v2 (#201)

* assessment page saves in new v2 object

* mostly working I think

* child objects properly appear on server

* includes materials and transport colours in report parent object now

* removed comment

* moved around a load of functions to (hopefully) make things a little cleaner

* clean up

* model object id now saved to report object to be more certain that correct model being displayed on view assessment page

* child objects actually contain total carbon

* wrote main parameter update function, don't know if it works yet

* almost working

* attempted to make things work

* adding param function works (kinda)

* cleaned up addParams method a little bit, should more reliably work now

* model with new params being correctly uploaded

* carbon heatmap inside Act!

* started adding some controls for the viewer on the report viewer page

* continued work on the viewer controls on the report viewing page

* can change model views on the view report page

* report viewer can load both v1 and v2 reports

* updated v1 report to v2 works

* added key to report viewer page (it's rubbish, but gets the job done)

* removed most of the console.log's

* added message to the final loading spinner on the assessment page

* object parameter grouping now properly works

* updated version number

* cleaned things up

* updated speckle viewer

* almost working

* working (as far as I know)

* clean up

* clean up

* text update

* text update 2

* added links (#215)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants