Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: Display warning when menu editor is used in community license #3056

Merged
merged 4 commits into from
Jul 25, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletion lib/avo.rb
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,10 @@
def init
Avo::Current.error_manager = Avo::ErrorManager.build
# Check rails version issues only on NON Production environments
check_rails_version_issues unless Rails.env.production?
unless Rails.env.production?
check_rails_version_issues

Check failure on line 78 in lib/avo.rb

View workflow job for this annotation

GitHub Actions / lint / runner / standardrb

[rubocop] reported by reviewdog 🐶 [Corrected] Layout/TrailingWhitespace: Trailing whitespace detected. Raw Output: lib/avo.rb:78:35: C: [Corrected] Layout/TrailingWhitespace: Trailing whitespace detected. check_rails_version_issues ^
display_menu_editor_warning
end
Avo::Current.resource_manager = Avo::Resources::ResourceManager.build
Avo::Current.tool_manager = Avo::Tools::ToolManager.build

Expand All @@ -92,6 +95,7 @@
def main_menu
return unless Avo.plugin_manager.installed?("avo-menu")


Check failure on line 98 in lib/avo.rb

View workflow job for this annotation

GitHub Actions / lint / runner / standardrb

[rubocop] reported by reviewdog 🐶 [Corrected] Layout/EmptyLines: Extra blank line detected. Raw Output: lib/avo.rb:98:1: C: [Corrected] Layout/EmptyLines: Extra blank line detected.
Paul-Bob marked this conversation as resolved.
Show resolved Hide resolved
# Return empty menu if the app doesn't have the profile menu configured
return Avo::Menu::Builder.new.build unless has_main_menu?

Expand Down Expand Up @@ -160,6 +164,16 @@
})
end
end

def display_menu_editor_warning
if Avo.configuration.license == "community" && has_main_menu?
Avo.error_manager.add({
url: "https://docs.avohq.io/3.0/menu-editor.html",
target: "_blank",
message: "The menu editor is available only on the Pro license. Please upgrade to Pro to use this."
binarygit marked this conversation as resolved.
Show resolved Hide resolved
})
end
end
end
end

Expand Down
Loading