Skip to content

Remove obscure propsData usage in provide

Lorenz van Herwaarden requested to merge update-vue-apollo into master

What does this MR do and why?

Due to a bug in vue-apollo, we couldn't use props directly this.<propname> in the provide function of a vue component. Instead we had to take the prop from this.$options.propsData.<propname>. The fix (which @pslaughter provided) in vue-apollo was merged a couple days ago and a new release was made containing this fix; vue-apollo: 3.1.1.

This MR updates vue-apollo and removes the comments and obscure way of accessing the props in the components where I found this behavior.

As part of other fixes in vue-apollo between v3.0.7 and v3.1.1, I've had to update some specs.

How to set up and validate locally

Numbered steps to set up and validate the change are strongly suggested.

Go to following pages and notice there are no console errors regarding the props in provide (you could add a breakpoint in the provide function to inspect the props):

  1. For app/assets/javascripts/super_sidebar/components/sidebar_menu.vue: http://gdk.test:3000/
  2. For app/assets/javascripts/members/components/app.vue: http://gdk.test:3000/root/gitlab/-/project_members
  3. For app/assets/javascripts/content_editor/components/content_editor_provider.vue: Go to any issue and use rich-text-editing
  4. For ee/app/assets/javascripts/security_dashboard/components/pipeline/pipeline_security_dashboard.vue:
    1. You need an EE license
    2. You need to have runners enabled (See $2408961 for setting up a runner)
    3. Import https://gitlab.com/gitlab-examples/security/security-reports
    4. Run a pipeline on master
    5. Go to the pipeline > security tab
  5. For app/assets/javascripts/vue_shared/components/vuex_module_provider.vue: switch to the old navigation (click avatar icon > untoggle New navigation)

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Lorenz van Herwaarden

Merge request reports