Skip to content

fix: 修复"导入意图包"弹窗导入成功后不自动关闭的问题 - #443

Open
openjiuwen-sync-bot[bot] wants to merge 1 commit into
openJiuwen-ai:studio-2.0-devfrom
openjiuwenai:sync/pr-1900
Open

fix: 修复"导入意图包"弹窗导入成功后不自动关闭的问题#443
openjiuwen-sync-bot[bot] wants to merge 1 commit into
openJiuwen-ai:studio-2.0-devfrom
openjiuwenai:sync/pr-1900

Conversation

@openjiuwen-sync-bot

@openjiuwen-sync-bot openjiuwen-sync-bot Bot commented Aug 14, 2026

Copy link
Copy Markdown

Paired: GitHub #443GitCode !1900

fix(intent-package): 修复"导入意图包"弹窗导入成功后不自动关闭的问题

Linked Closing Issues:

- ImportPackageModalComponent.dismiss() 使用 modalRef.destroy() 替代 close()
- 对 NzModalRef / NZ_MODAL_DATA 加 @optional(),兼容作为模板子组件使用的场景
- nzFooter: null 的动态模态框必须用 destroy() 才能销毁(close() 仅触发 nzOnOk 结果回传,无 footer 按钮时不会真正关闭)
@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

1 similar comment
@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@openjiuwen-collaboration-bot

openjiuwen-collaboration-bot Bot commented Aug 14, 2026

Copy link
Copy Markdown

head_sha: 5268a3fe1a3315f8f6556dada93c3b8eb38677a1

变更摘要

本 PR 主要修复「导入意图包」弹窗取消按钮不生效、以及导入成功后弹窗不自动关闭的问题。改动集中在 import-package-modal.component.ts:将 NzModalRefNZ_MODAL_DATA 的依赖注入标记为 @Optional(),并在 dismiss() 中由直接调用 modalRef.close() 改为在 modalRef 存在时调用 modalRef.destroy(),从而避免因依赖未注入导致的异常,并确保弹窗能够被正确关闭。

主要改动

  • 依赖注入增加 @Optional() 标记:为构造函数中的 private modalRef: NzModalRef@Inject(NZ_MODAL_DATA) public nzData: any 添加 @Optional(),使这两个依赖在未提供时不会被强制注入,避免组件因缺少依赖而创建失败。
  • dismiss() 关闭方式调整:将 this.modalRef.close() 改为先判断 if (this.modalRef),再调用 this.modalRef.destroy(),防止在 modalRefnull 时调用方法报错,同时改用 destroy() 销毁弹窗。
  • 导入语句补充 Optional:在 @angular/core 的导入中新增 Optional,以支持上述依赖注入装饰器的使用。

@openjiuwen-collaboration-bot

openjiuwen-collaboration-bot Bot commented Aug 14, 2026

Copy link
Copy Markdown

head_sha: 5268a3fe1a3315f8f6556dada93c3b8eb38677a1

代码审查

✅ 未发现问题

@openjiuwen-sync-bot openjiuwen-sync-bot Bot changed the title fix: 修复"导入意图"弹窗取消按钮不生效的问题 fix: 修复"导入意图包"弹窗导入成功后不自动关闭的问题 Aug 14, 2026
@openjiuwen-collaboration-bot

Copy link
Copy Markdown

head_sha: 5268a3fe1a3315f8f6556dada93c3b8eb38677a1

TASK STATUS DETAILS
CodeCheck ✅SUCCESS Click here
AntiPoison ✅SUCCESS Click here
Software Composition Analysis ✅SUCCESS Click here
Npm Build ✅SUCCESS See CHECK tab
Ruff Check ✅SUCCESS See CHECK tab
UT测试 ✅SUCCESS 点此跳转

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants