Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
anis
anis-client
Commits
ac481e5f
Commit
ac481e5f
authored
Oct 01, 2019
by
Tifenn Guillas
Browse files
send type of action => DONE
parent
e6a4e859
Changes
6
Hide whitespace changes
Inline
Side-by-side
src/app/search/components/result/datatable.component.html
View file @
ac481e5f
...
...
@@ -14,7 +14,7 @@
</div>
<div
*ngIf=
"searchMeta"
>
<div
*ngIf=
"getDataset().selectable_row"
class=
"mb-2"
>
<button
[disabled]=
"noSelectedData() || processWip"
(click)=
"fire
Action
('csv')"
<button
[disabled]=
"noSelectedData() || processWip"
(click)=
"fire
Process
('csv')"
class=
"btn btn-sm btn-outline-primary"
>
To CSV
</button>
...
...
src/app/search/components/result/datatable.component.ts
View file @
ac481e5f
...
...
@@ -24,7 +24,7 @@ export class DatatableComponent {
@
Output
()
getSearchData
:
EventEmitter
<
number
>
=
new
EventEmitter
();
@
Output
()
addSelectedData
:
EventEmitter
<
any
>
=
new
EventEmitter
();
@
Output
()
deleteSelectedData
:
EventEmitter
<
any
>
=
new
EventEmitter
();
@
Output
()
execute
Action
:
EventEmitter
<
string
>
=
new
EventEmitter
();
@
Output
()
execute
Process
:
EventEmitter
<
string
>
=
new
EventEmitter
();
initDatatable
()
{
this
.
initSearchMeta
.
emit
();
...
...
@@ -78,7 +78,7 @@ export class DatatableComponent {
return
this
.
selectedData
.
length
<
1
;
}
fire
Action
(
typeAction
:
string
):
void
{
this
.
execute
Action
.
emit
(
type
Action
);
fire
Process
(
typeProcess
:
string
):
void
{
this
.
execute
Process
.
emit
(
type
Process
);
}
}
src/app/search/containers/result.component.html
View file @
ac481e5f
...
...
@@ -27,7 +27,7 @@
[processWip]=
"processWip | async"
[processDone]=
"processDone | async"
[processId]=
"processId | async"
(execute
Action
)=
"executeProcess($event)"
>
(execute
Process
)=
"executeProcess($event)"
>
</app-datatable>
</div>
<div
class=
"col-12 col-md-4 pt-2"
>
...
...
src/app/search/containers/result.component.ts
View file @
ac481e5f
...
...
@@ -88,7 +88,7 @@ export class ResultComponent implements OnInit {
this
.
store
.
dispatch
(
new
searchActions
.
DeleteSelectedDataAction
(
data
));
}
executeProcess
(
type
Action
:
string
):
void
{
this
.
store
.
dispatch
(
new
searchActions
.
ExecuteProcessAction
(
type
Action
));
executeProcess
(
type
Process
:
string
):
void
{
this
.
store
.
dispatch
(
new
searchActions
.
ExecuteProcessAction
(
type
Process
));
}
}
src/app/search/store/search.effects.ts
View file @
ac481e5f
...
...
@@ -177,13 +177,13 @@ export class SearchEffects {
withLatestFrom
(
this
.
store$
),
switchMap
(([
action
,
state
])
=>
{
const
executeProcessAction
=
action
as
searchActions
.
ExecuteProcessAction
;
let
query
=
state
.
search
.
datasetName
;
query
+
=
'
?a=
'
+
state
.
search
.
outputList
.
join
(
'
;
'
);
const
dname
=
state
.
search
.
datasetName
;
let
query
=
'
?a=
'
+
state
.
search
.
outputList
.
join
(
'
;
'
);
query
+=
'
&c=
'
;
query
+=
state
.
metamodel
.
attribute
.
datasetAttributeList
.
find
(
a
=>
a
.
search_flag
===
'
ID
'
).
id
;
query
+=
'
::in::
'
;
query
+=
state
.
search
.
selectedData
.
join
(
'
|
'
);
return
this
.
searchService
.
executeProcess
(
executeProcessAction
.
payload
,
query
).
pipe
(
return
this
.
searchService
.
executeProcess
(
executeProcessAction
.
payload
,
dname
,
query
).
pipe
(
map
((
res
:
any
)
=>
new
searchActions
.
ExecuteProcessWipAction
(
res
.
message
)),
catchError
(()
=>
of
(
new
searchActions
.
ExecuteProcessFailAction
()))
);
...
...
src/app/search/store/search.service.ts
View file @
ac481e5f
...
...
@@ -19,8 +19,9 @@ export class SearchService {
return
this
.
http
.
get
<
any
[]
>
(
this
.
API_PATH
+
'
/search/
'
+
this
.
instanceName
+
'
/data/
'
+
query
);
}
executeProcess
(
typeAction
:
string
,
query
:
string
)
{
const
url
=
this
.
API_PATH
+
'
/service/
'
+
this
.
instanceName
+
'
/
'
+
query
;
executeProcess
(
typeProcess
:
string
,
dname
:
string
,
query
:
string
)
{
const
url
=
this
.
API_PATH
+
'
/service/
'
+
this
.
instanceName
+
'
/
'
+
dname
+
'
/
'
+
typeProcess
+
query
;
console
.
log
(
url
);
return
this
.
http
.
get
<
any
>
(
url
);
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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