diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-05-25 18:07:58 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-05-25 18:07:58 +0300 |
commit | 0d8e625e4cd499162e6113dca4988b28f9faa9b6 (patch) | |
tree | 8744ab9fdba76e924f15272bba473521e39b8760 /app/serializers | |
parent | b5249f2d99206a72459bc5e2bf2aeb2f06ee36f3 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/serializers')
-rw-r--r-- | app/serializers/web_ide_terminal_entity.rb | 12 | ||||
-rw-r--r-- | app/serializers/web_ide_terminal_serializer.rb | 11 |
2 files changed, 23 insertions, 0 deletions
diff --git a/app/serializers/web_ide_terminal_entity.rb b/app/serializers/web_ide_terminal_entity.rb new file mode 100644 index 00000000000..e2e90e824e7 --- /dev/null +++ b/app/serializers/web_ide_terminal_entity.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +class WebIdeTerminalEntity < Grape::Entity + expose :id + expose :status + expose :show_path + expose :cancel_path + expose :retry_path + expose :terminal_path + expose :services + expose :proxy_websocket_path, if: ->(_) { Feature.enabled?(:build_service_proxy) } +end diff --git a/app/serializers/web_ide_terminal_serializer.rb b/app/serializers/web_ide_terminal_serializer.rb new file mode 100644 index 00000000000..5a9c4b99e0a --- /dev/null +++ b/app/serializers/web_ide_terminal_serializer.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +class WebIdeTerminalSerializer < BaseSerializer + entity WebIdeTerminalEntity + + def represent(resource, opts = {}) + resource = WebIdeTerminal.new(resource) if resource.is_a?(Ci::Build) + + super + end +end |