fix(generate): disable OssInsight while its rankings are paused - #17
Merged
Merged
Conversation
OssInsight paused its star-based rankings, so picking it as a collect source returns no repositories. Disable the option instead of removing it, since the endpoint itself is alive and only the metric is gone. A stored `ossinsight` value now falls back to GitHub through normalizeResource, applied to all three places the resource reaches state: the localStorage initializer, the settings loaded from the backend and the offline fallback. Without it the form would sit on a hidden source and render the Period and Language fields instead of Date range and Spoken Language.
Member
Author
|
🎉 This PR is included in version 1.51.2 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
OssInsight paused its star-based rankings, so choosing it as the collect source in Collect posts returns no repositories at all. The dropdown still offered it as an equal option to GitHub.
Change
Disable, not delete. The endpoint itself is alive and only the metric is gone, so the option stays in place as
OssInsight (paused)withdisabled, and theresource === 'ossinsight'fields below it are kept. Re-enabling is a one-line change if upstream recovers.SelectItemforwards props toSelectPrimitive.Itemand already carriesdata-[disabled]:opacity-50, so no extra styling was needed.Normalise the stored value.
resourcereaches state from three places, not just localStorage:useStateinitialiser (localStorage),ossinsightactually lives,loadSettingscatch branch.All three now go through
normalizeResource, which maps anything inPAUSED_RESOURCESback togithub. Without it the form would sit on a hidden source: the trigger would show the disabledOssInsight (paused)and the fields below would render Period and Language instead of Date range and Spoken Language.The catch branch also now always writes the normalised value to
dashboardResourceinstead of only writing when the key is missing — otherwise a staleossinsightwould survive in localStorage.Verification
npx tsc --noEmitclean,npm run buildsucceeds,npm test50/50 (the existing suites do not cover this form, so they only confirm nothing else broke).OssInsight (paused)greyed out and that a storedossinsightlands on GitHub after a reload.Related
github