lizhimins opened a new pull request, #7354:
URL: https://github.com/apache/rocketmq-dashboard/pull/7354

   ### Which Issue(s) This PR Fixes
   
   No tracking issue. Follows the backend domain model 
(`docs/studio-instance-model-spec.md`).
   
   ### Brief Description
   
   The backend now scopes topic and group uniqueness to a NameServer domain, 
but nothing in the UI says
   so, and an open-source instance could not be bound to a NameServer at all. 
This surfaces the rule where
   creation happens:
   
   - **Instance page**: a NameServer cluster selector on the create form 
(required for APACHE instances,
     immutable afterwards — the edit form shows it as fixed) plus a NameServer 
column in the list, so the
     domain an instance belongs to is visible. `web/src/api/instance.ts` 
carries `nameserverId`.
   - **Create forms**: a question-mark help modal (`ResourceRuleHelp`) on the 
create-instance NameServer
     field and on the name field of the create-topic and create-group forms 
(create mode only, not on
     edit). It states the uniqueness boundary and the three creation outcomes: 
nobody owns the name yet →
     created; the calling instance owns it → updated with the new parameters; 
another instance owns it →
     the owner is reported and the create is rejected. The trigger calls 
`preventDefault`, because a click
     inside a `Form.Item` label would otherwise focus the field and open the 
Select dropdown behind the
     modal.
   - **Resource model page** (`/studio/resource-model`): the ownership topology 
as an SVG — two NameServer
     domains, the instances bound to each, the broker clusters underneath, a 
same-name pair that coexists
     across domains and a conflicting pair inside one slot — followed by the 
four ownership rules.
   
   The creation-decision flow diagram is deliberately not part of this change: 
it read as a backend
   implementation detail, so the rule lives on the forms instead.
   
   All new UI text has Chinese and English entries under `web/src/i18n/` 
(`instance.nameserver*`,
   `resourceModel.*`); the example identifiers are generic (trade / logistics / 
staging, orders /
   payments).
   
   ### How Did You Test This Change?
   
   ```
   cd web && npm run lint && npm test && npm run build
   npm run lint
     ✖ 10 problems (0 errors, 10 warnings)   # all pre-existing, none in a file 
this PR touches
     exit 0
   
   npm test   (vitest run)
     Test Files  164 passed (164)
          Tests  1863 passed (1863)
       Duration  225.80s
   
   npm run build
     ✓ built in 13.61s
     web license check passed: 132 actual components, 139 license files
   
   npm run license:test
     # pass 5
     # fail 0
   ```
   
   Guard tests: `ResourceRuleHelp.test.tsx` (6 cases: the modal opens from the 
trigger, the topology and
   the four rules render, the i18n directory stays bilingual, every SVG label 
fits its rect) plus one case
   each in `InstancePage.test.tsx`, `TopicPage.test.tsx` and 
`ConsumerPage.test.tsx` asserting the create
   form carries the question-mark trigger and opens the rule modal, so the 
entry points cannot regress
   silently. The modal-close assertions key off the mask's `ant-fade-leave` 
class rather than the dialog
   leaving the accessibility tree, because jsdom never fires `animationend`.
   
   Browser check on the test machine (playwright, read-only — modals opened and 
dismissed with Escape,
   nothing submitted): the three triggers render exactly once each at 14x14px, 
the modal copy is complete
   with no leaked i18n keys, the smallest rendered font is 14px, no SVG label 
overflows its rect, and
   clicking the trigger does not open the NameServer dropdown. Zero console 
errors.
   
   ### Checklist
   
   - [x] One coherent change; unrelated modifications are not bundled in
   - [x] Commit subject follows Conventional Commits (`feat:` / `fix:` / 
`refactor:` / `chore:` / `docs:` / `perf:`)
   - [x] Tests added or updated for non-trivial changes, test methods named 
`...Test`
   - [x] New UI text has both Chinese and English entries under `web/src/i18n/`
   - [x] Architecture constraints stay green (`mvn test` runs the ArchUnit 
checks) — no backend change here
   - [x] New source files carry the ASF license header (frontend sources are 
not header-bearing in this repo)
   - [x] Documentation touched where behaviour changed (README / `docs/` / 
in-app help)
   


-- 
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