-
Notifications
You must be signed in to change notification settings - Fork 31
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
Customizable gender field #4027
base: main
Are you sure you want to change the base?
Conversation
Add subscription, relations, and AppConfig. Open are still filter, sort and import, and perhaps delete prompt. |
Needs an updated versions of: |
<mat-select formControlName="gender_id"> | ||
<mat-option [value]="null">-</mat-option> | ||
@for (gender of genders; track gender) { | ||
<mat-option [value]="gender"> | ||
{{ gender | translate }} | ||
@for (gender of genders; track gender.name) { | ||
<mat-option [value]="gender.id"> | ||
{{ gender.name | translate }} | ||
</mat-option> | ||
} | ||
</mat-select> |
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.
Use the repo-search-selector
for this.
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.
done, needed to update the noneItem.
@@ -13,6 +14,7 @@ export class ParticipantDetailComponent extends BaseModelRequestHandlerComponent | |||
if (params[`id`]) { | |||
this.subscribeTo(getParticipantDetailSubscription(+params[`id`]), { hideWhenDestroyed: true }); | |||
} | |||
this.subscribeTo(getGenderListSubscriptionConfig()); |
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.
When using the repo search selector you can directly pass the needed subscription to the search selector and remove it here.
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.
done, provide the getGenderListSubscriptionConfig for the repo-search-selector
{ | ||
idField: `gender_id`, | ||
fieldset: [`name`] | ||
} |
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.
Wrong place. This will just request the gender model of the operator. Just move to accountListSubsciptionContent
as written in my other comment.
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.
removed.
{ | ||
idField: `gender_ids`, | ||
fieldset: [`name`], | ||
isFulllist: true | ||
} |
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.
Move this to accountListSubsciptionContent
.
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.
done.
{ | ||
idField: `gender_ids`, | ||
fieldset: [`name`], | ||
isFulllist: true |
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 has no effect because it is written wrong (isFullList
). However this is not needed here anyway.
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.
removed.
this.noneItem = { | ||
getListTitle: (): string => this.noneTitle, | ||
getTitle: (): string => this.noneTitle, | ||
id: null | ||
}; |
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.
Why do you need this here? Does this affect any other usages of this component?
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 needed it here, to set noneItem.id to 'null' instead of '0'. I found no other usage of none item with the repo-search-selector.
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 am asking because of #3272
It is indeed used in participant-create-wizard.component.html
and participant-detail-view.component.html
.
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.
Okay, how can I use the repo-search-selector with noneItem, that it doesn't deliver a 0 to the action?
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 have removed the noneItem change and set 0 to null before sending the payload to the repos.
It seems that there is a test failing because of wrong imports in a newly created |
Like the other tests, this component test is 'xdescribe'.
Resolve #3803
Work in Progress, added internal logic and the list and dialog, the genders/gender fields still need to be replaced in the different code positions.