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

send type of action => DONE

parent e6a4e859
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
</div> </div>
<div *ngIf="searchMeta"> <div *ngIf="searchMeta">
<div *ngIf="getDataset().selectable_row" class="mb-2"> <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"> class="btn btn-sm btn-outline-primary">
To CSV To CSV
</button> </button>
......
...@@ -24,7 +24,7 @@ export class DatatableComponent { ...@@ -24,7 +24,7 @@ export class DatatableComponent {
@Output() getSearchData: EventEmitter<number> = new EventEmitter(); @Output() getSearchData: EventEmitter<number> = new EventEmitter();
@Output() addSelectedData: EventEmitter<any> = new EventEmitter(); @Output() addSelectedData: EventEmitter<any> = new EventEmitter();
@Output() deleteSelectedData: EventEmitter<any> = new EventEmitter(); @Output() deleteSelectedData: EventEmitter<any> = new EventEmitter();
@Output() executeAction: EventEmitter<string> = new EventEmitter(); @Output() executeProcess: EventEmitter<string> = new EventEmitter();
initDatatable() { initDatatable() {
this.initSearchMeta.emit(); this.initSearchMeta.emit();
...@@ -78,7 +78,7 @@ export class DatatableComponent { ...@@ -78,7 +78,7 @@ export class DatatableComponent {
return this.selectedData.length < 1; return this.selectedData.length < 1;
} }
fireAction(typeAction: string): void { fireProcess(typeProcess: string): void {
this.executeAction.emit(typeAction); this.executeProcess.emit(typeProcess);
} }
} }
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
[processWip]="processWip | async" [processWip]="processWip | async"
[processDone]="processDone | async" [processDone]="processDone | async"
[processId]="processId | async" [processId]="processId | async"
(executeAction)="executeProcess($event)"> (executeProcess)="executeProcess($event)">
</app-datatable> </app-datatable>
</div> </div>
<div class="col-12 col-md-4 pt-2"> <div class="col-12 col-md-4 pt-2">
......
...@@ -88,7 +88,7 @@ export class ResultComponent implements OnInit { ...@@ -88,7 +88,7 @@ export class ResultComponent implements OnInit {
this.store.dispatch(new searchActions.DeleteSelectedDataAction(data)); this.store.dispatch(new searchActions.DeleteSelectedDataAction(data));
} }
executeProcess(typeAction: string): void { executeProcess(typeProcess: string): void {
this.store.dispatch(new searchActions.ExecuteProcessAction(typeAction)); this.store.dispatch(new searchActions.ExecuteProcessAction(typeProcess));
} }
} }
...@@ -177,13 +177,13 @@ export class SearchEffects { ...@@ -177,13 +177,13 @@ export class SearchEffects {
withLatestFrom(this.store$), withLatestFrom(this.store$),
switchMap(([action, state]) => { switchMap(([action, state]) => {
const executeProcessAction = action as searchActions.ExecuteProcessAction; const executeProcessAction = action as searchActions.ExecuteProcessAction;
let query = state.search.datasetName; const dname = state.search.datasetName;
query += '?a=' + state.search.outputList.join(';'); let query = '?a=' + state.search.outputList.join(';');
query += '&c='; query += '&c=';
query += state.metamodel.attribute.datasetAttributeList.find(a => a.search_flag === 'ID').id; query += state.metamodel.attribute.datasetAttributeList.find(a => a.search_flag === 'ID').id;
query += '::in::'; query += '::in::';
query += state.search.selectedData.join('|'); 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)), map((res: any) => new searchActions.ExecuteProcessWipAction(res.message)),
catchError(() => of(new searchActions.ExecuteProcessFailAction())) catchError(() => of(new searchActions.ExecuteProcessFailAction()))
); );
......
...@@ -19,8 +19,9 @@ export class SearchService { ...@@ -19,8 +19,9 @@ export class SearchService {
return this.http.get<any[]>(this.API_PATH + '/search/' + this.instanceName + '/data/' + query); return this.http.get<any[]>(this.API_PATH + '/search/' + this.instanceName + '/data/' + query);
} }
executeProcess(typeAction: string, query: string) { executeProcess(typeProcess: string, dname: string, query: string) {
const url = this.API_PATH + '/service/' + this.instanceName + '/' + query; const url = this.API_PATH + '/service/' + this.instanceName + '/' + dname + '/' + typeProcess + query;
console.log(url);
return this.http.get<any>(url); return this.http.get<any>(url);
} }
......
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