wu-sheng opened a new pull request, #18:
URL: https://github.com/apache/skywalking-horizon-ui/pull/18

   ## Summary
   
   Follow-up to #17. Two operator-facing inconsistencies on the Layer 
Dashboards and Overview Templates admin editors:
   
   ### 1. Default = remote; pill hidden on the default path
   
   Remote is the canonical baseline — `pickLayerContent` / 
`pickOverviewContent` in `bundle.ts` serve remote content to the runtime menu 
for every synced / diverged / remote-only row. The editor now matches: on every 
(re-)mount it loads remote whenever it's reachable. Priority is **local draft → 
remote → bundled** (last only on bundled-fallback rows).
   
   The `from {source}` pill renders only when the operator has stepped off the 
default — saved a LOCAL draft, or hit Reset to BUNDLED. The two pages used to 
disagree (Layer Dashboards always showed `from remote`; Overview Templates 
showed nothing); both are quiet now on the common path.
   
   ### 2. Reset really discards the local draft
   
   The "Reset to bundled" / "Reset to remote" dropdown items advertise "Discard 
current edits and reload …", but the previous implementation called 
`persistLocal(new_content)` right after `loadFrom(src)`. On a diverged row that 
wrote the freshly-loaded content into `localEdits` as a **brand-new draft** — 
so right after hitting reset the `TemplateConflictPrompt` would pop up:
   
   > **You have unpublished local edits**
   > 1 dashboard(s) have edits saved only in this browser …
   > • Layer · ActiveMQ
   
   Reset now calls `localEdits.remove(editName)` instead. Subsequent edits in 
the editor re-create a draft naturally on the next change. The 
unpublished-edits modal stops popping up immediately after a reset.
   
   ### i18n
   
   Adds the new `from {source}` + `local` keys to all eight locale catalogs 
(`remote` and `bundled` were already there).
   
   ## Test plan
   
   - [x] `pnpm --filter ui exec vue-tsc --noEmit` — clean.
   - [ ] Open Layer Dashboards → pick a diverged row → no pill (loaded from 
remote). Hit Reset to bundled → `from bundled` pill appears, 
**TemplateConflictPrompt does NOT pop up**. Edit any field → the operator's 
edits now stage into the local draft as expected.
   - [ ] Same on Overview Templates.
   - [ ] Switch the top-bar locale; confirm `from local` / `from bundled` 
translate.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to