-
Notifications
You must be signed in to change notification settings - Fork 6
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
Conversation
# Conflicts: # apps/dsp-app/src/app/app-routing.module.ts # apps/dsp-app/src/app/app.module.ts
# Conflicts: # apps/dsp-app/src/app/app.module.ts
# Conflicts: # apps/dsp-app/src/app/project/list/list-item-form/list-item-form.component.ts # apps/dsp-app/src/app/project/list/list.component.ts
# Conflicts: # apps/dsp-app/src/app/project/list/list-item-form/list-item-form.component.ts
apps/dsp-app/src/app/project/list/action-bubble/action-bubble.component.ts
Outdated
Show resolved
Hide resolved
askToDeleteListNode() { | ||
this._dialog | ||
.afterConfirmation('Do you want to delete this node?', this.node.labels[0].value) | ||
.pipe(switchMap(() => this._listApiService.deleteListNode(this.node.id))) |
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.
unsubscribe by using .pipe(take(1))
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.
dialog automatically unsubscribes
...-app/src/app/project/list/list-item-form/edit-list-item/create-list-item-dialog.component.ts
Show resolved
Hide resolved
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.
larger part of the code in the create and edit components is duplicated. I would suggest to make one 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 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" |
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.
add trackBy function to avoid looping through all DOM elements during change detection
No description provided.