Skip to content

Conversation

enis-pixel
Copy link
Member

Summary

This PR replaces the old +button with a split button that exposes two actions:

  • Create (default): Behaves as Add + Create under the hood. It adds the current operation (if valid) and immediately creates all queued operations. If the form is invalid but there are already queued operations, it still creates those.
  • Add: Only stages the current operation to the list (no create).

The right-hand arrow only selects which action the left button executes. Selection doesn't execute. This streamlines the common case (one order + one operation) while keeping the rare multi-operation flow via Add.

Screenshots

image image image image

@enis-pixel enis-pixel self-assigned this Oct 2, 2025
@1nf0rmagician 1nf0rmagician added the enhancement New feature or request label Oct 2, 2025
@1nf0rmagician 1nf0rmagician added this to the Framework 10.0.0 milestone Oct 2, 2025
Copy link
Member

@1nf0rmagician 1nf0rmagician left a comment

Choose a reason for hiding this comment

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

Looks great, just some small remarks to clean up 😊 Feel free to rebase and squash your changes afterwards, then we will merge them 👍

matInput
[formControl]="operationNumberFormControl"
[(ngModel)]="operationNumber"
[disabled]="isLoading()"
Copy link
Member

Choose a reason for hiding this comment

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

Is this not needed anymore? if yes, why?

<mat-menu #actionMenu="matMenu">
<button
mat-menu-item
(click)="onSelectAction('ADD_CREATE')"
Copy link
Member

Choose a reason for hiding this comment

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

I think this would make a nice little enum, don't you think? 🤔

if (!failed) this.dialog.close();
}

primaryActionLabel = computed(() => {
Copy link
Member

Choose a reason for hiding this comment

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

fields belong at the beginning of the class to the others 😊

}

this.operationNumberFormControl.reset('');
this.operationNumberFormControl.markAsPristine();
Copy link
Member

Choose a reason for hiding this comment

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

this and the following line should be redundant, see https://angular.dev/api/forms/FormControl -> reset

Also check line 208, that shouldn't be necessary anymore either

if (this.operations().length > 0) await this.create();
return;
}
if (this.canAddOperation()) this.addOperation();
Copy link
Member

Choose a reason for hiding this comment

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

either make this if-else and remove the return or use the early return and remove the second if, this is half of both options 😅

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants