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

Remove custom module for news search (moved to HDBT) #411

Merged
merged 6 commits into from
Aug 2, 2023

Conversation

jeremysteerio
Copy link
Contributor

@jeremysteerio jeremysteerio commented Jul 17, 2023

UHF-8638

Move news archive app to HDBT.

What was done

In this branch:

  • Moved all news archive code to HDBT
    • ...Including styles
  • Updated news view template to include correct script from HDBT

In HDBT:

  • Reworked news archive app to work with HDBT 'framework' for react apps
    • Removed reliance on reactivesearch
  • Codebase for the app is like 80% remade so here are some highlights that need extra attention:
    • Instead of initaiting filter options in store like job search app does, refactored initialization into a swr hook (see useInitialQuery.tsx, FormContainer.tsx)
    • Speaking of swr hooks, made a reusable wrapper hook for swr hooks, maybe this might be of use in future for a common component? See: useIndexQuery.tsx.
    • Added loading overlay and used keepPreviousData arg for swr to create a better transition when updating the app (prevents "collapsing" and inidicates loading better for the user). Added components for the transition into common components, see ResultWrapper.tsx and LoadingOverlay.tsx
    • Used react reft for the 'jump to results' scrolling (see useEffect in ResultsContainer.tsx

In platform config:

  • Added news archive block code from the custom module there

How to install

  • Make sure your instance is up and running on correct branch.
    • git checkout origin/UHF-8638-move-news-archive-to-hdbt
    • Add ELASTIC_PROXY_URL=https://uutisapi.hel.fi to your .env file (use data from prod to display results)
    • composer require drupal/hdbt:dev-UHF-8638-move-news-archive-to-hdbt
    • composer require drupal/helfi_platform_config:dev-UHF-8638-move-news-archive-to-hdbt
    • Run make fresh

How to test

Designers review

  • This PR does not need designers review
  • This PR has been visually reviewed by a designer (Name of the designer)

Other PRs

Copy link
Contributor

@Jussiles Jussiles left a comment

Choose a reason for hiding this comment

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

Looks good and 🪨 s! I added some comments on HDBT PR.

@sonarcloud
Copy link

sonarcloud bot commented Aug 2, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 1 Code Smell

No Coverage information No Coverage information
0.0% 0.0% Duplication

@jeremysteerio jeremysteerio merged commit c3f28f6 into dev Aug 2, 2023
3 checks passed
@jeremysteerio jeremysteerio deleted the UHF-8638-move-news-archive-to-hdbt branch August 2, 2023 07:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants