Skip to content

fix: selecting an OpenProject work package does not insert the reference - #1200

Open
saw-jan wants to merge 4 commits into
masterfrom
fix/smart-picker-wp-selection
Open

saw-jan wants to merge 4 commits into
masterfrom
fix/smart-picker-wp-selection

Conversation

@saw-jan

@saw-jan saw-jan commented Oct 26, 2026 •

Copy link
Copy Markdown
Collaborator

Description

Current this.$emit('submit', link) in SearchInput component no longer triggers a native DOM event in Vue3 as it is treated as the component event, but the vue3 version of @nextcloud/vue expects the native events, See https://github.com/nextcloud-libraries/nextcloud-vue/blob/390653107207ae3cfa100d29330861a5fc3a3d60/src/components/NcRichText/NcReferencePicker/NcCustomPickerElement.vue#L69-L70

				this.renderResult.element.addEventListener('submit', (e) => {
					this.onSubmit(e.detail)
				})

Due to this very reason, the submit event was not caught and the wp link didn't get copied to the textbox. To fix this, we emit a native event.

Related Issue or Workpackage

Screenshots (if appropriate):

After fix:
Screenshot from 2026-10-26 18-23-04
Screenshot from 2026-10-26 18-23-19
Screenshot from 2026-10-26 18-23-43

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Tests only (no source changes)

Checklist:

  • Code changes
  • Unit tests added
  • Acceptance tests added
  • Updated CHANGELOG.md file

@saw-jan saw-jan self-assigned this Oct 26, 2026
@saw-jan
saw-jan force-pushed the fix/smart-picker-wp-selection branch from d95c737 to 9ae65e7 Compare October 27, 2026 04:22
Signed-off-by: Saw-jan <saw.jan.grg3e@gmail.com>
Vue3 removed the $on instance method, and $emit triggers component events rather than native DOM events.
Therefore, dispatch a native DOM event to notify external listeners.

Signed-off-by: Saw-jan <saw.jan.grg3e@gmail.com>
Comment thread src/reference.js Outdated
Comment thread src/reference.js Outdated
Signed-off-by: Saw-jan <saw.jan.grg3e@gmail.com>
@saw-jan
saw-jan force-pushed the fix/smart-picker-wp-selection branch from 7140fc4 to 4917695 Compare October 27, 2026 11:57
Vue3 removed the $on instance method, and $emit triggers component events rather than native DOM events.
Therefore, dispatch a native DOM event to notify external listeners.

Signed-off-by: Saw-jan <saw.jan.grg3e@gmail.com>
@saw-jan
saw-jan force-pushed the fix/smart-picker-wp-selection branch from 4917695 to 645d715 Compare October 27, 2026 11:59
@github-actions

Copy link
Copy Markdown

JS Code Coverage

Coverage after merging fix/smart-picker-wp-selection into master will be
83.08%
Coverage Report
FileStmtsBranchesFuncsLinesUncovered Lines
src
   adminSettings.js0%100%100%0%12–14
   dashboard.js0%100%0%0%10–12, 15–16
   personalSettings.js0%100%100%0%12–14
   projectTab.js0%0%0%0%16–17, 20, 24, 30, 34, 34, 34, 36, 38
   reference.js0%100%0%0%14, 16, 18, 22, 24–25, 27, 32–34, 36–37, 42–44, 46–48, 50, 52
   setup.js0%100%0%0%10–13, 9
src/components
   AdminSettings.vue87.22%81.58%93.55%87.50%206, 227, 227, 227–228, 24, 247–248, 272–273, 273, 273–274, 276, 78
   ErrorLabel.vue50%100%100%50%6
   OAuthConnectButton.vue80.77%68.75%100%81.48%63–64, 66–67, 69, 72, 72, 72–73, 75
   PersonalSettings.vue79.81%80.43%85%76.32%132–133, 143–145, 145, 145, 145, 145–146, 151–152, 152, 152, 154, 154, 157, 18
