Say where each cost model page's data-source values came from - #7931
Open
Unisay wants to merge 1 commit into
Open
Say where each cost model page's data-source values came from#7931Unisay wants to merge 1 commit into
Unisay wants to merge 1 commit into
Conversation
A field filled from `localStorage` looked exactly like one somebody chose. A review link whose query string got cut in transit therefore loaded a half-typed path left over from an earlier session and reported a 404 that read as a broken page. Three changes, all in the shared plumbing, so every builtin page gets them: A query parameter now wins even when it is empty. `?json=` says "no JSON URL", and the old `||` chain treated that as absent and fell through to storage. Same for `csv` and for `branch`. A stored path is only restored when the link does not name a different branch, because a path saved against one branch is wrong for another, and a stale absolute path is worse than an empty field: the empty field falls back to the branch and works. A field that storage filled in says so, next to itself, with a button that drops the stored value and falls back to the branch for that field alone. A failed request adds the same note to its message, since that is the case where nobody can tell where the URL came from. Copy Link now carries whichever of `csv` and `json` the branch does not imply, so a review link stands on its own. `?csv=` and `?json=` are new: they let a link point at files a branch does not have yet, which needs a local HTTP server because `fetch` rejects the `file:` scheme.
Contributor
|
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.
A cost model page fills its CSV and JSON URL fields from
localStoragewhen the link does not carry them, and gave no sign it had done so. A review link whose query string was cut in transit therefore loaded a half-typed path left from an earlier session, showed it as though somebody had chosen it, and reported a 404 that read as a broken page.A field that storage filled in now says so beside itself, with a button that drops the stored value and falls back to the branch for that field alone. A failed request repeats the note in its message, which is the case where nobody can otherwise tell where the URL came from. A query parameter now wins even when it is empty, so
?json=means there is no JSON URL rather than falling through to storage, and a stored path is restored only when the link does not name a different branch, because a path saved against one branch is wrong for another.?csv=and?json=are new, which lets a review link point at files a branch does not have yet.The change is in shared plumbing, so all 14 cost model pages get it.
Found while preparing the pages for the
keepPoliciesanddropPoliciescost models.