Skip to content

Feature/redirects #247

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

Closed
wants to merge 9 commits into from
Closed

Feature/redirects #247

wants to merge 9 commits into from

Conversation

boazpoolman
Copy link
Member

What does it do?

Introduces a new add-on called "Redirects". It offers the ability to manage your redirects in the Strapi admin panel, with automatic redirect generation whenever you change the URL of a page.

Why is it needed?

To address #28

How to test it?

Setup the development environment as described in the CONTRIBUTING.md. Start up the admin panel and notice the Redirects page.

Copy link

changeset-bot bot commented Apr 3, 2025

🦋 Changeset detected

Latest commit: 8773d3f

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 3 packages
Name Type
strapi-plugin-webtools Minor
docs Minor
webtools-addon-redirects Major

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR introduces a new "Redirects" add-on, providing an interface within the Strapi admin panel to manage URL redirects automatically. Key changes include:

  • Registration of the add-on routes and components in the admin panel.
  • Implementation of a form for creating and editing redirects with client-side validation.
  • Addition of end-to-end Cypress tests for ensuring redirects functionality.

Reviewed Changes

Copilot reviewed 65 out of 69 changed files in this pull request and generated no comments.

Show a summary per file
File Description
packages/addons/redirects/admin/index.ts Registers new routes for the Redirects add-on
packages/addons/redirects/admin/index.cy.jsx Implements Cypress tests for the add-on workflow
packages/addons/redirects/admin/helpers/* Provides helper functions for translations and plugin identification
packages/addons/redirects/admin/components/RedirectForm/index.tsx Implements the form component for redirect management
Other files Documentation, license, configuration, and changeset updates
Files not reviewed (4)
  • package.json: Language not supported
  • packages/addons/redirects/.eslintignore: Language not supported
  • packages/addons/redirects/.gitignore: Language not supported
  • packages/addons/redirects/.npmignore: Language not supported
Comments suppressed due to low confidence (2)

packages/addons/redirects/admin/index.ts:15

  • The route name 'settings-route' is used for multiple routes. Consider using unique names (e.g., 'redirects-list', 'redirects-new', 'redirects-edit') to avoid potential conflicts.
name: 'settings-route',

packages/addons/redirects/admin/components/RedirectForm/index.tsx:75

  • Calling setErrors inside the render callback could trigger unnecessary re-renders. Move error state updates outside the render phase or use Formik's built-in error handling to avoid potential performance issues.
if (!isEmpty(errors)) {

Copy link

codecov bot commented Apr 3, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 44.19%. Comparing base (ac06105) to head (8773d3f).
Report is 2 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #247      +/-   ##
==========================================
+ Coverage   42.41%   44.19%   +1.78%     
==========================================
  Files           2        2              
  Lines         639      663      +24     
  Branches      156      164       +8     
==========================================
+ Hits          271      293      +22     
  Misses        293      293              
- Partials       75       77       +2     
Flag Coverage Δ
unit 44.19% <ø> (+1.78%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@boazpoolman
Copy link
Member Author

Closed in favor of #249

@boazpoolman boazpoolman closed this Apr 6, 2025
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.

1 participant