-
Notifications
You must be signed in to change notification settings - Fork 117
Conversation
@Column(DataType.STRING) | ||
op: GroupRuleOpType; | ||
|
||
@Column | ||
relativeMatchNumber: number; | ||
|
||
@Column | ||
relativeMatchUnit: string; | ||
@Column(DataType.STRING) | ||
relativeMatchUnit: RelativeMatchUnitType; | ||
|
||
@Column | ||
relativeMatchDirection: string; | ||
@Column(DataType.STRING) | ||
relativeMatchDirection: RelativeMatchDirectionType; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adds better TS Types
operation: { op: GroupRuleOpType; description?: string }; | ||
match?: string | number | boolean; | ||
relativeMatchNumber?: number; | ||
relativeMatchUnit?: string; | ||
relativeMatchDirection?: string; | ||
relativeMatchUnit?: RelativeMatchUnitType; | ||
relativeMatchDirection?: RelativeMatchDirectionType; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adds better TS Types
|
||
export async function loadGroup( | ||
configObject: GroupConfigurationObject, | ||
externallyValidate: boolean, | ||
validate = false | ||
): Promise<IdsByClass> { | ||
let isNew = false; | ||
validateConfigObjectKeys(Group, configObject, ["rules"]); | ||
validateConfigObjectKeys(Group, configObject, ["rules", "type"]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For now, we won't crash if group.type
is provided on a config object, but we check it below
export type GroupRuleOpType = | ||
| typeof _boolean_ops[number]["op"] | ||
| typeof _number_ops[number]["op"] | ||
| typeof _string_ops_sqlite[number]["op"] | ||
| typeof _string_ops_postgres[number]["op"] | ||
| typeof _date_ops[number]["op"]; | ||
export type RelativeMatchUnitType = typeof _relativeMatchUnits[number]; | ||
export type RelativeMatchDirectionType = "add" | "subtract"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Finally providing types for the Group Rules
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a big one! Looks good though and I think the migration path is clear.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bye Manual Groups! I found one spot that still used "Calculated Group" instead of "Group" in a test, but other than that looks good.
Co-authored-by: Teal Larson <teal.larson@grouparoo.com>
5add42a
to
94ed466
Compare
To simplify & clarify Grouparoo, this PR removes the concept of "manual" Groups. From this point forward, all Grouparoo Groups are "calculated", meaning that they dynamically determine which Records are members based on the Properties of those Records. This has the effect of simplifying many things from the UI, configuration files, and internal logic. This is a breaking change.
After the application of this PR, the following breaking changes will happen:
group.type
is no longer a property of a Grouparoo group.Docs @ grouparoo/www.grouparoo.com#828
Checklists
Development
Impact
Please explain any security, performance, migration, or other impacts if relevant:
Code review