Remove console messages and unecessary help messages, and adjusts to new mapping list structure (#160)

This commit is contained in:
weryques 2018-12-13 17:15:30 -02:00
parent 64558dd01c
commit 271b278d1c
8 changed files with 22 additions and 65 deletions

View File

@ -51,7 +51,7 @@
class="is-block"
v-if="Object.keys(exporterSession).length &&
Object.keys(exporterSession.mapping_accept).length &&
exporterSession.mapping_accept.any"
exporterSession.mapping_list.length"
:label="$i18n.get('mapping')">
<b-select
@ -61,10 +61,10 @@
:placeholder="$i18n.get('instruction_select_a_mapper')">
<option :value="''">-</option>
<option
v-for="(mapping, key) in exporterSession.mapping_list"
:value="key"
:key="key">
{{ key.replace(/-/, ' ') }}
v-for="(mapping) in exporterSession.mapping_list"
:value="mapping"
:key="mapping">
{{ mapping.replace(/-/, ' ') }}
</option>
</b-select>
@ -102,6 +102,9 @@
</div>
</div>
</form>
<pre>
{{ exporterSession }}
</pre>
</div>
</template>
@ -174,11 +177,12 @@
formIsValid(){
return (
this.selectedCollection &&
((!this.exporterSession.accept_no_mapping && this.selectedMapping) ||
this.exporterSession.accept_no_mapping) &&
!this.formErrorMessage
);
},
verifyError(response){
console.log(response);
if(response.constructor.name === 'Object' &&
(response.data && response.data.status &&
response.data.status.toString().split('')[0] != 2) || response.error_message) {

View File

@ -14,7 +14,6 @@ import Page from '../pages/lists/taxonomies-page.vue'
import ActivitiesPage from '../pages/lists/activities-page.vue'
import AvailableExportersPage from '../pages/lists/available-exporters-page.vue'
import AvailableImportersPage from '../pages/lists/available-importers-page.vue'
import ExportPage from '../pages/singles/export-page.vue'
// Edition Form Components
import CollectionEditionForm from '../components/edition/collection-edition-form.vue'
@ -82,9 +81,6 @@ const routes = [
{ path: '/importers/:importerSlug/:sessionId', name: 'ImporterCreationForm', component: ImporterEditionForm, meta: { title: i18nGet('title_importer_page'), icon: 'import' } },
{ path: '/importers/:importerType/:sessionId/mapping/:collectionId', name: 'ImporterMappingForm', component: ImporterMappingForm, meta: {title: i18nGet('title_importer_mapping_page'), icon: 'import'} },
{ path: '/exporters/collection/:collectionId', name: 'ExportCollection', component: ExportPage, meta: {title: i18nGet('title_export_collection_page'), icon: 'export'} },
{ path: '/exporters/item/:itemId', name: 'ExportItem', component: ExportPage, meta: {title: i18nGet('title_export_item_page'), icon: 'export'} },
{ path: '/exporters', name: 'ExportersPage', component: AvailableExportersPage, meta: {title: i18nGet('title_exporters_page'), icon: 'export'} },
{ path: '/exporters/:exporterSlug', name: 'ExporterEditionForm', component: ExporterEditionForm, meta: {title: i18nGet('title_exporter_page'), icon: 'export'}},

View File

@ -4,7 +4,6 @@
:bread-crumb-items="[{ path: '', label: $i18n.get('exporters') }]" />
<h3>{{ $i18n.get('label_available_exporters') }}</h3>
<p>{{ $i18n.get('info_available_exporters_helper') }}</p>
<p>{{ $i18n.get('instruction_select_an_exporter_type') }}</p>
<div class="exporter-types-container">
<div

View File

@ -4,7 +4,6 @@
:bread-crumb-items="[{ path: '', label: $i18n.get('importers') }]" />
<h3>{{ $i18n.get('label_available_importers') }}</h3>
<p>{{ $i18n.get('info_available_importers_helper') }}</p>
<p>{{ $i18n.get('instruction_select_an_importer_type') }}</p>
<div class="importer-types-container">
<div

View File

@ -1,42 +0,0 @@
<template>
<div class="columns is-fullheight">
<section class="column is-secondary-content">
<tainacan-collection-subheader :id="collectionId"/>
<router-view
id="export-page-container"
:collection-id="collectionId"
class="page-container page-container-small"/>
</section>
</div>
</template>
<script>
import TainacanCollectionSubheader from '../../components/navigation/tainacan-collection-subheader.vue';
export default {
name: 'ExportPage',
data(){
return {
collectionId: Number,
itemId: Number,
selectedList: []
}
},
components: {
TainacanCollectionSubheader
},
created(){
this.collectionId = parseInt(this.$route.params.collectionId);
this.itemId = parseInt(this.$route.params.itemId);
this.selectedList = [];
this.$eventBusSearch.setCollectionId(this.collectionId);
}
}
</script>
<style scoped>
</style>

View File

@ -468,7 +468,6 @@ return apply_filters( 'tainacan-admin-i18n', [
'info_create_filters' => __( 'Click or Drag and Drop Metadata here for creating a new Filter.', 'tainacan' ),
'info_create_metadata' => __( 'Click or Drag and Drop Metadata Types here for creating a new Metadata.', 'tainacan' ),
'info_choose_your_metadata' => __( 'Choose your metadata.', 'tainacan' ),
'info_available_importers_helper' => __( 'The available importer type will affect the file or link that will provide your data besides deciding wich options are available to the importer.', 'tainacan' ),
'info_target_collection_helper' => __( 'The collection where imported item will be added.', 'tainacan' ),
'info_source_file_upload' => __( 'The file containing the data to be imported.', 'tainacan' ),
'info_metadata_mapping_helper' => __( 'Map each file metadata with the corresponding one in selected collection.', 'tainacan' ),
@ -513,7 +512,6 @@ return apply_filters( 'tainacan-admin-i18n', [
'info_leaving_bulk_edition' => __( 'You are leaving the bulk edition now.', 'tainacan' ),
'info_current_view_mode_metadata_not_allowed' => __( 'Current view mode does not allow displayed metadata selection.', 'tainacan' ),
'info_cant_select_metadata_without_items' => __( 'Can not select displayed metadata without items on list.', 'tainacan' ),
'info_available_exporters_helper' => __( '?', 'tainacan' ),
'info_empty' => __( 'empty', 'tainacan' ),
'info_url_copied' => __( 'URL link copied', 'tainacan' ),
'info_other_item_listing_options' => __('Other items listing options: ', 'tainacan'),

View File

@ -73,10 +73,12 @@ class GutenbergBlock {
array('wp-edit-blocks')
);
register_block_type('tainacan/items-grid', array(
'editor_script' => 'items-grid',
'style' => 'items-grid'
));
if(function_exists('register_block_type')) {
register_block_type( 'tainacan/items-grid', array(
'editor_script' => 'items-grid',
'style' => 'items-grid'
) );
}
}
public function register_tainacan_collections_carousel(){
@ -94,10 +96,12 @@ class GutenbergBlock {
array('wp-edit-blocks')
);
register_block_type('tainacan/collections-carousel', array(
'editor_script' => 'collections-carousel',
'style' => 'collections-carousel'
));
if(function_exists('register_block_type')) {
register_block_type( 'tainacan/collections-carousel', array(
'editor_script' => 'collections-carousel',
'style' => 'collections-carousel'
) );
}
}
public function get_plugin_js_settings(){

View File

@ -28,7 +28,6 @@ export const updateExporterSession = ({commit}, exporterSessionUpdated) => {
return tainacan.patch(`/exporters/session/${exporterSessionUpdated.id}`, exporterSessionUpdated.body)
.then(response => {
console.info(response.data);
commit('setExporterSession');
return response;