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

View File

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

View File

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

View File

@ -67,7 +67,7 @@
</thead> </thead>
<tbody> <tbody>
<tr <tr
:class="{ 'selected-row': selected[index] }" :class="{ 'selected-row': selected[index], 'highlighted-process': highlightedProcess == bgProcess.ID }"
:key="index" :key="index"
v-for="(bgProcess, index) of processes"> v-for="(bgProcess, index) of processes">
<!-- Checking list --> <!-- Checking list -->
@ -140,7 +140,7 @@
class="icon has-text-success loading-icon"> class="icon has-text-success loading-icon">
<div class="control has-icons-right is-loading is-clearfix" /> <div class="control has-icons-right is-loading is-clearfix" />
</span> </span>
<span <!-- <span
v-if="bgProcess.done <= 0" v-if="bgProcess.done <= 0"
class="icon has-text-gray action-icon" class="icon has-text-gray action-icon"
@click="pauseProcess(index)"> @click="pauseProcess(index)">
@ -151,7 +151,7 @@
class="icon has-text-gray action-icon" class="icon has-text-gray action-icon"
@click="pauseProcess(index)"> @click="pauseProcess(index)">
<i class="mdi mdi-18px mdi-close-circle-outline"/> <i class="mdi mdi-18px mdi-close-circle-outline"/>
</span> </span> -->
<span <span
v-tooltip="{ v-tooltip="{
content: $i18n.get('label_process_completed'), content: $i18n.get('label_process_completed'),
@ -181,7 +181,8 @@
return { return {
selected: [], selected: [],
allOnPageSelected: false, allOnPageSelected: false,
isSelecting: false isSelecting: false,
highlightedProcess: ''
} }
}, },
props: { props: {
@ -303,6 +304,11 @@
}, },
pauseProcess() { pauseProcess() {
} }
},
mounted() {
if (this.$route.query.highlight) {
this.highlightedProcess = this.$route.query.highlight;
}
} }
} }
</script> </script>
@ -332,6 +338,24 @@
top: 0; 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> </style>

View File

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

View File

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

View File

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

View File

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

View File

@ -40,6 +40,7 @@ export default {
@import "../admin/scss/_checkboxes.scss"; @import "../admin/scss/_checkboxes.scss";
@import "../admin/scss/_pagination.scss"; @import "../admin/scss/_pagination.scss";
@import "../admin/scss/_tags.scss"; @import "../admin/scss/_tags.scss";
// @import "../admin/scss/_tabs.scss";
@import "../admin/scss/_selects.scss"; @import "../admin/scss/_selects.scss";
@import "../admin/scss/_dropdown-and-autocomplete.scss"; @import "../admin/scss/_dropdown-and-autocomplete.scss";
@import "../admin/scss/_tooltips.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 { .filters-menu {
// height: auto; // height: auto;
position: absolute !important; position: absolute !important;
@ -153,6 +129,10 @@ export default {
.search-control { .search-control {
@media screen and (min-width: 768px) {
margin-bottom: $page-small-top-padding;
}
.gray-icon, .gray-icon .icon { .gray-icon, .gray-icon .icon {
color: $gray4 !important; color: $gray4 !important;
i::before { i::before {
@ -175,7 +155,7 @@ export default {
#items-list-area { #items-list-area {
width: 100%; width: 100%;
overflow-y: unset; overflow-y: hidden;
margin-left: 0; margin-left: 0;
&.spaced-to-right { &.spaced-to-right {
margin-left: $filter-menu-width-theme; margin-left: $filter-menu-width-theme;

View File

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