Commit Graph

149 Commits

Author SHA1 Message Date
Filip Ónodi e7772d621e feat(i18n): update and create Slovak translations (#25831)
Co-authored-by: Bassel Kanso <basselkanso82@gmail.com>
2026-05-26 15:10:41 +03:00
Andrei L b5452ab89f chore(eslint): migrate .eslintrc + .eslintignore to .eslintrc.cjs (#26216)
* chore(eslint): migrate .eslintrc + .eslintignore to .eslintrc.cjs

Consolidates the per-package ESLint setup into a single typed
`.eslintrc.cjs` file across the monorepo (177 files touched).

Why
- `.eslintignore` is removed in ESLint v9/v10. Folding ignore patterns
  into `ignorePatterns` inside the rc file is the supported migration
  path and unblocks future ESLint upgrades (which will likely be needed
  alongside the in-flight TypeScript 6 migration).
- `.cjs` extension is explicit about module format, so the configs keep
  working if any package later adopts `"type": "module"` (no CJS/ESM
  surprises).
- Wrapping each config in `// @ts-check` + a `Linter.Config`-typed
  `const config` block gives editor autocomplete and catches typos.
  Surfaced two real duplicates in
  `eslint-config-custom/back/typescript.js`
  (`node/no-unsupported-features/es-syntax`,
  `node/no-missing-import`), now deduplicated.
- `extends` references switched from the `custom/*` shorthand to the
  explicit `eslint-config-custom/*` package name. ESLint resolves both,
  but the explicit form makes the source unambiguous.
- Added `coverage/` to `ignorePatterns` so coverage output produced
  inside a workspace is not linted.

Misc
- `examples/kitchensink` had ESLint configured but no `lint` script;
  added one so the config actually runs.
- `nx.json` hash inputs updated:
  - removed `.eslintignore` (no longer exists)
  - replaced `{projectRoot}/.eslintrc.js` with
    `{projectRoot}/**/.eslintrc.cjs` so nested package configs are also
    part of the cache key (the previous glob missed them).
- `packages/utils/upgrade/tsconfig.eslint.json` include path updated
  from `.eslintrc.js` to `.eslintrc.cjs`.

Verification
- `eslint --print-config` resolves cleanly on sampled back/front
  packages (admin, users-permissions, upload).
- Full `pnpm -r lint` is clean.

* chore(eslint): set tsconfigRootDir for vscode-eslint typed linting

CLI lint resolved tsconfig paths via cwd, but vscode-eslint runs from
the workspace root and could not locate per-package tsconfigs. Set
parserOptions.tsconfigRootDir to __dirname in each package's
.eslintrc.cjs so the editor resolves typed-lint configs correctly.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* chore(eslint): self-ignore configs, scope coverage to jest packages

- Replace `env: { es6: true }` workaround with `.eslintrc.cjs` in
  ignorePatterns so eslint never lints the config file itself
  (root cause of the "const is not a keyword" parse error in es5)
- Add `.eslintrc.cjs` to ignorePatterns across all configs that
  were missing it
- Restrict `coverage/` ignorePatterns to workspace roots that
  actually run jest; drop from non-test packages and admin/server
  subdir configs (tests run from the workspace root)
2026-05-12 07:32:12 +00:00
Andrei L 6d83054647 chore(deps): migrate msw 1.x → 2.13.4 across admin test suites (#26065)
* chore(deps): bump msw to 1.3.5 and typedoc to 0.25.13

Widens TypeScript peer ranges in msw (>= 4.4.x) and typedoc (adds 5.4.x),
unblocking a future bump to typescript 5.6 required by react-intl 7.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* chore(deps): bump msw to 2.13.4 across admin test suites

Migrates 8 workspaces (admin, content-manager, content-releases, upload,
review-workflows, plugin-i18n, plugin-documentation, plugin-users-permissions)
from msw 1.3.5 to 2.13.4; bumps email's unused dep for consistency.

Handler changes:
- rest.X((req, res, ctx) => res(ctx.json(X))) → http.X(() => HttpResponse.json(X))
- res(ctx.status(N)) → new HttpResponse(null, { status: N })
- res.once(...) → http.X(path, handler, { once: true })
- res.networkError(...) → HttpResponse.error()
- await req.json<T>() / casts → http.METHOD<Params, Body>(...) generics
- RequestHandler → HttpHandler
- Empty 200 responses use HttpResponse.json({}) to avoid cross-realm
  SyntaxError instanceof check in getFetchClient.ts

Jest setup (per msw frequent-issues guide):
- jest-preset.front.js: customExportConditions: [''] so msw/node resolves
  under jsdom; .mjs swc transform; ESM allow-list for msw deps
  (rettime, @open-draft, outvariant, until-async, etc.)
- packages/admin-test-utils/src/environment.ts: polyfill Node fetch +
  streams + BroadcastChannel + URL into jsdom global. Blob/File/FormData
  intentionally left as jsdom's — Strapi app code threads them through
  jsdom-only APIs (FileReader, Image, HTMLFormElement) where realm matters.
  Comment in env.ts documents the trade-off.

Verified vs develop+msw@1.3.5 baseline: 0 net regressions across all 7
workspaces with msw test files; TypeScript clean.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* Revert "chore(deps): bump typedoc to 0.25.13"

The typedoc bump was bundled with the msw 1.3.5 bump in 39d169cfbb but
isn't required for the msw v2 migration. Reverting the docs/ and
core/types typedoc dep back to 0.25.10 to keep this branch focused on
the msw upgrade.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* chore(tests): type msw handler params via generics

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* chore(tests): address review feedback on msw v2 migration

- env.ts: snapshot jsdom globals in setup(), restore in teardown() so
  per-test mutations cannot leak across files in a Jest worker.
- env.ts: collapse polyfill list and value map into a single NODE_GLOBALS
  source of truth; document the fetch trade-off (Node undici vs jsdom).
- handlers: replace `<never, Body>` generics with `<Record<string, never>,
  Body>` (msw v2 convention; `{}` blocked by ban-types).
- email: drop unused msw devDep entirely (zero source usage in workspace).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* chore(tests): use realm-agnostic SyntaxError check; drop URL polyfill

Two follow-ups to the msw v2 migration:

- `getFetchClient.responseInterceptor` now matches `error?.name === 'SyntaxError'`
  rather than `instanceof SyntaxError`. Constructor identity differs across JS realms
  (under jsdom + Node fetch, an empty 200 throws a Node-realm `SyntaxError` that
  fails the jsdom-realm `instanceof` check; the same is true in browsers when the
  Response originates from a service worker / iframe). Name comparison is realm-
  agnostic. With this in place, empty 200 handlers can return `new HttpResponse()`
  again (closer to v1's `res(ctx.status(200))`) instead of the `HttpResponse.json({})`
  workaround.

- Drop `URL` / `URLSearchParams` from the env.ts polyfill list. jsdom already
  provides browser-spec versions, and Node's `URL.createObjectURL` only accepts
  Node-realm `Blob` — replacing it broke the "from computer" upload path in
  `LogoInput.tsx`. MSW v2's interceptor doesn't require these to come from Node.

env.ts comments restructured: all polyfill rationale lives in one top-of-file block
so the body is short and the trade-offs are documented in one place.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* chore(tests): switch content-type-builder jest env to shared polyfilled env

`aiClient.test.ts` constructs `new Response(...)` which jsdom does not provide
spec-compliantly. Align CTB with the other admin test suites by using
`@strapi/admin-test-utils/environment`, which polyfills Node's
`fetch`/`Request`/`Response`/streams into the jsdom global.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* fix(tests): make msw v2 + undici body + jsdom realms work together

Three regressions surfaced by running the full front test suite under
jsdom + Node's undici fetch polyfill:

1. `TypeError: Body is unusable: Body has already been read` in every
   handler doing `await request.json()`. MSW v2's `RequestHandler.run()`
   calls `request.clone()` before invoking the resolver (to keep a copy
   for post-hoc logging). Under Node's undici, `Request.clone()` tees the
   underlying `ReadableStream` and locks the original body, so the
   resolver's `.json()` throws. Fix in `environment.ts`: wrap the global
   `Request` constructor to stash the stringified body on every instance
   and patch `Request.prototype.json` / `.text` to return the stash when
   present. Handlers now get the body regardless of how many times msw
   clones internally.

2. `expect.any(Array)` and `toStrictEqual` failing with "serializes to
   the same string" against msw response bodies. `Response.prototype.json`
   runs Node's `JSON.parse`, so the resulting objects carry Node-realm
   `Object`/`Array` prototypes; jsdom's `instanceof`/strict-equality
   matchers reject them. Patch `Response.prototype.json` to parse with
   the jsdom-realm `JSON`.

3. `useWidgets > should handle network errors gracefully` expected the
   toast text "Network error", which msw v1's `res.networkError('Network
   error')` surfaced verbatim. v2's `HttpResponse.error()` drops the
   custom message and fetch throws `TypeError: Failed to fetch`; update
   the assertion accordingly.

Also: `UIDInput` uses `jest.useFakeTimers()`. Adding `doNotFake:
['queueMicrotask', 'setImmediate']` keeps per-test runtime at ~1s
instead of ~10s (plain fake timers stall undici's internal microtasks
between request emission and handler resolution), and an `afterEach`
restores real timers so a failing test cannot leak fake timers into
the next one.

Verified with `nx run-many --target=test:front --parallel=1` across all
12 projects — all suites green.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* test(admin): assert toast container in Widgets error tests

Replace text-match (`findByText('Server error' | 'Failed to fetch')`) with
`[data-sonner-toast]` container assertion. Decouples the test from toast
copy and from msw v1/v2 network-error message differences.

Addresses @jhoward1994's review comment on PR #26065.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* test(admin): assert toast text, scope msw handlers, use jsdom env

- Widgets tests: match actual toast text (Server error / fetch failure
  regex) instead of data-sonner-toast container.
- ConfirmBulkActionDialog: mark msw runtime handlers { once: true } so
  they do not leak across cases.
- content-type-builder: jest testEnvironment back to jsdom.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* chore(tests): split jest env patches into modules

Refactor packages/admin-test-utils/src/environment.ts by extracting
the msw v2 + undici body + jsdom realm shims into dedicated modules
under src/patches/ (node-globals, request-body-stash,
response-json-realm, types).

Co-Authored-By: Jamie Howard <jhoward1994@gmail.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-11 08:45:04 +00:00
Andrei L 90623baa6f fix(admin): clean up lazy component registration warnings (#25015)
* fix(admin): don't warn when Component is missing in addMenuLink/addSettingsLink

* fix: add some missing StrapiApp types

* fix(admin): clean up lazy component registrations

---------

Co-authored-by: Bassel Kanso <basselkanso82@gmail.com>
2026-04-30 16:27:48 +03:00
Filip Ónodi 4ccaab3c74 enhancement(translations): update czech translations (#25824)
Co-authored-by: Bassel Kanso <basselkanso82@gmail.com>
2026-04-24 11:11:48 +03:00
Michał Kleszczyński 62023de80d chore: update Polish language translations (#23762) 2026-04-08 15:29:18 +02:00
Adrien L 9ef7aa5f21 fix: es translations (#25655)
Co-authored-by: Iñigo Zulueta <eggamer131@gmail.com>
2026-03-05 16:03:00 +01:00
Adrien L 3615e59020 fix: responsive cm header (#25203) 2026-01-21 13:55:26 +01:00
Lukas Eipert 3d9d4b0209 feat: update german translations for various components (#24143) 2026-01-21 11:58:39 +01:00
Maksim Zhukau 83cb416993 feat(i18n): add Russian translations for all admin components (#24077) 2025-12-13 11:53:27 +01:00
HichamELBSI 18948ab6b4 chore: update DS version to stable 2025-11-19 10:20:19 +01:00
Simone 26bde6ef6b fix(upload): import cropperjs css by styled components (#23707) 2025-06-17 15:45:19 +02:00
Ivan Malaniak 9a7418f343 enhancement: add missing Ukrainian translations for various plugins and components (#22150)
Co-authored-by: Bassel Kanso <basselkanso82@gmail.com>
2025-02-26 19:46:18 +02:00
Alexandre Bodin 92055a7fb1 chore: use rollup
chore: fetch template only if name matches name convention

chore: linting

chore: fix tests

chore: fix npm scripts

test: try to fix test
2025-01-23 16:28:23 +01:00
Madhuri Sandbhor 9192781fb6 chore: bump DS rc-7 (#20860)
* chore: design system and icons bumped, grid item style adjusted

* fix: type error fixed

* fix: upload and users-permission tests fixed

* fix: tests fixed

* fix: add to dynamic zone button style updated

* fix: styling issues fixed for DZ component button and color picker

* fix: snapshot updated

* fix: fieldset border width removed, popover menu icon color updated

* fix: wysiwyg expand collapse button styles

* fix: ds deps bumped

* fix: editorlayout wrapper style fixed, panels actions style fixed

* fix: more button icon centered, man nav icons size fixed

* fix: help button style fixed

* fix: email settings button fixed
2024-07-31 14:22:27 +02:00
Fernando Chávez 9f00348b6e fix(documentation): add check to password input (#20704)
* fix(documentation): add check to password input

* fix(documentation): toggle notification when there is an error
2024-07-16 10:20:29 +02:00
Josh 11011e9804 chore: integrate beta.5 of the design-system (#20431)
* chore: refactor admin

* chore: refactor content-manager

* chore: refactor plugins

* chore: refactor content-releases

* chore: refactor CTB

* chore: refactor i18n

* chore: refactor user-permissions

* chore: refactor upload plugin

* chore: update deps

* chore: fix ci

* chore: design fixes

* chore: update import

Co-Authored-By: Simone <startae14@gmail.com>

* fix: guided home tour check color

* chore: update snapshots

* chore: update to beta.6

* chore: update import

Co-authored-by: Simone <startae14@gmail.com>

* chore: more fixes

* chore: fix import syntax

Co-authored-by: Simone <startae14@gmail.com>

* chore: fixes

* fix(upload): snapshot

---------

Co-authored-by: Simone <startae14@gmail.com>
Co-authored-by: Jamie Howard <jamie.howard@strapi.io>
2024-06-10 14:50:34 +01:00
Josh e98c3e2020 fix(admin): reset all redux toolkit cache on logout (#20318)
* fix(admin): reset all redux toolkit cache on logout

* chore: refactor API to use one createApi call from redux/toolkit

* chore: fix e2e suite

* chore: spelling error

Co-authored-by: Bassel Kanso <basselkanso82@gmail.com>

* chore: remove rogue import

---------

Co-authored-by: Bassel Kanso <basselkanso82@gmail.com>
2024-05-20 14:43:30 +01:00
Josh 5ff7024fc8 chore: update DS to 2.0.0-beta.4 (#20301) 2024-05-20 10:42:44 +01:00
Simone c734c14d5f feat(main-nav): Main nav refactoring, change links order (#20275)
* feat(main-nav): change links order in main nav

* feat(main-nav): add the position property to order links in the main nav

* feat(main-nav): refactor the sorting of the nav links

* feat(main-nav): add useCollator and format message to sort by name the links
2024-05-13 08:58:09 +02:00
Bassel Kanso 3bc72930fa Merge branch 'v5/main' into v5/replace-axios 2024-05-08 12:00:18 +03:00
Josh b7c62568a8 chore!: update styled-components to 6 & update DS to 2.0.0-beta.3 (#20260)
* chore: update styled-components to 6

* chore: update admin

* chore: update CM

* chore: update ctb

* chore: update other plugin packages

* chore: update content-releases

* chore: update user-permissions

* chore: update upload

* chore: update fields to be dot notation

* chore: update tests

* chore: update yarn.lock

* chore: update snapshots

* chore: update deps

* chore: update snapshots

* fix: left menu

* test: add label prop to NavLink test

* chore: PR tweaks
2024-05-07 14:01:26 +01:00
Bassel Kanso 433fc96d7d chore: fixing front unit tests 2024-05-06 23:39:18 +03:00
Bassel Kanso ab41b2e7ac Merge branch 'v5/main' into v5/replace-axios 2024-05-06 21:48:47 +03:00
Madhuri Sandbhor 63d70071de chore: moved cms components from DS to admin (#20242)
* chore: move all CMS components from DS to admin

* fix: eslint config

---------

Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com>
2024-05-06 09:29:44 +01:00
Bassel Kanso 79f3446e9e chore: fixing some flaky frontend unit tests 2024-05-02 18:00:16 +03:00
Josh 00f1e17248 test: please work units 2024-04-29 14:18:14 +01:00
Bassel Kanso fd55682955 Merge branch 'v5/main' into v5/replace-axios 2024-04-29 02:13:48 +03:00
Bassel Kanso e3ea9f6402 chore: fixing some tests that are not rendering properly 2024-04-26 17:47:13 +03:00
Josh 5d000fb33c chore: upgrade to DS 2.0.0-beta.2 (#20151) 2024-04-25 16:17:23 +01:00
Bassel Kanso 61d71566fb fix: make all builds work 2024-04-24 09:37:52 +03:00
Bassel Kanso 23718db2fc chore: fixing some tests 2024-04-18 18:20:38 +03:00
Bassel Kanso f41be330aa chore: remove axios from packages and edit some tests 2024-04-15 19:47:36 +03:00
Bassel Kanso 9e8dcb640e Merge branch 'v5/main' into v5/replace-axios 2024-04-09 15:07:12 +03:00
Bassel Kanso 7ca9df7f9d chore: error handling for fetch 2024-04-08 21:43:37 +03:00
Josh f31eabd7d2 feat(admin): rbac middleware (#19949)
* feat: rbac middleware

* chore: make the entire function curried
2024-04-08 16:31:07 +01:00
Bassel Kanso 65df420943 chore: replacing axios with native fetch 2024-04-08 17:31:38 +03:00
Ben Irvin b003dee48e chore: upgrade prettier to 3.2.5 2024-03-29 14:39:52 +01:00
Christian 8af582bab7 chore(admin): remove react-helmet (#19923)
* chore: remove react-helmet

* chore: lint fixes

---------

Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com>
2024-03-27 10:02:40 +00:00
Alexandre Bodin eedd4c978a chore: migrate doc plugin to ts 2024-03-21 18:20:12 +01:00
Josh e11b6f2e96 chore(helper-plugin)!: move RBAC / remove auth / remove usePersistentState (#19847)
* chore(helper-plugin)!: move useRBAC

* chore: get tests working

* chore!: remove auth

* chore!: remove usePersistentState

* fix: refactor building admin package so it shares modules with different entries

* fix: session vs local
2024-03-20 11:39:59 +00:00
Simone c46976a9da chore(helper-plugin)!: remove prefixPluginTranslations (#19845) 2024-03-19 16:33:46 +00:00
Simone e9eabddd69 chore(helper-plugin)!: move getFetchClient and useFetchClient (#19840)
* chore(helper-plugin)!: move useFetchClient and getFetchClient to the admin

* chore(helper-plugin)!: fix prettier errors

* chore(helper-plugin)!: remove useless functions
2024-03-19 15:37:20 +00:00
Josh b17a180f13 chore!(helper-plugin): remove useLockScroll / useClipboard / useFocusWhenNavigate / useQuery / useFocusInputField (#19835)
* chore!: remove useLockScroll & useClipboard

* chore!: remove useFocusWhenNavigate

* chore!: remove useQuery

* chore!: remove useFocusInputField

* chore!: move useQueryParams

* chore: fix tests

* chore: update copy

Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com>

* chore: pretty

---------

Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com>
2024-03-19 09:56:07 +00:00
Josh 95674865d9 chore(helper-plugin)!: move Notifications & AppInfo to admin (#19831)
* chore(helper-plugin)!: move Notifications to admin

* chore(helper-plugin)!: move AppInfo to admin
2024-03-18 21:07:24 +00:00
Simone 2b10610286 chore(helper-plugin)!: move getPrefixedId, useAPIErrorHandler, normalizeAPIError and getAPIInnerErrors (#19823) 2024-03-18 15:43:19 +00:00
Simone 1cb89ea8d0 chore!: remove translatedErrors from the helper-plugin (#19814)
* chore: move translatedErrors into the admin

* chore: fix prettier errors
2024-03-18 13:36:43 +00:00
Josh f2e89269f9 chore!: move confirm dialog to admin package and refactor (#19782) 2024-03-15 15:33:24 +00:00
Josh cbe7d7a488 chore(helper-plugin)!: remove page decorators (#19662)
* chore(helper-plugin): remove page decorators

* chore: fixes
2024-03-05 14:53:55 +00:00
Josh 93eda17d2a chore(helper-plugin)!: remove form (#19612)
* chore!: remove form

* chore: re-introduce form error focusing

* chore: remove usage of Formik in auth

* chore: fix test suite
2024-02-29 14:18:21 +00:00