From 8272b7e9c3fab4ca2d40f7ac15252bdd42f99fca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javi=20Mart=C3=ADn?= Date: Fri, 12 Apr 2024 14:06:11 +0200 Subject: [PATCH] Move shared component stylesheets to shared folder We had an inconsistency where most stylesheets associated to a component would have the same relative path as their component, so if we had a component in `app/components/admin/whatever`, its associated stylesheet would be in `app/assets/stylesheets/admin/whatever`. There was one exception to this rule: stylesheets for components in `app/components/shared/` were placed in `app/assets/stylesheets/`. The reason was that we thought "well... if they're in the root folder, they're shared". However, this is confusing because in the root folder there are also stylesheets that aren't associated to a component. So we're creating the `app/assets/stylesheets/shared/` folder. This also means we don't have to manually add every stylesheet in this folder the the `application.scss` file. We aren't the same for JavaScript files because with JavaScript we still don't have a clear association between JavaScript files and components. Only a couple of them (`advanced_search.js` and `check_all_none.js`) would be good candidates, and the one for the advanced search form doesn't even use the `.advanced-search-form` selector that we use in the CSS file. --- app/assets/stylesheets/application.scss | 10 +--------- .../stylesheets/{ => shared}/advanced_search.scss | 0 app/assets/stylesheets/{ => shared}/avatar.scss | 0 app/assets/stylesheets/{ => shared}/banner.scss | 0 .../stylesheets/{ => shared}/check_all_none.scss | 0 .../stylesheets/{ => shared}/comments_count.scss | 0 .../stylesheets/{ => shared}/in_favor_against.scss | 0 app/assets/stylesheets/{ => shared}/map_location.scss | 0 .../stylesheets/{ => shared}/moderation_actions.scss | 0 .../{ => shared}/search_results_summary.scss | 0 10 files changed, 1 insertion(+), 9 deletions(-) rename app/assets/stylesheets/{ => shared}/advanced_search.scss (100%) rename app/assets/stylesheets/{ => shared}/avatar.scss (100%) rename app/assets/stylesheets/{ => shared}/banner.scss (100%) rename app/assets/stylesheets/{ => shared}/check_all_none.scss (100%) rename app/assets/stylesheets/{ => shared}/comments_count.scss (100%) rename app/assets/stylesheets/{ => shared}/in_favor_against.scss (100%) rename app/assets/stylesheets/{ => shared}/map_location.scss (100%) rename app/assets/stylesheets/{ => shared}/moderation_actions.scss (100%) rename app/assets/stylesheets/{ => shared}/search_results_summary.scss (100%) diff --git a/app/assets/stylesheets/application.scss b/app/assets/stylesheets/application.scss index c4a6c4adb..ae376c155 100644 --- a/app/assets/stylesheets/application.scss +++ b/app/assets/stylesheets/application.scss @@ -22,28 +22,19 @@ @import "mixins/*"; @import "admin"; -@import "advanced_search"; @import "annotator_overrides"; @import "autocomplete_overrides"; -@import "avatar"; -@import "banner"; -@import "check_all_none"; -@import "comments_count"; @import "datepicker_overrides"; @import "layout"; @import "participation"; @import "milestones"; @import "pages"; @import "dashboard"; -@import "in_favor_against"; @import "legislation"; @import "legislation_process"; @import "legislation_process_form"; -@import "map_location"; -@import "moderation_actions"; @import "notification_item"; @import "community"; -@import "search_results_summary"; @import "stats"; @import "sticky_overrides"; @import "tags"; @@ -61,6 +52,7 @@ @import "sdg/**/*"; @import "sdg_management/*"; @import "sdg_management/**/*"; +@import "shared/**/*"; @import "subscriptions"; @import "widgets/**/*"; diff --git a/app/assets/stylesheets/advanced_search.scss b/app/assets/stylesheets/shared/advanced_search.scss similarity index 100% rename from app/assets/stylesheets/advanced_search.scss rename to app/assets/stylesheets/shared/advanced_search.scss diff --git a/app/assets/stylesheets/avatar.scss b/app/assets/stylesheets/shared/avatar.scss similarity index 100% rename from app/assets/stylesheets/avatar.scss rename to app/assets/stylesheets/shared/avatar.scss diff --git a/app/assets/stylesheets/banner.scss b/app/assets/stylesheets/shared/banner.scss similarity index 100% rename from app/assets/stylesheets/banner.scss rename to app/assets/stylesheets/shared/banner.scss diff --git a/app/assets/stylesheets/check_all_none.scss b/app/assets/stylesheets/shared/check_all_none.scss similarity index 100% rename from app/assets/stylesheets/check_all_none.scss rename to app/assets/stylesheets/shared/check_all_none.scss diff --git a/app/assets/stylesheets/comments_count.scss b/app/assets/stylesheets/shared/comments_count.scss similarity index 100% rename from app/assets/stylesheets/comments_count.scss rename to app/assets/stylesheets/shared/comments_count.scss diff --git a/app/assets/stylesheets/in_favor_against.scss b/app/assets/stylesheets/shared/in_favor_against.scss similarity index 100% rename from app/assets/stylesheets/in_favor_against.scss rename to app/assets/stylesheets/shared/in_favor_against.scss diff --git a/app/assets/stylesheets/map_location.scss b/app/assets/stylesheets/shared/map_location.scss similarity index 100% rename from app/assets/stylesheets/map_location.scss rename to app/assets/stylesheets/shared/map_location.scss diff --git a/app/assets/stylesheets/moderation_actions.scss b/app/assets/stylesheets/shared/moderation_actions.scss similarity index 100% rename from app/assets/stylesheets/moderation_actions.scss rename to app/assets/stylesheets/shared/moderation_actions.scss diff --git a/app/assets/stylesheets/search_results_summary.scss b/app/assets/stylesheets/shared/search_results_summary.scss similarity index 100% rename from app/assets/stylesheets/search_results_summary.scss rename to app/assets/stylesheets/shared/search_results_summary.scss