Implemented Frontend Editor And Action Listing For Cloning Dataset Profiles (Ticket #50 - Cloning dataset profiles)
This commit is contained in:
parent
6128ede341
commit
01de2754e5
|
@ -1,6 +1,7 @@
|
|||
package eu.eudat.controllers;
|
||||
|
||||
import eu.eudat.data.dao.criteria.RequestItem;
|
||||
import eu.eudat.logic.managers.AdminManager;
|
||||
import eu.eudat.logic.managers.DatasetProfileManager;
|
||||
import eu.eudat.logic.managers.UserManager;
|
||||
import eu.eudat.logic.security.claims.ClaimedAuthorities;
|
||||
|
@ -64,10 +65,11 @@ public class DatasetProfileController extends BaseController {
|
|||
|
||||
@Transactional
|
||||
@RequestMapping(method = RequestMethod.POST, value = {"/datasetprofile/clone/{id}"}, consumes = "application/json", produces = "application/json")
|
||||
public ResponseEntity<ResponseItem<eu.eudat.data.entities.DatasetProfile>> clone(@PathVariable String id, @ClaimedAuthorities(claims = {ADMIN})Principal principal) {
|
||||
//TODO
|
||||
public ResponseEntity<ResponseItem<eu.eudat.models.data.admin.composite.DatasetProfile>> clone(@PathVariable String id, @ClaimedAuthorities(claims = {ADMIN})Principal principal) {
|
||||
eu.eudat.data.entities.DatasetProfile profile = new DatasetProfileManager().clone(this.getApiContext(), id);
|
||||
return ResponseEntity.status(HttpStatus.OK).body(new ResponseItem<eu.eudat.data.entities.DatasetProfile>().payload(profile));
|
||||
eu.eudat.models.data.admin.composite.DatasetProfile datasetprofile = AdminManager.generateDatasetProfileModel(profile);
|
||||
datasetprofile.setLabel(profile.getLabel());
|
||||
return ResponseEntity.status(HttpStatus.OK).body(new ResponseItem<eu.eudat.models.data.admin.composite.DatasetProfile>().payload(datasetprofile));
|
||||
}
|
||||
|
||||
@RequestMapping(method = RequestMethod.POST, value = {"/search/autocomplete"}, consumes = "application/json", produces = "application/json")
|
||||
|
|
|
@ -37,7 +37,7 @@ public class DatasetProfileManager {
|
|||
DatasetProfile profile = apiContext.getOperationsContext().getDatabaseRepository().getDatasetProfileDao().find(UUID.fromString(id));
|
||||
apiContext.getOperationsContext().getDatabaseRepository().detachEntity(profile);
|
||||
profile.setId(null);
|
||||
return apiContext.getOperationsContext().getDatabaseRepository().getDatasetProfileDao().createOrUpdate(profile);
|
||||
return profile;
|
||||
}
|
||||
|
||||
public static DataTableData<DatasetProfileListingModel> getPaged(ApiContext apiContext, DatasetProfileTableRequestItem datasetProfileTableRequestItem) throws Exception {
|
||||
|
|
|
@ -47,7 +47,7 @@ const appRoutes: Routes = [
|
|||
canActivate: [AuthGuard]
|
||||
},
|
||||
{
|
||||
path: 'form',
|
||||
path: 'dataset-profile',
|
||||
loadChildren: './dataset-profile-form/dataset-profile.module#DatasetProfileModule',
|
||||
data: {
|
||||
breadcrumb: true
|
||||
|
@ -81,13 +81,6 @@ const appRoutes: Routes = [
|
|||
path: 'users',
|
||||
loadChildren: './users/users.module#UsersModule'
|
||||
},
|
||||
{
|
||||
path: 'datasetsProfiles',
|
||||
loadChildren: './datasets-admin-listing/dataset-admin.module#DatasetAdminModule',
|
||||
data: {
|
||||
breadcrumb: true
|
||||
},
|
||||
},
|
||||
{
|
||||
path: 'welcome',
|
||||
component: WelcomepageComponent,
|
||||
|
|
|
@ -26,6 +26,9 @@ import { ComboboxComponent } from '../shared/componentsAdmin/combobox/combobox-c
|
|||
import { SharedModule } from '../shared/shared.module';
|
||||
import { DatasetProfilePreviewerComponent } from './previewer/dataset-profile-previewer.component';
|
||||
import { DynamicFormModule } from '../form/dynamic-form.module';
|
||||
import { DatasetProfileAdminListingComponent } from './datasets-admin-listing/dataset-profile-admin-listing.component';
|
||||
import { TranslateService, TranslateModule, TranslateLoader } from '@ngx-translate/core';
|
||||
import { TranslateHttpLoader } from '@ngx-translate/http-loader';
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
|
@ -36,7 +39,14 @@ import { DynamicFormModule } from '../form/dynamic-form.module';
|
|||
RouterModule,
|
||||
SharedModule,
|
||||
DynamicFormModule,
|
||||
RouterModule.forChild(DatasetProfileRoutes)
|
||||
RouterModule.forChild(DatasetProfileRoutes),
|
||||
TranslateModule.forRoot({
|
||||
loader: {
|
||||
provide: TranslateLoader,
|
||||
useFactory: HttpLoaderFactory,
|
||||
deps: [HttpClient]
|
||||
}
|
||||
}),
|
||||
],
|
||||
|
||||
declarations: [
|
||||
|
@ -44,6 +54,7 @@ import { DynamicFormModule } from '../form/dynamic-form.module';
|
|||
//GroupFieldFormComponent,
|
||||
RuleFormComponent,
|
||||
SectionFormComponent,
|
||||
DatasetProfileAdminListingComponent,
|
||||
PageFormComponent,
|
||||
CompositeFieldFormComponent,
|
||||
FieldFormComponent,
|
||||
|
@ -65,6 +76,7 @@ import { DynamicFormModule } from '../form/dynamic-form.module';
|
|||
SectionFormComponent,
|
||||
PageFormComponent,
|
||||
CompositeFieldFormComponent,
|
||||
DatasetProfileAdminListingComponent,
|
||||
FieldFormComponent,
|
||||
TextAreaComponent,
|
||||
CheckBoxComponent,
|
||||
|
@ -83,4 +95,13 @@ import { DynamicFormModule } from '../form/dynamic-form.module';
|
|||
})
|
||||
|
||||
|
||||
export class DatasetProfileModule { }
|
||||
export class DatasetProfileModule {
|
||||
constructor(private translate: TranslateService) {
|
||||
translate.setDefaultLang('en');
|
||||
translate.use('en');
|
||||
}
|
||||
}
|
||||
|
||||
export function HttpLoaderFactory(httpClient: HttpClient) {
|
||||
return new TranslateHttpLoader(httpClient, 'assets/lang/', '.json');
|
||||
}
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
import { RouterModule, Routes } from '@angular/router';
|
||||
import { FormComponent } from './form/form.component';
|
||||
import { AuthGuard } from '../shared/guards/auth.guard';
|
||||
import { DatasetProfileAdminListingComponent } from './datasets-admin-listing/dataset-profile-admin-listing.component';
|
||||
|
||||
export const DatasetProfileRoutes: Routes = [
|
||||
{
|
||||
|
@ -7,8 +9,12 @@ export const DatasetProfileRoutes: Routes = [
|
|||
component: FormComponent
|
||||
},
|
||||
{
|
||||
path: '',
|
||||
path: 'clone/:cloneid',
|
||||
component: FormComponent
|
||||
}
|
||||
},
|
||||
{
|
||||
path: '',
|
||||
component: DatasetProfileAdminListingComponent,
|
||||
},
|
||||
|
||||
];
|
||||
|
|
|
@ -0,0 +1,59 @@
|
|||
<div class="container-fluid">
|
||||
<h3>{{titlePrefix}} {{'DATASET-PROFILE-LISTING.TITLE' | translate}}</h3>
|
||||
|
||||
|
||||
<app-dataset-profile-criteria-component></app-dataset-profile-criteria-component>
|
||||
<mat-card class="mat-card">
|
||||
<mat-card-header>
|
||||
<mat-progress-bar *ngIf="dataSource?.isLoadingResults" mode="query"></mat-progress-bar>
|
||||
</mat-card-header>
|
||||
<mat-table [dataSource]="dataSource" matSort (matSortChange)="refresh()">
|
||||
|
||||
<!-- Column Definition: Name -->
|
||||
<ng-container cdkColumnDef="label">
|
||||
<mat-header-cell *matHeaderCellDef mat-sort-header="label">{{'DATASET-PROFILE-LISTING.COLUMNS.NAME' | translate}}</mat-header-cell>
|
||||
<mat-cell *matCellDef="let row">{{row.label}}</mat-cell>
|
||||
</ng-container>
|
||||
|
||||
<!-- Column Definition: Description -->
|
||||
<ng-container cdkColumnDef="description">
|
||||
<mat-header-cell *matHeaderCellDef>{{'DATASET-PROFILE-LISTING.COLUMNS.DESCRIPTION' | translate}}</mat-header-cell>
|
||||
<mat-cell *matCellDef="let row"> {{row.description}} </mat-cell>
|
||||
</ng-container>
|
||||
|
||||
<!-- Column Definition: Created -->
|
||||
<ng-container cdkColumnDef="created">
|
||||
<mat-header-cell *matHeaderCellDef mat-sort-header="created">{{'DATASET-PROFILE-LISTING.COLUMNS.CREATED' |
|
||||
translate}}</mat-header-cell>
|
||||
<mat-cell *matCellDef="let row">{{row.created | date:'shortDate'}}</mat-cell>
|
||||
</ng-container>
|
||||
|
||||
<!-- Column Definition: Submission Time -->
|
||||
<ng-container cdkColumnDef="actions">
|
||||
<mat-header-cell *matHeaderCellDef>{{'DATASET-PROFILE-LISTING.COLUMNS.ACTIONS' | translate}}</mat-header-cell>
|
||||
<mat-cell *matCellDef="let row" (click)="$event.stopPropagation()">
|
||||
<mat-menu #actionsMenu="matMenu">
|
||||
<button mat-menu-item (click)="clone(row.id)">
|
||||
<mat-icon>filter_none</mat-icon>{{'DATASET-PROFILE-LISTING.ACTIONS.CLONE' | 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>
|
||||
</button>
|
||||
</mat-cell>
|
||||
</ng-container>
|
||||
|
||||
<mat-header-row *matHeaderRowDef="displayedColumns"></mat-header-row>
|
||||
<mat-row *matRowDef="let row; columns: displayedColumns" (click)="rowClick(row.id);"></mat-row>
|
||||
<!-- (click)="rowClick(row.id)" -->
|
||||
|
||||
</mat-table>
|
||||
<mat-paginator #paginator [length]="dataSource?.totalCount" [pageSizeOptions]="[10, 25, 100]">
|
||||
</mat-paginator>
|
||||
</mat-card>
|
||||
|
||||
<button mat-fab class="mat-fab-bottom-right" color="primary" [routerLink]="['/form'] ">
|
||||
<mat-icon class="mat-24">add</mat-icon>
|
||||
</button>
|
||||
</div>
|
|
@ -1,6 +1,3 @@
|
|||
import { DataTableRequest } from '../models/data-table/DataTableRequest';
|
||||
import { DatasetListingModel } from '../models/datasets/DatasetListingModel';
|
||||
import { DatasetCriteria } from '../models/criteria/dataset/DatasetCriteria';
|
||||
import { Component, ViewChild, OnInit, AfterViewInit } from '@angular/core';
|
||||
import { MatPaginator, MatSort, MatSnackBar } from '@angular/material';
|
||||
import { Router, Params, ActivatedRoute } from '@angular/router';
|
||||
|
@ -9,10 +6,13 @@ import { DataSource } from '@angular/cdk/table';
|
|||
|
||||
import { Observable } from 'rxjs';
|
||||
import { PageEvent } from '@angular/material';
|
||||
import { DataManagementPlanService } from '../services/data-management-plan/data-management-plan.service';
|
||||
import { DataManagementPlanModel } from '../models/data-managemnt-plans/DataManagementPlanModel';
|
||||
import { DatasetCriteriaComponent } from '../shared/components/criteria/datasets/datasets-criteria.component';
|
||||
import { DatasetProfileAdmin } from '../services/datasetProfileAdmin/datasetProfileAfmin.service';
|
||||
import { DatasetProfileAdmin } from '../../services/datasetProfileAdmin/datasetProfileAfmin.service';
|
||||
import { DataManagementPlanService } from '../../services/data-management-plan/data-management-plan.service';
|
||||
import { DatasetProfileCriteriaComponent } from '../../shared/components/criteria/dataset-profile/dataset-profile.component';
|
||||
import { DataManagementPlanModel } from '../../models/data-managemnt-plans/DataManagementPlanModel';
|
||||
import { DatasetListingModel } from '../../models/datasets/DatasetListingModel';
|
||||
import { DataTableRequest } from '../../models/data-table/DataTableRequest';
|
||||
import { DatasetProfileCriteria } from '../../models/criteria/dataset-profile/DatasetProfileCriteria';
|
||||
|
||||
|
||||
@Component({
|
||||
|
@ -25,11 +25,11 @@ export class DatasetProfileAdminListingComponent implements OnInit {
|
|||
|
||||
@ViewChild(MatPaginator) _paginator: MatPaginator;
|
||||
@ViewChild(MatSort) sort: MatSort;
|
||||
@ViewChild(DatasetCriteriaComponent) criteria: DatasetCriteriaComponent;
|
||||
@ViewChild(DatasetProfileCriteriaComponent) criteria: DatasetProfileCriteriaComponent;
|
||||
|
||||
|
||||
dataSource: DatasetDataSource | null;
|
||||
displayedColumns: String[] = ['label', 'dmp', 'profile', 'dataRepositories', 'registries', 'services', 'description', 'created', 'actions'];
|
||||
displayedColumns: String[] = ['label', 'description', 'created', 'actions'];
|
||||
pageEvent: PageEvent;
|
||||
titlePrefix: String;
|
||||
dmpId: String;
|
||||
|
@ -73,17 +73,19 @@ export class DatasetProfileAdminListingComponent implements OnInit {
|
|||
}
|
||||
|
||||
rowClick(rowId: String) {
|
||||
this.router.navigate(['form/' + rowId]);
|
||||
this.router.navigate(['dataset-profile/' + rowId]);
|
||||
}
|
||||
|
||||
getDefaultCriteria(dmpId: String): DatasetCriteria {
|
||||
const defaultCriteria = new DatasetCriteria();
|
||||
if (dmpId != null) {
|
||||
defaultCriteria.dmpIds.push(dmpId);
|
||||
}
|
||||
getDefaultCriteria(dmpId: String): DatasetProfileCriteria {
|
||||
const defaultCriteria = new DatasetProfileCriteria();
|
||||
|
||||
return defaultCriteria;
|
||||
}
|
||||
|
||||
clone(id: string) {
|
||||
this.router.navigate(['dataset-profile/clone/' + id]);
|
||||
}
|
||||
|
||||
// makeItPublic(id: String) {
|
||||
// debugger;
|
||||
// this.datasetService.makeDatasetPublic(id).subscribe();
|
||||
|
@ -102,7 +104,7 @@ export class DatasetDataSource extends DataSource<DatasetListingModel> {
|
|||
private _sort: MatSort,
|
||||
private _languageService: TranslateService,
|
||||
private _snackBar: MatSnackBar,
|
||||
private _criteria: DatasetCriteriaComponent
|
||||
private _criteria: DatasetProfileCriteriaComponent
|
||||
) {
|
||||
super();
|
||||
|
||||
|
@ -114,7 +116,6 @@ export class DatasetDataSource extends DataSource<DatasetListingModel> {
|
|||
//this._sort.matSortChange
|
||||
];
|
||||
|
||||
|
||||
return Observable.merge(...displayDataChanges)
|
||||
.startWith(null)
|
||||
.switchMap(() => {
|
||||
|
@ -124,7 +125,7 @@ export class DatasetDataSource extends DataSource<DatasetListingModel> {
|
|||
const startIndex = this._paginator.pageIndex * this._paginator.pageSize;
|
||||
let fields: Array<string> = new Array();
|
||||
if (this._sort.active) { fields = this._sort.direction === 'asc' ? ['+' + this._sort.active] : ['-' + this._sort.active]; }
|
||||
const request = new DataTableRequest<DatasetCriteria>(startIndex, this._paginator.pageSize, { fields: fields });
|
||||
const request = new DataTableRequest<DatasetProfileCriteria>(startIndex, this._paginator.pageSize, { fields: fields });
|
||||
request.criteria = this._criteria.criteria;
|
||||
return this._service.getPaged(request);
|
||||
})
|
|
@ -1,23 +1,10 @@
|
|||
<div class="container">
|
||||
<!-- <mat-card>
|
||||
<form *ngIf="form" novalidate [formGroup]="form" (ngSubmit)="onSubmit()">
|
||||
<div class="row">
|
||||
<div class="form-group col-md-12">
|
||||
<div class="container" [formGroup]='form'>
|
||||
<mat-form-field class="full-width">
|
||||
<input matInput formControlName="label" placeholder="Label">
|
||||
<input matInput formControlName="label" placeholder="{{'FORM.LABEL' | translate}}" required>
|
||||
<mat-error *ngIf="form.get('label').errors?.required">{{'GENERAL.VALIDATION.REQUIRED' | translate}}</mat-error>
|
||||
</mat-form-field>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<button mat-raised-button color="primary" type="submit" [disabled]="!form.valid">Save</button>
|
||||
</form>
|
||||
</mat-card> -->
|
||||
|
||||
<mat-horizontal-stepper [linear]="true" #stepper>
|
||||
<mat-step>
|
||||
|
||||
<div class="panel-group">
|
||||
<mat-expansion-panel *ngFor="let page of dataModel.pages; let i=index;" #panel>
|
||||
<mat-expansion-panel-header>
|
||||
|
@ -36,7 +23,6 @@
|
|||
</div>
|
||||
</mat-expansion-panel>
|
||||
</div>
|
||||
|
||||
<div style="margin-top:20px; padding-left: 15px;" class="row">
|
||||
<button mat-button (click)="addPage()" style="cursor: pointer">
|
||||
Add Page +
|
||||
|
@ -44,7 +30,6 @@
|
|||
</div>
|
||||
</mat-step>
|
||||
<mat-step>
|
||||
|
||||
<div>
|
||||
<mat-expansion-panel *ngFor="let section of dataModel.sections; let i=index;" #panel>
|
||||
<mat-expansion-panel-header>
|
||||
|
@ -63,9 +48,6 @@
|
|||
</div>
|
||||
</mat-expansion-panel>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div style="margin-top:20px; padding-left: 15px;" class="row">
|
||||
<button mat-button (click)="addSection()" style="cursor: pointer">
|
||||
Add Section +
|
||||
|
@ -74,6 +56,5 @@
|
|||
</mat-step>
|
||||
</mat-horizontal-stepper>
|
||||
<button mat-button (click)="preview()">Preview</button>
|
||||
<button mat-raised-button color="primary" type="button" (click)='onSubmit()' [disabled]="!form.valid">Save</button>
|
||||
|
||||
<button mat-raised-button color="primary" type="button" (click)='onSubmit()' [disabled]="form.valid">Save</button>
|
||||
</div>
|
||||
|
|
|
@ -23,6 +23,7 @@ export class FormComponent implements OnInit {
|
|||
dataModel: DatasetProfileModelAdmin;
|
||||
form: FormGroup;
|
||||
private profileID: string;
|
||||
private cloneId: string;
|
||||
|
||||
constructor(
|
||||
public datasetprofileAdmin: DatasetProfileAdmin,
|
||||
|
@ -32,6 +33,7 @@ export class FormComponent implements OnInit {
|
|||
public dialog: MatDialog,
|
||||
) {
|
||||
this.profileID = route.snapshot.params['id'];
|
||||
this.cloneId = route.snapshot.params['cloneid'];
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
|
@ -43,6 +45,11 @@ export class FormComponent implements OnInit {
|
|||
this.dataModel = JsonSerializer.fromJSONObject(data, DatasetProfileModelAdmin);
|
||||
this.form = this.dataModel.buildForm();
|
||||
});
|
||||
} else if (this.cloneId) {
|
||||
this.datasetprofileAdmin.clone(this.cloneId).subscribe((data) => {
|
||||
this.dataModel = JsonSerializer.fromJSONObject(data, DatasetProfileModelAdmin);
|
||||
this.form = this.dataModel.buildForm();
|
||||
});
|
||||
} else {
|
||||
this.addSection();
|
||||
this.addPage();
|
||||
|
|
|
@ -29,7 +29,7 @@ export class DatasetProfilePreviewerComponent implements OnInit {
|
|||
this.datasetProfileAdminService.preview(this.data['model']).subscribe(x => {
|
||||
this.datasetWizardModel = new DatasetWizardModel();
|
||||
this.datasetWizardModel.datasetProfileDefinition = JsonSerializer.fromJSONObject(x, DatasetProfileDefinitionModel);
|
||||
this.formGroup = this.datasetWizardModel.buildForm();
|
||||
this.formGroup = <FormGroup>this.datasetWizardModel.buildForm().get('datasetProfileDefinition');
|
||||
});
|
||||
|
||||
}
|
||||
|
|
|
@ -1,54 +0,0 @@
|
|||
import { RouterModule } from '@angular/router';
|
||||
import { TranslateHttpLoader } from '@ngx-translate/http-loader';
|
||||
import { DatasetService } from '../services/dataset/dataset.service';
|
||||
import { DynamicFormModule } from '../form/dynamic-form.module';
|
||||
import { TranslateLoader, TranslateModule, TranslateService } from '@ngx-translate/core';
|
||||
import { DatasetAdminRoutes } from './dataset-admin.routes';
|
||||
import { CommonModule } from '@angular/common';
|
||||
import { HttpClient, HttpClientModule } from '@angular/common/http';
|
||||
import { NgModule } from '@angular/core';
|
||||
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
|
||||
|
||||
import { SharedModule } from '../shared/shared.module';
|
||||
import { DatasetProfileAdminListingComponent } from './dataset-profile-admin-listing.component';
|
||||
@NgModule({
|
||||
imports: [
|
||||
CommonModule,
|
||||
FormsModule,
|
||||
HttpClientModule,
|
||||
SharedModule,
|
||||
RouterModule.forChild(DatasetAdminRoutes),
|
||||
ReactiveFormsModule,
|
||||
DynamicFormModule,
|
||||
TranslateModule.forRoot({
|
||||
loader: {
|
||||
provide: TranslateLoader,
|
||||
useFactory: HttpLoaderFactory,
|
||||
deps: [HttpClient]
|
||||
}
|
||||
}),
|
||||
],
|
||||
|
||||
declarations: [
|
||||
DatasetProfileAdminListingComponent,
|
||||
],
|
||||
|
||||
exports: [
|
||||
DatasetProfileAdminListingComponent,
|
||||
RouterModule
|
||||
],
|
||||
providers: [
|
||||
DatasetService
|
||||
]
|
||||
})
|
||||
|
||||
export class DatasetAdminModule {
|
||||
constructor(private translate: TranslateService) {
|
||||
translate.setDefaultLang('en');
|
||||
translate.use('en');
|
||||
}
|
||||
}
|
||||
|
||||
export function HttpLoaderFactory(httpClient: HttpClient) {
|
||||
return new TranslateHttpLoader(httpClient, 'assets/lang/', '.json');
|
||||
}
|
|
@ -1,7 +0,0 @@
|
|||
import { RouterModule, Routes } from '@angular/router';
|
||||
import { AuthGuard } from '../shared/guards/auth.guard';
|
||||
import { DatasetProfileAdminListingComponent } from './dataset-profile-admin-listing.component';
|
||||
|
||||
export const DatasetAdminRoutes: Routes = [
|
||||
{ path: '', component: DatasetProfileAdminListingComponent, canActivate: [AuthGuard] },
|
||||
];
|
|
@ -1,94 +0,0 @@
|
|||
<div class="container-fluid">
|
||||
<h3>{{titlePrefix}} {{'DATASET-LISTING.TITLE' | translate}}</h3>
|
||||
|
||||
|
||||
<app-datasets-criteria-component></app-datasets-criteria-component>
|
||||
<mat-card class="mat-card">
|
||||
<mat-card-header>
|
||||
<mat-progress-bar *ngIf="dataSource?.isLoadingResults" mode="query"></mat-progress-bar>
|
||||
</mat-card-header>
|
||||
<mat-table [dataSource]="dataSource" matSort (matSortChange)="refresh()">
|
||||
|
||||
<!-- Column Definition: Name -->
|
||||
<ng-container cdkColumnDef="label">
|
||||
<mat-header-cell *matHeaderCellDef mat-sort-header="label">{{'DATASET-LISTING.COLUMNS.NAME' | translate}}</mat-header-cell>
|
||||
<mat-cell *matCellDef="let row">{{row.label}}</mat-cell>
|
||||
</ng-container>
|
||||
|
||||
<!-- Column Definition: Dmp -->
|
||||
<ng-container cdkColumnDef="dmp">
|
||||
<mat-header-cell *matHeaderCellDef mat-sort-header="|join|dmp:label">{{'DATASET-LISTING.COLUMNS.DMP' | translate}}</mat-header-cell>
|
||||
<mat-cell *matCellDef="let row"> {{row.dmp}} </mat-cell>
|
||||
</ng-container>
|
||||
|
||||
<!-- Column Definition: Profile -->
|
||||
<ng-container cdkColumnDef="profile">
|
||||
<mat-header-cell *matHeaderCellDef mat-sort-header="|join|profile:label">{{'DATASET-LISTING.COLUMNS.PROFILE' | translate}}</mat-header-cell>
|
||||
<mat-cell *matCellDef="let row"> {{row.profile}} </mat-cell>
|
||||
</ng-container>
|
||||
|
||||
<!-- Column Definition: DataRepositories -->
|
||||
<ng-container cdkColumnDef="dataRepositories">
|
||||
<mat-header-cell *matHeaderCellDef>{{'DATASET-LISTING.COLUMNS.DATAREPOSITORIES' | translate}}</mat-header-cell>
|
||||
<mat-cell *matCellDef="let row"> {{row.dataRepositories}} </mat-cell>
|
||||
</ng-container>
|
||||
|
||||
<!-- Column Definition: DataRepositories -->
|
||||
<ng-container cdkColumnDef="registries">
|
||||
<mat-header-cell *matHeaderCellDef>{{'DATASET-LISTING.COLUMNS.REGISTRIES' | translate}}</mat-header-cell>
|
||||
<mat-cell *matCellDef="let row"> {{row.registries}} </mat-cell>
|
||||
</ng-container>
|
||||
|
||||
<!-- Column Definition: DataRepositories -->
|
||||
<ng-container cdkColumnDef="services">
|
||||
<mat-header-cell *matHeaderCellDef>{{'DATASET-LISTING.COLUMNS.SERVICES' | translate}}</mat-header-cell>
|
||||
<mat-cell *matCellDef="let row"> {{row.services}} </mat-cell>
|
||||
</ng-container>
|
||||
|
||||
<!-- Column Definition: Status -->
|
||||
<!-- <ng-container cdkColumnDef="status">
|
||||
<mat-header-cell *matHeaderCellDef>{{'DATASET-LISTING.COLUMNS.STATUS' | translate}}</mat-header-cell>
|
||||
<mat-cell *matCellDef="let row"> {{row.status}}
|
||||
</mat-cell>
|
||||
</ng-container> -->
|
||||
|
||||
<!-- Column Definition: Description -->
|
||||
<ng-container cdkColumnDef="description">
|
||||
<mat-header-cell *matHeaderCellDef>{{'DATASET-LISTING.COLUMNS.DESCRIPTION' | translate}}</mat-header-cell>
|
||||
<mat-cell *matCellDef="let row"> {{row.description}} </mat-cell>
|
||||
</ng-container>
|
||||
|
||||
<!-- Column Definition: Created -->
|
||||
<ng-container cdkColumnDef="created">
|
||||
<mat-header-cell *matHeaderCellDef mat-sort-header="created">{{'DATASET-LISTING.COLUMNS.CREATED' | translate}}</mat-header-cell>
|
||||
<mat-cell *matCellDef="let row">{{row.created | date:'shortDate'}}</mat-cell>
|
||||
</ng-container>
|
||||
|
||||
<!-- Column Definition: Submission Time -->
|
||||
<ng-container cdkColumnDef="actions">
|
||||
<mat-header-cell *matHeaderCellDef>{{'DATASET-LISTING.COLUMNS.ACTIONS' | translate}}</mat-header-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 *ngIf="row.status==1" mat-menu-item (click)="rowClick(row.id)"><mat-icon>visibility</mat-icon>{{'DATASET-LISTING.ACTIONS.VIEW' | 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>
|
||||
</button>
|
||||
</mat-cell>
|
||||
</ng-container>
|
||||
|
||||
<mat-header-row *matHeaderRowDef="displayedColumns"></mat-header-row>
|
||||
<mat-row *matRowDef="let row; columns: displayedColumns"></mat-row>
|
||||
<!-- (click)="rowClick(row.id)" -->
|
||||
|
||||
</mat-table>
|
||||
<mat-paginator #paginator [length]="dataSource?.totalCount" [pageSizeOptions]="[10, 25, 100]">
|
||||
</mat-paginator>
|
||||
</mat-card>
|
||||
|
||||
<button mat-fab class="mat-fab-bottom-right" color="primary" [routerLink]="['/form'] ">
|
||||
<mat-icon class="mat-24">add</mat-icon>
|
||||
</button>
|
||||
</div>
|
|
@ -13,7 +13,6 @@ import { DataManagementPlanModel, DataManagementPlanStatus } from '../../models/
|
|||
import { ExternalSourcesService } from '../../services/external-sources/external-sources.service';
|
||||
import { ExternalSourcesItemModel } from '../../models/external-sources/ExternalSourcesItemModel';
|
||||
import { RequestItem } from '../../models/criteria/RequestItem';
|
||||
import { DatasetProfileCriteria } from '../../models/criteria/dataset/DatasetProfileCriteria';
|
||||
import { DataManagementPlanCriteriaComponent } from '../../shared/components/criteria/data-management-plan/dmp-criteria.component';
|
||||
import { DatasetProfileModel } from '../../models/datasets/DatasetProfileModel';
|
||||
import { ProjectCriteria } from '../../models/criteria/project/ProjectCriteria';
|
||||
|
@ -36,6 +35,7 @@ import { MultipleAutoCompleteConfiguration } from '../../shared/components/autoc
|
|||
import * as FileSaver from 'file-saver';
|
||||
import { DMPFinaliseDialogComponent } from './dmp-finalise-dialog/dmp-finalise-dialog.component';
|
||||
import { DatasetListingModel } from '../../models/datasets/DatasetListingModel';
|
||||
import { DatasetProfileCriteria } from '../../models/criteria/dataset-profile/DatasetProfileCriteria';
|
||||
|
||||
@Component({
|
||||
selector: 'app-dmp-editor-component',
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
import { DatasetProfileModel } from '../../../models/datasets/DatasetProfileModel';
|
||||
import { DatasetProfileCriteria } from '../../../models/criteria/dataset/DatasetProfileCriteria';
|
||||
import { BaseErrorModel } from '../../../models/error/BaseErrorModel';
|
||||
import { SnackBarNotificationComponent } from '../../../shared/components/notificaiton/snack-bar-notification.component';
|
||||
import { JsonSerializer } from '../../../utilities/JsonSerializer';
|
||||
|
@ -22,6 +21,7 @@ import { BaseCriteria } from '../../../models/criteria/BaseCriteria';
|
|||
import { SingleAutoCompleteConfiguration } from '../../../shared/components/autocompletes/single/single-auto-complete-configuration';
|
||||
import { LanguageResolverService } from '../../../services/language-resolver/language-resolver.service';
|
||||
import { MultipleAutoCompleteConfiguration } from '../../../shared/components/autocompletes/multiple/multiple-auto-complete-configuration';
|
||||
import { DatasetProfileCriteria } from '../../../models/criteria/dataset-profile/DatasetProfileCriteria';
|
||||
|
||||
|
||||
@Component({
|
||||
|
|
|
@ -46,7 +46,8 @@ export class DynamicFormComponent implements OnInit, AfterViewInit {
|
|||
|
||||
// @Input() datasetId: string;
|
||||
|
||||
constructor(private router: Router,
|
||||
constructor(
|
||||
private router: Router,
|
||||
private _location: Location,
|
||||
private route: ActivatedRoute,
|
||||
private visibilityRulesService: VisibilityRulesService,
|
||||
|
|
|
@ -1,5 +0,0 @@
|
|||
import { BaseCriteria } from '../BaseCriteria';
|
||||
|
||||
export class DatasetProfileCriteria extends BaseCriteria {
|
||||
|
||||
}
|
|
@ -10,6 +10,7 @@ import { DatasetCriteria } from '../../models/criteria/dataset/DatasetCriteria';
|
|||
|
||||
import { DatasetProfileModelAdmin } from '../../models/datasetProfileAdmin/DatasetProfileModelAdmin';
|
||||
import { DatasetListingModel } from '../../models/datasets/DatasetListingModel';
|
||||
import { DatasetProfileCriteria } from '../../models/criteria/dataset-profile/DatasetProfileCriteria';
|
||||
|
||||
|
||||
@Injectable()
|
||||
|
@ -38,7 +39,7 @@ export class DatasetProfileAdmin {
|
|||
return this.http.get<DatasetProfileModelAdmin>(this.actionUrl + 'get/' + datasetProfileID, { headers: this.headers });
|
||||
}
|
||||
|
||||
getPaged(dataTableRequest: DataTableRequest<DatasetCriteria>): Observable<DataTableData<DatasetListingModel>> {
|
||||
getPaged(dataTableRequest: DataTableRequest<DatasetProfileCriteria>): Observable<DataTableData<DatasetListingModel>> {
|
||||
return this.http.post<DataTableData<DatasetListingModel>>(this.actionUrl + 'datasetprofiles/getPaged', dataTableRequest, { headers: this.headers });
|
||||
}
|
||||
|
||||
|
@ -46,4 +47,7 @@ export class DatasetProfileAdmin {
|
|||
return this.http.post<DatasetProfileModelAdmin>(this.actionUrl + 'preview', data, { headers: this.headers });
|
||||
}
|
||||
|
||||
clone(id: string): Observable<DatasetProfileModelAdmin> {
|
||||
return this.http.post<DatasetProfileModelAdmin>(HostConfiguration.Server + 'datasetprofile/clone/' + id, {}, { headers: this.headers });
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,13 @@
|
|||
<div class="dmp-criteria">
|
||||
<mat-card class="mat-card">
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<mat-form-field>
|
||||
<input matInput placeholder=" {{'CRITERIA.DATASET-PROFILE.LIKE'| translate}}" name="datasetProfileLike"
|
||||
[(ngModel)]="criteria.like" (ngModelChange)="controlModified()">
|
||||
<mat-error *ngIf="baseErrorModel?.like">{{baseErrorModel['Criteria.like']}}</mat-error>
|
||||
</mat-form-field>
|
||||
</div>
|
||||
</div>
|
||||
</mat-card>
|
||||
</div>
|
|
@ -0,0 +1,45 @@
|
|||
import { TranslateService } from '@ngx-translate/core';
|
||||
import { Component, OnInit, Input } from '@angular/core';
|
||||
import { BaseCriteriaComponent } from '../base/base-criteria.component';
|
||||
import { DatasetProfileCriteria } from '../../../../models/criteria/dataset-profile/DatasetProfileCriteria';
|
||||
import { FormBuilder } from '@angular/forms';
|
||||
|
||||
@Component({
|
||||
selector: 'app-dataset-profile-criteria-component',
|
||||
templateUrl: './dataset-profile.component.html',
|
||||
styleUrls: ['./dataset-profile.component.scss'],
|
||||
})
|
||||
|
||||
export class DatasetProfileCriteriaComponent extends BaseCriteriaComponent implements OnInit {
|
||||
|
||||
public criteria: DatasetProfileCriteria = new DatasetProfileCriteria();
|
||||
|
||||
constructor(
|
||||
public language: TranslateService,
|
||||
public formBuilder: FormBuilder
|
||||
) {
|
||||
super(new DatasetProfileCriteria());
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
super.ngOnInit();
|
||||
if (this.criteria == null) { this.criteria = new DatasetProfileCriteria(); }
|
||||
}
|
||||
|
||||
setCriteria(criteria: DatasetProfileCriteria): void {
|
||||
this.criteria = criteria;
|
||||
}
|
||||
|
||||
onCallbackError(error: any) {
|
||||
this.setErrorModel(error.error);
|
||||
}
|
||||
|
||||
controlModified(): void {
|
||||
this.clearErrorModel();
|
||||
if (this.refreshCallback != null &&
|
||||
(this.criteria.like == null || this.criteria.like.length === 0 || this.criteria.like.length > 2)
|
||||
) {
|
||||
this.refreshCallback();
|
||||
}
|
||||
}
|
||||
}
|
|
@ -12,7 +12,7 @@
|
|||
<a *ngIf="isAdmin()" mat-button class="navbar-button" routerLink="/users">{{'NAV-BAR.USERS' | translate}}</a>
|
||||
<a *ngIf="isAdmin()" mat-button class="navbar-button" routerLink="/dmp-profiles">{{'NAV-BAR.DMP-PROFILES' |
|
||||
translate}}</a>
|
||||
<a *ngIf="isAdmin()" mat-button class="navbar-button" routerLink="/datasetsProfiles">{{'NAV-BAR.DATASETS-ADMIN'
|
||||
<a *ngIf="isAdmin()" mat-button class="navbar-button" routerLink="/dataset-profile">{{'NAV-BAR.DATASETS-ADMIN'
|
||||
| translate}}</a>
|
||||
</div>
|
||||
|
||||
|
|
|
@ -30,6 +30,7 @@ import { CultureService } from '../utilities/culture/culture-service';
|
|||
import { MAT_DATE_LOCALE } from '@angular/material';
|
||||
import { FacetSearchComponent } from './components/facets/facet-search.component';
|
||||
import { FacetSearchSectionComponent } from './components/facets/facet-search-component/facet-search-section.component';
|
||||
import { DatasetProfileCriteriaComponent } from './components/criteria/dataset-profile/dataset-profile.component';
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
|
@ -49,6 +50,7 @@ import { FacetSearchSectionComponent } from './components/facets/facet-search-co
|
|||
DatasetCriteriaComponent,
|
||||
DataManagementPlanCriteriaComponent,
|
||||
DataManagementPlanProfileCriteriaComponent,
|
||||
DatasetProfileCriteriaComponent,
|
||||
FigurecardComponent,
|
||||
BaseCriteriaComponent,
|
||||
FileUploaderComponent,
|
||||
|
@ -75,6 +77,7 @@ import { FacetSearchSectionComponent } from './components/facets/facet-search-co
|
|||
DatasetCriteriaComponent,
|
||||
DataManagementPlanProfileCriteriaComponent,
|
||||
DataManagementPlanCriteriaComponent,
|
||||
DatasetProfileCriteriaComponent,
|
||||
FigurecardComponent,
|
||||
BaseCriteriaComponent,
|
||||
FileUploaderComponent,
|
||||
|
|
Loading…
Reference in New Issue