Skip to content

Feat/73 Write frontend for Admin/Interesting facts block#2

Merged
VolodymyrShapoval merged 9 commits into
mainfrom
feat/73/write_frontend_for_admin_interesting_facts_block
Dec 17, 2025
Merged

Feat/73 Write frontend for Admin/Interesting facts block#2
VolodymyrShapoval merged 9 commits into
mainfrom
feat/73/write_frontend_for_admin_interesting_facts_block

Conversation

@VolodymyrShapoval
Copy link
Copy Markdown
Contributor

@VolodymyrShapoval VolodymyrShapoval commented Dec 14, 2025

dev

GitHub

Code reviewers

Second Level Review

Summary of issue

This pull request implements a major refactor and feature upgrade for the Interesting Facts admin modal, focusing on improved UX, stricter validation, and more reliable image and fact creation flows. The changes include a full rewrite of the modal component, new and responsive styles, enhanced form management, and improved error handling for both fact and image creation. There are also some API and store interface updates to support the new logic.

Interesting Facts Admin Modal Refactor and UX Improvements:

  • Completely rewrote InterestingFactsAdminModal.component.tsx to use Ant Design's Form for better validation, live character counters, and improved image upload handling. Added support for both fact creation and editing, with image upload now required only for new facts. Improved error handling and user feedback on failures.
  • Added a new, comprehensive SCSS file (InterestingFactsAdminModal.styles.scss) with responsive and accessible styles, including input counters, upload area improvements, and mobile adaptations.

API and Store Interface Adjustments:

  • Updated the API layer so that the create method for facts now expects a FactCreate type, aligning the frontend and backend data contracts.
  • Improved the createFact and createImage methods in their respective stores (facts-store.ts, image-store.ts) to return the created object or null on error, and to provide better error logging and state updates.

Image Alt Text Handling:

  • Changed the logic for setting the alt attribute of fact images: now uses the fact's title instead of the image description, both when setting image details and when adding a new fact.

Store Interface Fixes:

  • Added modalStore to the root store interface to ensure correct typing and access throughout the app.

CHECK LIST

  • СI passed
  • Сode coverage >=95%
  • PR is reviewed manually again (to make sure you have 100% ready code)
  • All reviewers agreed to merge the PR
  • I've checked new feature as logged in and logged out user if needed
  • PR meets all conventions

@VolodymyrShapoval VolodymyrShapoval self-assigned this Dec 14, 2025
@VolodymyrShapoval VolodymyrShapoval added the documentation Improvements or additions to documentation label Dec 14, 2025
@VolodymyrShapoval VolodymyrShapoval requested a review from a team December 15, 2025 14:05
Copy link
Copy Markdown
Contributor

@Vektor19 Vektor19 left a comment

Choose a reason for hiding this comment

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

Excellent

Comment thread src/models/streetcode/text-contents.model.ts
Copy link
Copy Markdown
Contributor

@shribakb1 shribakb1 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

@sonarqubecloud
Copy link
Copy Markdown

Copy link
Copy Markdown
Contributor

@Vektor19 Vektor19 left a comment

Choose a reason for hiding this comment

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

All comments were resolved. Well done!

@VolodymyrShapoval VolodymyrShapoval merged commit aceccce into main Dec 17, 2025
3 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants