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

This commit is contained in:
weryques 2018-08-02 16:45:37 -03:00
commit a7c169f8dd
10 changed files with 77 additions and 63 deletions

View File

@ -127,6 +127,7 @@
(importer.accepts.file && importer.accepts.url && !importerFile && !url)"
id="button-submit-collection-creation"
@click.prevent="onFinishImporter()"
:class="{'is-loading': isLoadingRun }"
class="button is-success">{{ $i18n.get('run') }}</button>
</div>
<div
@ -142,7 +143,7 @@
(importer.accepts.file && importer.accepts.url && !importerFile && !url)"
id="button-submit-collection-creation"
@click.prevent="onFinishImporter()"
class="button is-success">{{ $i18n.get('label_metadata_mapping') }}</button>
class="button is-success">{{ $i18n.get('next') }}</button>
</div>
</div>
</form>
@ -162,6 +163,7 @@ export default {
importerId: Number,
importer: null,
isLoading: false,
isLoadingRun: false,
isFetchingCollections: false,
form: {
@ -310,19 +312,23 @@ export default {
});
},
onFinishImporter() {
this.isLoadingRun = true;
this.onUpdateOptions().then(() => {
this.uploadSource()
.then(() => {
if (this.importer.manual_mapping)
if (this.importer.manual_mapping) {
this.goToMappingPage();
else
this.isLoadingRun = false;
} else {
this.onRunImporter();
}
}).catch((errors) => {
this.isLoadingRun = false;
this.$console.log(errors);
});
})
.catch((errors) => {
this.isLoadingRun = false;
this.$console.log(errors);
});
@ -331,9 +337,11 @@ export default {
this.runImporter(this.sessionId)
.then(backgroundProcess => {
this.backgroundProcess = backgroundProcess;
this.$router.push(this.$routerHelper.getProcessesPage());
this.isLoadingRun = false;
this.$router.push(this.$routerHelper.getProcessesPage(backgroundProcess.bg_process_id));
})
.catch((errors) => {
this.isLoadingRun = false;
this.$console.log(errors);
});
},

View File

@ -152,6 +152,7 @@
:disabled="sessionId == undefined || importer == undefined"
id="button-submit-collection-creation"
@click.prevent="onRunImporter"
:class="{'is-loading': isLoadingRun }"
class="button is-success">{{ $i18n.get('run') }}</button>
</div>
</div>
@ -174,6 +175,7 @@ export default {
importerId: Number,
importer: null,
isLoading: false,
isLoadingRun: false,
mappedCollection: {
'id': Number,
'mapping': {},
@ -284,12 +286,14 @@ export default {
return undefined;
},
onRunImporter() {
this.isLoadingRun = true;
this.updateImporterCollection({ sessionId: this.sessionId, collection: this.mappedCollection })
.then(updatedImporter => {
this.importer = updatedImporter;
this.finishRunImporter();
})
.catch((errors) => {
this.isLoadingRun = false;
this.$console.log(errors);
});
@ -298,27 +302,27 @@ export default {
this.runImporter(this.sessionId)
.then(backgroundProcess => {
this.backgroundProcess = backgroundProcess;
this.isLoadingRun = false;
this.$router.push(this.$routerHelper.getProcessesPage());
})
.catch((errors) => {
this.isLoadingRun = false;
this.$console.log(errors);
});
},
onSelectCollectionMetadata(selectedMetadatum, sourceMetadatum) {
if (selectedMetadatum)
this.mappedCollection['mapping'][selectedMetadatum] = sourceMetadatum;
else {
let removedKey = '';
for (let key in this.mappedCollection['mapping']) {
if(this.mappedCollection['mapping'][key] == sourceMetadatum)
removedKey = key;
}
if (removedKey != '')
delete this.mappedCollection['mapping'][removedKey];
let removedKey = '';
for (let key in this.mappedCollection['mapping']) {
if(this.mappedCollection['mapping'][key] == sourceMetadatum)
removedKey = key;
}
if (removedKey != '')
delete this.mappedCollection['mapping'][removedKey];
this.mappedCollection['mapping'][selectedMetadatum] = sourceMetadatum;
// Necessary for causing reactivity to re-check if metadata remains available
this.collectionMetadata.push("");
this.collectionMetadata.pop();

View File

@ -396,10 +396,6 @@ export default {
}
}
img.table-thumb {
border-radius: 50px !important;
}
.total-items-header {
text-align: right;
}

View File

@ -67,7 +67,7 @@
</thead>
<tbody>
<tr
:class="{ 'selected-row': selected[index] }"
:class="{ 'selected-row': selected[index], 'highlighted-process': highlightedProcess == bgProcess.ID }"
:key="index"
v-for="(bgProcess, index) of processes">
<!-- Checking list -->
@ -140,7 +140,7 @@
class="icon has-text-success loading-icon">
<div class="control has-icons-right is-loading is-clearfix" />
</span>
<span
<!-- <span
v-if="bgProcess.done <= 0"
class="icon has-text-gray action-icon"
@click="pauseProcess(index)">
@ -151,7 +151,7 @@
class="icon has-text-gray action-icon"
@click="pauseProcess(index)">
<i class="mdi mdi-18px mdi-close-circle-outline"/>
</span>
</span> -->
<span
v-tooltip="{
content: $i18n.get('label_process_completed'),
@ -181,7 +181,8 @@
return {
selected: [],
allOnPageSelected: false,
isSelecting: false
isSelecting: false,
highlightedProcess: ''
}
},
props: {
@ -303,6 +304,11 @@
},
pauseProcess() {
}
},
mounted() {
if (this.$route.query.highlight) {
this.highlightedProcess = this.$route.query.highlight;
}
}
}
</script>
@ -332,6 +338,24 @@
top: 0;
}
@keyframes highlight {
from {
background-color: $blue1;
}
to {
background-color: $white;
}
}
.highlighted-process {
td, .checkbox-cell .checkbox, .actions-cell .actions-container {
transition: background-color 0.5s;
animation-name: highlight;
animation-duration: 1s;
animation-iteration-count: 2;
}
}
</style>

View File

@ -45,7 +45,7 @@
</span>
<p>{{ bgProcess.name ? bgProcess.name : $i18n.get('label_unamed_process') }}</p>
</div>
<span
<!-- <span
v-if="bgProcess.done <= 0"
class="icon has-text-gray action-icon"
@click="pauseProcess(index)">
@ -56,7 +56,7 @@
class="icon has-text-gray action-icon"
@click="pauseProcess(index)">
<i class="mdi mdi-18px mdi-close-circle-outline"/>
</span>
</span> -->
<span
v-if="bgProcess.done > 0"
class="icon has-text-success">

View File

@ -205,8 +205,11 @@ RouterHelperPlugin.install = function (Vue, options = {}) {
getAvailableImportersPath() {
return '/importers/new';
},
getProcessesPage() {
return '/events?tab=processes';
getProcessesPage(highlightedProcess) {
if (highlightedProcess)
return '/events?tab=processes&highlight=' + highlightedProcess;
else
return '/events?tab=processes';
},
// Singles
getCollectionPath(id) {

View File

@ -1266,11 +1266,6 @@
display: flex;
justify-content: space-between;
flex-wrap: wrap;
@media screen and (min-width: 768px) {
margin-bottom: $page-small-top-padding;
}
}
.search-control-item {

View File

@ -455,7 +455,7 @@
position: absolute;
bottom: 0;
z-index: 999999;
background-color: $turquoise1;
background-color: $gray1;
width: 100%;
height: 65px;

View File

@ -40,6 +40,7 @@ export default {
@import "../admin/scss/_checkboxes.scss";
@import "../admin/scss/_pagination.scss";
@import "../admin/scss/_tags.scss";
// @import "../admin/scss/_tabs.scss";
@import "../admin/scss/_selects.scss";
@import "../admin/scss/_dropdown-and-autocomplete.scss";
@import "../admin/scss/_tooltips.scss";
@ -104,31 +105,6 @@ export default {
}
}
// Tabs
.tabs {
a {
font-size: 13px;
margin-bottom: -3px;
&:hover{
border-bottom-color: transparent;
}
}
li.is-active a {
border-bottom: 5px solid $turquoise3;
color: $turquoise3;
}
}
.select select{
border-radius: 1;
padding: 4px 16px;
color: #1d1d1d;
font-size: 1.0em;
font-weight: normal;
cursor: pointer;
background-color: white;
}
.filters-menu {
// height: auto;
position: absolute !important;
@ -153,6 +129,10 @@ export default {
.search-control {
@media screen and (min-width: 768px) {
margin-bottom: $page-small-top-padding;
}
.gray-icon, .gray-icon .icon {
color: $gray4 !important;
i::before {
@ -175,7 +155,7 @@ export default {
#items-list-area {
width: 100%;
overflow-y: unset;
overflow-y: hidden;
margin-left: 0;
&.spaced-to-right {
margin-left: $filter-menu-width-theme;

View File

@ -120,7 +120,11 @@ export const setTotalItems = ( state, total ) => {
};
export const setSearchQuery = ( state, searchQuery ) => {
state.postquery.search = searchQuery;
if (searchQuery != '')
state.postquery.search = searchQuery;
else
state.postquery.search = undefined;
};
export const setStatus = ( state, status ) => {