-
-
Notifications
You must be signed in to change notification settings - Fork 154
feat: integrate Unused-Guid-Search #3319
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
base: master
Are you sure you want to change the base?
Conversation
libs/features/unused-guid-search/src/unused-guid-search.component.ts
Outdated
Show resolved
Hide resolved
I made some minor refactoring. We usually don't use async/await but we work with rxjs, I see that you are using About other variables, I converted them into signals, and removed the cdr change detection trigger, it is not necessary if you use signals. For the rest, the job seems a good start point! |
@Helias, Thanks for the feedback and the improvements. I've refactored as needed to match the rest of the project, and I'lll look into setting up tests sometime in the future. |
startIndex: [1, [Validators.required, Validators.min(1), Validators.max(this.MAX_INT_UNSIGNED_VALUE)]], | ||
amount: [10, [Validators.required, Validators.min(1), Validators.max(this.MAX_INT_UNSIGNED_VALUE)]], | ||
consecutive: [false, [Validators.required]], | ||
}); |
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.
you could use protected readonly form: FormGroup<FormGroupINTERFACE>
, so let's define an interface with the form group content.
Moreover I would avoid to use the formBuilder, use new FormGroup<FormGroupINTERFACE>({ .... })
|
||
protected results: string[] = []; | ||
protected loading = signal(false); | ||
protected error = signal(''); |
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.
I forgot to set the signals as readonly
protected loading = signal(false); | ||
protected error = signal(''); | ||
|
||
protected async onSearch(): Promise<void> { |
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.
the async
should not be necessary anymore
selector: 'keira-features-unused-guid-search', | ||
templateUrl: './unused-guid-search.component.html', | ||
styleUrl: './unused-guid-search.component.scss', | ||
imports: [FormsModule, ReactiveFormsModule, TranslateModule], |
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.
you are importing TranslateModule but you are not using any translations, in the future you could add them before merging this PR
}) | ||
export class UnusedGuidSearchComponent { | ||
private readonly mysql = inject(MysqlQueryService); | ||
private readonly fb = inject(FormBuilder); |
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.
the FormBuilder is not necessary
This integrates https://github.com/Kitzunu/Unused-Guid-Search as a tab
UI Screenshot
I copied the minimal UI, and the feature supports the same tables
It's still missing tests and translations, but I would prefer some feedback before, as I'm not too familiar with Angular architecture