project-booster-vue 9.44.6 → 9.44.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "project-booster-vue",
3
- "version": "9.44.6",
3
+ "version": "9.44.8",
4
4
  "private": false,
5
5
  "scripts": {
6
6
  "serve": "vue-cli-service serve",
@@ -1,17 +1,5 @@
1
1
  <template>
2
2
  <m-flex direction="column" class="pb-project-item-save-project-name" full-width>
3
- <m-flex direction="column" class="pb-project-item-save-project-name__input" full-width>
4
- <div class="pb-project-item-save-project-name__title">Nommez votre projet</div>
5
- <m-text-input
6
- :name="`text-input-${id}`"
7
- type="text"
8
- v-model="name"
9
- :valid="nameMeta.touched && nameMeta.valid"
10
- :invalid="nameMeta.touched && nameMeta.invalid"
11
- @input="emitInputEvent"
12
- :error="nameError"
13
- />
14
- </m-flex>
15
3
  <m-flex
16
4
  class="pb-project-item-save-project-name__loading"
17
5
  v-if="isLoadingTypologies && typologies.length === 0"
@@ -33,7 +21,7 @@
33
21
  :label="typology.title"
34
22
  :value="currentTypology === typology.code"
35
23
  tagType="selectable"
36
- @input="handleTyplologyClick(typology.code)"
24
+ @input="handleTyplologyClick(typology.code, typology.title)"
37
25
  class="pb-project-item-save-project-name__typologies-typology"
38
26
  >
39
27
  </m-tag>
@@ -90,12 +78,6 @@ export default defineComponent({
90
78
  const hasStillTypologies = computed(() => store.getters['projects/hasStillTypologies']);
91
79
 
92
80
  const validationSchema = yup.object({
93
- [`text-input-${componentId}`]: yup
94
- .string()
95
- .typeError('Saisir un nom de projet')
96
- .required('Le nom du projet est obligatoire')
97
- .min(0, 'Le nom du projet doit avoir plus de ${min} caractères')
98
- .max(60, 'Le nom du projet doit avoir moins de ${max} caractères'),
99
81
  [`tag-input-${componentId}`]: yup
100
82
  .string()
101
83
  .typeError('Choisir une pièce')
@@ -113,6 +95,7 @@ export default defineComponent({
113
95
  } = useField(`text-input-${componentId}`, undefined, {
114
96
  initialValue: props.defaultName,
115
97
  });
98
+
116
99
  const {
117
100
  value: currentTypology,
118
101
  errorMessage: typologyError,
@@ -122,23 +105,22 @@ export default defineComponent({
122
105
  const showMoreTypologies = () => {
123
106
  store.dispatch('projects/loadTypologies');
124
107
  };
125
- const handleTyplologyClick = (typologyCode: string) => {
108
+
109
+ const defineDefaultProjectName = (typologyName: string) => {
110
+ name.value = 'Estimation ' + typologyName.toLowerCase();
111
+ };
112
+
113
+ const handleTyplologyClick = (typologyCode: string, typologyName: string) => {
126
114
  setFieldValue('tag-input-' + componentId, currentTypology.value !== typologyCode ? typologyCode : undefined);
127
115
 
128
116
  setTimeout(() => {
129
- /**
130
- * Emitted the project props have changed
131
- * @event project-change
132
- * @type {Event}
133
- */
134
- emit('project-change', {
135
- name: name.value,
136
- typology: typologyCode,
137
- valid: nameMeta.valid && typologyMeta.valid,
138
- });
117
+ emitInputEvent(typologyCode);
118
+ defineDefaultProjectName(typologyName);
119
+ currentTypology.value = typologyCode;
139
120
  });
140
121
  };
141
- const emitInputEvent = async () => {
122
+
123
+ const emitInputEvent = async (typologie?: string) => {
142
124
  /**
143
125
  * Emitted the project props have changed
144
126
  * @event project-change
@@ -146,7 +128,7 @@ export default defineComponent({
146
128
  */
147
129
  emit('project-change', {
148
130
  name: name.value,
149
- typology: currentTypology.value,
131
+ typology: typologie ? typologie : currentTypology.value,
150
132
  valid: nameMeta.valid && typologyMeta.valid,
151
133
  });
152
134
  };
@@ -166,6 +148,10 @@ export default defineComponent({
166
148
  });
167
149
  }
168
150
 
151
+ if (typologies.value.length === 1) {
152
+ handleTyplologyClick(typologies.value[0].code, typologies.value[0].title);
153
+ }
154
+
169
155
  return {
170
156
  id: componentId,
171
157
  name,
@@ -382,10 +382,13 @@ $responsive-breakpoint: 'm';
382
382
  .pb-warning-message {
383
383
  &__dialog-help {
384
384
  &__title {
385
+ margin: 0;
385
386
  padding: $mu250 $mu250 0 $mu250;
386
387
 
387
388
  h2 {
388
389
  @include set-font-scale('08', 'm');
390
+ @include set-font-face('semi-bold');
391
+ margin: 0 0 $mu050 0;
389
392
  }
390
393
  }
391
394
 
@@ -394,6 +397,17 @@ $responsive-breakpoint: 'm';
394
397
 
395
398
  p {
396
399
  @include set-font-scale('06', 'm');
400
+ margin: $mu075 0;
401
+ }
402
+
403
+ ul {
404
+ padding-left: $mu200;
405
+
406
+ li {
407
+ list-style: disc;
408
+ margin: $mu075 0;
409
+ @include set-font-scale('06', 'm');
410
+ }
397
411
  }
398
412
 
399
413
  &__image {
@@ -10,7 +10,7 @@
10
10
  "action": {
11
11
  "viewModelDialog": {
12
12
  "headerTitle": "Les précautions avant d’installer une pompe à chaleur en appartement",
13
- "contentHtml": "<p>Avant d'installer un pompe à chaleur air-eau dans un appartement, voici quelques précautions à prendre :</p><p>- informez-vous sur le <strong>système de chauffage</strong> de votre immeuble : est-il collectif ou individuel ?</p><p>- vérifiez si <strong>votre commune autorise l'installation</strong> de groupes extérieurs sur votre balcon ou façade dans le plan local d'urbanisme</p><p>- <strong>informez les voisins</strong> de votre projet, et notamment du bruit que peut générer le groupe extérieur</p>"
13
+ "contentHtml": "<p>Avant d'installer un pompe à chaleur air-eau dans un appartement, voici quelques précautions à prendre :</p><ul> <li>informez-vous sur le <strong>système de chauffage</strong> de votre immeuble : est-il collectif ou individuel ?</li><li>vérifiez si <strong>votre commune autorise l'installation</strong> de groupes extérieurs sur votre balcon ou façade dans le plan local d'urbanisme</li><li><strong>informez les voisins</strong> de votre projet, et notamment du bruit que peut générer le groupe extérieur</li></ul>"
14
14
  }
15
15
  }
16
16
  },