Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
metagrid-go
metagrid-vue
Commits
6fae8b92
Commit
6fae8b92
authored
Oct 22, 2020
by
Tobinsk
Browse files
Merge branch '17-navigtate-after-matching' into 'master'
Resolve "navigtate after matching" Closes
#17
See merge request
!15
parents
13710df5
8d29a536
Changes
5
Hide whitespace changes
Inline
Side-by-side
src/components/MatchForm.vue
View file @
6fae8b92
<
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
,
...
...
src/components/Pagination.vue
View file @
6fae8b92
...
...
@@ -8,7 +8,6 @@
last-text=
"Last"
@
change=
"change"
v-if=
"total > size"
>
</b-pagination>
</
template
>
...
...
src/store/proposal/index.ts
View file @
6fae8b92
...
...
@@ -125,9 +125,9 @@ const proposal: Module<ProposalState, any> = {
throw
err
;
});
commit
(
Mutations
.
FINISH_LOAD
);
commit
(
Mutations
.
LIST
,
proposals
);
// todo: return
t
otal
return
200
;
commit
(
Mutations
.
LIST
,
proposals
.
proposals
);
// todo: return
intT
otal
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
);
},
}
...
...
src/views/Proposal.vue
View file @
6fae8b92
...
...
@@ -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
:
{
...
...
src/views/Search.vue
View file @
6fae8b92
...
...
@@ -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>
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment