@@ -20,7 +20,6 @@ import { type ScopedRole } from '../components/authorization/dto';
20
20
import { CalculatedSymbol } from './calculated.decorator' ;
21
21
import { DataObject } from './data-object' ;
22
22
import { DbLabel } from './db-label.decorator' ;
23
- import { getDbClassLabels , getDbPropertyLabels } from './db-label.helpers' ;
24
23
import { ServerException } from './exceptions' ;
25
24
import { type ID , IdField } from './id-field' ;
26
25
import { DateTimeField } from './luxon.graphql' ;
@@ -282,7 +281,14 @@ export class EnhancedResource<T extends ResourceShape<any>> {
282
281
283
282
@Once ( )
284
283
get dbLabels ( ) {
285
- return getDbClassLabels ( this . type ) ;
284
+ const labels = getParentTypes ( this . type ) . flatMap ( ( cls ) => {
285
+ if ( ! isResourceClass ( cls ) ) {
286
+ return [ ] ;
287
+ }
288
+ const declared = DbLabel . getOwn ( cls ) ;
289
+ return declared ? [ ...declared ] : [ cls . name ] ;
290
+ } ) ;
291
+ return [ ...new Set ( [ ...labels , 'BaseNode' ] ) ] ;
286
292
}
287
293
get dbLabel ( ) {
288
294
return this . dbLabels [ 0 ] ;
@@ -291,9 +297,10 @@ export class EnhancedResource<T extends ResourceShape<any>> {
291
297
get dbPropLabels ( ) : {
292
298
readonly [ K in keyof T [ 'prototype' ] & string ] ?: readonly string [ ] ;
293
299
} {
294
- return mapValues . fromList ( this . props , ( prop ) =>
295
- getDbPropertyLabels ( this . type , prop ) ,
296
- ) . asRecord ;
300
+ return mapValues . fromList ( this . props , ( prop ) => {
301
+ const declared = DbLabel . get ( this . type , prop as unknown as string ) ;
302
+ return [ ...new Set ( [ ...( declared ?? [ ] ) , 'Property' ] ) ] ;
303
+ } ) . asRecord ;
297
304
}
298
305
}
299
306
setInspectOnClass ( EnhancedResource , ( res ) => ( { collapsed } ) => {
0 commit comments