Commit ac481e5f authored by Tifenn Guillas's avatar Tifenn Guillas
Browse files

send type of action => DONE

parent e6a4e859
......@@ -14,7 +14,7 @@
</div>
<div *ngIf="searchMeta">
<div *ngIf="getDataset().selectable_row" class="mb-2">
<button [disabled]="noSelectedData() || processWip" (click)="fireAction('csv')"
<button [disabled]="noSelectedData() || processWip" (click)="fireProcess('csv')"
class="btn btn-sm btn-outline-primary">
To CSV
</button>
......
......@@ -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() executeAction: EventEmitter<string> = new EventEmitter();
@Output() executeProcess: EventEmitter<string> = new EventEmitter();
initDatatable() {
this.initSearchMeta.emit();
......@@ -78,7 +78,7 @@ export class DatatableComponent {
return this.selectedData.length < 1;
}
fireAction(typeAction: string): void {
this.executeAction.emit(typeAction);
fireProcess(typeProcess: string): void {
this.executeProcess.emit(typeProcess);
}
}
......@@ -27,7 +27,7 @@
[processWip]="processWip | async"
[processDone]="processDone | async"
[processId]="processId | async"
(executeAction)="executeProcess($event)">
(executeProcess)="executeProcess($event)">
</app-datatable>
</div>
<div class="col-12 col-md-4 pt-2">
......
......@@ -88,7 +88,7 @@ export class ResultComponent implements OnInit {
this.store.dispatch(new searchActions.DeleteSelectedDataAction(data));
}
executeProcess(typeAction: string): void {
this.store.dispatch(new searchActions.ExecuteProcessAction(typeAction));
executeProcess(typeProcess: string): void {
this.store.dispatch(new searchActions.ExecuteProcessAction(typeProcess));
}
}
......@@ -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()))
);
......
......@@ -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);
}
......
Markdown is supported
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