diff --git a/src/views/project/Project_detail.vue b/src/views/project/Project_detail.vue index f702da8c5137f7bc55f5a43b458f68a22c13e7da..178bbbeada3fde591927aa495cf82055fb3f8121 100644 --- a/src/views/project/Project_detail.vue +++ b/src/views/project/Project_detail.vue @@ -211,6 +211,15 @@ > <i class="inverted grey copy alternate icon"></i> </router-link> + {{isImporting(type)}} + <div + v-if="isImporting(type)" + class="import-message" + > + <i class="info circle icon" /> + Import en cours + </div> + <div v-else v-frag> <router-link :to="{ name: 'editer-type-signalement', @@ -221,11 +230,7 @@ type.is_editable && permissions && permissions.can_create_feature_type && - isOffline() !== true && - !( - importFeatureTypeData.find(el => el.feature_type_title === type.slug) && - importFeatureTypeData.find(el => el.feature_type_title === type.slug).status === 'pending' - ) + isOffline() !== true " class=" ui @@ -254,10 +259,7 @@ permissions && permissions.can_create_feature_type && isOffline() != true && - !( - importFeatureTypeData.find(el => el.feature_type_title === type.slug) && - importFeatureTypeData.find(el => el.feature_type_title === type.slug).status === 'pending' - ) + !isImporting(type) " class=" ui @@ -274,15 +276,6 @@ > <i class="inverted grey paint brush alternate icon"></i> </router-link> - <div - v-if=" - importFeatureTypeData.find(el => el.feature_type_title === type.slug) && - importFeatureTypeData.find(el => el.feature_type_title === type.slug).status === 'pending' - " - class="import-message" - > - <i class="info circle icon" /> - Import en cours </div> </div> </div> @@ -722,6 +715,13 @@ export default { isOffline() { return navigator.onLine === false; }, + isImporting(type) { + if (this.importFeatureTypeData) { + const singleImportData = this.importFeatureTypeData.find(el => el.feature_type_title === type.slug); + return singleImportData && singleImportData.status === 'pending' + } + return false; + }, checkForOfflineFeature() { let arraysOffline = [];