diff --git a/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod/AccompanyingPeriodWorkEvaluationDocument.php b/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod/AccompanyingPeriodWorkEvaluationDocument.php index e4a15fccc..faae0f4c3 100644 --- a/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod/AccompanyingPeriodWorkEvaluationDocument.php +++ b/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod/AccompanyingPeriodWorkEvaluationDocument.php @@ -83,12 +83,12 @@ class AccompanyingPeriodWorkEvaluationDocument implements \Chill\MainBundle\Doct private ?DocGeneratorTemplate $template = null; /** - * @ORM\Column(type="text", nullable=true) + * @ORM\Column(type="text", nullable=false, options={"default": ""}) * @Serializer\Groups({"read"}) * @Serializer\Groups({"write"}) * @Serializer\Groups({"accompanying_period_work_evaluation:create"}) */ - private ?string $title = null; + private ?string $title = ''; /** * @ORM\Column(type="date_immutable", nullable=true, options={"default": null}) diff --git a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkEdit/components/FormEvaluation.vue b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkEdit/components/FormEvaluation.vue index 49e53dbc3..dfa739551 100644 --- a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkEdit/components/FormEvaluation.vue +++ b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkEdit/components/FormEvaluation.vue @@ -67,42 +67,36 @@
-
- +
-
- -
{{ d.template.name.fr }}
-
-
-
-

Créé par {{ d.createdBy.text }}
- Le {{ $d(ISOToDatetime(d.createdAt.datetime), 'long') }}

- +
+

Créé par {{ d.createdBy.text }}
+ Le {{ $d(ISOToDatetime(d.createdAt.datetime), 'long') }}

+
+
+ +
@@ -276,12 +270,15 @@ export default { addDocument(storedObject) { let document = { type: 'accompanying_period_work_evaluation_document', - storedObject: storedObject + storedObject: storedObject, + title: 'Nouveau document', }; this.$store.commit('addDocument', {key: this.evaluation.key, document: document}); }, removeDocument(document) { - this.$store.commit('removeDocument', {key: this.evaluation.key, document: document}); + if (window.confirm("Êtes-vous sûr·e de vouloir supprimer le document qui a pour titre \"" + document.title +"\" ?")) { + this.$store.commit('removeDocument', {key: this.evaluation.key, document: document}); + } } }, } diff --git a/src/Bundle/ChillPersonBundle/migrations/Version20220224145951.php b/src/Bundle/ChillPersonBundle/migrations/Version20220224145951.php index e71174eea..75712f458 100644 --- a/src/Bundle/ChillPersonBundle/migrations/Version20220224145951.php +++ b/src/Bundle/ChillPersonBundle/migrations/Version20220224145951.php @@ -31,6 +31,8 @@ final class Version20220224145951 extends AbstractMigration public function up(Schema $schema): void { - $this->addSql('ALTER TABLE chill_person_accompanying_period_work_evaluation_document ADD title TEXT DEFAULT NULL'); + $this->addSql('ALTER TABLE chill_person_accompanying_period_work_evaluation_document ADD title TEXT NOT NULL DEFAULT \'\''); + $this->addSql('UPDATE chill_person_accompanying_period_work_evaluation_document SET title=name->>\'fr\' + FROM chill_docgen_template cdt WHERE cdt.id = chill_person_accompanying_period_work_evaluation_document.template_id'); } }