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

View components: admin menus #1096

Merged
merged 25 commits into from
May 7, 2021
Merged
Changes from 1 commit
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
656a12b
Add View Components lib to this branch too
denny May 2, 2021
976c682
Various minor config tweaks
denny May 2, 2021
2a8c984
Load view components in core plugin
denny May 2, 2021
d47ee48
Unrelated fix for colour glitch
denny May 2, 2021
0bca248
Add/update helpers
denny May 2, 2021
15b5c70
Fix anonymous name method
denny May 2, 2021
5e78b90
Start swapping out admin menu partials with view component(s)
denny May 2, 2021
36bfdfb
Fix related tests, re-enable CI
denny May 2, 2021
8230a3b
Not using these yet; removing them until needed
denny May 2, 2021
821c8ee
Add a few comments into spec config
denny May 2, 2021
3e97488
Replace admin menu item partial (and helper methods) with view component
denny May 4, 2021
b4f6024
Merge branch 'main' into dev/view-components/admin-menus
denny May 4, 2021
127abe5
Replace menu section partials+helpers with component
denny May 5, 2021
875734c
Break long line in menu partials, for readability
denny May 5, 2021
6764308
Pull core menu section list into constant
denny May 5, 2021
a0b104c
Add TODO note/method re. extending admin menus
denny May 5, 2021
db2b0e7
One tools admin to rule them all, and in etc etc
denny May 5, 2021
d819268
Remove stray space
denny May 5, 2021
c11f0e8
Coverband is not loaded in test env
denny May 5, 2021
801f915
Merge branch 'main' into dev/view-components/admin-menus
denny May 5, 2021
5c21d6c
Add component for each admin menu section
denny May 6, 2021
2d563bd
Remove admin menu partials from core plugin, simplifying admin menu c…
denny May 6, 2021
07aeb3b
Convert plugin admin menu section partials into components
denny May 6, 2021
9bc0071
Merge branch 'main' into dev/view-components/admin-menus
denny May 7, 2021
3317579
Remove now-unused code
denny May 7, 2021
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
Prev Previous commit
Remove now-unused code
denny committed May 7, 2021
commit 33175799e43913305e3151b9d2204f373d13c3d5
Original file line number Diff line number Diff line change
@@ -2,7 +2,4 @@
<% @menu_sections.each do |section| %>
<%= render section.new( current_user: @current_user ) %>
<% end %>
<% @feature_menu_partials.each do |path_to_partial| %>
<%= render partial: path_to_partial %>
<% end %>
</ul>
Original file line number Diff line number Diff line change
@@ -24,21 +24,13 @@ class MenuComponent < ApplicationComponent
private_constant :CORE_MENU_SECTION_COMPONENTS

def initialize( current_user: )
@feature_menu_partials = feature_plugin_admin_menu_partials
@menu_sections = menu_sections
@current_user = current_user
@current_user = current_user
end

def menu_sections
ShinyCMS.plugins.admin_menu_section_view_components + CORE_MENU_SECTION_COMPONENTS
end

def feature_plugin_admin_menu_partials
plugins = ShinyCMS.plugins.with_partial( 'admin/menu/_section.html.erb' )
return unless plugins

plugins.collect { |plugin| plugin.partial( 'admin/menu/section' ) }
end
end
end
end