diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-05-01 00:09:47 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-05-01 00:09:47 +0300 |
commit | 3aeda4e6146bea1920c3283e98b01ca4fcf796a8 (patch) | |
tree | b44e6298a749bd8a02283bc5867ab4a3269b62c3 /app/serializers | |
parent | adafb996ef88da50b30c737cdb8caee8307ec6d6 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/serializers')
-rw-r--r-- | app/serializers/cluster_entity.rb | 9 | ||||
-rw-r--r-- | app/serializers/cluster_serializer.rb | 14 | ||||
-rw-r--r-- | app/serializers/remote_mirror_entity.rb | 2 |
3 files changed, 24 insertions, 1 deletions
diff --git a/app/serializers/cluster_entity.rb b/app/serializers/cluster_entity.rb index c59f68bbc49..a4d094adf7c 100644 --- a/app/serializers/cluster_entity.rb +++ b/app/serializers/cluster_entity.rb @@ -3,7 +3,16 @@ class ClusterEntity < Grape::Entity include RequestAwareEntity + expose :cluster_type + expose :enabled + expose :environment_scope + expose :name expose :status_name, as: :status expose :status_reason + + expose :path do |cluster| + Clusters::ClusterPresenter.new(cluster).show_path # rubocop: disable CodeReuse/Presenter + end + expose :applications, using: ClusterApplicationEntity end diff --git a/app/serializers/cluster_serializer.rb b/app/serializers/cluster_serializer.rb index 4bb4d4880d4..418308f3fa6 100644 --- a/app/serializers/cluster_serializer.rb +++ b/app/serializers/cluster_serializer.rb @@ -1,8 +1,22 @@ # frozen_string_literal: true class ClusterSerializer < BaseSerializer + include WithPagination entity ClusterEntity + def represent_list(resource) + represent(resource, { + only: [ + :cluster_type, + :enabled, + :environment_scope, + :name, + :path, + :status + ] + }) + end + def represent_status(resource) represent(resource, { only: [:status, :status_reason, :applications] }) end diff --git a/app/serializers/remote_mirror_entity.rb b/app/serializers/remote_mirror_entity.rb index 8835c6d4647..440e4274668 100644 --- a/app/serializers/remote_mirror_entity.rb +++ b/app/serializers/remote_mirror_entity.rb @@ -2,7 +2,7 @@ class RemoteMirrorEntity < Grape::Entity expose :id - expose :url + expose :safe_url, as: :url expose :enabled expose :auth_method |