From 46eb6fb4582bd2cc7614c1cc05f5629b438984a0 Mon Sep 17 00:00:00 2001 From: Alexander Meindl Date: Sun, 17 Nov 2024 11:09:11 +0100 Subject: [PATCH] drop non working macro --- CHANGELOG.md | 1 + README.md | 1 - app/views/wiki/_tradingview.html.slim | 6 -- assets/images/icons.svg | 26 +++++--- .../wiki_macros/tradingview_macro.rb | 62 ------------------- test/functional/wiki_controller_test.rb | 12 ---- 6 files changed, 20 insertions(+), 88 deletions(-) delete mode 100644 app/views/wiki/_tradingview.html.slim delete mode 100644 lib/additionals/wiki_macros/tradingview_macro.rb diff --git a/CHANGELOG.md b/CHANGELOG.md index f7718f50..de0ef6ea 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ - Redmine 5 support dropped - Gemify support dropped - switch icons from fontawesome to tabler +- broken tradingview macro removed ## 3.4.0 diff --git a/README.md b/README.md index 652f5da2..22d2701f 100644 --- a/README.md +++ b/README.md @@ -86,7 +86,6 @@ Uninstall `additionals` plugin. * reddit * redmine.org issue and wiki page (redmine_issue and reminde_wiki) * slideshare - * tradingview * twitter * user * vimeo diff --git a/app/views/wiki/_tradingview.html.slim b/app/views/wiki/_tradingview.html.slim deleted file mode 100644 index 3eadf081..00000000 --- a/app/views/wiki/_tradingview.html.slim +++ /dev/null @@ -1,6 +0,0 @@ -/! TradingView Widget BEGIN -= javascript_include_tag 'https://s3.tradingview.com/tv.js' -div[style="display: inline-block;"] -javascript: - new TradingView.widget(#{raw options.to_json}); -/! TradingView Widget END diff --git a/assets/images/icons.svg b/assets/images/icons.svg index 85cd405f..08ffed04 100644 --- a/assets/images/icons.svg +++ b/assets/images/icons.svg @@ -216,13 +216,20 @@ - + - - - - - + + + + + + + + + + + + @@ -927,11 +934,16 @@ - + + + + + + diff --git a/lib/additionals/wiki_macros/tradingview_macro.rb b/lib/additionals/wiki_macros/tradingview_macro.rb deleted file mode 100644 index 0ea707f7..00000000 --- a/lib/additionals/wiki_macros/tradingview_macro.rb +++ /dev/null @@ -1,62 +0,0 @@ -# frozen_string_literal: true - -# see https://www.tradingview.com/widget/ -module Additionals - module WikiMacros - module TradingviewMacro - Redmine::WikiFormatting::Macros.register do - desc <<-DESCRIPTION - Creates Tradingview chart - - Syntax: - - {{tradingview(options)}} - - Parameters: - - :param int width: default 640 - :param int height: default 480 - :param string symbol: default NASDAQ:AAPL - :param string interval: default W - :param string timezone: default Europe/Berlin - :param string theme: default White - :param int style: default 2 - :param string locale: default de - :param string toolbar_bg: default #f1f3f6 - :param bool enable_publishing: default false - :param bool allow_symbol_change: default true - :param bool hideideasbutton: default true - - Examples: - - {{tradingview(symbol=NASDAQ:AMZN, locale=en)}} - Show chart with symbol `NASDAQ:AMZN` and use English locale - DESCRIPTION - - macro :tradingview do |_obj, args| - raise 'The correct usage is {{tradingview(options)}}' if args.empty? - - _args, options = extract_macro_options(args, :width, :height, :symbol, :interval, :timezone, - :theme, :style, :locale, :toolbar_bg, :enable_publishing, - :allow_symbol_change, :hideideasbutton) - - options[:width] = 640 if options[:width].blank? - options[:height] = 480 if options[:height].blank? - options[:symbol] = 'NASDAQ:AAPL' if options[:symbol].blank? - options[:interval] = 'W' if options[:interval].blank? - options[:timezone] = 'Europe/Berlin' if options[:timezone].blank? - options[:theme] = 'White' if options[:theme].blank? - options[:style] = 2 if options[:style].blank? - options[:locale] = 'de' if options[:locale].blank? - options[:toolbar_bg] = '#f1f3f6' if options[:toolbar_bg].blank? - options[:enable_publishing] = false if options[:enable_publishing].blank? - options[:allow_symbol_change] = true if options[:allow_symbol_change].blank? - options[:hideideasbutton] = true if options[:hideideasbutton].blank? - - render partial: 'wiki/tradingview', - formats: [:html], - locals: { options: } - end - end - end - end -end diff --git a/test/functional/wiki_controller_test.rb b/test/functional/wiki_controller_test.rb index cc9cf7fc..b4a872a5 100644 --- a/test/functional/wiki_controller_test.rb +++ b/test/functional/wiki_controller_test.rb @@ -326,18 +326,6 @@ def test_show_with_gist_macro assert_select 'script[src=?]', 'https://gist.github.com/plentz/6737338.js' end - def test_show_with_tradeview_macro - @request.session[:user_id] = WIKI_MACRO_USER_ID - page = WikiPage.generate! content: '{{tradingview(symbol=NASDAQ:AMZN, locale=en)}}', - title: __method__.to_s - - get :show, - params: { project_id: 1, id: page.title } - - assert_response :success - assert_select 'script[src=?]', 'https://s3.tradingview.com/tv.js' - end - def test_show_with_cryptocompare_macro @request.session[:user_id] = WIKI_MACRO_USER_ID page = WikiPage.generate! content: '{{cryptocompare(fsyms=BTC;ETH, type=header_v3)}}',