diff --git a/src/store/modules/feature.js b/src/store/modules/feature.js index 7c08380c4cebf1749266601ca7b2825a002f1a8b..1d359d832bd3ebc439eef95ff8b0007d32d9e984 100644 --- a/src/store/modules/feature.js +++ b/src/store/modules/feature.js @@ -139,8 +139,10 @@ const feature = { const features_count = response.data.count; commit("SET_FEATURES_COUNT", features_count); } + return response } catch (error) { console.error(error); + return error } }, GET_PROJECT_FEATURE({ commit, rootState }, { project_slug, feature_id }) { diff --git a/src/views/Catalog.vue b/src/views/Catalog.vue index dc293a0146b89b9783f23273c91668c3ce5c6a1a..82cf434e58b471d7e10e49aa47f73a81722109a3 100644 --- a/src/views/Catalog.vue +++ b/src/views/Catalog.vue @@ -14,8 +14,15 @@ <div v-for="(resource, index) in paginatedRessources" :key="`${resource.resource}-${index}`" - @click="selectResource(resource.dataset)" - class="row" + @click="selectResource(resource)" + :class="[ + 'row', + { + selected: + selectedResource && + resource.resource === selectedResource.resource, + }, + ]" > <div>{{ resource.organisation }}</div> <div>{{ resource.dataset }}</div> @@ -100,182 +107,218 @@ export default { { organisation: "Organisation 1", dataset: "Dataset 1", + layerName: "travaux_ccpro_867f108", resource: "Ressource 1", }, { organisation: "Organisation 2", dataset: "Dataset 2", + layerName: "travaux_ccpro_867f108", resource: "Ressource 2", }, { organisation: "Organisation 3", dataset: "Dataset 3", + layerName: "travaux_ccpro_867f108", resource: "Ressource 3", }, { organisation: "Organisation 4", dataset: "Dataset 4", + layerName: "travaux_ccpro_867f108", resource: "Ressource 4", }, { organisation: "Organisation 1", dataset: "Dataset 1", - resource: "Ressource 1", + layerName: "travaux_ccpro_867f108", + resource: "Ressource 11", }, { organisation: "Organisation 2", dataset: "Dataset 2", - resource: "Ressource 2", + layerName: "travaux_ccpro_867f108", + resource: "Ressource 12", }, { organisation: "Organisation 3", dataset: "Dataset 3", - resource: "Ressource 3", + layerName: "travaux_ccpro_867f108", + resource: "Ressource 13", }, { organisation: "Organisation 4", dataset: "Dataset 4", - resource: "Ressource 4", + layerName: "travaux_ccpro_867f108", + resource: "Ressource 14", }, { organisation: "Organisation 1", dataset: "Dataset 1", - resource: "Ressource 1", + layerName: "travaux_ccpro_867f108", + resource: "Ressource 21", }, { organisation: "Organisation 2", dataset: "Dataset 2", - resource: "Ressource 2", + layerName: "travaux_ccpro_867f108", + resource: "Ressource 22", }, { organisation: "Organisation 3", dataset: "Dataset 3", - resource: "Ressource 3", + layerName: "travaux_ccpro_867f108", + resource: "Ressource 23", }, { organisation: "Organisation 4", dataset: "Dataset 4", - resource: "Ressource 4", + layerName: "travaux_ccpro_867f108", + resource: "Ressource 24", }, { organisation: "Organisation 1", dataset: "Dataset 1", - resource: "Ressource 1", + layerName: "travaux_ccpro_867f108", + resource: "Ressource 31", }, { organisation: "Organisation 2", dataset: "Dataset 2", - resource: "Ressource 2", + layerName: "travaux_ccpro_867f108", + resource: "Ressource 32", }, { organisation: "Organisation 3", dataset: "Dataset 3", - resource: "Ressource 3", + layerName: "travaux_ccpro_867f108", + resource: "Ressource 33", }, { organisation: "Organisation 4", dataset: "Dataset 4", - resource: "Ressource 4", + layerName: "travaux_ccpro_867f108", + resource: "Ressource 34", }, { organisation: "Organisation 1", dataset: "Dataset 1", - resource: "Ressource 1", + layerName: "travaux_ccpro_867f108", + resource: "Ressource 41", }, { organisation: "Organisation 2", dataset: "Dataset 2", - resource: "Ressource 2", + layerName: "travaux_ccpro_867f108", + resource: "Ressource 42", }, { organisation: "Organisation 3", dataset: "Dataset 3", - resource: "Ressource 3", + layerName: "travaux_ccpro_867f108", + resource: "Ressource 43", }, { organisation: "Organisation 4", dataset: "Dataset 4", - resource: "Ressource 4", + layerName: "travaux_ccpro_867f108", + resource: "Ressource 44", }, { organisation: "Organisation 1", dataset: "Dataset 1", - resource: "Ressource 1", + layerName: "travaux_ccpro_867f108", + resource: "Ressource 51", }, { organisation: "Organisation 2", dataset: "Dataset 2", - resource: "Ressource 2", + layerName: "travaux_ccpro_867f108", + resource: "Ressource 52", }, { organisation: "Organisation 3", dataset: "Dataset 3", - resource: "Ressource 3", + layerName: "travaux_ccpro_867f108", + resource: "Ressource 53", }, { organisation: "Organisation 4", dataset: "Dataset 4", - resource: "Ressource 4", + layerName: "travaux_ccpro_867f108", + resource: "Ressource 54", }, { organisation: "Organisation 1", dataset: "Dataset 1", - resource: "Ressource 1", + layerName: "travaux_ccpro_867f108", + resource: "Ressource 61", }, { organisation: "Organisation 2", dataset: "Dataset 2", - resource: "Ressource 2", + layerName: "travaux_ccpro_867f108", + resource: "Ressource 62", }, { organisation: "Organisation 3", dataset: "Dataset 3", - resource: "Ressource 3", + layerName: "travaux_ccpro_867f108", + resource: "Ressource 63", }, { organisation: "Organisation 4", dataset: "Dataset 4", - resource: "Ressource 4", + layerName: "travaux_ccpro_867f108", + resource: "Ressource 64", }, { organisation: "Organisation 1", dataset: "Dataset 1", - resource: "Ressource 1", + layerName: "travaux_ccpro_867f108", + resource: "Ressource 71", }, { organisation: "Organisation 2", dataset: "Dataset 2", - resource: "Ressource 2", + layerName: "travaux_ccpro_867f108", + resource: "Ressource 72", }, { organisation: "Organisation 3", dataset: "Dataset 3", - resource: "Ressource 3", + layerName: "travaux_ccpro_867f108", + resource: "Ressource 73", }, { organisation: "Organisation 4", dataset: "Dataset 4", - resource: "Ressource 4", + layerName: "travaux_ccpro_867f108", + resource: "Ressource 74", }, { organisation: "Organisation 1", dataset: "Dataset 1", - resource: "Ressource 1", + layerName: "travaux_ccpro_867f108", + resource: "Ressource 81", }, { organisation: "Organisation 2", dataset: "Dataset 2", - resource: "Ressource 2", + layerName: "travaux_ccpro_867f108", + resource: "Ressource 82", }, { organisation: "Organisation 3", dataset: "Dataset 3", - resource: "Ressource 3", + layerName: "travaux_ccpro_867f108", + resource: "Ressource 83", }, { organisation: "Organisation 4", dataset: "Dataset 4", - resource: "Ressource 4", + layerName: "travaux_ccpro_867f108", + resource: "Ressource 84", }, ], pagination: { @@ -313,9 +356,8 @@ export default { }, methods: { - selectResource(typename) { - typename = "travaux_ccpro_867f108" // ! mock until plugin deployed - this.selectedResource = typename + selectResource(resource) { + this.selectedResource = resource; }, toPage(pageNumber) { const toAddOrRemove = @@ -355,7 +397,7 @@ export default { launchImport() { const user = "communaute-de-communes-du-pays-reuni-dorange"; - const paramsTest = `user=${user}&TYPENAME=${this.selectedResource}`; + const paramsTest = `user=${user}&TYPENAME=${this.selectedResource.layerName}`; miscAPI.getExternalGeojson(paramsTest).then((data) => { this.geojson = data; console.log(this.geojson); @@ -387,6 +429,14 @@ h1 { .table > .row { display: flex; } +.table > .row:not(:first-of-type).selected { + background-color: #8bddd9; +} +.table > .row:not(:first-of-type):hover { + background-color: #009c95; + color: #ffffff; + cursor: pointer; +} .table > .row:not(:last-child) { border-bottom: 1px solid #cacaca; } @@ -416,7 +466,7 @@ h1 { @media only screen and (max-width: 767px) { .pagination_wrapper { justify-content: center; -} + } } .dataTables_length, diff --git a/src/views/feature_type/Feature_type_detail.vue b/src/views/feature_type/Feature_type_detail.vue index cf4ddc8f768ef7d5d7fa868f163da6c911eec6b5..456cbcda719dfef109006fd3542d9f23a2c5453c 100644 --- a/src/views/feature_type/Feature_type_detail.vue +++ b/src/views/feature_type/Feature_type_detail.vue @@ -459,6 +459,8 @@ export default { limit: '5' }); + console.log("response", response) + if (response){ this.featuresLoading = false; }