This is a fairly lofty PR and I hope you're not daunted by it. My suggestion would be to evaluate various components that I identify here, as a whole rather than [files changed diff lines].
Broadly speaking, this PR sets out to formally delineate pop-up reading from editing.
I've introduced RichPopup, which contains a single property, relationships, an instance of Relationships, a data structure that handles loading (via AGSLoadable) and organizing related records.
Now, an instance of RichPopup can load relationships:
richPopup.relationships!.load({})
and check load status of relationships:
richPopup.relationships?.loadStatus
A Relationships (note the plural form) object maintains collections of related records. A Relationship (note the singular form) object represents a single relationship between two feature tables and is loaded via AGSLoadable. A Relationship is not intended to be used directly but instead to be subclassed, which the app does via OneToManyRelationship and ManyToOneRelationship. More relationship types can be added down the line, easily (such as one-to-one and many-to-one).
A Relationship subclass is a loadable model of related records for a specific relationship between and places the onus of actually relating the records into the RichPopupManager (née PopupRelatedRecordsManager).
This challenge opened up a series of app-wide changes, particularly in MapViewController and in RichPopupViewController (née PopupRelatedRecordsViewController) inspiring some cleanup up of this view controller as a whole.
I've also identified a number of other areas for improvement along the way, including a more clear and unified approach to AppErrors.
This is a fairly lofty PR and I hope you're not daunted by it. My suggestion would be to evaluate various components that I identify here, as a whole rather than [files changed diff lines].
Broadly speaking, this PR sets out to formally delineate pop-up reading from editing.
I've introduced
RichPopup
, which contains a single property,relationships
, an instance ofRelationships
, a data structure that handles loading (viaAGSLoadable
) and organizing related records.Now, an instance of
RichPopup
can load relationships:and check load status of relationships:
A
Relationships
(note the plural form) object maintains collections of related records. ARelationship
(note the singular form) object represents a single relationship between two feature tables and is loaded viaAGSLoadable
. ARelationship
is not intended to be used directly but instead to be subclassed, which the app does viaOneToManyRelationship
andManyToOneRelationship
. More relationship types can be added down the line, easily (such as one-to-one and many-to-one).A
Relationship
subclass is a loadable model of related records for a specific relationship between and places the onus of actually relating the records into theRichPopupManager
(néePopupRelatedRecordsManager
).This challenge opened up a series of app-wide changes, particularly in
MapViewController
and inRichPopupViewController
(néePopupRelatedRecordsViewController
) inspiring some cleanup up of this view controller as a whole.I've also identified a number of other areas for improvement along the way, including a more clear and unified approach to
AppErrors
.