src/components/admin
   FieldValue.vue100%100%100%100%
   FormAuthMethod.vue87.97%86.11%87.10%89.39%221, 224, 248, 248, 248–250, 32, 40, 82, 82, 82
   FormHeading.vue75%70%100%100%12, 15, 9
   FormOAuthSettings.vue87.76%91.04%81.82%88.24%101, 137, 217, 248, 351, 351, 351–352, 375, 375, 375–376, 61, 61, 61, 85
   FormOpenProjectHost.vue95.52%90.91%95.45%97.47%156, 159, 53, 53, 53
   FormProjectFolder.vue89.64%87.50%90%91.14%100, 100, 100–101, 101, 119, 139, 269, 322, 341, 341–342, 376, 376–377, 389–390, 408, 410, 431–433, 460, 462, 490, 490, 490–491, 69
   FormSSOSettings.vue93.44%94.29%90.48%93.75%123, 139, 139, 139, 232–233, 238, 244, 294, 359–360, 384, 74
   TermsOfServiceUnsigned.vue100%100%100%100%
   TextInput.vue79.49%100%60%75.76%147, 152, 23–27, 47
src/components/icons
   ClippyIcon.vue66.67%100%0%66.67%11
   OpenProjectIcon.vue66.67%100%0%66.67%11
src/components/settings
   CheckBox.vue81.82%100%60%71.43%15–16
   ErrorNote.vue100%100%100%100%
   SettingsTitle.vue91.30%75%100%93.33%48, 51
src/components/tab
   EmptyContent.vue92%88.37%100%96.15%10, 106–107, 12, 12, 16
   SearchInput.vue88.41%85.90%91.18%89.26%172, 179, 18, 180, 180, 180–181, 198, 209–210, 210, 210–211, 213, 251, 283, 286, 289, 300–302, 306, 309–310
   WorkPackage.vue84.12%73.58%83.33%89.90%118–120, 151–154, 165–166, 228–229, 233, 233, 233, 233–236, 7, 7, 7, 7, 90–91
src/filesPlugin
   filesPlugin.js0%0%0%0%100, 104–106, 108, 111, 113, 115–117, 119–120, 122, 126–127, 15, 15, 15, 19, 27–29, 32, 34–36, 40, 42, 46, 48, 52, 52, 52, 52, 54, 56, 59–61, 63, 63, 63–65, 68–69, 71–72, 76, 80, 82, 86, 86, 86, 86, 88, 90, 93–95
src/utils
   workpackageHelper.js92.56%94.87%88.89%91.78%102–104, 106, 27, 57, 57–58
src/views
   CreateWorkPackageModal.vue87.10%81.48%86.36%89.83%110, 137, 153, 371–372, 374–375, 379, 395, 512, 512, 512–513, 515, 520–521, 523–524, 53, 530–531, 533–534, 541, 541, 541–542, 544, 547, 557, 588, 597, 604–605, 605, 605–606, 619, 641, 644, 653, 684, 692, 700, 705, 707, 707, 707–708, 719–721, 79, 92, 95
   Dashboard.vue83.59%80.60%80%86.73%118, 118, 118–119, 121, 132, 142, 145, 15, 15, 15, 15, 15, 157, 16, 16, 16, 168, 17, 213–214, 218–220, 228–229
   LinkMultipleFilesModal.vue98.36%97.30%100%98.48%156–157
   ProjectsTab.vue86.11%83.93%83.33%88.30%103–105, 118, 142, 153–154, 189, 189, 189–192, 194, 197, 224, 248–249, 259, 269
   WorkPackagePickerElement.vue0%0%0%0%100–101, 101, 101, 101, 101–102, 104, 14, 14, 14, 17–18, 18, 39, 48, 57, 6, 60, 63, 63, 63, 63, 63–64, 66, 66, 66, 66, 66–67, 69, 7, 73, 77, 80, 80, 80–82, 84–86, 88–89, 89, 89–92, 95, 98–99, 99, 99, 99, 99, 99
   WorkPackageReferenceWidget.vue0%0%0%0%18, 33, 58, 66, 7, 71,

Comment thread CHANGELOG.md
### Fixed

- Keep the admin settings when Nextcloud replays the migrations to check the database schema (`occ db:schema:check`, every `occ upgrade` on Nextcloud 35)
- Selecting an OpenProject work package does not insert the reference [#1200](https://github.com/nextcloud/integration_openproject/pull/1200)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- Selecting an OpenProject work package does not insert the reference [#1200](https://github.com/nextcloud/integration_openproject/pull/1200)
- Selecting an OpenProject work package does not insert the reference in smart picker [#1200](https://github.com/nextcloud/integration_openproject/pull/1200)

This branch has not been deployed

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants