Skip to content
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

Open
wants to merge 23 commits into
base: main
Choose a base branch
from
Open

Conversation

reiterl
Copy link
Member

@reiterl reiterl commented Aug 15, 2024

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.

@reiterl reiterl added this to the 4.2 milestone Aug 15, 2024
@reiterl reiterl self-assigned this Aug 15, 2024
@reiterl
Copy link
Member Author

reiterl commented Sep 9, 2024

Add subscription, relations, and AppConfig. Open are still filter, sort and import, and perhaps delete prompt.

@reiterl reiterl marked this pull request as ready for review September 11, 2024 06:19
@reiterl
Copy link
Member Author

reiterl commented Sep 11, 2024

@reiterl reiterl removed their assignment Sep 11, 2024
Comment on lines 85 to 92
<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>
Copy link
Member

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.

Copy link
Member Author

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());
Copy link
Member

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.

Copy link
Member Author

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

Comment on lines 112 to 115
{
idField: `gender_id`,
fieldset: [`name`]
}
Copy link
Member

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.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed.

Comment on lines 84 to 88
{
idField: `gender_ids`,
fieldset: [`name`],
isFulllist: true
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Move this to accountListSubsciptionContent.

Copy link
Member Author

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
Copy link
Member

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.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed.

@bastianjoel bastianjoel assigned reiterl and unassigned bastianjoel and Elblinator Sep 12, 2024
Comment on lines 56 to 60
this.noneItem = {
getListTitle: (): string => this.noneTitle,
getTitle: (): string => this.noneTitle,
id: null
};
Copy link
Member

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?

Copy link
Member Author

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.

Copy link
Member

@bastianjoel bastianjoel Sep 16, 2024

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.

Copy link
Member Author

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?

Copy link
Member Author

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.

@reiterl reiterl assigned bastianjoel and unassigned reiterl Sep 16, 2024
@bastianjoel
Copy link
Member

It seems that there is a test failing because of wrong imports in a newly created .spec.ts file.

@bastianjoel bastianjoel removed their assignment Sep 16, 2024
reiterl and others added 2 commits September 16, 2024 14:49
Like the other tests, this component test is 'xdescribe'.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add customisable gender
4 participants