project-booster-vue 10.25.13 → 10.26.0

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": "10.25.13",
3
+ "version": "10.26.0",
4
4
  "private": false,
5
5
  "scripts": {
6
6
  "serve": "vue-cli-service serve",
@@ -73,8 +73,6 @@
73
73
  :title="appointmentNotificationTitle"
74
74
  :type="appointmentNotificationType"
75
75
  :text="appointmentNotificationText"
76
- :link-label="appointmentNotificationLinkLabel"
77
- @link-click="handleAppointmentLinkClick"
78
76
  is-big
79
77
  />
80
78
  </m-flex>
@@ -1017,12 +1015,6 @@ export default defineComponent({
1017
1015
  ? 'Date du rendez-vous passée.'
1018
1016
  : 'Si vous le souhaitez vous pourrez annuler le rendez-vous dans le mail qui vous a été envoyé.<br/>N’oubliez pas !';
1019
1017
  },
1020
-
1021
- appointmentNotificationLinkLabel() {
1022
- return this.readOnly || this.appointment.isPast || this.appointment.cancelled
1023
- ? ''
1024
- : 'Ajoutez des plans aux mesures de votre pièce et des photos pour bien préparer le rendez-vous.';
1025
- },
1026
1018
  },
1027
1019
 
1028
1020
  watch: {
@@ -1230,22 +1222,6 @@ export default defineComponent({
1230
1222
  handleDocumentUploaded() {
1231
1223
  this.$store.dispatch('documents/refreshMediaList');
1232
1224
  },
1233
-
1234
- handleAppointmentLinkClick() {
1235
- this.$store.dispatch('sendEventToBus', {
1236
- code: 'appointmentLinkClicked',
1237
- payload: this.project.id,
1238
- });
1239
-
1240
- const pageName = ['KITCHEN_IN_STORE', 'KITCHEN_REMOTE'].includes(this.appointment.appointmentType)
1241
- ? 'cuisine'
1242
- : 'salle-de-bains';
1243
- nextTick(() => {
1244
- (<any>(
1245
- window
1246
- )).location = `/projets/preparation-rendez-vous/${pageName}.html?inhabitantProjectId=${this.project.id}&appointmentId=${this.appointment.appointmentId}&groupId=${this.appointment.groupId}&calendarId=${this.appointment.calendarId}&leadSourceDetail=Project_Space`;
1247
- });
1248
- },
1249
1225
  },
1250
1226
  });
1251
1227
  </script>
@@ -73,8 +73,6 @@
73
73
  :title="appointmentNotificationTitle"
74
74
  :type="appointmentNotificationType"
75
75
  :text="appointmentNotificationText"
76
- :link-label="appointmentNotificationLinkLabel"
77
- @link-click="handleAppointmentLinkClick"
78
76
  is-big
79
77
  />
80
78
  </m-flex>
@@ -1026,12 +1024,6 @@ export default defineComponent({
1026
1024
  ? 'Date du rendez-vous passée.'
1027
1025
  : 'Si vous le souhaitez vous pourrez annuler le rendez-vous dans le mail qui vous a été envoyé.<br/>N’oubliez pas !';
1028
1026
  },
1029
-
1030
- appointmentNotificationLinkLabel() {
1031
- return this.readOnly || this.appointment.isPast || this.appointment.cancelled
1032
- ? ''
1033
- : 'Ajoutez des plans aux mesures de votre pièce et des photos pour bien préparer le rendez-vous.';
1034
- },
1035
1027
  },
1036
1028
 
1037
1029
  watch: {
@@ -1239,18 +1231,6 @@ export default defineComponent({
1239
1231
  handleDocumentUploaded() {
1240
1232
  this.$store.dispatch('documents/refreshMediaList');
1241
1233
  },
1242
-
1243
- handleAppointmentLinkClick() {
1244
- this.$store.dispatch('sendEventToBus', {
1245
- code: 'appointmentLinkClicked',
1246
- payload: this.project.id,
1247
- });
1248
- nextTick(() => {
1249
- (<any>(
1250
- window
1251
- )).location = `/projets/preparation-rendez-vous/cuisine.html?inhabitantProjectId=${this.project.id}&appointmentId=${this.appointment.appointmentId}&groupId=${this.appointment.groupId}&calendarId=${this.appointment.calendarId}&leadSourceDetail=Project_Space`;
1252
- });
1253
- },
1254
1234
  },
1255
1235
  });
1256
1236
  </script>
@@ -105,6 +105,100 @@ export const summary = {
105
105
  ],
106
106
  };
