Flagsmith / Flagsmith/flagsmith

Code References: Dynamic VCS provider in UI badges

Open
#7,135 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
6.6k
Forks
567
Avg merge
1d 13h
Merged PRs (30d)
121

Description

Context: https://github.com/Flagsmith/flagsmith/issues/7000
Depends on: https://github.com/Flagsmith/flagsmith/issues/7134

The feature-list badges are hardcoded to show the GitHub icon regardless of the actual provider.

### Scope

Use the `vcs_provider` returned by the API (added in https://github.com/Flagsmith/flagsmith/issues/7134) to show the correct icon per repository.

### Changes

**`frontend/common/types/responses.ts`** (~line 633): Add `vcs_provider: VCSProvider` to the `code_references_counts` type.

**Three locations** hardcode `vcsProvider={VCSProvider.GITHUB}`:
- `frontend/web/components/feature-summary/FeatureTags.tsx` (line 79)
- `frontend/web/components/feature-summary/ProjectFeatureRow.tsx` (lines 70, 119)

Replace with dynamic provider from the data. When a feature is scanned from multiple providers, show one badge per provider. Consider extracting a shared component to avoid duplicating the grouping logic.

`VCSProviderTag` and `GitlabIcon` already exist and handle GitLab — no new UI components needed.

### Acceptance criteria

- [ ] Correct icon (GitHub/GitLab) shown per repository's provider
- [ ] Features scanned by both providers show both icons
- [ ] No hardcoded `VCSProvider.GITHUB` in badge rendering
- [ ] `npm run typecheck && npm run lint` pass

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.