project-booster-vue 8.96.3 → 8.96.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,6 +1,6 @@
1
1
  {
2
2
  "name": "project-booster-vue",
3
- "version": "8.96.3",
3
+ "version": "8.96.7",
4
4
  "private": false,
5
5
  "scripts": {
6
6
  "test:unit": "vue-cli-service test:unit --forceExit --detectOpenHandles",
@@ -123,7 +123,7 @@ $responsive-breakpoint: 'm';
123
123
  box-sizing: border-box;
124
124
  height: 100%;
125
125
  padding: $mu050;
126
-
126
+ width: 100%;
127
127
  @include set-from-screen($responsive-breakpoint) {
128
128
  padding: $mu100;
129
129
  }
@@ -22,6 +22,7 @@ function ConfigurationsSectionStoreOptions(emptyConfigurationList = false) {
22
22
  configurationsPerPageCount: 3,
23
23
  currentConfigurationsPage: 0,
24
24
  hasStillConfigurations: true,
25
+ _hasConfigurations: true,
25
26
  },
26
27
 
27
28
  getters: {
@@ -48,6 +49,10 @@ function ConfigurationsSectionStoreOptions(emptyConfigurationList = false) {
48
49
  hasStillConfigurations(state) {
49
50
  return state.hasStillConfigurations;
50
51
  },
52
+
53
+ _getHasConfigurations(state) {
54
+ return state._hasConfigurations;
55
+ },
51
56
  },
52
57
 
53
58
  mutations: {
@@ -78,6 +83,10 @@ function ConfigurationsSectionStoreOptions(emptyConfigurationList = false) {
78
83
  setHasStillConfigurations(state, hasStillConfigurations) {
79
84
  state.hasStillConfigurations = hasStillConfigurations;
80
85
  },
86
+
87
+ _setHasConfigurations(state, _hasConfigurations) {
88
+ state._hasConfigurations = _hasConfigurations;
89
+ },
81
90
  },
82
91
 
83
92
  actions: {
@@ -89,21 +98,23 @@ function ConfigurationsSectionStoreOptions(emptyConfigurationList = false) {
89
98
  commit('setIsLoadingConfigurations', false);
90
99
  commit('setHasStillConfigurations', false);
91
100
 
92
- setTimeout(() => {
93
- commit(
94
- 'addConfigurations',
95
- configurationsList.slice(
96
- state.currentConfigurationsPage,
97
- state.currentConfigurationsPage + state.configurationsPerPageCount,
98
- ),
99
- );
100
- if (state.currentConfigurationsPage + state.configurationsPerPageCount - 1 >= configurationsList.length) {
101
- commit('setHasStillConfigurations', false);
102
- } else {
103
- commit('setHasStillConfigurations', true);
104
- }
105
- commit('setCurrentConfigurationsPage', state.currentConfigurationsPage + state.configurationsPerPageCount);
106
- }, 100);
101
+ if (state._hasConfigurations) {
102
+ setTimeout(() => {
103
+ commit(
104
+ 'addConfigurations',
105
+ configurationsList.slice(
106
+ state.currentConfigurationsPage,
107
+ state.currentConfigurationsPage + state.configurationsPerPageCount,
108
+ ),
109
+ );
110
+ if (state.currentConfigurationsPage + state.configurationsPerPageCount - 1 >= configurationsList.length) {
111
+ commit('setHasStillConfigurations', false);
112
+ } else {
113
+ commit('setHasStillConfigurations', true);
114
+ }
115
+ commit('setCurrentConfigurationsPage', state.currentConfigurationsPage + state.configurationsPerPageCount);
116
+ }, 100);
117
+ }
107
118
  },
108
119
 
109
120
  loadConfigurations({ commit, dispatch }) {
@@ -223,25 +223,21 @@
223
223
  <span>{{ dialog.headerTitle }}</span>
224
224
  </template>
225
225
  <template #body>
226
- <m-flexy class="pb-question__dialog-body">
227
- <m-flexy-col width-from-m="2of3" width="full">
228
- <div :style="`background-image: url(${dialog.imageUrl});`" class="pb-question__dialog-body-image" />
229
- </m-flexy-col>
230
- <m-flexy-col width-from-m="1of3" width="full">
231
- <m-flex direction="column" class="pb-question__dialog-body-description">
232
- <div class="pb-question__dialog-body-title">{{ dialog.title }}</div>
233
- <div class="pb-question__dialog-body-text" v-html="dialog.text" />
234
- <m-link
235
- v-if="dialog.link"
236
- :label="dialog.link.label"
237
- :theme="dialog.link.theme"
238
- :href="dialog.link.href"
239
- width-from-m="fit"
240
- width="full"
241
- />
242
- </m-flex>
243
- </m-flexy-col>
244
- </m-flexy>
226
+ <div class="pb-question__dialog-body">
227
+ <div :style="`background-image: url(${dialog.imageUrl});`" class="pb-question__dialog-body-image" />
228
+ <m-flex direction="column" class="pb-question__dialog-body-description">
229
+ <div class="pb-question__dialog-body-title">{{ dialog.title }}</div>
230
+ <div class="pb-question__dialog-body-text" v-html="dialog.text" />
231
+ <m-link
232
+ v-if="dialog.link"
233
+ :label="dialog.link.label"
234
+ :theme="dialog.link.theme"
235
+ :href="dialog.link.href"
236
+ width-from-m="fit"
237
+ width="full"
238
+ />
239
+ </m-flex>
240
+ </div>
245
241
  </template>
246
242
  <template #footer>
247
243
  <m-flex class="pb-question__dialog-footer" justify-content="center">
@@ -1006,39 +1002,35 @@ $answers-apparition-duration: '0.5s';
1006
1002
  flex-grow: 1;
1007
1003
  }
1008
1004
  &-body {
1009
- align-items: center;
1010
1005
  display: flex;
1011
- flex-flow: column;
1012
1006
  flex-direction: column;
1007
+ flex-wrap: nowrap;
1008
+
1013
1009
  height: 100%;
1014
1010
  padding: $mu150;
1015
1011
  width: 100%;
1016
-
1017
1012
  @include set-from-screen($responsive-breakpoint) {
1018
- flex-flow: row;
1019
1013
  flex-direction: row;
1014
+ flex-wrap: wrap;
1020
1015
  justify-content: center;
1021
- .ml-flexy__col {
1022
- height: 100%;
1023
- }
1024
- }
1025
- :deep(.ml-flexy__col--full) {
1026
- width: 100%;
1027
- }
1028
- :deep(.ml-flexy__col) {
1029
- height: 100%;
1030
1016
  }
1031
1017
  &-description {
1032
- margin-left: 0;
1018
+ margin: $mu150 0 0 0;
1033
1019
  @include set-from-screen($responsive-breakpoint) {
1034
- margin-left: $mu150;
1020
+ flex: 1 1 0;
1021
+ margin: 0 0 0 $mu150;
1035
1022
  }
1036
1023
  }
1037
1024
  &-image {
1025
+ background-position: center;
1038
1026
  background-repeat: no-repeat;
1039
1027
  background-size: contain;
1040
1028
  height: 100%;
1029
+ max-height: 300px;
1041
1030
  width: 100%;
1031
+ @include set-from-screen($responsive-breakpoint) {
1032
+ flex: 2 1 0;
1033
+ }
1042
1034
  }
1043
1035
  &-title {
1044
1036
  @include set-font-scale('06', 'm');
@@ -5,7 +5,7 @@ import DEFAULT_PAYLOAD from './PbUploadDocument-Features-ShowMore.stories.json';
5
5
  import { TemplateSandbox } from '../../scenario/PbScenario.stories.mdx';
6
6
 
7
7
  <Meta
8
- title="Project Booster/Scenario/ 🦠 Questions/ 🦠 PbUploadDocument"
8
+ title="Project Booster/Scenario/ 🦠 Questions/ 🦠 PbUploadDocument/Feature/Show more"
9
9
  component={PbScenario}
10
10
  argTypes={{
11
11
  scenarios: {
@@ -526,7 +526,7 @@ const projectStore = {
526
526
  },
527
527
 
528
528
  actions: {
529
- loadProject({ dispatch, commit, state }) {
529
+ loadProject({ commit, dispatch, state }) {
530
530
  commit('setProject', null);
531
531
  commit('setIsLoadingProject', true);
532
532
  commit('setProjectLoadError', null);
@@ -539,6 +539,7 @@ const projectStore = {
539
539
  commit('_setHasTools', true);
540
540
  commit('_setHasEstimators', true);
541
541
  commit('_setHasConfigurators', true);
542
+ commit('_setHasConfigurations', true);
542
543
 
543
544
  setTimeout(() => {
544
545
  commit('setProject', PROJECT);
@@ -549,7 +550,7 @@ const projectStore = {
549
550
  }, 1000);
550
551
  },
551
552
 
552
- loadProjectNoLoading({ commit, state }) {
553
+ loadProjectNoLoading({ commit, dispatch, state }) {
553
554
  commit('setProject', null);
554
555
  commit('setIsLoadingProject', true);
555
556
  commit('setProjectLoadError', null);
@@ -562,6 +563,7 @@ const projectStore = {
562
563
  commit('_setHasTools', true);
563
564
  commit('_setHasEstimators', true);
564
565
  commit('_setHasConfigurators', true);
566
+ commit('_setHasConfigurations', true);
565
567
 
566
568
  setTimeout(() => {
567
569
  commit('setProject', PROJECT);
@@ -570,7 +572,7 @@ const projectStore = {
570
572
  }, 0);
571
573
  },
572
574
 
573
- loadProjectWithoutTools({ commit }, loadingDuration) {
575
+ loadProjectWithoutTools({ commit, dispatch }, loadingDuration) {
574
576
  commit('setProject', null);
575
577
  commit('setIsLoadingProject', true);
576
578
  commit('setProjectLoadError', null);
@@ -583,6 +585,7 @@ const projectStore = {
583
585
  commit('_setHasTools', false);
584
586
  commit('_setHasEstimators', false);
585
587
  commit('_setHasConfigurators', false);
588
+ commit('_setHasConfigurations', true);
586
589
 
587
590
  setTimeout(() => {
588
591
  commit('setProject', PROJECT);
@@ -591,7 +594,7 @@ const projectStore = {
591
594
  }, loadingDuration);
592
595
  },
593
596
 
594
- loadProjectWithoutEstimators({ commit }, loadingDuration) {
597
+ loadProjectWithoutEstimators({ commit, dispatch }, loadingDuration) {
595
598
  commit('setProject', null);
596
599
  commit('setIsLoadingProject', true);
597
600
  commit('setProjectLoadError', null);
@@ -604,6 +607,7 @@ const projectStore = {
604
607
  commit('_setHasTools', true);
605
608
  commit('_setHasEstimators', false);
606
609
  commit('_setHasConfigurators', true);
610
+ commit('_setHasConfigurations', true);
607
611
 
608
612
  setTimeout(() => {
609
613
  commit('setProject', PROJECT);
@@ -688,7 +692,7 @@ const projectStore = {
688
692
  }, loadingDuration);
689
693
  },
690
694
 
691
- loadProjectWithoutConfigurators({ commit }, loadingDuration) {
695
+ loadProjectWithoutConfigurators({ commit, dispatch }, loadingDuration) {
692
696
  commit('setProject', null);
693
697
  commit('setIsLoadingProject', true);
694
698
  commit('setProjectLoadError', null);
@@ -701,6 +705,29 @@ const projectStore = {
701
705
  commit('_setHasTools', true);
702
706
  commit('_setHasEstimators', false);
703
707
  commit('_setHasConfigurators', false);
708
+ commit('_setHasConfigurations', true);
709
+
710
+ setTimeout(() => {
711
+ commit('setProject', PROJECT);
712
+ commit('setIsLoadingProject', false);
713
+ dispatch('checkAuthStatusForTasks');
714
+ }, loadingDuration);
715
+ },
716
+
717
+ loadProjectWithoutConfigurations({ commit, dispatch }, loadingDuration) {
718
+ commit('setProject', null);
719
+ commit('setIsLoadingProject', true);
720
+ commit('setProjectLoadError', null);
721
+ commit('setIsCreatingProject', false);
722
+ commit('setProjectCreationError', null);
723
+ commit('setIsCreatingEstimate', false);
724
+ commit('setEstimateCreationError', null);
725
+ commit('setIsEstimateCreatedSuccessDisplayed', false);
726
+ commit('setCurrentProjectId', 'default-project');
727
+ commit('_setHasTools', true);
728
+ commit('_setHasEstimators', false);
729
+ commit('_setHasConfigurators', true);
730
+ commit('_setHasConfigurations', false);
704
731
 
705
732
  setTimeout(() => {
706
733
  commit('setProject', PROJECT);
@@ -722,6 +749,7 @@ const projectStore = {
722
749
  commit('_setHasTools', true);
723
750
  commit('_setHasEstimators', false);
724
751
  commit('_setHasConfigurators', false);
752
+ commit('_setHasConfigurations', true);
725
753
 
726
754
  setTimeout(() => {
727
755
  commit('setProject', PROJECT);
@@ -744,6 +772,7 @@ const projectStore = {
744
772
  commit('_setHasTools', true);
745
773
  commit('_setHasEstimators', true);
746
774
  commit('_setHasConfigurators', true);
775
+ commit('_setHasConfigurations', true);
747
776
 
748
777
  setTimeout(() => {
749
778
  commit('setProject', null);
@@ -766,6 +795,7 @@ const projectStore = {
766
795
  commit('_setHasTools', true);
767
796
  commit('_setHasEstimators', true);
768
797
  commit('_setHasConfigurators', true);
798
+ commit('_setHasConfigurations', true);
769
799
 
770
800
  setTimeout(() => {
771
801
  commit('setProject', null);
@@ -774,7 +804,7 @@ const projectStore = {
774
804
  }, loadingDuration);
775
805
  },
776
806
 
777
- retryLoadProject({ commit }, loadingDuration = 2000) {
807
+ retryLoadProject({ commit, dispatch }, loadingDuration = 2000) {
778
808
  commit('setProject', null);
779
809
  commit('setIsLoadingProject', true);
780
810
  commit('setProjectLoadError', null);
@@ -783,6 +813,7 @@ const projectStore = {
783
813
  commit('_setHasTools', true);
784
814
  commit('_setHasEstimators', true);
785
815
  commit('_setHasConfigurators', true);
816
+ commit('_setHasConfigurations', true);
786
817
 
787
818
  setTimeout(() => {
788
819
  commit('setProject', PROJECT);
@@ -803,6 +834,7 @@ const projectStore = {
803
834
  commit('_setHasTools', true);
804
835
  commit('_setHasEstimators', true);
805
836
  commit('_setHasConfigurators', true);
837
+ commit('_setHasConfigurations', true);
806
838
  commit('setProjectToCreate', {
807
839
  name: 'Rénovation de la cuisine',
808
840
  });
@@ -825,6 +857,7 @@ const projectStore = {
825
857
  commit('_setHasTools', true);
826
858
  commit('_setHasEstimators', true);
827
859
  commit('_setHasConfigurators', true);
860
+ commit('_setHasConfigurations', true);
828
861
  commit('setProjectToCreate', {
829
862
  name: 'Rénovation de la cuisine',
830
863
  });
@@ -1259,6 +1292,7 @@ export const showcaseWithNoConfigurations = () => ({
1259
1292
  },
1260
1293
  created() {
1261
1294
  this.$store.dispatch('loadProject', 1000);
1295
+ this.$store.dispatch('loadProjectWithoutConfigurations');
1262
1296
  this.$store.dispatch('loadCategories');
1263
1297
  },
1264
1298
  // eslint-disable-next-line
@@ -1,5 +1,5 @@
1
1
  <template>
2
- <div class="pb-project-hub__container">
2
+ <div class="pb-project-hub__container" ref="pbProjectHubContainer">
3
3
  <m-flex class="pb-project-hub" direction="column" align-items="stretch" full-width>
4
4
  <m-link
5
5
  v-if="showBackButton"
@@ -126,13 +126,15 @@
126
126
  </div>
127
127
  </m-flex>
128
128
  <m-flex
129
- v-show="
130
- (isLoadingConfigurations || configurations.length > 0 || !!configurationsLoadError) &&
131
- !isLoadingTools &&
132
- tools &&
133
- configurators.length !== 0
134
- "
135
129
  class="pb-project-hub__section"
130
+ :class="{
131
+ 'pb-project-hub__section--hidden': !(
132
+ (isLoadingConfigurations || configurations.length > 0 || !!configurationsLoadError) &&
133
+ !isLoadingTools &&
134
+ tools &&
135
+ configurators.length !== 0
136
+ ),
137
+ }"
136
138
  direction="column"
137
139
  full-width
138
140
  >
@@ -283,7 +285,6 @@
283
285
  ></pb-categories-section>
284
286
  </div>
285
287
  </m-flex>
286
-
287
288
  <m-flex class="pb-project-hub__section" direction="column" full-width>
288
289
  <div class="pb-project-hub__section-header">
289
290
  <div class="pb-project-hub__section-title">{{ titlePhotoInspiration }}</div>
@@ -790,6 +791,11 @@ export default {
790
791
  watch: {
791
792
  $route(to, from) {
792
793
  this.updateProject();
794
+ if (from.name === 'ProjectHub') {
795
+ this.$nextTick(() => {
796
+ this.scrollToTop();
797
+ });
798
+ }
793
799
  if (from.name === 'PbProducts') {
794
800
  this.$nextTick(() => {
795
801
  this.scrollToCategoriesSection();
@@ -832,6 +838,7 @@ export default {
832
838
  mounted() {
833
839
  this.updateProject();
834
840
  },
841
+
835
842
  methods: {
836
843
  beforeLeave(el) {
837
844
  const { marginLeft, marginTop, width, height } = window.getComputedStyle(el);
@@ -1028,6 +1035,16 @@ export default {
1028
1035
  return ICONS_PER_TOOL_TYPE[tool.type];
1029
1036
  }
1030
1037
  },
1038
+
1039
+ scrollToTop() {
1040
+ const top = this.$refs.pbProjectHubContainer.$el.offsetTop;
1041
+ window.scroll({
1042
+ top,
1043
+ left: 0,
1044
+ behavior: 'smooth',
1045
+ });
1046
+ },
1047
+
1031
1048
  scrollToCategoriesSection() {
1032
1049
  const top = this.$refs.PbProjectHubCategoriesSection.$el.offsetTop;
1033
1050
  window.scroll({
@@ -1087,6 +1104,10 @@ $appear-duration: 100ms;
1087
1104
  &__section {
1088
1105
  margin-bottom: $mu400;
1089
1106
 
1107
+ &--hidden {
1108
+ display: none !important;
1109
+ }
1110
+
1090
1111
  &-header {
1091
1112
  padding-bottom: $mu150;
1092
1113
  }