Commit 900f6d6
Relation-property editing: clearable relation type and browsable target-schema picker (#953)
* Add an all-schemas summary data source
Add a SchemaSummary type and getSchemaSummaries( offset, limit ) to the SchemaLookup
port, with REST (GET /neowiki/v0/schemas) and in-memory implementations — reusing the
endpoint the Schemas page already uses, no new backend. A cached, paginated
getAllSchemaSummaries() store action loads every schema once (cleared on save) for the
schema picker to filter client-side. SchemasPage reuses the shared SchemaSummary type.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* Add a browsable, constrained target-schema picker
Rebuild SchemaLookup on CdxCombobox so the field opens the full schema list on click
(empty or filled) and filters as you type, with descriptions shown throughout. Only an
exact existing schema is committed; unmatched text reverts to the committed value on
blur, so the field never holds an invalid value. Reword the now-shared placeholder to
"Select a schema" under a neutral neowiki-schema-lookup-placeholder key, stretch the
field to full width, and register CdxCombobox.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* Reflect cleared attributes in the relation property editor
Clearing the relation type now updates the model instead of silently keeping the
previous value; the property name is used only as the on-create default. The
target-schema required error shows only after the field has been touched (visited and
left empty) rather than immediately on a newly added relation property.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* Harden and simplify the schema picker from PR review
Follow-ups from the #953 review:
- Page getAllSchemaSummaries by request offset instead of loaded count.
The summaries endpoint counts every Schema page in totalRows but omits
ones it cannot load (restricted/malformed), so advancing the offset by
the loaded count re-requested earlier names and duplicated entries in
the cached picker list.
- Handle a failed schema load in SchemaLookup's onMounted instead of
leaving an unhandled rejection and a silently empty picker.
- Commit the canonical schema name from the picker rather than the raw
combobox text, so input with surrounding whitespace cannot store a
target schema that does not resolve.
- Simplify the picker's menu state to a computed over a query ref,
removing the imperative showAllSchemas/toMenuItems bookkeeping, and
drop the now-unused searchAndFetchMissingSchemas store action.
- Drop the SchemaLookup clear test that drove an event the real
component never emits; add coverage for the canonical-name commit,
the no-op re-emit, the load-failure path, and offset pagination.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* Reject empty relation type and target schema on schema save
A Schema could be saved with a relation-type property whose relation
(edge label) or targetSchema was empty or whitespace-only: the save-time
JSON Schema used additionalProperties:true and never constrained those
fields. An empty relation type then crashed Neo4j projection when a
Subject populated the relation, via Cypher::escape('') throwing — for a
user who need not be the one who saved the schema. An empty targetSchema
was only caught at read time by SchemaName('').
Add an if/then to schemaContentSchema.json: when a property definition's
type is "relation", relation and targetSchema are required and must
contain a non-whitespace character. This rejects the invalid schema at
save time through the existing SchemaContentValidator, the same path
that already rejects an empty type, rather than corrupting on read.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* Rename the SchemaLookup component to SchemaPicker
The Vue picker component shared its name with the unrelated SchemaLookup
data-access interface (application/SchemaLookup.ts) — public-api.ts even
re-exported both under the name SchemaLookup (one as a type, one as a
value). Rename the component, its placeholder message, and its CSS class
to SchemaPicker so the UI picker and the data-access lookup are clearly
distinct. The data interface keeps the SchemaLookup name, paired with
SchemaRepository.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* Match the schema picker selection case-insensitively and restore its menu
Follow-ups from the #953 review:
- findSchema now normalises the typed text the way a save normalises a Schema
name (case-insensitive first letter, collapsed whitespace) before matching,
so typing an existing name in a different case (e.g. "office" for "Office")
commits the canonical schema instead of reverting on blur. The menu filter
was already case-insensitive, so the two now agree.
- onSelect resets the filter on a committed selection, so reopening the picker
without leaving the field browses every schema again rather than showing the
stale filter from the previous query.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* Share one in-flight request when loading all schema summaries
Follow-up from the #953 review:
getAllSchemaSummaries cached only the resolved array, which is null for the whole
paginated load, so several relation-property pickers mounting in the same render
each ran a complete pagination. It now stores the in-flight request and hands it
to concurrent callers, releasing it on completion and on failure (so a later call
retries). saveSchema clears it alongside the cache.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* Reject relation type and target schema with surrounding whitespace on save
Follow-up from the #953 review:
The save-time JSON Schema pattern only rejected empty or whitespace-only values,
so a padded relation type or target schema (e.g. "Likes ") passed validation and
persisted. A padded target schema then matches no Neo4j label and a padded
relation type projects to a distinct backtick-escaped relationship type. Anchor
the pattern so leading and trailing whitespace is rejected at the same save-time
boundary (SchemaContentValidator) that already rejects empties, rather than
corrupting downstream.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* Assert whitespace-only relation input emits an empty relation
Follow-up from the #953 review:
updateRelation emits the trimmed value, so whitespace-only input emits an empty
relation. That PR-introduced behaviour had lost its emission assertion when the
whitespace test was reworded; add a focused test pinning it.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-authored-by: alistair3149 <alistair31494322@gmail.com>1 parent 52c4198 commit 900f6d6
19 files changed
Lines changed: 779 additions & 320 deletions
File tree
- i18n
- resources/ext.neowiki
- src
- application
- components
- SchemaEditor/Property
- SchemasPage
- SubjectCreator
- common
- persistence
- stores
- tests
- components
- SchemaEditor/Property
- SubjectCreator
- common
- stores
- src/Persistence/MediaWiki
- tests/phpunit/Persistence/MediaWiki
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
302 | 302 | | |
303 | 303 | | |
304 | 304 | | |
| 305 | + | |
305 | 306 | | |
306 | 307 | | |
307 | 308 | | |
| |||
412 | 413 | | |
413 | 414 | | |
414 | 415 | | |
415 | | - | |
| 416 | + | |
416 | 417 | | |
417 | 418 | | |
418 | 419 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
103 | 103 | | |
104 | 104 | | |
105 | 105 | | |
106 | | - | |
| 106 | + | |
107 | 107 | | |
108 | 108 | | |
109 | 109 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
52 | 52 | | |
53 | 53 | | |
54 | 54 | | |
| 55 | + | |
55 | 56 | | |
56 | 57 | | |
57 | 58 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
3 | 14 | | |
4 | 15 | | |
5 | 16 | | |
6 | 17 | | |
| 18 | + | |
7 | 19 | | |
8 | 20 | | |
9 | 21 | | |
| |||
31 | 43 | | |
32 | 44 | | |
33 | 45 | | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
34 | 59 | | |
35 | 60 | | |
36 | 61 | | |
| |||
Lines changed: 9 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
27 | | - | |
28 | | - | |
| 27 | + | |
| 28 | + | |
29 | 29 | | |
| 30 | + | |
30 | 31 | | |
31 | 32 | | |
32 | 33 | | |
| |||
46 | 47 | | |
47 | 48 | | |
48 | 49 | | |
49 | | - | |
| 50 | + | |
50 | 51 | | |
51 | 52 | | |
52 | 53 | | |
53 | 54 | | |
54 | 55 | | |
55 | 56 | | |
56 | 57 | | |
57 | | - | |
| 58 | + | |
58 | 59 | | |
59 | 60 | | |
60 | 61 | | |
| |||
69 | 70 | | |
70 | 71 | | |
71 | 72 | | |
| 73 | + | |
| 74 | + | |
72 | 75 | | |
73 | | - | |
| 76 | + | |
74 | 77 | | |
75 | 78 | | |
76 | 79 | | |
77 | 80 | | |
78 | 81 | | |
79 | 82 | | |
80 | | - | |
81 | | - | |
82 | | - | |
83 | | - | |
| 83 | + | |
84 | 84 | | |
85 | 85 | | |
86 | 86 | | |
| |||
Lines changed: 1 addition & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
111 | 111 | | |
112 | 112 | | |
113 | 113 | | |
| 114 | + | |
114 | 115 | | |
115 | 116 | | |
116 | 117 | | |
| |||
167 | 168 | | |
168 | 169 | | |
169 | 170 | | |
170 | | - | |
171 | | - | |
172 | | - | |
173 | | - | |
174 | | - | |
175 | | - | |
176 | 171 | | |
177 | 172 | | |
178 | 173 | | |
| |||
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
60 | 60 | | |
61 | 61 | | |
62 | 62 | | |
63 | | - | |
| 63 | + | |
64 | 64 | | |
65 | 65 | | |
66 | 66 | | |
| |||
176 | 176 | | |
177 | 177 | | |
178 | 178 | | |
179 | | - | |
| 179 | + | |
180 | 180 | | |
181 | 181 | | |
182 | 182 | | |
| |||
Lines changed: 0 additions & 94 deletions
This file was deleted.
Lines changed: 105 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
Lines changed: 13 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
4 | 5 | | |
5 | 6 | | |
6 | 7 | | |
| |||
47 | 48 | | |
48 | 49 | | |
49 | 50 | | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
50 | 63 | | |
51 | 64 | | |
52 | 65 | | |
| |||
0 commit comments