Commit 8d29a536 authored by Tobinsk's avatar Tobinsk
Browse files

Navigate to matchingOverview after click on run and fix bug for pagination

parent 13710df5
<template>
<div>
<div class="d-flex justify-content-between mb-4" v-if="!isNew">
<b-overlay :show="loading" spinner-variant="primary" spinner-type="grow">
<div class="d-flex justify-content-between mb-4" v-if="!isNew">
<h3>{{single.name}}</h3>
<b-button size="sm" @click="showConfig = !showConfig"><b-icon icon="gear"></b-icon></b-button>
</div>
......@@ -45,7 +45,7 @@
</FormContainer>
</transition>
</div>
</b-overlay>
</template>
<script>
......@@ -61,6 +61,8 @@
showConfig: false,
// is a new match. Its just possible to edit fields for a new matching
isNew: true,
// save new match flag
loading: false,
}
},
mounted() {
......@@ -82,22 +84,27 @@
* Save
**/
async preSave() {
this.loading = true;
await this.new({
name: this.single.name,
parameters: this.single.parameters,
});
// todo: navigate
// go back to overview
// wait until ES sync
setTimeout(() => {
this.loading = false;
this.$router.push('/matching');
}, 1100)
},
/**
* Run a test match
* todo: pagination!
* Don't use a pagination. This is just to check if we find something
*/
preTest() {
async preTest() {
if(this.single.name === '') {
return
}
// todo: reset pagination
this.test(
await this.test(
{
name: this.single.name,
parameters: this.single.parameters,
......
......@@ -8,7 +8,6 @@
last-text="Last"
@change="change"
v-if="total > size">
</b-pagination>
</template>
......
......@@ -125,9 +125,9 @@ const proposal: Module<ProposalState, any> = {
throw err;
});
commit(Mutations.FINISH_LOAD);
commit(Mutations.LIST, proposals);
// todo: return total
return 200;
commit(Mutations.LIST, proposals.proposals);
// todo: return intTotal
return proposals.meta.total;
},
/**
......@@ -158,7 +158,7 @@ const proposal: Module<ProposalState, any> = {
commit('error/add', metagridError, { root: true });
throw err;
});
commit(Mutations.LIST, proposals);
commit(Mutations.LIST, proposals.proposals);
commit(Mutations.FINISH_LOAD);
},
}
......
......@@ -3,7 +3,7 @@
<div class="container-fluid">
<MatchForm/>
</div>
<div class="container-fluid" v-if="!loading">
<div class="container-fluid" v-show="!loading">
<ProposalList/>
<Pagination :get="list" ref="pagination"></Pagination>
</div>
......@@ -28,7 +28,7 @@
const id = this.$route.params.id;
this.idMutation(id);
this.single(id);
this.$refs.pagination.change();
this.$refs.pagination.change(1);
}
},
methods: {
......
......@@ -3,7 +3,7 @@
<div class="container-fluid">
<SearchForm @search="preSearch"/>
</div>
<div class="container-fluid" v-if="!loading">
<div class="container-fluid" v-show="!loading">
<ResultList/>
<Pagination :get="list" ref="pagination"></Pagination>
</div>
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment