File tree Expand file tree Collapse file tree 3 files changed +28
-1
lines changed Expand file tree Collapse file tree 3 files changed +28
-1
lines changed Original file line number Diff line number Diff line change 22
33# Unreleased
44
5+ * Fixed custom key not displayed in JSON Schema form (\# 529);
56* Added dropdown for Python version in tasks (\# 526);
67* Improved formatting of errors in standard error alert component (\# 526);
78* Used ` postgres-psycopg ` adapter in CI (\# 525);
Original file line number Diff line number Diff line change @@ -242,4 +242,30 @@ describe('Object properties', () => {
242242 expect ( screen . getByRole ( 'textbox' , { name : 'key1' } ) ) . toHaveValue ( 'foo' ) ;
243243 expect ( screen . getByRole ( 'textbox' , { name : 'key2' } ) ) . toHaveValue ( '' ) ;
244244 } ) ;
245+
246+ it ( 'Display object with custom key and title - key prevails over title' , async function ( ) {
247+ const { component } = renderSchema (
248+ {
249+ type : 'object' ,
250+ properties : {
251+ map : {
252+ type : 'object' ,
253+ additionalProperties : {
254+ type : 'object' ,
255+ title : 'PropertyTitle' ,
256+ properties : {
257+ test : {
258+ type : 'string'
259+ }
260+ }
261+ }
262+ }
263+ }
264+ } ,
265+ { map : { k1 : { test : 'foo' } } }
266+ ) ;
267+ expect ( component . getArguments ( ) ) . deep . eq ( { map : { k1 : { test : 'foo' } } } ) ;
268+ expect ( screen . queryByText ( 'PropertyTitle' ) ) . toBeNull ( ) ;
269+ expect ( screen . queryByText ( 'k1' ) ) . not . toBeNull ( ) ;
270+ } ) ;
245271} ) ;
Original file line number Diff line number Diff line change @@ -328,7 +328,7 @@ export class FormManager {
328328 manager : this ,
329329 id : this . getUniqueId ( ) ,
330330 type : property . type || null ,
331- title : property . title || key || '' ,
331+ title : key && removable ? key : property . title || key || '' ,
332332 description : property . description || '' ,
333333 property : deepCopy ( property ) ,
334334 notifyChange : this . notifyChange
You can’t perform that action at this time.
0 commit comments