Skip to content

fix(AuditLog): Environment colours match the filter tags - #8966

Draft
Aviral02git wants to merge 3 commits into
Flagsmith:mainfrom
Aviral02git:fix/audit-log-environment-colours
Draft

Aviral02git wants to merge 3 commits into
Flagsmith:mainfrom
Aviral02git:fix/audit-log-environment-colours

Conversation

@Aviral02git

@Aviral02git Aviral02git commented Nov 14, 2026 •

Copy link
Copy Markdown

Thanks for submitting a PR! Please check the boxes below:

  • I have read the Contributing Guide.
  • I have added information to docs/ if required so people know about the feature.
  • I have filled in the "Changes" section below.
  • I have filled in the "How did you test this code" section below.

Changes

Closes #8681

In the audit log, the environment tag in each row could have a different colour from the same environment's tag in the filter above the table. The rows picked colours from the project store's environment list (sorted by name), while the filter uses the order returned by the API.

  • Audit log rows now use the same environment order as the filter, so each environment keeps one colour on the page.
  • Added a small helper with unit tests for the colour lookup.

How did you test this code?

  • Unit test for the helper (npx jest common/utils/__tests__/getEnvironmentColourIndex.test.ts), and eslint on the changed files.
  • Rendered the real EnvironmentTagSelect and AuditLog components with mocked API data (development, QA, production in API order). Before: the development and QA rows had each other's filter colours. After: all match.
  • I did not run the full app with a backend, so I have not seen this in a browser.

View guided diff

This function retrieves the index of a specified environment ID from a list of environments, defaulting to 0 if not found.
@vercel

vercel Bot commented Nov 14, 2026

Copy link
Copy Markdown

@Aviral02git is attempting to deploy a commit to the Flagsmith Team on Vercel.

A member of the Team first needs to authorize it.

@coderabbitai

coderabbitai Bot commented Nov 14, 2026

Copy link
Copy Markdown

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@github-actions github-actions Bot added the front-end Issue related to the React Front End Dashboard label Nov 14, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

front-end Issue related to the React Front End Dashboard

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Environment colors mismatch in audit log view

1 participant