Selaa lähdekoodia

fix(teaching): open feedback editor from report links

彭峰 17 tuntia sitten
vanhempi
commit
9224f7ada0

+ 6 - 0
projects/xiaoshu-mobile/src/app/core/lesson-workflow.integration.spec.ts

@@ -240,4 +240,10 @@ describe('appointment workflow screens',()=>{
   expect(component.feedbackError()).toContain('已被更新');expect(component.submitting()).toBeFalse();expect(component.feedbackSaved()).toBeFalse();
  });
 
+ it('opens the editor when entering details from a report edit link',async()=>{
+  order={...order,dszt:30,allowedActions:['editFeedback'],feedback:{contentSummary:'原内容',trainingSummary:'进度',noHomework:true,revision:'2026-10-13T00:00:00Z'}};
+  const {component}=await screen('/pages/shop/get_order?id=901&editReport=1');
+  expect(component.completionDialog()?.nativeElement.open).toBeTrue();expect(component.contentSummary).toBe('原内容');
+ });
+
 });

+ 1 - 1
projects/xiaoshu-mobile/src/app/features/appointment/appointment-page.component.ts

@@ -84,7 +84,7 @@ export class AppointmentPageComponent implements OnInit, OnDestroy {
       const dialog = this.completionDialog()?.nativeElement;
       if (dialog && !this.autoEditOpened && this.can('editFeedback') && this.feedback() && this.route.snapshot.queryParamMap.get('editReport') === '1') { this.autoEditOpened = true; this.openFeedbackEditor(); }
       if (dialog && !this.isStudentView && !this.order()['cancelled'] && this.can('complete') && this.route.snapshot.queryParamMap.get('feedback') === '1') dialog.showModal();
-    });
+    }, { allowSignalWrites: true });
   }
 
   ngOnInit(): void {