Skip to content

Add basic state management to Jira Connect Vue app

Tom Quirk requested to merge init-jira-connect-state into master

What does this MR do?

Towards #13019 (closed).

We need some kind of "global" state management for the Jira Connect App. The initial use case is to display form error messages in the Vue app.

This MR doesn't display any error message yet - this will come in the final MR (!48651 (merged))

Iteration MR
Move jira_connect JS to Vue App !48744 (merged)
Add basic shared state to Jira Connect Vue app 👉 You are here
Render gitlab-ui alert on error !48651 (merged)

Why do we need global state management?

The Jira Connect App is not entirely (or, at all) Vue, but we intend to iterate towards Vue over time.

The form submission code is currently handled by jQuery event listeners.

In the spirit of MVC and to avoid having to refactoring the entire project, this approach allows us to retain the current jQuery code, while progressively iterate towards Vue. We're manipulating the store in response to jQuery-handled events, and (eventually) reading from the store in our Vue app to display an error message.

Why not Vuex?

We may eventually need Vuex, but for now, this ultra-light, ultra-simple approach feels more appropriate. This approach is recommended in the Vue docs

Jira Connect App smoke test

  • Sign in to GitLab button redirects to GitLab signing page
  • After signing in, redirects to You are signed in as @ handle page
  • Add a namespace
  • Remove a namespace

Screenshots (strongly suggested)

No visual changes in this MR!

Does this MR meet the acceptance criteria?

Conformity

Availability and Testing

Security

If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:

  • Label as security and @ mention @gitlab-com/gl-security/appsec
  • The MR includes necessary changes to maintain consistency between UI, API, email, or other methods
  • Security reports checked/validated by a reviewer from the AppSec team
Edited by Tom Quirk

Merge request reports

Loading