nextcloud-libraries / nextcloud-libraries/nextcloud-vue
[NcActions] doesn't support non-direct NcAction* usage
@ShGKme is already working on this.
Since Jan 29, 2024.
- Dominant language
- Vue
- Stars
- 246
- Forks
- 99
- Avg merge
- 1d 20h
- Merged PRs (30d)
- 103
Description
This works:
<NcActions>
<NcAction* />
<NcAction* />
</NcActions>
This doesn't:
<NcActions>
<MyActionWrapper* /> -- Renders <NcAction* />
<MyActionWrapper* />
</NcActions>
The problem is that in NcActions we manually take actions from slot in render function.
And some parts check, what exactly action do we have.
For example, here (1)
https://github.com/nextcloud-libraries/nextcloud-vue/blob/0b1bf869a7ebed41ba1874d9009f32a66cc07dd4/src/components/NcActions/NcActions.vue#L1058-L1060
and here (2)
Because as an action name we take vnode's component instance's name:
https://github.com/nextcloud-libraries/nextcloud-vue/blob/0b1bf869a7ebed41ba1874d9009f32a66cc07dd4/src/components/NcActions/NcActions.vue#L1047-L1049
For MyActionWrapper it will be MyActionWrapper even if it renders <NcActionButton>.
While (1) only results in broken inline feature, (2) now breaks a whole <NcActions> when we use custom wrappers.
The complex part here is that in Vue when a parent is being rendered, it has no child yet. So we cannot just make recursive getActionName. So during NcActions rendering we have no idea what child MyActionWrapper way actually be.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.