From 281b7c5fecc299b065eba46dfafa97d2e45b6385 Mon Sep 17 00:00:00 2001 From: Augusto Cravo Silva Date: Wed, 20 Nov 2019 17:29:37 +0100 Subject: [PATCH] Support api version in zat theme preview --- lib/zendesk_apps_tools/theme.rb | 1 + lib/zendesk_apps_tools/theming/common.rb | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/lib/zendesk_apps_tools/theme.rb b/lib/zendesk_apps_tools/theme.rb index 4100ab53..27389fbe 100644 --- a/lib/zendesk_apps_tools/theme.rb +++ b/lib/zendesk_apps_tools/theme.rb @@ -96,6 +96,7 @@ def generate_payload payload['templates']['js'] = '' payload['templates']['assets'] = assets payload['templates']['variables'] = settings_hash + payload['templates']['metadata'] = metadata_hash payload end diff --git a/lib/zendesk_apps_tools/theming/common.rb b/lib/zendesk_apps_tools/theming/common.rb index ed1d5538..dfeb8a1f 100644 --- a/lib/zendesk_apps_tools/theming/common.rb +++ b/lib/zendesk_apps_tools/theming/common.rb @@ -45,6 +45,10 @@ def settings_hash end end + def metadata_hash + { 'api_version' => manifest['api_version'] } + end + def value_for_setting(variable) return variable.fetch('value') unless variable.fetch('type') == 'file'