CMDB Relationship Wording PR Review - edmozley/freeitsm GitHub Wiki
CMDB relationship wording - PR review
PR #297 by Dr4inder ยท Verdict: merge + fix
On a CMDB object's page, each relationship in the Connections panel now names both ends with the forward verb - VM-A runs on HOST-A - instead of fitting the verb round "this" ("hosts this", "this runs on"). The relationship-type settings describe failure direction with A and B instead of a sentence built from the verb. User page: CMDB ยง Connections and Relationship Types.
Why it was worth having
Two problems, one fix:
- Verbs cannot be inflected. Relationship verbs are configurable data, typed by an administrator. The old strings
cmdb.conn.verb_incoming({verb} this) andverb_outgoing(this {verb}) dropped that verb next to a translated "this", which in German came out as "hostet diesem" - wrong case, and no translation of the frame can fix a verb it does not know. Naming both ends (cmdb.conn.relationship_statement,{source} {verb} {target}) needs no grammar. - The incoming column was backwards in English too. It showed the inverse verb with the other object as subject, so a host's page labelled its VM "hosts this" - saying the VM hosts the host. I confirmed it on the test install with before and after screenshots (ZZ objects, removed afterwards). Incoming rows now read other โ current with the forward verb, which is what the row actually stores.
What was checked
| Question | How | Result |
|---|---|---|
| Does every row read the right way round? | Read connectionsHtml() in cmdb/object.js; before/after on the test install |
Outgoing: {source: this object, verb, target: other}. Incoming: {source: other, verb, target: this object}. Both use x.verb |
| Is any data changed? | Diff | No. cmdb_object_relationships and cmdb_relationship_types are untouched; impact_direction keeps its stored values none / to_from / from_to |
| Do the new settings options mean what is stored? | Compared with includes/cmdb_impact.php |
to_from = the TO object failing affects the FROM object. With A = from and B = to, that is "B fails โ A is affected"; from_to is "A fails โ B is affected". Correct |
| Is the A/B example clear? | Read syncRelTypeImpactOptions() in cmdb/settings/settings.js |
A live line, "A {verb} B ยท B {inverse} A", filled from the two verb fields as they are typed, tied to the select with aria-describedby |
| Were existing English strings changed? | Diff of lang/en/cmdb.php |
No. verb_incoming, verb_outgoing, rel_type_impact_to_from and rel_type_impact_from_to are kept; new keys were added |
| Anything else hard-coded? | Read the diff | The breadcrumb's Browse was English-only in breadcrumbHtml(); it now uses the existing cmdb.object.breadcrumb_browse |
| Long names | Read the CSS | .o2-rel-verb gained overflow-wrap: anywhere, so a sentence with two long object names wraps instead of overflowing |
The trade-off
The old English settings choice read as a sentence about your own estate: "Everything that runs on it is affected". "B fails โ A is affected" plus the A/B example is a little more abstract. I told the maintainer this and it was accepted: the old frame could not be right in every language, and the A/B form is.
What was changed
- #2809 - the new strings (
relationship_statement,rel_type_impact_b_to_a,rel_type_impact_a_to_b,rel_type_impact_example) in the five complete languages (de, el, es, id, pl).
Merged with git merge --no-ff under the contributor's name (374961a0a), then the follow-up commit (e495eea3f).
Worth knowing
- Never put a configured verb next to a translated pronoun. Both changed functions carry a
TRAP:comment saying so. Name both ends instead. - Incoming rows use the forward verb. It is tempting to "fix" the incoming column to use
inverse_verbso the current object comes first - that is exactly the bug this removed. The inverse verb is still used where it is right: the add-relationship modal's preview ("Read from the other end: Y {inverse} X", both names shown) and the settings example. - The old keys are unused by the panel and the settings form but kept in every language file.