Open james-strauss-uwa opened 6 hours ago
The PR fixes a bug where new GraphConfig objects could have null IDs by moving the ID generation into the constructor. This ensures that every GraphConfig instance has a valid ID from the moment it's created. The implementation removes redundant manual ID setting code from various locations where GraphConfig objects are instantiated.
classDiagram
class GraphConfig {
- ko.Observable id
+ ko.Observable name
+ ko.Observable description
+ GraphConfig()
}
note for GraphConfig "ID is now generated in the constructor using Utils.generateGraphConfigId()"
Change | Details | Files |
---|---|---|
Moved GraphConfig ID generation to the constructor |
|
src/GraphConfig.ts |
Removed redundant ID setting code from GraphConfig usage locations |
|
src/Eagle.ts src/ParameterTable.ts |
Added generation of GraphConfig id to the GraphConfig constructor, so it's impossible to forget. Removed some places in the code where the id was set manually.
Summary by Sourcery
Generate GraphConfig id in the constructor to prevent null ids and remove manual id assignments.
Bug Fixes:
Enhancements: