summaryrefslogtreecommitdiff
path: root/app/presenters/gitlab/whats_new/item_presenter.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/presenters/gitlab/whats_new/item_presenter.rb')
-rw-r--r--app/presenters/gitlab/whats_new/item_presenter.rb22
1 files changed, 22 insertions, 0 deletions
diff --git a/app/presenters/gitlab/whats_new/item_presenter.rb b/app/presenters/gitlab/whats_new/item_presenter.rb
new file mode 100644
index 00000000000..9f66e19ade0
--- /dev/null
+++ b/app/presenters/gitlab/whats_new/item_presenter.rb
@@ -0,0 +1,22 @@
+# frozen_string_literal: true
+
+module Gitlab
+ module WhatsNew
+ class ItemPresenter
+ DICTIONARY = {
+ core: 'Free',
+ starter: 'Bronze',
+ premium: 'Silver',
+ ultimate: 'Gold'
+ }.freeze
+
+ def self.present(item)
+ if Gitlab.com?
+ item['packages'] = item['packages'].map { |p| DICTIONARY[p.downcase.to_sym] }
+ end
+
+ item
+ end
+ end
+ end
+end