Conversation
|
@Dor3nz tests fail :( |
b984416 to
19d290b
Compare
Codecov Report
@@ Coverage Diff @@
## revamp_admin #1155 +/- ##
================================================
+ Coverage 97.11% 97.11% +<.01%
================================================
Files 421 422 +1
Lines 7042 7048 +6
================================================
+ Hits 6839 6845 +6
Misses 203 203
Continue to review full report at Codecov.
|
409f520 to
45565db
Compare
|
@Dor3nz, thanks for your PR! By analyzing the history of the files in this pull request, we identified @josepjaume and @beagleknight to be potential reviewers. |
| <%= link_to manage_feature_path(participatory_process, feature), data: { tooltip: true, disable_hover: false }, title: t("actions.manage", scope: "decidim.admin"), class: "action-icon action-icon--manage" do %> | ||
| <%= icon "pencil" %> | ||
| <% end %> | ||
| <%= icon_link_to "pencil", manage_feature_path(participatory_process, feature), t("actions.manage", scope: "decidim.admin"), "action-icon--manage" %> |
There was a problem hiding this comment.
You're using the argument klass in the wrong way, as this would actually generate action-iconaction-icon--manage. Same applies for the rest of its usage.
There was a problem hiding this comment.
Actually, there's a space to split them. Check how the helper merges the classes.
There was a problem hiding this comment.
Oh, nice xD. Anyway, I think specifying the whole class might be a bit redundant. Is there any case where you need to override the whole class name? If that's the case, maybe you could use a class: "whatever" option instead of this? Not a big fan of long lists of arguments when some of them are/could be optional.
There was a problem hiding this comment.
For testing purposes apparently we need to "classify" them all, can turn it to optional anyways.
There was a problem hiding this comment.
Oh, I understand. I'd make it optional via a options argument then.
|
Sorry for the trolling @Dor3nz: I'd make It's important to get these APIs right, as other developers will be using them from external modules and so they might become difficult to deprecate. Thoughts @oriolgual @mrcasals @beagleknight ? |
|
To make it clearer, the signature of the method would become: def icon_link_to(icon_name, link, title, options = {})
# ...
end |
|
Yeah I'm up for that. |
| module Decidim | ||
| module Admin | ||
| module IconLinkHelper | ||
| def icon_link_to(icon_name, link, title, klass, method, data={}) |
|
@Dor3nz be careful when merging this |
| # | ||
| def icon_link_to(icon_name, link, title, options = {}) | ||
| link_to(link, | ||
| method: options[:method], |
There was a problem hiding this comment.
I'd default :method to :get, just in case, as it's the default value for the link_to method.
method: options[:method] || :get
There was a problem hiding this comment.
It does so already when nil.
There was a problem hiding this comment.
Weird, but ok.
But remove the method: :get calls then, if it's the default value.
702fc14 to
d3fd872
Compare
* Add icon link helper * Update existing icon links * Add optional data to icon link helper * Add methods at icon links * Refactor tests for new icon helper * Add docs and refactor helper call * Refactor all icon links with new helper call
* Add icon link helper * Update existing icon links * Add optional data to icon link helper * Add methods at icon links * Refactor tests for new icon helper * Add docs and refactor helper call * Refactor all icon links with new helper call
* Add icon link helper * Update existing icon links * Add optional data to icon link helper * Add methods at icon links * Refactor tests for new icon helper * Add docs and refactor helper call * Refactor all icon links with new helper call
* Add admin styles * Add basic layout * Change scopes icon * Add participatory processes index page * Add participatory process layout * Fix some specs * Fix more broken tests * Fix more specs * Fix poltergeist * New admin - Settings section (#1124) * Add participatory process layout * Add basic layout for settings * Finish settings form * Add scopes index page * Finish basic scopes admin * Add revamp_admin to travis * Fix a few specs * Fix broken tests * Remove bad merge * [New admin] - Pages section (#1130) * Add index section * Add new section * Finish forms * Fix specs * [New admin] - Users (#1136) * Add layout * Add users index page * Add invite user form * Add user groups index and fix pagination for both users and user groups * Fix table links * Fix specs * Fix admin invite user labels * [New admin] - Newsletters (#1140) * Add layout and index page * Add new/edit forms * Add newsletter preview * Fix specs * [New Admin] - Process groups (#1141) * Add new views * Fix broken specs * [New Admin] - Style process features (#1143) * Style process features * Refactor feature tests for admin * [New Admin] - Processes info / steps (#1138) * updated new process view * updated process steps index * update process steps index table * update processes layouts * Processes steps views updated * Fix indentation * Remove unusued locales * Update tests * Add moderations missing menu * missing td added * Add icon link helper (#1155) * Add icon link helper * Update existing icon links * Add optional data to icon link helper * Add methods at icon links * Refactor tests for new icon helper * Add docs and refactor helper call * Refactor all icon links with new helper call * [New Admin] Update category views. (#1148) * Add category views * Fix tests * Add tests * Add new icon_helper * [New Admin] Attachment update. (#1158) * Views added * Finish tests * add helper * Style process features at admin (#1149) * [New Admin] - Process groups (#1141) * Add new views * Fix broken specs * Style meetings table * Update branch with icon helper * Style proposals * Style results * Style budgets * Update missing styles for some forms * Fix most of the tests * Fix more tests * Style moderation tables (#1182) * Remove unused travis step * [New Admin] Update process admins views. (#1183) * Add new and edit forms * clean update command * Tests added * Amend test * Add dashboard content * Spellcheck * Amend managing roles strings * Use user instead of admin * Fix participatory process edit button * Add some feedback * Add styles for feature forms * Add edit feature form * Add more feedback * [New Admin] Html and styles review. (#1200) * Review all the forms * Class coherence review * CA: Swap funcionalitat with component * Fix a few specs * ES: Swap funcionalidad with componente * Fix a few more specs * Add missing helper * Add preview images to organization settings form * Icons updated on features table * amend icon
🎩 What? Why?
This adds a helper to create icon links in a more easy way, right now it is quite tedious to add an icon link. This should improve the dev experience.
I intend to update all the existing icons in the admin in this PR as well.
📌 Related Issues
👻 GIF