feat(referencePicker): introduce getReferenceWithPicker()#8532
Conversation
|
/backport to stable8 |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #8532 +/- ##
==========================================
- Coverage 54.57% 54.31% -0.26%
==========================================
Files 106 106
Lines 3443 3461 +18
Branches 1004 1009 +5
==========================================
+ Hits 1879 1880 +1
- Misses 1323 1336 +13
- Partials 241 245 +4 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
/backport to stable8 |
53cfef4 to
367d86b
Compare
638da91 to
7113c3d
Compare
ShGKme
left a comment
There was a problem hiding this comment.
If I understand the change correctly, the following components have changed public API:
NcReferencePickerNcSearch
| const modalId = 'referencePickerModal' | ||
| const modalElement = document.createElement('div') | ||
| modalElement.id = modalId | ||
| document.body.append(modalElement) |
There was a problem hiding this comment.
We have spawnDialog util to mount dialogs
| * @param providerId - Optional ID of initial selected provider | ||
| * @param isInsideViewer - Should be true if this function is called while the Viewer is displayed | ||
| */ | ||
| export async function getReferenceWithPicker(providerId?: string, isInsideViewer?: boolean): Promise<PickerSubmitResult> { |
There was a problem hiding this comment.
Having isInsideViewer as a position parameter seems unexpected to me. Picker shouldn't know, it is it in Viewer. If it's really needed, I'd make it an option rather than a second position parameter.
There was a problem hiding this comment.
As written in 1:1 chat, I kept it that way to keep getLinkWithPicker() and getReferenceWithPicker() as similar as possible to make it a no-brainer to migrate from one to the other.
481340b to
a4a1f78
Compare
Required for Text and Collectives to pass the link title from the picker (e.g. Collectives PagePicker.vue) to the consumer (menubar in Text). Signed-off-by: Jonas <jonas@freesources.org>
- In NcCustomPickerElement we cannot control the submitted type, so let's add the type check there as well. - NcSearch is exported publically and used by apps, so changing its return type would introduce a backwards-incompatibility. - NcProviderList, NcRawLinkInput and NcCustomPickerElement are not publically exposed, so we can change the emitted type there. Signed-off-by: Jonas <jonas@freesources.org>
a4a1f78 to
9e64b40
Compare
Requires nextcloud-libraries/nextcloud-vue#8532 to have an effect. Signed-off-by: Jonas <jonas@freesources.org>
|
nextcloud/text#8615 and nextcloud/collectives#2522 are the respective PRs in Text and Collectives to use this new feature. |
Required for Text and Collectives to pass the link title from the picker (e.g. Collectives PagePicker.vue) to the consumer (menubar in Text).
🏁 Checklist
stable8for maintained Vue 2 version or not applicable