Implemented voog footer and redis cache - #1584
Open
maricavor wants to merge 4 commits into
Open
Conversation
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Overview
This PR significantly refactors the footer component to use the new voog_footer gem for managing dynamic footer content from the Voog CMS, adds Redis caching infrastructure, and improves invoice authorization security.
Key Changes
Replaced legacy footer system with the new voog_footer gem (added to Gemfile)
Created config/initializers/voog_footer.rb to configure the VoogFooter with:
Site URL and API key support
Redis cache store integration with configurable TTL (default 3600s)
Locale support (English & Estonian)
SSL verification settings
Completely rewrote app/components/common/footer/component.rb (~437 lines):
Added sophisticated footer link mapping between app slots and Voog keys
Implemented fallback navigation columns for when Voog is disabled
Added support for dynamic footer navigation structure from Voog
Added footer contacts, social links, and highlight section rendering
Integrated social media link handling with icon mapping
Removed hardcoded footer links in favor of configuration-driven approach
Updated footer template (app/components/common/footer/component.html.erb):
Changed from hardcoded links to dynamic rendering using helper methods
Updated to render navigation columns using footer_navigation_columns
Added dynamic social links rendering
Cleaned up inline styles and made HTML more maintainable
Added Redis cache configuration in config/environments/production.rb:
Uses REDIS_CACHE_URL environment variable (defaults to localhost:6379/2)
Includes error handler for graceful cache failures
Updated config/cable.yml to use REDIS_CABLE_URL instead of generic REDIS_URL (better separation of concerns)
Removed Redis health check from bin/docker-entrypoint (likely handled elsewhere or simplified)
Updated app/models/ability.rb: Changed Invoice authorization from allowing all invoice reads/updates to only allowing access to user's own invoices
Ruby
can %i[read update], Invoice, user_id: user.id # Previously: can %i[read update], Invoice
Updated app/controllers/invoices_controller.rb: Added user_id filtering in set_invoice to ensure users can only access their own invoices
Updated tests in test/integration/invoices_test.rb: Changed expected behavior from 500 errors to 404 (not found) when accessing other users' invoices
Dependency Updates
JWT gem pinned to version ~> 2.10.3 (was unpinned)
Added voog_footer gem from GitHub: internetee/voog_footer
Configuration & Localization
Added configuration keys to config/customization.yml.sample:
voog_site_url, voog_api_key, voog_site_fetching_enabled, voog_footer_cache_ttl
Expanded English and Estonian locales in config/locales/common.*.yml:
Added labels section for footer link text (links may differ from labels)
Added social section for social media titles
Added links section with centralized footer URLs
Updated copyright year to 2026
Cleanup
Removed legacy footer fetcher: Deleted app/jobs/shared_footer_fetcher_job.rb (old manual footer HTML scraping approach)
Removed cached footer helper: Deleted cached_footer from app/helpers/application_helper.rb
Removed footer job reference from app/models/job.rb
Removed Settings seeds for Voog configuration (now in config/customization.yml)
Updated test fixtures in test/components/common/footer_test.rb to work with new component architecture
New Assets
Added SVG icons for social media:
app/views/svg/_instagram.html.erb
app/views/svg/_spotify.html.erb
Other Updates
Updated .dockerignore with comprehensive exclusion patterns
Added health check route in config/routes.rb