mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2026-07-10 05:55:09 +00:00
More direct signals conversion
This commit is contained in:
@@ -22,14 +22,14 @@
|
||||
</div>
|
||||
</li>
|
||||
|
||||
@if (loading && workflows.length === 0) {
|
||||
@if (loading && workflows().length === 0) {
|
||||
<li class="list-group-item">
|
||||
<div class="spinner-border spinner-border-sm me-2" role="status"></div>
|
||||
<ng-container i18n>Loading...</ng-container>
|
||||
</li>
|
||||
}
|
||||
|
||||
@for (workflow of workflows; track workflow.id) {
|
||||
@for (workflow of workflows(); track workflow.id) {
|
||||
<li class="list-group-item">
|
||||
<div class="row fade" [class.show]="show">
|
||||
<div class="col d-flex align-items-center"><button class="btn btn-link p-0 text-start" type="button" (click)="editWorkflow(workflow)" [disabled]="!permissionsService.currentUserCan(PermissionAction.Change, PermissionType.Workflow)">{{workflow.name}}</button></div>
|
||||
@@ -76,7 +76,7 @@
|
||||
</div>
|
||||
</li>
|
||||
}
|
||||
@if (!loading && workflows.length === 0) {
|
||||
@if (!loading && workflows().length === 0) {
|
||||
<li class="list-group-item" [class.show]="show" i18n>No workflows defined.</li>
|
||||
}
|
||||
</ul>
|
||||
|
||||
@@ -39,15 +39,7 @@ export class WorkflowsComponent
|
||||
private modalService = inject(NgbModal)
|
||||
private toastService = inject(ToastService)
|
||||
|
||||
private workflowsSignal = signal<Workflow[]>([])
|
||||
|
||||
public get workflows(): Workflow[] {
|
||||
return this.workflowsSignal()
|
||||
}
|
||||
|
||||
public set workflows(workflows: Workflow[]) {
|
||||
this.workflowsSignal.set(workflows)
|
||||
}
|
||||
readonly workflows = signal<Workflow[]>([])
|
||||
|
||||
ngOnInit() {
|
||||
this.reload()
|
||||
@@ -59,7 +51,7 @@ export class WorkflowsComponent
|
||||
.listAll()
|
||||
.pipe(
|
||||
takeUntil(this.unsubscribeNotifier),
|
||||
tap((r) => (this.workflows = r.results))
|
||||
tap((r) => this.workflows.set(r.results))
|
||||
)
|
||||
.subscribe(() => {
|
||||
this.show = true
|
||||
|
||||
Reference in New Issue
Block a user