File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -71,6 +71,27 @@ function getAttributeNames(type: string, nameLike: string) {
7171 [ type , `%${ nameLike } %` ]
7272 ) ;
7373
74+ // Also include attribute definitions (e.g. 'relation:*' or 'label:*') which are saved as type='label'
75+ if ( type === "relation" || type === "label" ) {
76+ const prefix = `${ type } :` ;
77+ const defNames = sql . getColumn < string > (
78+ /*sql*/ `SELECT DISTINCT name
79+ FROM attributes
80+ WHERE isDeleted = 0
81+ AND type = 'label'
82+ AND name LIKE ?` ,
83+ [ `${ prefix } %${ nameLike } %` ]
84+ ) ;
85+ for ( const dn of defNames ) {
86+ if ( dn . startsWith ( prefix ) ) {
87+ const stripped = dn . substring ( prefix . length ) ;
88+ if ( ! names . includes ( stripped ) ) {
89+ names . push ( stripped ) ;
90+ }
91+ }
92+ }
93+ }
94+
7495 for ( const attr of BUILTIN_ATTRIBUTES ) {
7596 if ( attr . type === type && attr . name . toLowerCase ( ) . includes ( nameLike ) && ! names . includes ( attr . name ) ) {
7697 names . push ( attr . name ) ;
You can’t perform that action at this time.
0 commit comments