project-booster-vue 9.44.6 → 9.44.7
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,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,26 @@ export default defineComponent({
|
|
|
122
105
|
const showMoreTypologies = () => {
|
|
123
106
|
store.dispatch('projects/loadTypologies');
|
|
124
107
|
};
|
|
125
|
-
|
|
108
|
+
|
|
109
|
+
const defineDefaultProjectName = (typologyCode: string, typologyName: string) => {
|
|
110
|
+
if (typologyCode === '/domestic-spaces/59461') {
|
|
111
|
+
name.value = 'Estimation pour ' + typologyName.toLowerCase();
|
|
112
|
+
} else {
|
|
113
|
+
name.value = 'Estimation pour la ' + typologyName.toLowerCase();
|
|
114
|
+
}
|
|
115
|
+
};
|
|
116
|
+
|
|
117
|
+
const handleTyplologyClick = (typologyCode: string, typologyName: string) => {
|
|
126
118
|
setFieldValue('tag-input-' + componentId, currentTypology.value !== typologyCode ? typologyCode : undefined);
|
|
127
119
|
|
|
128
120
|
setTimeout(() => {
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
* @type {Event}
|
|
133
|
-
*/
|
|
134
|
-
emit('project-change', {
|
|
135
|
-
name: name.value,
|
|
136
|
-
typology: typologyCode,
|
|
137
|
-
valid: nameMeta.valid && typologyMeta.valid,
|
|
138
|
-
});
|
|
121
|
+
emitInputEvent(typologyCode);
|
|
122
|
+
defineDefaultProjectName(typologyCode, typologyName);
|
|
123
|
+
currentTypology.value = typologyCode;
|
|
139
124
|
});
|
|
140
125
|
};
|
|
141
|
-
|
|
126
|
+
|
|
127
|
+
const emitInputEvent = async (typologie?: string) => {
|
|
142
128
|
/**
|
|
143
129
|
* Emitted the project props have changed
|
|
144
130
|
* @event project-change
|
|
@@ -146,7 +132,7 @@ export default defineComponent({
|
|
|
146
132
|
*/
|
|
147
133
|
emit('project-change', {
|
|
148
134
|
name: name.value,
|
|
149
|
-
typology: currentTypology.value,
|
|
135
|
+
typology: typologie ? typologie : currentTypology.value,
|
|
150
136
|
valid: nameMeta.valid && typologyMeta.valid,
|
|
151
137
|
});
|
|
152
138
|
};
|
|
@@ -166,6 +152,10 @@ export default defineComponent({
|
|
|
166
152
|
});
|
|
167
153
|
}
|
|
168
154
|
|
|
155
|
+
if (typologies.value.length === 1) {
|
|
156
|
+
handleTyplologyClick(typologies.value[0].code, typologies.value[0].title);
|
|
157
|
+
}
|
|
158
|
+
|
|
169
159
|
return {
|
|
170
160
|
id: componentId,
|
|
171
161
|
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><
|
|
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
|
},
|