make public butto, save and finalize, dataset profile field
This commit is contained in:
parent
943d121e98
commit
e4d1fd5398
|
@ -13,7 +13,7 @@
|
||||||
</auto-complete> -->
|
</auto-complete> -->
|
||||||
<mat-form-field>
|
<mat-form-field>
|
||||||
<mat-select placeholder=" {{'DATASET-WIZARD.FIRST-STEP.PROFILE'| translate}}" formControlName="profile">
|
<mat-select placeholder=" {{'DATASET-WIZARD.FIRST-STEP.PROFILE'| translate}}" formControlName="profile">
|
||||||
<mat-option *ngFor="let profile of availableProfiles" [value]="profile">
|
<mat-option *ngFor="let profile of availableProfiles" [value]=" formGroup.get('profile').value">
|
||||||
{{profile.label}}
|
{{profile.label}}
|
||||||
</mat-option>
|
</mat-option>
|
||||||
</mat-select>
|
</mat-select>
|
||||||
|
|
|
@ -67,11 +67,20 @@
|
||||||
<!-- Column Definition: Submission Time -->
|
<!-- Column Definition: Submission Time -->
|
||||||
<ng-container cdkColumnDef="actions">
|
<ng-container cdkColumnDef="actions">
|
||||||
<mat-header-cell *matHeaderCellDef>{{'DATASET-LISTING.COLUMNS.ACTIONS' | translate}}</mat-header-cell>
|
<mat-header-cell *matHeaderCellDef>{{'DATASET-LISTING.COLUMNS.ACTIONS' | translate}}</mat-header-cell>
|
||||||
<mat-cell *matCellDef="let row"></mat-cell>
|
<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>
|
||||||
|
</mat-menu>
|
||||||
|
<button mat-icon-button [matMenuTriggerFor]="actionsMenu">
|
||||||
|
<mat-icon>more_vert</mat-icon>
|
||||||
|
</button>
|
||||||
|
</mat-cell>
|
||||||
</ng-container>
|
</ng-container>
|
||||||
|
|
||||||
<mat-header-row *matHeaderRowDef="displayedColumns"></mat-header-row>
|
<mat-header-row *matHeaderRowDef="displayedColumns"></mat-header-row>
|
||||||
<mat-row *matRowDef="let row; columns: displayedColumns" (click)="rowClick(row.id)"></mat-row>
|
<mat-row *matRowDef="let row; columns: displayedColumns"></mat-row>
|
||||||
|
<!-- (click)="rowClick(row.id)" -->
|
||||||
|
|
||||||
</mat-table>
|
</mat-table>
|
||||||
<mat-paginator #paginator [length]="dataSource?.totalCount" [pageSizeOptions]="[10, 25, 100]">
|
<mat-paginator #paginator [length]="dataSource?.totalCount" [pageSizeOptions]="[10, 25, 100]">
|
||||||
|
|
|
@ -85,6 +85,10 @@ export class DatasetListingComponent implements OnInit {
|
||||||
return defaultCriteria;
|
return defaultCriteria;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
makeItPublic(){
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export class DatasetDataSource extends DataSource<DatasetListingModel> {
|
export class DatasetDataSource extends DataSource<DatasetListingModel> {
|
||||||
|
|
|
@ -6,11 +6,11 @@
|
||||||
|
|
||||||
<!-- <mat-sidenav-content> -->
|
<!-- <mat-sidenav-content> -->
|
||||||
<!-- <button mat-raised-button color="primary" style="margin: 15px;" (click)="toggleSidebar()" icon="fa-arrow-left">Table Of Contents</button> -->
|
<!-- <button mat-raised-button color="primary" style="margin: 15px;" (click)="toggleSidebar()" icon="fa-arrow-left">Table Of Contents</button> -->
|
||||||
<form *ngIf="form" novalidate [formGroup]="form" (ngSubmit)="onSubmit()">
|
<form *ngIf="form" novalidate [formGroup]="form">
|
||||||
<button mat-raised-button color="primary" *ngIf="datasetProfileDefinitionModel&&datasetProfileDefinitionModel.status != 1"
|
<button mat-raised-button color="primary" *ngIf="dataModel&&dataModel.status.toString() != 1"
|
||||||
style="margin-top: 15px;margin-bottom: 15px;margin-right: 15px;" type="submit">Save</button>
|
style="margin-top: 15px;margin-bottom: 15px;margin-right: 15px;" (click)="save();" type="button">Save</button>
|
||||||
<!-- <button mat-raised-button color="primary" *ngIf="datasetProfileDefinitionModel&&datasetProfileDefinitionModel?.status != 1"
|
<button mat-raised-button color="primary" *ngIf="dataModel&&dataModel?.status != 1"
|
||||||
style="margin-top: 15px;margin-bottom: 15px;margin-right: 15px;" (click)="submit();">Save and Finalize</button> -->
|
style="margin-top: 15px;margin-bottom: 15px;margin-right: 15px;" (click)="saveFinalize();" type ="button">Save and Finalize</button>
|
||||||
<div>
|
<div>
|
||||||
<div class="alignment-center">
|
<div class="alignment-center">
|
||||||
<!-- <ngb-pagination *ngIf="pages" [collectionSize]="pages.length*10" [page]="currentPageIndex" (pageChange)="changePageIndex($event)" aria-label="Default pagination"></ngb-pagination> -->
|
<!-- <ngb-pagination *ngIf="pages" [collectionSize]="pages.length*10" [page]="currentPageIndex" (pageChange)="changePageIndex($event)" aria-label="Default pagination"></ngb-pagination> -->
|
||||||
|
|
|
@ -78,7 +78,6 @@ export class DynamicFormComponent implements OnInit {
|
||||||
if (params && "page" in params)
|
if (params && "page" in params)
|
||||||
this.changeCurrentPage(params["page"]);
|
this.changeCurrentPage(params["page"]);
|
||||||
});
|
});
|
||||||
|
|
||||||
/* else{
|
/* else{
|
||||||
|
|
||||||
this.addSection();
|
this.addSection();
|
||||||
|
@ -90,14 +89,20 @@ export class DynamicFormComponent implements OnInit {
|
||||||
this.visibilityRulesService.buildVisibilityRules(rules) */
|
this.visibilityRulesService.buildVisibilityRules(rules) */
|
||||||
}
|
}
|
||||||
|
|
||||||
submit() {
|
submit(){
|
||||||
}
|
this.datasetWizardService.saveDataset(this.dataModel.id, this.dataModel.status, this.form.value).subscribe(data => {
|
||||||
|
|
||||||
onSubmit(){
|
|
||||||
this.datasetWizardService.saveDataset(this.dataModel.id, this.form.value).subscribe(data => {
|
|
||||||
this.router.navigateByUrl("/datasets/" + this.dataModel.dmp.id);
|
this.router.navigateByUrl("/datasets/" + this.dataModel.dmp.id);
|
||||||
});
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
save(){
|
||||||
|
this.dataModel.status= "0";
|
||||||
|
this.submit();
|
||||||
|
}
|
||||||
|
|
||||||
|
saveFinalize() {
|
||||||
|
this.dataModel.status= "1";
|
||||||
|
this.submit();
|
||||||
}
|
}
|
||||||
|
|
||||||
toggleSidebar() {
|
toggleSidebar() {
|
||||||
|
|
|
@ -43,7 +43,8 @@ export class DatasetWizardService {
|
||||||
return this.http.post<DatasetWizardModel>(this.actionUrl + 'createOrUpdate', datasetModel, { headers: this.headers });
|
return this.http.post<DatasetWizardModel>(this.actionUrl + 'createOrUpdate', datasetModel, { headers: this.headers });
|
||||||
}
|
}
|
||||||
|
|
||||||
public saveDataset(datasetId:String, formValue){
|
public saveDataset(datasetId:String, datasetStatus:String, formValue){
|
||||||
|
formValue.status = datasetStatus;
|
||||||
return this.http.post(HostConfiguration.Server +'datasetprofile/save/'+datasetId, formValue, { headers: this.headers })
|
return this.http.post(HostConfiguration.Server +'datasetprofile/save/'+datasetId, formValue, { headers: this.headers })
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -85,6 +85,10 @@
|
||||||
"DATAREPOSITORIES": "Data Repositories",
|
"DATAREPOSITORIES": "Data Repositories",
|
||||||
"REGISTRIES": "Registries",
|
"REGISTRIES": "Registries",
|
||||||
"SERVICES": "Services"
|
"SERVICES": "Services"
|
||||||
|
},
|
||||||
|
"ACTIONS": {
|
||||||
|
"EDIT": "Edit",
|
||||||
|
"MAKE-IT-PUBLIC": "Make it public"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"PROJECT-EDITOR": {
|
"PROJECT-EDITOR": {
|
||||||
|
|
Loading…
Reference in New Issue