@@ -2,7 +2,6 @@ import Component from '@glimmer/component';
22import { action } from ' @ember/object' ;
33import { tracked } from ' @glimmer/tracking' ;
44import { on } from ' @ember/modifier' ;
5- import { t } from ' ember-intl' ;
65import { get } from ' @ember/helper' ;
76import type { SchemaField } from ' #src/schemas/section-templates.ts' ;
87import { fn } from ' @ember/helper' ;
@@ -27,6 +26,7 @@ const isTextarea = (field: SchemaField) => field.type === 'textarea';
2726class CurriculumEditSectionItem extends Component <CurriculumEditSectionItemSignature > {
2827 @service declare curriculum: CurriculumService ;
2928 @tracked isOpen = false ;
29+ @tracked firstFieldKey = this .args .fields [0 ]?.key || ' ' ;
3030
3131 @action
3232 toggleOpen() {
@@ -45,16 +45,24 @@ class CurriculumEditSectionItem extends Component<CurriculumEditSectionItemSigna
4545 this .args .onUpdate ();
4646 }
4747
48+ get firstFieldValue() {
49+ const firstFieldKey = this .args .fields [0 ]?.key ;
50+ if (! firstFieldKey || ! this .args .fillInfos ) {
51+ return ' Nouvel élément' ;
52+ }
53+ return this .args .fillInfos [firstFieldKey ]?.substring (0 , 25 ) || ' Sans titre' ;
54+ }
55+
4856 <template >
4957 <div
5058 class =" flex flex-col w-full border border-gray-300 rounded-lg bg-white shadow-sm overflow-hidden"
5159 >
5260 <div
5361 class =" flex flex-row items-center justify-between px-4 py-2 bg-white-50 border-b border-gray-200"
5462 >
55- <span class =" text-sm font-medium text-gray-700" >{{ t
56- " curriculums.edit.field "
57- }} </span >
63+ <span class =" text-sm font-medium text-gray-700" >
64+ {{ this .firstFieldValue }}
65+ </span >
5866
5967 <div class =" flex flex-row items-center gap-2" >
6068
0 commit comments