1. 01 Nov, 2018 7 commits
    • Thong Kuah's avatar
      Resolve controller sharing concern · dd8a715b
      Thong Kuah authored
      Use ClustersController as base while having Projects::ClustersController
      to inform what `clusterable` is. Thanks @ayufan for the great suggestion
      !
      
      - View changes to work with new approach
      
      - Fix javascript for new approach
      
      - Fix feature specs for new approach
      
      - Fix QA
      dd8a715b
    • Thong Kuah's avatar
      Restore 403 functionality for external auth · f3b81d7f
      Thong Kuah authored
      When we unhooked ClustersController from
      Project::ApplicationsController, we missed an EE override to
      handle_not_found_or_authorized.
      
      Rather than carry on with override RoutingActions, make a specific proc
      for Project that we override in EE instead. Use that proc in both
      Clusters::BaseController and Project::ApplicationsController.
      f3b81d7f
    • Thong Kuah's avatar
      EE: Move EE specific code into ee/ dir · 94c0ca31
      Thong Kuah authored
      Restore app/helpers/clusters_helper.rb to CE, move override to EE
      module.
      94c0ca31
    • Thong Kuah's avatar
      Move view and path concerns to presenters · c4d8fc61
      Thong Kuah authored
      - Move show path for cluster to ClusterPresenter
      
      - Create ClusterablePresenter to encapsulate logic. Consolidates
      scattered methods from BaseController and ClustersHelper into an object.
      c4d8fc61
    • Thong Kuah's avatar
      EE: Fix EE specific code affected by refactor · 0dd58980
      Thong Kuah authored
      - EE: Restore metrics json endpoint for cluster
      
      Use new controller so that we have one less EE prepend.
      
      - EE: Fix assets and views for ClustersController
      
      We moved from Projects::ClustersController to ClustersController.
      So, some of the EE only views and assets needs to be updated.
      
      Also update some EE only controller specs to ClustersController
      
      - EE: Update override of can_create_cluster?
      
      The method signature changed in CE to accomodate group as a
      `clusterable`. Correspondingly, update the method to use `clusterable`.
      
      This presumes multiple group level clusters is available at the same
      license as projet level clusters which is GitLab Premium.
      
      Also fix related specs
      0dd58980
    • Thong Kuah's avatar
      Abstract out project out of ClustersController · 40060eca
      Thong Kuah authored
      To the extent possible swap out `project` with `clusterable`
      
      - Abstract paths for showing cluster or clusters. This will allow us to
      swap in alternative paths for group level cluster
      
      - Push :project_id and :namespace_id params from the URL to the POST
      body.
      
      - Create a nice helper for to generate links for the destroy
      action
      
      For some reason, spec :project_id and :namespace_id param are not going
      through `to_param` for a JSON format. Manually call `to_param` to fix
      specs.
      
      - Move :layout to BaseController
      40060eca
    • Thong Kuah's avatar
      Convert clusters to use a top-level controller · 9b1bbda1
      Thong Kuah authored
      In preparation so that we can create both cluster attached to project
      and cluster attached to group.
      
      - Move ClustersController to top level
      
      - Move Clusters::ApplicationsController to top-level too
      
      - Creates a Clusters::BaseController to share common functions
      
      - Do not rely on @project ivar. Anything could set the ivar.
      
      - Fix Vue page components due to new data-page value
      
      Because of the controller change we have gone from
      `projects:clusters:new` to `clusters:new`, so we need to update the file
      location of the page components. There is somewhere a function that will
      convert data-page to a file location.
      
      On that note, projects/clusters/gcp/new/, translate to
      Projects::Clusters::Gcp#new doesn't exist so replace that with
      clusters/create_gcp/ and clusters/create_user/
      9b1bbda1
  2. 31 Oct, 2018 4 commits
  3. 30 Oct, 2018 29 commits