Merge branch 'develop' of https://github.com/tainacan/tainacan into develop

This commit is contained in:
vnmedeiros 2019-09-19 13:54:37 -03:00
commit a4378378e9
2 changed files with 52 additions and 40 deletions

View File

@ -42,47 +42,58 @@
<div
v-if="importerSourceInfo != undefined &&
importerSourceInfo != null">
<p class="mapping-header-label is-inline">{{ $i18n.get('label_from_source_collection') }}</p>
<p class="mapping-header-label is-pulled-right">{{ $i18n.get('label_to_target_collection') }}</p>
<div
v-if="importerSourceInfo.source_metadata.length > 0"
class="source-metadatum"
v-for="(source_metadatum, index) of importerSourceInfo.source_metadata"
:key="index"><p>{{ source_metadatum }}</p>
<b-select
v-if="collectionMetadata != undefined &&
collectionMetadata.length > 0 &&
!isFetchingCollectionMetadata"
:value="checkCurrentSelectedCollectionMetadatum(source_metadatum)"
@input="onSelectCollectionMetadata($event, source_metadatum)"
:placeholder="$i18n.get('label_select_metadatum')">
<option :value="undefined">
{{ $i18n.get('label_select_metadatum') }}
</option>
<option :value="'create_metadata' + index">
{{ $i18n.get('label_create_metadatum') }}
</option>
<option
v-for="(metadatum, index) of collectionMetadata"
:key="index"
:value="metadatum.id"
:disabled="checkIfMetadatumIsAvailable(metadatum.id)">
<span class="metadatum-name">
{{ metadatum.name }}
</span>
<span class="label-details">
({{ $i18n.get(metadatum.metadata_type_object.component) }}) <em>{{ (metadatum.collection_id != collectionId) ? $i18n.get('label_inherited') : '' }}</em>
</span>
</option>
</b-select>
<p v-if="collectionMetadata == undefined || collectionMetadata.length <= 0">{{ $i18n.get('info_select_collection_to_list_metadata') }}</p>
</div>
<div v-if="importerSourceInfo.source_metadata.length <= 0">
<template v-if="importerSourceInfo.source_metadata.length > 0">
<p class="mapping-header-label is-inline">{{ $i18n.get('label_from_source_collection') }}</p>
<p class="mapping-header-label is-pulled-right">{{ $i18n.get('label_to_target_collection') }}</p>
<div
class="source-metadatum"
v-for="(source_metadatum, index) of importerSourceInfo.source_metadata"
:key="index">
<p>{{ source_metadatum }}</p>
<b-select
v-if="collectionMetadata != undefined &&
collectionMetadata.length > 0 &&
!isFetchingCollectionMetadata"
:value="checkCurrentSelectedCollectionMetadatum(source_metadatum)"
@input="onSelectCollectionMetadata($event, source_metadatum)"
:placeholder="$i18n.get('label_select_metadatum')">
<option :value="undefined">
{{ $i18n.get('label_select_metadatum') }}
</option>
<option :value="'create_metadata' + index">
{{ $i18n.get('label_create_metadatum') }}
</option>
<option
v-for="(metadatum, index) of collectionMetadata"
:key="index"
:value="metadatum.id"
:disabled="checkIfMetadatumIsAvailable(metadatum.id)">
<span class="metadatum-name">
{{ metadatum.name }}
</span>
<span class="label-details">
({{ $i18n.get(metadatum.metadata_type_object.component) }}) <em>{{ (metadatum.collection_id != collectionId) ? $i18n.get('label_inherited') : '' }}</em>
</span>
</option>
</b-select>
<p v-if="collectionMetadata == undefined || collectionMetadata.length <= 0">{{ $i18n.get('info_select_collection_to_list_metadata') }}</p>
</div>
</template>
<template v-if="importerSourceInfo.source_metadata.length <= 0 && !isLoading">
<br>
<p>{{ $i18n.get('info_no_metadata_source_file') }}</p>
<p>{{ $i18n.get('info_special_fields_available') }}</p>
</div>
<p v-if="importerSourceInfo.source_special_fields && importerSourceInfo.source_special_fields.length > 0">
{{ $i18n.get('info_special_fields_available') }}
<ul style="list-style: disc; margin-left: 1rem; font-style: italic;">
<li
:key="specialFieldIndex"
v-for="(specialField, specialFieldIndex) of importerSourceInfo.source_special_fields">
{{ specialField }}
</li>
</ul>
</p>
<p v-else>{{ $i18n.get('info_no_special_fields_available') }}</p>
</template>
<b-modal
@close="onMetadatumEditionCanceled()"
:active.sync="isNewMetadatumModalActive">

View File

@ -596,7 +596,8 @@ return apply_filters( 'tainacan-admin-i18n', [
'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_no_metadata_source_file' => __( 'No metadata was found from the source file.', 'tainacan' ),
'info_special_fields_available' => __( 'Some metadata may be set by special fields such as id, status, attachments, etc...', 'tainacan' ),
'info_no_special_fields_available' => __( 'No special field was found.', 'tainacan' ),
'info_special_fields_available' => __( 'The following special fields were found:', 'tainacan' ),
'info_metadata_mapping_helper' => __( 'Map each file metadata with the corresponding one in selected collection.', 'tainacan' ),
'info_upload_a_source_to_see_metadata' => __( 'Upload a source file to load metadata.', 'tainacan' ),
'info_select_collection_to_list_metadata' => __( 'Select a target collection to list metadata.', 'tainacan' ),