107
107
 
108
+ export const ROISummary = {
109
+ subprojectTemplateId: 'c353f7f8-d405-4000-86a0-63e5053a769e',
110
+ subprojectTemplateLabel: 'Panneaux photovoltaïques',
111
+ businessUnit: 'LMFR',
112
+ summaryDate: '2024-006T20:21:17.313023151Z',
113
+ cost: {
114
+ min: 10734,
115
+ max: 10734,
116
+ currency: 'EURO',
117
+ },
118
+ components: [
119
+ {
120
+ componentId: 'FURNISHING',
121
+ title: 'Panneaux photovoltaïques (hors aides)',
122
+ details:
123
+ "Le prix est estimatif et non contractuel : il est susceptible d'etre revu à la hausse ou à la baisse et sera confirmé par le relevé technique.",
124
+ cost: {
125
+ min: 11800,
126
+ max: 11800,
127
+ currency: 'EURO',
128
+ },
129
+ lines: [
130
+ {
131
+ text: "10 panneaux photovoltaïques + installation (sous réserve d'éligibilité à la TVA réduite)",
132
+ cost: {
133
+ min: 11800,
134
+ max: 11800,
135
+ currency: 'EURO',
136
+ },
137
+ },
138
+ ],
139
+ },
140
+ {
141
+ componentId: 'AID',
142
+ title: 'Aides estimées (Leroy Merlin)',
143
+ cost: {
144
+ min: -1066,
145
+ max: -1066,
146
+ currency: 'EURO',
147
+ },
148
+ lines: [
149
+ {
150
+ text: "Prime à l'autoconsommation",
151
+ cost: {
152
+ min: -1066,
153
+ max: -1066,
154
+ currency: 'EURO',
155
+ },
156
+ },
157
+ ],
158
+ },
159
+ {
160
+ componentId: 'ROI',
161
+ title: 'Votre installation serait rentabilisée en 10 ans',
162
+ cost: {
163
+ min: 0,
164
+ max: 0,
165
+ currency: 'EURO',
166
+ },
167
+ lines: [
168
+ {
169
+ text: '1125 € de gain annuel (basé sur 0,25 € par kWh)',
170
+ },
171
+ {
172
+ text: "28125 € de gain sur 25 ans (sur base du prix du Kwh d'électricité en 2024)",
173
+ },
174
+ {
175
+ text: '4500 kWh de Production moyenne annuelle',
176
+ },
177
+ {
178
+ text: '19 m² de surface utilisée',
179
+ },
180
+ ],
181
+ },
182
+ ],
183
+ subprojectAttributes: {
184
+ age: 'NEW',
185
+ housingType: 'HOUSE',
186
+ income: 'MIDDLE',
187
+ inhabitantsCount: 1,
188
+ location: '20137',
189
+ situation: 'OWNER',
190
+ surfaceAreaInSquareMeters: 40,
191
+ },
192
+ suggestedTypologies: [
193
+ {
194
+ domesticSpaceLabel: 'Tout le logement',
195
+ domesticSpaceHref: '/domestic-spaces/59461',
196
+ projectKindHref: '/project-kinds/34048',
197
+ projectTypeHref: '/project-types/61855',
198
+ },
199
+ ],
200
+ };
201
+
108
202
  # 🦠 `MPbRestitutionList` - Component
109
203
 
110
204
  The `MPbRestitutionList` component allows to display the summary of an estimate.
