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

Display Plugin commit hashes in the About Modal #4423

Merged
merged 2 commits into from
Aug 17, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
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
21 changes: 21 additions & 0 deletions app/assets/stylesheets/about_modal_background.scss
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,24 @@
background-image: image-url($img-bg-login-whitelabel);
background-size: 100% 100%;
}

::-webkit-scrollbar {
width: 10px;
}

/* Track */
::-webkit-scrollbar-track {
box-shadow: inset 0 0 10px #f5f5f5;
border-radius: 10px;
}

/* Handle */
::-webkit-scrollbar-thumb {
background: #f5f5f5;
border-radius: 10px;
}

/* Handle on hover */
::-webkit-scrollbar-thumb:hover {
background: #b305500;
}
10 changes: 10 additions & 0 deletions app/helpers/application_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1361,6 +1361,16 @@ def vmdb_build_info(key)
end
end

def plugin_name(engine)
start_marker = "ManageIQ::"
end_marker = "::Engine"
engine.to_s[/#{Regexp.escape(start_marker)}(.*?)#{Regexp.escape(end_marker)}/m, 1]
end

def vmdb_plugins_sha
Vmdb::Plugins.versions
end

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Both methods shrunk into one:

def vmdb_plugins
  Vmdb::Plugin.versions.collect do |engine, sha|
    "#{engine.gsub(/ManageIQ::|::Engine/, '')} #{sha}"
  end
end

def user_role_name
User.current_user.miq_user_role_name
end
Expand Down
7 changes: 7 additions & 0 deletions app/views/layouts/_about_modal.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,13 @@
%strong
= session_info[0]
= session_info[1]
%strong
= _("Plugins")
%ul.list-unstyled{:style => "height: 40px;overflow: auto"}
- vmdb_plugins_sha.each do |engine, sha|
%div
= "#{plugin_name(engine)} #{sha}"

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

... and then in view:

- vmdb_plugins.each do |plugin|
  %div
    = plugin

.trademark-pf
= I18n.t("product.copyright")
.modal-footer
Expand Down