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

refactor: make list forms files clearer #1338

Merged
merged 100 commits into from Jan 11, 2024
Merged

Conversation

derschnee68
Copy link
Collaborator

No description provided.

askToDeleteListNode() {
this._dialog
.afterConfirmation('Do you want to delete this node?', this.node.labels[0].value)
.pipe(switchMap(() => this._listApiService.deleteListNode(this.node.id)))
Copy link
Contributor

Choose a reason for hiding this comment

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

unsubscribe by using .pipe(take(1))

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

dialog automatically unsubscribes

Copy link
Contributor

Choose a reason for hiding this comment

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

larger part of the code in the create and edit components is duplicated. I would suggest to make one component.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I don't agree, as those two codes are clearly different components, it makes the code less readable and is prone to unmaintainable code in case we want to change specific part in the dialog for one or the other case

styleUrls: ['./list-item.component.scss'],
template: `
<app-list-item-element
*ngFor="let child of children; let index = index; let first = first; let last = last"
Copy link
Contributor

Choose a reason for hiding this comment

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

add trackBy function to avoid looping through all DOM elements during change detection

@derschnee68 derschnee68 merged commit c5ac901 into main Jan 11, 2024
13 checks passed
@derschnee68 derschnee68 deleted the julien/list-item-form branch January 11, 2024 12:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants