Skip to content

Restructure `releases/**` JavaScript in preparation for new `show` page

Nathan Friend requested to merge nfriend-reorganize-releases-js into master

What does this MR do?

Rearranges the JavaScript code in app/assets/javascripts/releases/** in preparation for the dedicated Release page (the show page) being implemented as part of #32827 (closed).

For context: the "index" page (the Releases page that lists all Releases in a project) and the "edit" page (the page that allows a single Release to be edited) already exist.

Here are the specific changes in this MR:

  • Combine the "list" and "detail" stores into a single store with two modules (named "list" and "detail"):
    • app/assets/javascripts/releases/stores/modules/list/** and
    • app/assets/javascripts/releases/stores/modules/detail/**
  • Move all components into a single app/assets/javascripts/releases/components directory
  • Rename and move the Vue mount scripts to app/assets/javascripts/releases/mount_index.js and app/assets/javascripts/releases/mount_edit.js
    • Some small refactors to make these files smaller/simpler
  • Update all related tests

Where will the new page go?

The new "show" page will reuse the existing "detail" module, since this module already contains the logic for fetching a single release from the API.

Implementing this new page will require (at minimum) three new files:

  • A Rails entrypoint: app/assets/javascripts/pages/projects/releases/show/index.js
  • A Vue mount script: app/assets/javascripts/releases/mount_show.js
  • A "show" Vue app: app/assets/javascripts/releases/components/app_show.vue

This new page will be implemented in !24006 (merged)

Edited by Nathan Friend

Merge request reports