project-booster-vue 9.56.0 → 9.56.2

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.56.0",
3
+ "version": "9.56.2",
4
4
  "private": false,
5
5
  "scripts": {
6
6
  "serve": "vue-cli-service serve",
@@ -40,6 +40,7 @@ export const TemplateSandbox = (args, { argTypes }) => {
40
40
  components: { PbMediaDetail },
41
41
  setup() {
42
42
  const store = useStore();
43
+ store.dispatch('documents/setCurrentProjectId', { currentProjectId: '18f9ed7a-639a-4349-b56d-b07ff05c5a7a' });
43
44
  return { args };
44
45
  },
45
46
  template: `<div style="flex-direction: column;display: flex;place-content: flex-start;align-items: center;min-height: 100vh;width: 100%;">
@@ -296,6 +296,11 @@ export default defineComponent({
296
296
  '@@PB_MEDIA_ID_FILLER@@',
297
297
  this.media.id,
298
298
  );
299
+ } else {
300
+ mediaUrl = this.$store.getters[this.storePrefix + 'getMediaUrl'].replace(
301
+ '@@PB_MEDIA_ID_FILLER@@',
302
+ this.media.id,
303
+ );
299
304
  }
300
305
  return mediaUrl;
301
306
  },
@@ -14,21 +14,19 @@
14
14
  <div class="pb-pedagogy__content-description-line-text" v-html="line.label" />
15
15
  </div>
16
16
  </m-flex>
17
- <form
18
- action="#"
19
- class="pb-pedagogy__form-lead"
20
- v-if="payload.viewModel.showFormLead"
21
- @submit.prevent="saveFormLead(payload.viewModel.showFormLead.nextStep)"
22
- >
17
+ <form action="#" class="pb-pedagogy__form-lead" v-if="payload.viewModel.showFormLead">
23
18
  <input
24
19
  type="email"
25
20
  class="pb-pedagogy__form-lead__input"
26
21
  v-model="emailToSaved"
22
+ required
27
23
  :placeholder="payload.viewModel.showFormLead.inputPlaceholder"
28
24
  />
25
+ <div v-if="error && error.message" class="pb-pedagogy__error">{{ error.message }}</div>
29
26
  <m-button
30
27
  :label="payload.viewModel.showFormLead.buttonLabel"
31
28
  class="pb-pedagogy__form-lead__button mc-button--full"
29
+ @click="saveFormLead(payload.viewModel.showFormLead)"
32
30
  />
33
31
  </form>
34
32
  <m-flex
@@ -107,6 +105,7 @@ export default defineComponent({
107
105
  data: () => ({
108
106
  value: [],
109
107
  emailToSaved: '',
108
+ error: {},
110
109
  }),
111
110
  computed: {
112
111
  ...mapGetters('appointmentQualification', {
@@ -168,10 +167,23 @@ export default defineComponent({
168
167
  });
169
168
  },
170
169
  saveFormLead(action: any) {
171
- this.$emit('step-completed', {
172
- answers: this.emailToSaved,
173
- nextStep: action,
174
- });
170
+ const validation = /^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(this.emailToSaved.trim());
171
+
172
+ if (this.emailToSaved.trim() != '' && validation) {
173
+ this.error = false;
174
+ this.$emit('step-completed', {
175
+ answers: [
176
+ {
177
+ email: this.emailToSaved,
178
+ },
179
+ ],
180
+ nextStep: action.nextStep,
181
+ });
182
+ } else {
183
+ this.error = {
184
+ message: 'Veuillez rentrer un email valide.',
185
+ };
186
+ }
175
187
  },
176
188
  },
177
189
  });
@@ -202,6 +214,13 @@ $responsive-breakpoint: 'm';
202
214
  }
203
215
  }
204
216
 
217
+ &__error {
218
+ @include set-font-scale('04', 'm');
219
+
220
+ color: $color-danger-500;
221
+ margin-bottom: $mu050;
222
+ }
223
+
205
224
  &__content {
206
225
  box-sizing: border-box;
207
226
  padding: $mu100;
@@ -279,9 +279,13 @@ export default defineComponent({
279
279
  if (action?.type === 'MODAL') {
280
280
  this.dialogViewModel = action.dialogViewModel;
281
281
  this.displayDialog = true;
282
+ } else if (action?.type === 'STEP') {
283
+ this.$emit('step-completed', {
284
+ answers: [],
285
+ nextStep: action,
286
+ });
282
287
  }
283
288
  },
284
-
285
289
  handleDialogClose() {
286
290
  this.showSaveProjectItem = false;
287
291
  },