Skip to content

Commit 36679c4

Browse files
committed
feat(front): add name placeholder field
1 parent 8121e5d commit 36679c4

2 files changed

Lines changed: 13 additions & 5 deletions

File tree

@apps/backend/src/seeders/models/personal-informations.schema.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
{
22
"title": "Informations personnelles",
33
"properties": [
4-
{ "key": "profilePicture", "label": "Photo de profil", "type": "file" },
54
{ "key": "firstName", "label": "Prénom", "type": "text" },
65
{ "key": "lastName", "label": "Nom", "type": "text" },
6+
{ "key": "profilePicture", "label": "Photo de profil", "type": "file" },
77
{ "key": "email", "label": "Email", "type": "email" },
88
{ "key": "phone", "label": "Téléphone", "type": "tel" },
99
{ "key": "address", "label": "Adresse", "type": "textarea" }

@libs/users-front/src/components/curriculums/edit/curriculum-edit-section-item.gts

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import Component from '@glimmer/component';
22
import { action } from '@ember/object';
33
import { tracked } from '@glimmer/tracking';
44
import { on } from '@ember/modifier';
5-
import { t } from 'ember-intl';
65
import { get } from '@ember/helper';
76
import type { SchemaField } from '#src/schemas/section-templates.ts';
87
import { fn } from '@ember/helper';
@@ -27,6 +26,7 @@ const isTextarea = (field: SchemaField) => field.type === 'textarea';
2726
class 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

Comments
 (0)