make it public functionality

This commit is contained in:
annampak 2018-01-19 17:19:02 +02:00
parent 62c4fb0547
commit 4741c31c0c
3 changed files with 7 additions and 3 deletions

View File

@ -70,7 +70,7 @@
<mat-cell *matCellDef="let row">
<mat-menu #actionsMenu="matMenu">
<button mat-menu-item (click)="rowClick(row.id)"><mat-icon>mode_edit</mat-icon>{{'DATASET-LISTING.ACTIONS.EDIT' | translate}}</button>
<button mat-menu-item (click)="makeItPublic(row.id)"><mat-icon>people_outline</mat-icon>{{'DATASET-LISTING.ACTIONS.MAKE-IT-PUBLIC' | translate}}</button>
<button *ngIf="row.status==1" mat-menu-item (click)="makeItPublic(row.id)"><mat-icon>people_outline</mat-icon>{{'DATASET-LISTING.ACTIONS.MAKE-IT-PUBLIC' | translate}}</button>
</mat-menu>
<button mat-icon-button [matMenuTriggerFor]="actionsMenu">
<mat-icon>more_vert</mat-icon>

View File

@ -85,8 +85,8 @@ export class DatasetListingComponent implements OnInit {
return defaultCriteria;
}
makeItPublic(){
makeItPublic(id:String){debugger;
this.datasetService.makeDatasetPublic(id).subscribe();
}
}

View File

@ -29,5 +29,9 @@ export class DatasetService {
getPaged(dataTableRequest: DataTableRequest<DatasetCriteria>): Observable<DataTableData<DatasetListingModel>> {
return this.http.post<DataTableData<DatasetListingModel>>(this.actionUrl + 'getPaged', dataTableRequest, { headers: this.headers });
}
makeDatasetPublic(id: String){
return this.http.get(this.actionUrl + 'makepublic/' + id, { headers: this.headers })
}
}