-
Notifications
You must be signed in to change notification settings - Fork 563
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Feat] Mikro Orm Query Support (#7507)
* feat: create mikro-orm and typeorm combined decorator * fix: type issue * feat: update relations in entities to support mikro-orm * feat: create mikro-orm and typeorm combined decorator * fix: type issue * feat: update relations in entities to support mikro-orm * fix: relations for mikro-orm * fix: one-to-one-relation for mikro-orm * fix: one-to-one and many-to-one relation in mikro-orm * fix: relation ref column and join column * feat: update column decorator * fix: many-to-one relations * feat: update joinColumn * fix:Map Mikro ORM Entity To Json * feat: create mikro-orm and typeorm combined decorator * fix: type issue * feat: update relations in entities to support mikro-orm * feat: create mikro-orm and typeorm combined decorator * fix: type issue * feat: update relations in entities to support mikro-orm * fix: relations for mikro-orm * fix: one-to-one-relation for mikro-orm * fix: one-to-one and many-to-one relation in mikro-orm * fix: relation ref column and join column * feat: update column decorator * fix: many-to-one relations * feat: update joinColumn * fix:Map Mikro ORM Entity To Json * fix: circular user and employee entity (create employee) * fix(deepscan): removed unnecessary import * fix: gauzy develop start error * feat: parse where condition in mikro-orm * chore(deps): updated yarn.lock * refactor: many to one decorator * fix: added new decortors for relations and columns * fix(deepscan): removed unused import * fix: updated column decorator * fix: refactor column decorator types * fix: one to one entity relations * fix: updated employee create handler * fix: refactor one to one decortor * feat: added pipeline core subscriber * fix: pipeline entity and shared utils * fix: updated pipeline filters * refactor: updated crud service * fix: warehouse many to many relations * fix: refactor relations decorators * Revert "fix: refactor relations decorators" This reverts commit 1f2d94d. * feat: added shared types * refactor: one to one and many to one decorators * refactor: one to many and many to many decorators * fix: missing await / async for find one method * fix: updated transform interceptor * fix: updated relations decorators * fix: role service used custom role repository * fix: missing where in count by crud method * wip: column/property indexing * feat: added mikro orm DB logging * fix: serialize and wrap mikro orm entity * fix: replace user module for permission guard * fix: role permission custom repository for typeorm * Update utils.ts * feat: create type-orm to mikro-orm query builder mapping * remove console log * feat: fix query builder class mapping for mikro-orm * chore(deps): bump @mikro-orm/core from 6.0.5 to 6.1.7 * fix: strict partial loading for specific fields * fix: added missing subscribers for mikro-orm * wip: event subscriber for mikro and type orm * fix: rename event subscriber name * fix: created generic entity event subscriber for MikroOrm and TypeOrm * fix: rename base entity event subscriber * fix: revert back defaults for local env * chore: logging was not working well * fix: tracer importing * fix: before insert and create combine subscriber method * fix: common mikro and typeorm before update event hook --------- Co-authored-by: RAHUL RATHORE <41804588+rahul-rocket@users.noreply.github.com> Co-authored-by: Ruslan K <evereq@gmail.com> Co-authored-by: Rahul R <rahulrathore576@gmail.com>
- Loading branch information
1 parent
3bc7ad0
commit 1289c36
Showing
232 changed files
with
4,480 additions
and
2,669 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 14 additions & 1 deletion
15
apps/gauzy/src/app/@core/validators/at-least-one-field.validator.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,27 @@ | ||
import { UntypedFormGroup } from '@angular/forms'; | ||
import { isNotNullOrUndefined } from '@gauzy/common-angular'; | ||
|
||
/** | ||
* Validates that at least one field in the group has a valid, non-null, and non-undefined value. | ||
* | ||
* @param group - The form group to validate. | ||
* @returns A validation error object if no valid value is found in the group, otherwise null. | ||
*/ | ||
export function AtLeastOneFieldValidator(group: UntypedFormGroup): { [key: string]: any } { | ||
let isAtLeastOne = false; | ||
|
||
if (group && group.controls) { | ||
for (const control in group.controls) { | ||
if (group.controls.hasOwnProperty(control) && group.controls[control].valid && group.controls[control].value) { | ||
if ( | ||
group.controls.hasOwnProperty(control) && | ||
group.controls[control].valid && | ||
isNotNullOrUndefined(group.controls[control].value) | ||
) { | ||
isAtLeastOne = true; | ||
break; | ||
} | ||
} | ||
} | ||
|
||
return isAtLeastOne ? null : { requiredAtLeastOne: true }; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.