@@ -149,3 +243,42 @@ export const TemplateSandbox = (args, { argTypes }) => ({
149
243
  {TemplateSandbox.bind({})}
150
244
  </Story>
151
245
  </Canvas>
246
+
247
+ export const TemplateSandbox2 = (args, { argTypes }) => ({
248
+ props: Object.keys(argTypes),
249
+ components: { MPbRestitutionList },
250
+ setup() {
251
+ const store = useStore();
252
+ store.dispatch('projects/loadProjects');
253
+ store.dispatch('estimates/setSummary', ROISummary);
254
+ store.dispatch('projects/loadTypologies');
255
+ store.dispatch('estimates/initSessions', {
256
+ formId: 'FORM_ID',
257
+ correlationId: 'CORRELATION_ID',
258
+ estimatorId: 'ESTIMATOR_ID',
259
+ businessUnit: 'BU',
260
+ subprojectFormStructure: {},
261
+ source: 'SOURCE',
262
+ sourceDetail: 'SOURCE_DETAIL',
263
+ });
264
+ return { args };
265
+ },
266
+ template: `<m-pb-restitution-list :payload="args.payload" :answers="args.answers" :show-save-estimate="args.showSaveEstimate" :runtime-options="args.runtimeOptions" :show-back-button="args.showBackButton" />`,
267
+ });
268
+
269
+ <Canvas>
270
+ <Story
271
+ name="Features/ROI"
272
+ args={{ payload: DEFAULT_PAYLOAD, runtimeOptions: { isLoggedIn: true, projectMode: true } }}
273
+ parameters={{
274
+ msw: [
275
+ rest.get('/api/inhabitant-projects', getProjectsResolver),
276
+ rest.post('/api/estimates', successResolver),
277
+ rest.post('/api/inhabitant-projects', successResolver),
278
+ ],
279
+ storyshots: { disable: true },
280
+ }}
281
+ >
282
+ {TemplateSandbox2.bind({})}
283
+ </Story>
284
+ </Canvas>
@@ -3,7 +3,7 @@
3
3
  <template #beforeLabel>
4
4
  <div class="pb-restitution-list-line" :class="{ green: line.componentId == 'AID' }">
5
5
  <div class="pb-restitution-list-line__title" v-html="line.title"></div>
6
- <div class="pb-restitution-list-line__range">
6
+ <div v-if="line.componentId !== 'ROI'" class="pb-restitution-list-line__range">
7
7
  <span v-if="line?.cost?.min === line?.cost?.max">{{ formattedPriceRange(line?.cost?.min) }}</span>
8
8
  <span v-else>{{ formattedPriceRange(line?.cost?.min) }} et {{ formattedPriceRange(line?.cost?.max) }}</span>
9
9
  </div>
@@ -17,25 +17,22 @@
17
17
  </template>
18
18
  </m-notification>
19
19
 
20
- <div
21
- v-for="detail in line.lines"
22
- :key="detail.text"
23
- class="pb-restitution-list-line__row"
24
- :class="{ ' pb-restitution-list-line__row--reduce': detail.cost.reduce }"
25
- >
20
+ <div v-for="detail in line.lines" :key="detail.text" class="pb-restitution-list-line__row">
26
21
  <ul>
27
22
  <div>
28
23
  <li>
29
24
  <div v-html="detail.text"></div>
30
25
 
31
- <m-flex v-if="detail.cost.min != detail.cost.max" align-items="center" justify-content="flex-end">
32
- <span v-html="formattedPriceRange(detail.cost.min)"></span>
33
- <span>&nbsp;et&nbsp;</span>
34
- <span v-html="formattedPriceRange(detail.cost.max)"></span>
35
- </m-flex>
36
- <m-flex v-else align-items="center" justify-content="flex-end">
37
- <span v-html="formattedPriceRange(detail.cost.min)"></span>
38
- </m-flex>
26
+ <div v-if="line.componentId !== 'ROI'">
27
+ <m-flex v-if="detail.cost.min != detail.cost.max" align-items="center" justify-content="flex-end">
28
+ <span v-html="formattedPriceRange(detail.cost.min)"></span>
29
+ <span>&nbsp;et&nbsp;</span>
30
+ <span v-html="formattedPriceRange(detail.cost.max)"></span>
31
+ </m-flex>
32
+ <m-flex v-else align-items="center" justify-content="flex-end">
33
+ <span v-html="formattedPriceRange(detail.cost.min)"></span>
34
+ </m-flex>
35
+ </div>
39
36
  </li>
40
37
  </div>
41
38
  </ul>
@@ -97,10 +94,10 @@ $responsive-breakpoint: 'm';
97
94
  display: flex;
98
95
 
99
96
  div {
100
- width: 50%;
97
+ width: 100%;
101
98
  color: $color-grey-600;
102
99
 
103
- &:last-child {
100
+ span {
104
101
  @include set-font-face('semi-bold');
105
102
  }
106
103
  }