summaryrefslogtreecommitdiff
path: root/app/presenters/project_clusterable_presenter.rb
blob: bd149cdcc705a439a17b9acd1c60b3a7beaedc0a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# frozen_string_literal: true

class ProjectClusterablePresenter < ClusterablePresenter
  def index_path
    project_clusters_path(clusterable)
  end

  def new_path
    new_project_cluster_path(clusterable)
  end

  def create_user_clusters_path
    create_user_project_clusters_path(clusterable)
  end

  def create_gcp_clusters_path
    create_gcp_project_clusters_path(clusterable)
  end

  def cluster_status_cluster_path(cluster, params = {})
    cluster_status_project_cluster_path(clusterable, cluster, params)
  end

  def install_applications_cluster_path(cluster, application)
    install_applications_project_cluster_path(clusterable, cluster, application)
  end

  def cluster_path(cluster, params = {})
    project_cluster_path(clusterable, cluster, params)
  end

  def clusterable_params
    { project_id: clusterable.to_param, namespace_id: clusterable.namespace.to_param }
  end
end