Merge remote-tracking branch 'origin/ui-redesign' into ui-redesign
This commit is contained in:
commit
0d0fed6137
|
@ -31,4 +31,8 @@ export class DashboardService {
|
|||
getRecentActivity(request: DataTableRequest<RecentActivityCriteria>): Observable<RecentActivityModel[]> {
|
||||
return this.http.post<RecentActivityModel[]>(this.actionUrl + 'recentActivity', request, {headers: this.headers});
|
||||
}
|
||||
|
||||
// getRecentActivity(request: DataTableRequest<RecentActivityCriteria>): Observable<DataTableData<RecentActivityModel>> {
|
||||
// return this.http.post<DataTableData<RecentActivityModel>>(this.actionUrl + 'recentActivity', request, {headers: this.headers});
|
||||
// }
|
||||
}
|
||||
|
|
|
@ -51,22 +51,18 @@
|
|||
<div class="latest-activity-title">{{'DASHBOARD.LATEST-ACTIVITY' | translate}}</div>
|
||||
<mat-tab-group mat-align-tabs="start" class="remove-border-bottom">
|
||||
<mat-tab label="{{'DASHBOARD.ALL' | translate}} ({{totalRecents}})">
|
||||
<div *ngIf="totalRecents === 0" class="col-auto pt-3"><input type="text" class="d-flex ml-auto" placeholder="  Search"></div>
|
||||
<app-recent-edited-activity (totalCountRecentEdited)="onCountAllRecent($event)"></app-recent-edited-activity>
|
||||
<div *ngIf="totalRecents === 0" class="empty-list">{{'DASHBOARD.EMPTY-LIST' | translate}}</div>
|
||||
</mat-tab>
|
||||
<mat-tab label="{{'DASHBOARD.DRAFTS' | translate}} ({{totalDraftDatasets}})">
|
||||
<div *ngIf="totalDraftDatasets === 0" class="col-auto pt-3"><input type="text" class="d-flex ml-auto" placeholder="  Search"></div>
|
||||
<app-drafts (totalCountDraftDatasets)="onCountDraftDatasets($event)"></app-drafts>
|
||||
<div *ngIf="totalDraftDatasets === 0" class="empty-list">{{'DASHBOARD.EMPTY-LIST' | translate}}</div>
|
||||
</mat-tab>
|
||||
<mat-tab label="{{'DASHBOARD.DMPS' | translate}} ({{totalDmps}})">
|
||||
<div *ngIf="totalDmps === 0" class="col-auto pt-3"><input type="text" class="d-flex ml-auto" placeholder="  Search"></div>
|
||||
<app-recent-edited-dmp-activity (totalCountDmps)="onCountDmps($event)"></app-recent-edited-dmp-activity>
|
||||
<div *ngIf="totalDmps === 0" class="empty-list">{{'DASHBOARD.EMPTY-LIST' | translate}}</div>
|
||||
</mat-tab>
|
||||
<mat-tab label="{{'DASHBOARD.DATASET-DESCRIPTIONS' | translate}} ({{totalDatasets}})">
|
||||
<div *ngIf="totalDatasets === 0" class="col-auto pt-3"><input type="text" class="d-flex ml-auto" placeholder="  Search"></div>
|
||||
<app-recent-edited-dataset-activity (totalCountDatasets)="onCountDatasets($event)"></app-recent-edited-dataset-activity>
|
||||
<div *ngIf="totalDatasets === 0" class="empty-list">{{'DASHBOARD.EMPTY-LIST' | translate}}</div>
|
||||
<div *ngIf="totalDatasets === 0" class="col-auto d-flex justify-content-center">
|
||||
|
|
|
@ -17,6 +17,7 @@ import { ConfirmationDialogModule } from '@common/modules/confirmation-dialog/co
|
|||
import { RecentEditedDatasetActivityComponent } from './recent-edited-dataset-activity/recent-edited-dataset-activity.component';
|
||||
import { DatasetCopyDialogModule } from '../dataset/dataset-wizard/dataset-copy-dialogue/dataset-copy-dialogue.module';
|
||||
import { RecentEditedDmpActivityComponent } from './recent-edited-dmp-activity/recent-edited-dmp-activity.component';
|
||||
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
|
@ -24,7 +25,9 @@ import { RecentEditedDmpActivityComponent } from './recent-edited-dmp-activity/r
|
|||
DashboardRoutingModule,
|
||||
ExportMethodDialogModule,
|
||||
ConfirmationDialogModule,
|
||||
DatasetCopyDialogModule
|
||||
DatasetCopyDialogModule,
|
||||
FormsModule,
|
||||
ReactiveFormsModule
|
||||
],
|
||||
declarations: [
|
||||
DashboardComponent,
|
||||
|
|
|
@ -176,6 +176,24 @@ input[type="text"] {
|
|||
cursor: pointer;
|
||||
}
|
||||
|
||||
.search-form {
|
||||
text-align: left;
|
||||
width: 20rem;
|
||||
}
|
||||
|
||||
.search-form mat-icon {
|
||||
color: #129d99;
|
||||
}
|
||||
|
||||
::ng-deep .search-form .mat-form-field-wrapper {
|
||||
background-color: white !important;
|
||||
padding-bottom: 0 !important;
|
||||
}
|
||||
|
||||
::ng-deep .mat-form-field-appearance-outline .mat-form-field-infix {
|
||||
padding: 0.3rem 0rem 0.6rem 0rem !important;
|
||||
}
|
||||
|
||||
/* .grey {
|
||||
color: rgb(162, 162, 162);
|
||||
}
|
||||
|
|
|
@ -1,67 +1,75 @@
|
|||
<div *ngFor="let activity of datasetDrafts">
|
||||
<div class="dataset-card">
|
||||
<div [routerLink]="['../datasets/overview/' + activity.id]" class="pointer">
|
||||
<div class="d-flex flex-direction-row">
|
||||
<div class="col-auto dataset-label">{{'DATASET-LISTING.DATASET-DESCRIPTION' | translate}}</div>
|
||||
<div class="col-auto ml-auto edited-date">{{'DATASET-LISTING.STATES.EDITED' | translate}}: {{activity.modified | date:"longDate"}}</div>
|
||||
</div>
|
||||
<div class="col-auto dataset-title">{{'DATASET-LISTING.DATASET-DESCRIPTION' | translate}}: {{activity.label}}</div>
|
||||
<div class="dataset-subtitle">
|
||||
<span class="col-auto">{{ roleDisplay(activity.users) }}</span>
|
||||
<span>.</span>
|
||||
<span class="col-auto" *ngIf="activity.status === 1 && activity.public === true"><span class="material-icons icon-align">public</span>{{'DATASET-LISTING.STATES.PUBLIC' | translate}}</span>
|
||||
<span *ngIf="activity.status === 1 && activity.public === false" class="col-auto"><span class="material-icons icon-align">done</span>{{ enumUtils.toDmpStatusString(activity.status) }}</span>
|
||||
<span *ngIf="activity.status === 0" class=" col-auto draft"><span class="material-icons icon-align">create</span>{{ enumUtils.toDmpStatusString(activity.status) }}</span>
|
||||
<span>.</span>
|
||||
<span class="col">{{'DATASET-LISTING.COLUMNS.GRANT' | translate}}: {{activity.grant}}</span>
|
||||
</div>
|
||||
<div class="d-flex flex-direction-row pt-3 pb-3">
|
||||
<div class="col-auto dataset-subtitle">{{'DATASET-LISTING.TOOLTIP.PART-OF' | translate}}
|
||||
<div class="col-auto dmp-label ml-4">{{'DATASET-LISTING.TOOLTIP.DMP' | translate}}</div>
|
||||
<div>
|
||||
<!-- Search Filter-->
|
||||
<mat-form-field appearance="outline" class="search-form ml-auto col-auto pr-0" floatLabel="never">
|
||||
<mat-icon matSuffix>search</mat-icon>
|
||||
<input matInput placeholder="{{'CRITERIA.DATA-SETS.DRAFT-LIKE'| translate}}" name="likeCriteria" [formControl]="formGroup.get('like')">
|
||||
<mat-error *ngIf="formGroup.get('like').hasError('backendError')">{{formGroup.get('like').getError('backendError').message}}</mat-error>
|
||||
</mat-form-field>
|
||||
<!-- End of Search Filter -->
|
||||
<div *ngFor="let activity of datasetDrafts">
|
||||
<div class="dataset-card">
|
||||
<div [routerLink]="['../datasets/overview/' + activity.id]" class="pointer">
|
||||
<div class="d-flex flex-direction-row">
|
||||
<div class="col-auto dataset-label">{{'DATASET-LISTING.DATASET-DESCRIPTION' | translate}}</div>
|
||||
<div class="col-auto ml-auto edited-date">{{'DATASET-LISTING.STATES.EDITED' | translate}}: {{activity.modified | date:"longDate"}}</div>
|
||||
</div>
|
||||
<div class="col-auto dataset-title">{{'DATASET-LISTING.DATASET-DESCRIPTION' | translate}}: {{activity.label}}</div>
|
||||
<div class="dataset-subtitle">
|
||||
<span class="col-auto">{{ roleDisplay(activity.users) }}</span>
|
||||
<span>.</span>
|
||||
<span class="col-auto" *ngIf="activity.status === 1 && activity.public === true"><span class="material-icons icon-align">public</span>{{'DATASET-LISTING.STATES.PUBLIC' | translate}}</span>
|
||||
<span *ngIf="activity.status === 1 && activity.public === false" class="col-auto"><span class="material-icons icon-align">done</span>{{ enumUtils.toDmpStatusString(activity.status) }}</span>
|
||||
<span *ngIf="activity.status === 0" class=" col-auto draft"><span class="material-icons icon-align">create</span>{{ enumUtils.toDmpStatusString(activity.status) }}</span>
|
||||
<span>.</span>
|
||||
<span class="col">{{'DATASET-LISTING.COLUMNS.GRANT' | translate}}: {{activity.grant}}</span>
|
||||
</div>
|
||||
<div class="d-flex flex-direction-row pt-3 pb-3">
|
||||
<div class="col-auto dataset-subtitle">{{'DATASET-LISTING.TOOLTIP.PART-OF' | translate}}
|
||||
<div class="col-auto dmp-label ml-4">{{'DATASET-LISTING.TOOLTIP.DMP' | translate}}</div>
|
||||
</div>
|
||||
<!-- <div class="col-auto dmp-label">{{'DATASET-LISTING.TOOLTIP.DMP' | translate}}</div> -->
|
||||
<div class="col dmp-title">{{'DATASET-LISTING.TOOLTIP.DMP-FOR' | translate}}: {{activity.dmp}}</div>
|
||||
</div>
|
||||
<!-- <div class="col-auto dmp-label">{{'DATASET-LISTING.TOOLTIP.DMP' | translate}}</div> -->
|
||||
<div class="col dmp-title">{{'DATASET-LISTING.TOOLTIP.DMP-FOR' | translate}}: {{activity.dmp}}</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="dataset-card-actions">
|
||||
<a class="col-auto border-right pointer" [matMenuTriggerFor]="exportMenu"><span class="material-icons icon-align pr-2">open_in_new</span>{{'DATASET-LISTING.ACTIONS.EXPORT' | translate}}</a>
|
||||
<a class="col-auto border-right pointer" (click)="openShareDialog(activity.dmpId, activity.dmp)"><span class="material-icons icon-align pr-2">group_add</span>{{'DATASET-LISTING.ACTIONS.INVITE-COLLABORATORS' | translate}}</a>
|
||||
<a class="col-auto pointer" [matMenuTriggerFor]="actionsMenu"><span class="material-icons icon-align pl-2">more_horiz</span></a>
|
||||
<!-- <a class="col-auto" [matMenuTriggerFor]="actionsMenu" *ngIf="!publicMode"><span class="material-icons icon-align pl-2">more_horiz</span></a> -->
|
||||
</div>
|
||||
<mat-menu #actionsMenu="matMenu">
|
||||
<button mat-menu-item (click)="openDmpSearchDialogue(activity.id)" class="menu-item">
|
||||
<mat-icon>file_copy</mat-icon>{{'DATASET-WIZARD.ACTIONS.COPY-DATASET' | translate}}
|
||||
</button>
|
||||
<button mat-menu-item (click)="openConfirm(activity.id)" class="menu-item">
|
||||
<mat-icon>delete</mat-icon>{{ 'DATASET-WIZARD.ACTIONS.DELETE' | translate }}
|
||||
</button>
|
||||
<!-- <button mat-menu-item *ngIf="needsUpdate(activity)" class="menu-item" (click)="openUpdateDatasetProfileDialogue(activity.id);">
|
||||
<div class="dataset-card-actions">
|
||||
<a class="col-auto border-right pointer" [matMenuTriggerFor]="exportMenu"><span class="material-icons icon-align pr-2">open_in_new</span>{{'DATASET-LISTING.ACTIONS.EXPORT' | translate}}</a>
|
||||
<a class="col-auto border-right pointer" (click)="openShareDialog(activity.dmpId, activity.dmp)"><span class="material-icons icon-align pr-2">group_add</span>{{'DATASET-LISTING.ACTIONS.INVITE-COLLABORATORS' | translate}}</a>
|
||||
<a class="col-auto pointer" [matMenuTriggerFor]="actionsMenu"><span class="material-icons icon-align pl-2">more_horiz</span></a>
|
||||
<!-- <a class="col-auto" [matMenuTriggerFor]="actionsMenu" *ngIf="!publicMode"><span class="material-icons icon-align pl-2">more_horiz</span></a> -->
|
||||
</div>
|
||||
<mat-menu #actionsMenu="matMenu">
|
||||
<button mat-menu-item (click)="openDmpSearchDialogue(activity.id)" class="menu-item">
|
||||
<mat-icon>file_copy</mat-icon>{{'DATASET-WIZARD.ACTIONS.COPY-DATASET' | translate}}
|
||||
</button>
|
||||
<button mat-menu-item (click)="openConfirm(activity.id)" class="menu-item">
|
||||
<mat-icon>delete</mat-icon>{{ 'DATASET-WIZARD.ACTIONS.DELETE' | translate }}
|
||||
</button>
|
||||
<!-- <button mat-menu-item *ngIf="needsUpdate(activity)" class="menu-item" (click)="openUpdateDatasetProfileDialogue(activity.id);">
|
||||
<mat-icon>update</mat-icon>
|
||||
{{ 'DATASET-WIZARD.ACTIONS.UPDATE-DATASET-PROFILE' | translate }}
|
||||
</button> -->
|
||||
</mat-menu>
|
||||
</mat-menu>
|
||||
|
||||
<mat-menu #exportMenu="matMenu" xPosition="before">
|
||||
<button mat-menu-item (click)="downloadPDF(activity)">
|
||||
<i class="fa fa-file-pdf-o pr-2"></i>
|
||||
<span>{{'GENERAL.FILE-TYPES.PDF' | translate}}</span>
|
||||
</button>
|
||||
<button mat-menu-item (click)="downloadDOCX(activity)">
|
||||
<i class="fa fa-file-word-o pr-2"></i>
|
||||
<span>{{'GENERAL.FILE-TYPES.DOC' | translate}}</span>
|
||||
</button>
|
||||
<button mat-menu-item (click)="downloadXML(activity)">
|
||||
<i class="fa fa-file-code-o pr-2"></i>
|
||||
<span>{{'GENERAL.FILE-TYPES.XML' | translate}}</span>
|
||||
</button>
|
||||
</mat-menu>
|
||||
<mat-menu #exportMenu="matMenu" xPosition="before">
|
||||
<button mat-menu-item (click)="downloadPDF(activity)">
|
||||
<i class="fa fa-file-pdf-o pr-2"></i>
|
||||
<span>{{'GENERAL.FILE-TYPES.PDF' | translate}}</span>
|
||||
</button>
|
||||
<button mat-menu-item (click)="downloadDOCX(activity)">
|
||||
<i class="fa fa-file-word-o pr-2"></i>
|
||||
<span>{{'GENERAL.FILE-TYPES.DOC' | translate}}</span>
|
||||
</button>
|
||||
<button mat-menu-item (click)="downloadXML(activity)">
|
||||
<i class="fa fa-file-code-o pr-2"></i>
|
||||
<span>{{'GENERAL.FILE-TYPES.XML' | translate}}</span>
|
||||
</button>
|
||||
</mat-menu>
|
||||
</div>
|
||||
</div>
|
||||
<div *ngIf="datasetDrafts && datasetDrafts.length > 0 && datasetDrafts.length >= startIndex + pageSize" class="d-flex justify-content-center">
|
||||
<button type="button" class="btn-load-more" (click)="loadMore()">{{'GENERAL.ACTIONS.LOAD-MORE' | translate}}</button>
|
||||
</div>
|
||||
</div>
|
||||
<div *ngIf="datasetDrafts && datasetDrafts.length > 0" class="d-flex justify-content-center">
|
||||
<button type="button" class="btn-load-more" (click)="loadMore()">{{'GENERAL.ACTIONS.LOAD-MORE' | translate}}</button>
|
||||
</div>
|
||||
|
||||
<!-- <div class="card card-draft">
|
||||
<div class="card-header card-header-plain">
|
||||
<div class="card-desc">
|
||||
|
|
|
@ -5,14 +5,14 @@ import { DatasetCriteria } from '../../../core/query/dataset/dataset-criteria';
|
|||
import { DatasetListingModel } from '../../../core/model/dataset/dataset-listing';
|
||||
import { AuthService } from '../../../core/services/auth/auth.service';
|
||||
import { RecentActivityType } from '../../../core/common/enum/recent-activity-type';
|
||||
import { Router} from '@angular/router';
|
||||
import { Router } from '@angular/router';
|
||||
import { DmpStatus } from '../../../core/common/enum/dmp-status';
|
||||
import { Principal } from '@app/core/model/auth/principal';
|
||||
import { TranslateService } from '@ngx-translate/core';
|
||||
import { takeUntil } from 'rxjs/operators';
|
||||
import { ConfirmationDialogComponent } from '@common/modules/confirmation-dialog/confirmation-dialog.component';
|
||||
import { DatasetCopyDialogueComponent } from '@app/ui/dataset/dataset-wizard/dataset-copy-dialogue/dataset-copy-dialogue.component';
|
||||
import { FormControl } from '@angular/forms';
|
||||
import { FormControl, FormBuilder } from '@angular/forms';
|
||||
import { BaseComponent } from '@common/base/base.component';
|
||||
import { MatDialog } from '@angular/material';
|
||||
import { DatasetWizardService } from '@app/core/services/dataset-wizard/dataset-wizard.service';
|
||||
|
@ -37,8 +37,11 @@ export class DraftsComponent extends BaseComponent implements OnInit {
|
|||
status: number;
|
||||
|
||||
totalCount: number;
|
||||
startIndex: number = 4;
|
||||
startIndex: number = 0;
|
||||
pageSize: number = 5;
|
||||
public formGroup = new FormBuilder().group({
|
||||
like: new FormControl()
|
||||
});
|
||||
|
||||
constructor(
|
||||
private router: Router,
|
||||
|
@ -62,9 +65,11 @@ export class DraftsComponent extends BaseComponent implements OnInit {
|
|||
this.datasetService.getPaged(dmpDataTableRequest).subscribe(response => {
|
||||
this.datasetDrafts = response.data;
|
||||
this.totalCount = response.totalCount;
|
||||
this.totalCountDraftDatasets.emit(this.pageSize);
|
||||
// this.totalCountDraftDatasets.emit(this.totalCount);
|
||||
this.totalCountDraftDatasets.emit(this.datasetDrafts.length);
|
||||
});
|
||||
this.formGroup.get('like').valueChanges
|
||||
.pipe(takeUntil(this._destroyed))
|
||||
.subscribe(x => this.refresh());
|
||||
}
|
||||
|
||||
redirect(id: string, type: RecentActivityType) {
|
||||
|
@ -236,18 +241,33 @@ export class DraftsComponent extends BaseComponent implements OnInit {
|
|||
return filename;
|
||||
}
|
||||
|
||||
refresh(): void {
|
||||
const fields: Array<string> = [];
|
||||
fields.push('-modified');
|
||||
this.startIndex = 0;
|
||||
const dmpDataTableRequest: DataTableRequest<DatasetCriteria> = new DataTableRequest(0, 5, { fields: fields });
|
||||
dmpDataTableRequest.criteria = new DatasetCriteria();
|
||||
dmpDataTableRequest.criteria.status = DmpStatus.Draft;
|
||||
dmpDataTableRequest.criteria.like = this.formGroup.get("like").value;
|
||||
this.datasetService.getPaged(dmpDataTableRequest).subscribe(response => {
|
||||
this.datasetDrafts = response.data;
|
||||
this.totalCount = response.totalCount;
|
||||
this.totalCountDraftDatasets.emit(this.datasetDrafts.length);
|
||||
});
|
||||
}
|
||||
|
||||
public loadMore() {
|
||||
this.startIndex = this.startIndex + this.pageSize;
|
||||
const fields: Array<string> = ["-modified"];
|
||||
const request = new DataTableRequest<DatasetCriteria>(this.startIndex, this.pageSize, { fields: fields });
|
||||
|
||||
request.criteria = new DatasetCriteria();
|
||||
request.criteria.like = "";
|
||||
request.criteria.status = DmpStatus.Draft;
|
||||
request.criteria.like = this.formGroup.get("like").value;;
|
||||
|
||||
this.datasetService.getPaged(request).pipe(takeUntil(this._destroyed)).subscribe(result => {
|
||||
if (!result) { return []; }
|
||||
this.datasetDrafts = this.datasetDrafts.concat(result.data);
|
||||
this.totalCountDraftDatasets.emit(this.datasetDrafts.length);
|
||||
});
|
||||
this.startIndex = this.startIndex + this.pageSize;
|
||||
this.totalCountDraftDatasets.emit(this.startIndex + 1);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -176,6 +176,24 @@ input[type="text"] {
|
|||
cursor: pointer;
|
||||
}
|
||||
|
||||
.search-form {
|
||||
text-align: left;
|
||||
width: 20rem;
|
||||
}
|
||||
|
||||
.search-form mat-icon {
|
||||
color: #129d99;
|
||||
}
|
||||
|
||||
::ng-deep .search-form .mat-form-field-wrapper {
|
||||
background-color: white !important;
|
||||
padding-bottom: 0 !important;
|
||||
}
|
||||
|
||||
::ng-deep .mat-form-field-appearance-outline .mat-form-field-infix {
|
||||
padding: 0.3rem 0rem 0.6rem 0rem !important;
|
||||
}
|
||||
|
||||
/* th {
|
||||
text-transform: uppercase;
|
||||
}
|
||||
|
|
|
@ -1,4 +1,11 @@
|
|||
<div *ngIf="allRecentActivities != null">
|
||||
<!-- Search Filter-->
|
||||
<mat-form-field appearance="outline" class="search-form ml-auto col-auto pr-0" floatLabel="never">
|
||||
<mat-icon matSuffix>search</mat-icon>
|
||||
<input matInput placeholder="{{'CRITERIA.LIKE'| translate}}" name="likeCriteria" [formControl]="formGroup.get('like')">
|
||||
<mat-error *ngIf="formGroup.get('like').hasError('backendError')">{{formGroup.get('like').getError('backendError').message}}</mat-error>
|
||||
</mat-form-field>
|
||||
<!-- End of Search Filter -->
|
||||
<div *ngFor="let activity of allRecentActivities">
|
||||
<div *ngIf="activity && activity.type === recentActivityTypeEnum.Dmp.valueOf()">
|
||||
<div class="dmp-card">
|
||||
|
@ -129,7 +136,7 @@
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div *ngIf="allRecentActivities && allRecentActivities.length > 0" class="d-flex justify-content-center">
|
||||
<div *ngIf="allRecentActivities && allRecentActivities.length > 0 && allRecentActivities.length >= startIndex + pageSize" class="d-flex justify-content-center">
|
||||
<button type="button" class="btn-load-more" (click)="loadMore()">{{'GENERAL.ACTIONS.LOAD-MORE' | translate}}</button>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -27,7 +27,7 @@ import { RecentDmpModel } from '@app/core/model/recent-activity/recent-dmp-activ
|
|||
import { RecentDatasetModel } from '@app/core/model/recent-activity/recent-dataset-activity.model';
|
||||
import { UserInfoListingModel } from '@app/core/model/user/user-info-listing';
|
||||
import { DatasetWizardService } from '@app/core/services/dataset-wizard/dataset-wizard.service';
|
||||
import { FormControl } from '@angular/forms';
|
||||
import { FormControl, FormBuilder } from '@angular/forms';
|
||||
import { DatasetCopyDialogueComponent } from '@app/ui/dataset/dataset-wizard/dataset-copy-dialogue/dataset-copy-dialogue.component';
|
||||
|
||||
@Component({
|
||||
|
@ -39,12 +39,15 @@ export class RecentEditedActivityComponent extends BaseComponent implements OnIn
|
|||
|
||||
@Output() totalCountRecentEdited: EventEmitter<any> = new EventEmitter();
|
||||
|
||||
allRecentActivities:RecentActivityModel[];
|
||||
allRecentActivities: RecentActivityModel[];
|
||||
recentActivityTypeEnum = RecentActivityType;
|
||||
isDraft: boolean;
|
||||
totalCount: number;
|
||||
startIndex: number = 4;
|
||||
startIndex: number = 0;
|
||||
pageSize: number = 5;
|
||||
public formGroup = new FormBuilder().group({
|
||||
like: new FormControl()
|
||||
});
|
||||
|
||||
constructor(
|
||||
private router: Router,
|
||||
|
@ -72,7 +75,10 @@ export class RecentEditedActivityComponent extends BaseComponent implements OnIn
|
|||
this.allRecentActivities = response;
|
||||
this.totalCountRecentEdited.emit(this.allRecentActivities.length);
|
||||
});
|
||||
}
|
||||
this.formGroup.get('like').valueChanges
|
||||
.pipe(takeUntil(this._destroyed))
|
||||
.subscribe(x => this.refresh());
|
||||
}
|
||||
}
|
||||
|
||||
getDatasets(activity: RecentDmpModel): RecentDatasetModel[] {
|
||||
|
@ -375,19 +381,33 @@ export class RecentEditedActivityComponent extends BaseComponent implements OnIn
|
|||
});
|
||||
}
|
||||
|
||||
refresh(): void {
|
||||
const fields: Array<string> = ["-modified"];
|
||||
this.startIndex = 0;
|
||||
const allDataTableRequest: DataTableRequest<RecentActivityCriteria> = new DataTableRequest(0, this.pageSize, { fields: fields });
|
||||
allDataTableRequest.criteria = new RecentActivityCriteria();
|
||||
allDataTableRequest.criteria.like = this.formGroup.get("like").value;
|
||||
this.dashboardService
|
||||
.getRecentActivity(allDataTableRequest)
|
||||
.subscribe(response => {
|
||||
this.allRecentActivities = response;
|
||||
this.totalCountRecentEdited.emit(this.allRecentActivities.length);
|
||||
});
|
||||
}
|
||||
|
||||
public loadMore() {
|
||||
this.startIndex = this.startIndex + this.pageSize;
|
||||
const fields: Array<string> = ["-modified"];
|
||||
const request = new DataTableRequest<RecentActivityCriteria>(this.startIndex, this.pageSize, { fields: fields });
|
||||
request.criteria = new RecentActivityCriteria();
|
||||
request.criteria.like = "";
|
||||
request.criteria.like = this.formGroup.get("like").value ? this.formGroup.get("like").value : "";
|
||||
|
||||
this.dashboardService.getRecentActivity(request).pipe(takeUntil(this._destroyed)).subscribe(result => {
|
||||
if (!result) { return []; }
|
||||
this.allRecentActivities = this.allRecentActivities.concat(result);
|
||||
this.totalCountRecentEdited.emit(this.allRecentActivities.length);
|
||||
});
|
||||
this.startIndex = this.startIndex + this.pageSize;
|
||||
|
||||
this.totalCountRecentEdited.emit(this.startIndex + 1);
|
||||
}
|
||||
|
||||
// advancedClicked(dmp: DmpListingModel) {
|
||||
|
|
|
@ -1,5 +1,11 @@
|
|||
|
||||
<div *ngIf="datasetActivities != null">
|
||||
<!-- Search Filter-->
|
||||
<mat-form-field appearance="outline" class="search-form ml-auto col-auto pr-0" floatLabel="never">
|
||||
<mat-icon matSuffix>search</mat-icon>
|
||||
<input matInput placeholder="{{'CRITERIA.DATA-SETS.LIKE'| translate}}" name="likeCriteria" [formControl]="formGroup.get('like')">
|
||||
<mat-error *ngIf="formGroup.get('like').hasError('backendError')">{{formGroup.get('like').getError('backendError').message}}</mat-error>
|
||||
</mat-form-field>
|
||||
<!-- End of Search Filter -->
|
||||
<div *ngFor="let activity of datasetActivities">
|
||||
<div class="dataset-card">
|
||||
<div [routerLink]="['../datasets/overview/' + activity.id]" class="pointer">
|
||||
|
@ -60,8 +66,7 @@
|
|||
</mat-menu>
|
||||
</div>
|
||||
</div>
|
||||
<div *ngIf="datasetActivities && datasetActivities.length > 0" class="d-flex justify-content-center">
|
||||
<div *ngIf="datasetActivities && datasetActivities.length > 0 && datasetActivities.length >= startIndex + pageSize" class="d-flex justify-content-center">
|
||||
<button type="button" class="btn-load-more" (click)="loadMore()">{{'GENERAL.ACTIONS.LOAD-MORE' | translate}}</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
|
|
@ -175,3 +175,21 @@ input[type="text"] {
|
|||
.pointer {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.search-form {
|
||||
text-align: left;
|
||||
width: 20rem;
|
||||
}
|
||||
|
||||
.search-form mat-icon {
|
||||
color: #129d99;
|
||||
}
|
||||
|
||||
::ng-deep .search-form .mat-form-field-wrapper {
|
||||
background-color: white !important;
|
||||
padding-bottom: 0 !important;
|
||||
}
|
||||
|
||||
::ng-deep .mat-form-field-appearance-outline .mat-form-field-infix {
|
||||
padding: 0.3rem 0rem 0.6rem 0rem !important;
|
||||
}
|
||||
|
|
|
@ -8,7 +8,7 @@ import { BaseComponent } from '@common/base/base.component';
|
|||
import { Principal } from '@app/core/model/auth/principal';
|
||||
import { TranslateService } from '@ngx-translate/core';
|
||||
import { EnumUtils } from '@app/core/services/utilities/enum-utils.service';
|
||||
import { FormControl } from '@angular/forms';
|
||||
import { FormControl, FormBuilder } from '@angular/forms';
|
||||
import { DatasetCopyDialogueComponent } from '@app/ui/dataset/dataset-wizard/dataset-copy-dialogue/dataset-copy-dialogue.component';
|
||||
import { MatDialog } from '@angular/material';
|
||||
import { takeUntil } from 'rxjs/operators';
|
||||
|
@ -33,8 +33,11 @@ export class RecentEditedDatasetActivityComponent extends BaseComponent implemen
|
|||
|
||||
datasetActivities: DatasetListingModel[];
|
||||
totalCount: number;
|
||||
startIndex: number = 4;
|
||||
startIndex: number = 0;
|
||||
pageSize: number = 5;
|
||||
public formGroup = new FormBuilder().group({
|
||||
like: new FormControl()
|
||||
});
|
||||
// publicMode = false;
|
||||
|
||||
constructor(
|
||||
|
@ -61,26 +64,42 @@ export class RecentEditedDatasetActivityComponent extends BaseComponent implemen
|
|||
.subscribe(response => {
|
||||
this.datasetActivities = response.data;
|
||||
this.totalCount = response.totalCount;
|
||||
this.totalCountDatasets.emit(this.pageSize);
|
||||
// this.totalCountDatasets.emit(this.totalCount);
|
||||
this.totalCountDatasets.emit(this.datasetActivities.length);
|
||||
});
|
||||
this.formGroup.get('like').valueChanges
|
||||
.pipe(takeUntil(this._destroyed))
|
||||
.subscribe(x => this.refresh());
|
||||
}
|
||||
}
|
||||
|
||||
refresh(): void {
|
||||
const fields: Array<string> = ["-modified"];
|
||||
this.startIndex = 0;
|
||||
const datasetDataTableRequest: DataTableRequest<DatasetCriteria> = new DataTableRequest(0, this.pageSize, { fields: fields });
|
||||
datasetDataTableRequest.criteria = new DatasetCriteria();
|
||||
datasetDataTableRequest.criteria.like = this.formGroup.get("like").value;
|
||||
this.datasetService
|
||||
.getPaged(datasetDataTableRequest)
|
||||
.subscribe(response => {
|
||||
this.datasetActivities = response.data;
|
||||
this.totalCount = response.totalCount;
|
||||
this.totalCountDatasets.emit(this.datasetActivities.length);
|
||||
});
|
||||
}
|
||||
|
||||
public loadMore() {
|
||||
this.startIndex = this.startIndex + this.pageSize;
|
||||
const fields: Array<string> = ["-modified"];
|
||||
const request = new DataTableRequest<DatasetCriteria>(this.startIndex, this.pageSize, { fields: fields });
|
||||
|
||||
request.criteria = new DatasetCriteria();
|
||||
request.criteria.like = "";
|
||||
request.criteria.like = this.formGroup.get("like").value ? this.formGroup.get("like").value : "";
|
||||
|
||||
this.datasetService.getPaged(request).pipe(takeUntil(this._destroyed)).subscribe(result => {
|
||||
if (!result) { return []; }
|
||||
this.datasetActivities = this.datasetActivities.concat(result.data);
|
||||
this.totalCountDatasets.emit(this.datasetActivities.length);
|
||||
});
|
||||
this.startIndex = this.startIndex + this.pageSize;
|
||||
|
||||
this.totalCountDatasets.emit(this.startIndex + 1);
|
||||
}
|
||||
|
||||
public isAuthenticated(): boolean {
|
||||
|
|
|
@ -9,8 +9,7 @@
|
|||
padding-bottom: 1.2rem;
|
||||
}
|
||||
|
||||
.dmp-card,
|
||||
.dataset-card {
|
||||
.dmp-card, .dataset-card {
|
||||
min-width: 712px;
|
||||
/* min-height: 308px; */
|
||||
background: #ffffff 0% 0% no-repeat padding-box;
|
||||
|
@ -70,8 +69,7 @@ input[type="text"] {
|
|||
opacity: 0.75;
|
||||
}
|
||||
|
||||
.dmp-title,
|
||||
.dataset-title {
|
||||
.dmp-title, .dataset-title {
|
||||
text-align: left;
|
||||
font-weight: 500;
|
||||
font-family: "Roboto", sans-serif;
|
||||
|
@ -82,8 +80,7 @@ input[type="text"] {
|
|||
color: #212121;
|
||||
}
|
||||
|
||||
.dataset-subtitle,
|
||||
.dmp-subtitle {
|
||||
.dataset-subtitle, .dmp-subtitle {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
text-align: left;
|
||||
|
@ -112,8 +109,7 @@ input[type="text"] {
|
|||
padding-bottom: 0.4rem;
|
||||
}
|
||||
|
||||
.dataset-card-actions,
|
||||
.dmp-card-actions {
|
||||
.dataset-card-actions, .dmp-card-actions {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
border-top: 1px solid #dbdbdb;
|
||||
|
@ -121,14 +117,12 @@ input[type="text"] {
|
|||
color: #848484;
|
||||
}
|
||||
|
||||
.dataset-card-actions a,
|
||||
.dmp-card-actions a {
|
||||
.dataset-card-actions a, .dmp-card-actions a {
|
||||
color: #848484 !important;
|
||||
text-decoration: none !important;
|
||||
}
|
||||
|
||||
.dataset-card-actions a:hover,
|
||||
.dmp-card-actions a:hover {
|
||||
.dataset-card-actions a:hover, .dmp-card-actions a:hover {
|
||||
color: #129d99 !important;
|
||||
}
|
||||
|
||||
|
@ -175,6 +169,24 @@ input[type="text"] {
|
|||
cursor: pointer;
|
||||
}
|
||||
|
||||
.search-form {
|
||||
text-align: left;
|
||||
width: 20rem;
|
||||
}
|
||||
|
||||
.search-form mat-icon {
|
||||
color: #129d99;
|
||||
}
|
||||
|
||||
::ng-deep .search-form .mat-form-field-wrapper {
|
||||
background-color: white !important;
|
||||
padding-bottom: 0 !important;
|
||||
}
|
||||
|
||||
::ng-deep .mat-form-field-appearance-outline .mat-form-field-infix {
|
||||
padding: 0.3rem 0rem 0.6rem 0rem !important;
|
||||
}
|
||||
|
||||
/* th {
|
||||
text-transform: uppercase;
|
||||
}
|
||||
|
|
|
@ -1,4 +1,11 @@
|
|||
<div *ngIf="dmpActivities != null">
|
||||
<!-- Search Filter-->
|
||||
<mat-form-field appearance="outline" class="search-form ml-auto col-auto pr-0" floatLabel="never">
|
||||
<mat-icon matSuffix>search</mat-icon>
|
||||
<input matInput placeholder="{{'CRITERIA.DMP.LIKE'| translate}}" name="likeCriteria" [formControl]="formGroup.get('like')">
|
||||
<mat-error *ngIf="formGroup.get('like').hasError('backendError')">{{formGroup.get('like').getError('backendError').message}}</mat-error>
|
||||
</mat-form-field>
|
||||
<!-- End of Search Filter -->
|
||||
<div *ngFor="let activity of dmpActivities">
|
||||
<div class="dmp-card">
|
||||
<div [routerLink]="['../plans/overview/' + activity.id]" class="pointer">
|
||||
|
@ -67,7 +74,7 @@
|
|||
</mat-menu>
|
||||
</div>
|
||||
</div>
|
||||
<div *ngIf="dmpActivities && dmpActivities.length > 0" class="d-flex justify-content-center">
|
||||
<div *ngIf="dmpActivities && dmpActivities.length > 0 && this.startIndex < this.totalCount - 1 && this.pageSize < this.totalCount - 1" class="d-flex justify-content-center">
|
||||
<button type="button" class="btn-load-more" (click)="loadMore()">{{'GENERAL.ACTIONS.LOAD-MORE' | translate}}</button>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -20,6 +20,7 @@ import { DmpStatus } from '@app/core/common/enum/dmp-status';
|
|||
import { DatasetService } from '@app/core/services/dataset/dataset.service';
|
||||
import { DatasetListingModel } from '@app/core/model/dataset/dataset-listing';
|
||||
import { Role } from '@app/core/common/enum/role';
|
||||
import { FormBuilder, FormControl } from '@angular/forms';
|
||||
|
||||
@Component({
|
||||
selector: 'app-recent-edited-dmp-activity',
|
||||
|
@ -32,13 +33,15 @@ export class RecentEditedDmpActivityComponent extends BaseComponent implements O
|
|||
|
||||
dmpActivities: DmpListingModel[];
|
||||
datasetActivities: DatasetListingModel[];
|
||||
// allRecentActivities: RecentActivity[] = [];
|
||||
recentActivityTypeEnum = RecentActivityType;
|
||||
isDraft: boolean;
|
||||
|
||||
totalCount: number;
|
||||
startIndex: number = 4;
|
||||
startIndex: number = 0;
|
||||
pageSize: number = 5;
|
||||
public formGroup = new FormBuilder().group({
|
||||
like: new FormControl()
|
||||
});
|
||||
|
||||
constructor(
|
||||
private router: Router,
|
||||
|
@ -64,7 +67,8 @@ export class RecentEditedDmpActivityComponent extends BaseComponent implements O
|
|||
.subscribe(response => {
|
||||
this.dmpActivities = response.data;
|
||||
this.totalCount = response.totalCount;
|
||||
this.totalCountDmps.emit(this.pageSize);
|
||||
this.totalCountDmps.emit(this.dmpActivities.length);
|
||||
// this.totalCount < this.pageSize ? this.totalCountDmps.emit(response.totalCount) : this.totalCountDmps.emit(this.pageSize);
|
||||
// this.totalCountDmps.emit(this.totalCount);
|
||||
// this.dmpActivities.forEach(dmpActivity => {
|
||||
// const recentActivity: RecentActivity = {
|
||||
|
@ -74,6 +78,9 @@ export class RecentEditedDmpActivityComponent extends BaseComponent implements O
|
|||
// this.allRecentActivities.push(recentActivity)
|
||||
// })
|
||||
});
|
||||
this.formGroup.get('like').valueChanges
|
||||
.pipe(takeUntil(this._destroyed))
|
||||
.subscribe(x => this.refresh());
|
||||
|
||||
// const datasetDataTableRequest: DataTableRequest<DatasetCriteria> = new DataTableRequest(0, 5, { fields: fields });
|
||||
// datasetDataTableRequest.criteria = new DatasetCriteria();
|
||||
|
@ -90,7 +97,7 @@ export class RecentEditedDmpActivityComponent extends BaseComponent implements O
|
|||
// this.allRecentActivities.push(recentActivity)
|
||||
// })
|
||||
// });
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public isAuthenticated(): boolean {
|
||||
|
@ -288,20 +295,35 @@ export class RecentEditedDmpActivityComponent extends BaseComponent implements O
|
|||
}
|
||||
}
|
||||
|
||||
refresh(): void {
|
||||
const fields: Array<string> = ["-modified"];
|
||||
this.startIndex = 0;
|
||||
const dmpDataTableRequest: DataTableRequest<DmpCriteria> = new DataTableRequest(this.startIndex, this.pageSize, { fields: fields });
|
||||
dmpDataTableRequest.criteria = new DmpCriteria();
|
||||
dmpDataTableRequest.criteria.like = this.formGroup.get("like").value;
|
||||
this.dmpService
|
||||
.getPaged(dmpDataTableRequest, "listing")
|
||||
.subscribe(response => {
|
||||
this.dmpActivities = response.data;
|
||||
this.totalCount = response.totalCount;
|
||||
this.totalCountDmps.emit(this.dmpActivities.length);
|
||||
});
|
||||
}
|
||||
|
||||
public loadMore() {
|
||||
this.startIndex = this.startIndex + this.pageSize;
|
||||
const fields: Array<string> = ["-modified"];
|
||||
const request = new DataTableRequest<DmpCriteria>(this.startIndex, this.pageSize, { fields: fields });
|
||||
|
||||
request.criteria = new DmpCriteria();
|
||||
request.criteria.like = "";
|
||||
request.criteria.like = this.formGroup.get("like").value ? this.formGroup.get("like").value : "";
|
||||
|
||||
this.dmpService.getPaged(request, "listing").pipe(takeUntil(this._destroyed)).subscribe(result => {
|
||||
if (!result) { return []; }
|
||||
this.dmpActivities = this.dmpActivities.concat(result.data);
|
||||
this.totalCountDmps.emit(this.dmpActivities.length);
|
||||
});
|
||||
this.startIndex = this.startIndex + this.pageSize;
|
||||
|
||||
this.totalCountDmps.emit(this.startIndex + 1);
|
||||
}
|
||||
|
||||
// advancedClicked(dmp: DmpListingModel) {
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
<div>
|
||||
<div class="listing row pb-2">
|
||||
<!-- Search Filter-->
|
||||
<mat-form-field *ngIf="listingItems.length > 0" appearance="outline" class="search-form ml-auto col-auto" floatLabel="never">
|
||||
<mat-form-field appearance="outline" class="search-form ml-auto col-auto" floatLabel="never">
|
||||
<mat-icon matSuffix>search</mat-icon>
|
||||
<input matInput placeholder="{{'CRITERIA.DATA-SETS.LIKE'| translate}}" name="likeCriteria" [formControl]="formGroup.get('like')">
|
||||
<mat-error *ngIf="formGroup.get('like').hasError('backendError')">{{formGroup.get('like').getError('backendError').message}}</mat-error>
|
||||
|
|
|
@ -132,6 +132,7 @@ export class DatasetListingComponent extends BaseComponent implements OnInit, IB
|
|||
// setTimeout(() => this.refreshCallback(true));
|
||||
// }
|
||||
this.criteria.like = this.formGroup.get("like").value;
|
||||
this.startIndex = 0;
|
||||
this.refresh();
|
||||
}
|
||||
|
||||
|
|
|
@ -2,8 +2,8 @@
|
|||
<div class="container-fluid pl-0 pr-0">
|
||||
<div *ngIf="dataset">
|
||||
<a class="row mb-2 pl-1" (click)="goBack()" role="button">
|
||||
<mat-icon class="back-icon">chevron_left</mat-icon>
|
||||
<p class="label-txt">{{'DMP-WIZARD.ACTIONS.BACK' | translate}}</p>
|
||||
<mat-icon class="back-icon pointer">chevron_left</mat-icon>
|
||||
<p class="label-txt pointer">{{'DMP-WIZARD.ACTIONS.BACK' | translate}}</p>
|
||||
</a>
|
||||
<div class="row">
|
||||
<div class="col-md-8 col-lg-8 pl-4">
|
||||
|
@ -76,7 +76,7 @@
|
|||
<div class="row header">{{'DMP-OVERVIEW.RESEARCHERS' | translate}}</div>
|
||||
<div class="row">
|
||||
<div *ngFor="let researcher of researchers; let last = last">
|
||||
<a href="{{ getOrcidPath() + researcher.id }}" target="blank" class="researcher">
|
||||
<a href="{{ getOrcidPathForResearcher(researcher.reference) }}" target="blank" class="researcher">
|
||||
<div class="id-btn"> </div>
|
||||
<div *ngIf="!last">{{ researcher.name }}, </div>
|
||||
<div *ngIf="last">{{ researcher.name }}</div>
|
||||
|
|
|
@ -303,6 +303,12 @@ export class DatasetOverviewComponent extends BaseComponent implements OnInit {
|
|||
return this.configurationService.orcidPath;
|
||||
}
|
||||
|
||||
getOrcidPathForResearcher(reference: string): string {
|
||||
const path = this.getOrcidPath();
|
||||
const userId = reference.split(':')[1];
|
||||
return path + userId;
|
||||
}
|
||||
|
||||
downloadPDF(id: string) {
|
||||
this.datasetService.downloadPDF(id)
|
||||
.pipe(takeUntil(this._destroyed))
|
||||
|
|
|
@ -14,7 +14,15 @@
|
|||
[configuration]="usersAutoCompleteConfiguration">
|
||||
</app-multiple-auto-complete>
|
||||
</mat-form-field>
|
||||
<div class="col-12 d-flex justify-content-end row m-0">
|
||||
<div class="col-12 d-flex justify-content-end align-items-center row m-0 pr-0">
|
||||
<mat-form-field class="select-role" floatLabel="never">
|
||||
<mat-label>{{'DMP-LISTING.MEMBER' | translate}}</mat-label>
|
||||
<mat-select [formControl]="formGroup.get('role')">
|
||||
<mat-option *ngFor="let roleName of roleNames | keyvalue" selected [value]="roles[roleName.value]">
|
||||
{{ roleName.value }}
|
||||
</mat-option>
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
<button mat-raised-button (click)="send()" type="button"
|
||||
class="invite-btn">{{'DMP-LISTING.ACTIONS.INVITE-SHORT' | translate}}</button>
|
||||
</div>
|
||||
|
|
|
@ -28,6 +28,10 @@
|
|||
border-radius: 4px;
|
||||
}
|
||||
|
||||
::ng-deep .mat-dialog-container {
|
||||
border-radius: 8px;
|
||||
}
|
||||
|
||||
::ng-deep .mat-form-field-underline {
|
||||
display: none;
|
||||
}
|
||||
|
@ -56,3 +60,12 @@
|
|||
margin-bottom: 0.25em;
|
||||
}
|
||||
|
||||
.select-role {
|
||||
width: 16% !important;
|
||||
font-size: 14px;
|
||||
color: #848484;
|
||||
height: min-content;
|
||||
margin-right: 2.5rem;
|
||||
border: none;
|
||||
background-color: transparent;
|
||||
}
|
||||
|
|
|
@ -14,6 +14,7 @@ import { MultipleAutoCompleteConfiguration } from '@app/library/auto-complete/mu
|
|||
import { BaseComponent } from '@common/base/base.component';
|
||||
import { Observable } from 'rxjs';
|
||||
import { map, takeUntil } from 'rxjs/operators';
|
||||
import { Role } from '@app/core/common/enum/role';
|
||||
|
||||
@Component({
|
||||
selector: 'app-invitation-component',
|
||||
|
@ -26,6 +27,8 @@ export class DmpInvitationDialogComponent extends BaseComponent implements OnIni
|
|||
public filteredUsersAsync = false;
|
||||
public filteredUsers: DmpInvitationUser[];
|
||||
public emails: string[] = [];
|
||||
public roles = Role;
|
||||
public roleNames: string[];
|
||||
|
||||
visible = true;
|
||||
selectable = true;
|
||||
|
@ -33,13 +36,29 @@ export class DmpInvitationDialogComponent extends BaseComponent implements OnIni
|
|||
addOnBlur = true;
|
||||
readonly separatorKeysCodes: number[] = [ENTER, COMMA];
|
||||
|
||||
constructor(
|
||||
public invitationService: DmpInvitationService,
|
||||
public route: ActivatedRoute,
|
||||
public router: Router,
|
||||
public dialogRef: MatDialogRef<DmpInvitationDialogComponent>,
|
||||
@Inject(MAT_DIALOG_DATA) public data: any
|
||||
) {
|
||||
super();
|
||||
this.roleNames = Object.keys(this.roles).filter(key => key.length > 1);
|
||||
}
|
||||
|
||||
ngOnInit(): void {
|
||||
const invitation = new DmpInvitation();
|
||||
invitation.dataManagementPlan = this.data.dmpId;
|
||||
this.formGroup = invitation.buildForm();
|
||||
}
|
||||
|
||||
usersAutoCompleteConfiguration: MultipleAutoCompleteConfiguration = {
|
||||
filterFn: this.filterUsers.bind(this),
|
||||
initialItems: (excludedItems: any[]) => this.filterUsers('').pipe(map(result => result.filter(resultItem => (excludedItems || []).map(x => x.id).indexOf(resultItem.id) === -1))),
|
||||
displayFn: (item) => typeof(item) === 'string' ? item : item.name,
|
||||
titleFn: (item) => typeof(item) === 'string' ? item : item.name,
|
||||
valueAssign: (item) => {
|
||||
|
||||
const result = typeof(item) === 'string' ? item : item.email;
|
||||
console.log(result);
|
||||
return result;
|
||||
|
@ -64,30 +83,13 @@ export class DmpInvitationDialogComponent extends BaseComponent implements OnIni
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
constructor(
|
||||
public invitationService: DmpInvitationService,
|
||||
public route: ActivatedRoute,
|
||||
public router: Router,
|
||||
public dialogRef: MatDialogRef<DmpInvitationDialogComponent>,
|
||||
@Inject(MAT_DIALOG_DATA) public data: any
|
||||
) { super(); }
|
||||
|
||||
ngOnInit(): void {
|
||||
const invitation = new DmpInvitation();
|
||||
invitation.dataManagementPlan = this.data.dmpId;
|
||||
this.formGroup = invitation.buildForm();
|
||||
}
|
||||
|
||||
|
||||
send(value: any) {
|
||||
let invitationObject: any = {};
|
||||
invitationObject.dataManagementPlan = this.data.dmpId;
|
||||
invitationObject.role = this.formGroup.get('role').value;
|
||||
invitationObject.users = [];
|
||||
console.log(this.formGroup.get('users').value);
|
||||
invitationObject.users.push(...(<any[]>this.formGroup.get('users').value).filter(user => typeof(user) === 'string').map(email => ({ email: email, name: email })));
|
||||
invitationObject.users.push(...(<any[]>this.formGroup.get('users').value).filter(user => typeof(user) !== 'string'));
|
||||
console.log(invitationObject.users);
|
||||
//invitationObject.users.push(...this.formGroup.get('users').value);
|
||||
this.emails.forEach(email => {
|
||||
invitationObject.users.push({ email: email, name: email });
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
<div>
|
||||
<div class="listing row pb-2">
|
||||
<!-- Search Filter-->
|
||||
<mat-form-field *ngIf="listingItems.length > 0" appearance="outline" class="search-form ml-auto col-auto" floatLabel="never">
|
||||
<mat-form-field appearance="outline" class="search-form ml-auto col-auto" floatLabel="never">
|
||||
<mat-icon matSuffix>search</mat-icon>
|
||||
<input matInput placeholder="{{'CRITERIA.DMP.LIKE'| translate}}" name="likeCriteria" [formControl]="formGroup.get('like')">
|
||||
<mat-error *ngIf="formGroup.get('like').hasError('backendError')">{{formGroup.get('like').getError('backendError').message}}</mat-error>
|
||||
|
|
|
@ -231,6 +231,7 @@ export class DmpListingComponent extends BaseComponent implements OnInit, IBread
|
|||
// setTimeout(() => this.refreshCallback(true));
|
||||
// }
|
||||
this.criteria.like = this.formGroup.get("like").value;
|
||||
this.startIndex = 0;
|
||||
this.refresh();
|
||||
}
|
||||
|
||||
|
|
|
@ -63,7 +63,7 @@
|
|||
<div class="row header">{{'DMP-OVERVIEW.RESEARCHERS' | translate}}</div>
|
||||
<div class="row">
|
||||
<div *ngFor="let researcher of dmp.researchers; let last = last">
|
||||
<a href="{{ getOrcidPath() + researcher.id}}" target="blank" class="researcher">
|
||||
<a href="{{ getOrcidPathForResearcher(researcher.reference) }}" target="blank" class="researcher">
|
||||
<div class="id-btn"> </div>
|
||||
<div *ngIf="!last">{{ researcher.name }}, </div>
|
||||
<div *ngIf="last">{{ researcher.name }}</div>
|
||||
|
|
|
@ -584,9 +584,9 @@ export class DmpOverviewComponent extends BaseComponent implements OnInit {
|
|||
|
||||
reloadPage(): void {
|
||||
this.router.navigateByUrl('/plans', { skipLocationChange: true }).then(() => {
|
||||
this.router.navigate([`/plans/overview/${this.dmp.id}`]);
|
||||
this.router.navigate([`/plans/overview/${this.dmp.id}`]);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
updateUsers() {
|
||||
return this.dmpService.updateUsers(this.dmp.id, this.dmp.users).pipe(takeUntil(this._destroyed))
|
||||
|
@ -594,7 +594,7 @@ export class DmpOverviewComponent extends BaseComponent implements OnInit {
|
|||
complete => {
|
||||
this.onCallbackSuccess();
|
||||
this.reloadPage();
|
||||
},
|
||||
},
|
||||
error => this.onDeleteCallbackError(error)
|
||||
);
|
||||
}
|
||||
|
@ -632,6 +632,12 @@ export class DmpOverviewComponent extends BaseComponent implements OnInit {
|
|||
return this.configurationService.orcidPath;
|
||||
}
|
||||
|
||||
getOrcidPathForResearcher(reference: string): string {
|
||||
const path = this.getOrcidPath();
|
||||
const userId = reference.split(':')[1];
|
||||
return path + userId;
|
||||
}
|
||||
|
||||
checkLockStatus(id: string) {
|
||||
this.lockService.checkLockStatus(id).pipe(takeUntil(this._destroyed))
|
||||
.subscribe(lockStatus => this.lockStatus = lockStatus);
|
||||
|
|
|
@ -849,6 +849,7 @@
|
|||
"TAGS": "Tags",
|
||||
"SELECT-TAGS": "Select Tags",
|
||||
"LIKE": "Search Dataset Descriptions",
|
||||
"DRAFT-LIKE": "Search Draft Dataset Descriptions",
|
||||
"SELECT-GRANTS": "Select Grants",
|
||||
"ROLE": "Role",
|
||||
"ORGANIZATION": "Organization",
|
||||
|
@ -876,7 +877,8 @@
|
|||
"LABEL": "Search",
|
||||
"ROLE": "Role"
|
||||
},
|
||||
"SELECT": "Select an option"
|
||||
"SELECT": "Select an option",
|
||||
"LIKE": "Search"
|
||||
},
|
||||
"DATASET-EDITOR": {
|
||||
"TITLE": {
|
||||
|
|
|
@ -844,6 +844,7 @@
|
|||
"TAGS": "Etiquetas",
|
||||
"SELECT-TAGS": "Etiquetas seleccionadas",
|
||||
"LIKE": "Busdar descripciones del Dataset",
|
||||
"DRAFT-LIKE": "Search Draft Dataset Descriptions",
|
||||
"SELECT-GRANTS": "Seleccionar subvención",
|
||||
"ROLE": "Función",
|
||||
"ORGANIZATION": "Organización",
|
||||
|
@ -871,7 +872,8 @@
|
|||
"LABEL": "Búsqueda",
|
||||
"ROLE": "Función"
|
||||
},
|
||||
"SELECT": "Seleccionar una opción"
|
||||
"SELECT": "Seleccionar una opción",
|
||||
"LIKE": "Search"
|
||||
},
|
||||
"DATASET-EDITOR": {
|
||||
"TITLE": {
|
||||
|
|
|
@ -845,6 +845,7 @@
|
|||
"TAGS": "Ετικέτες",
|
||||
"SELECT-TAGS": "Επιλογή Ετικέτας",
|
||||
"LIKE": "Αναζήτηση Περιγραφών Συνόλου Δεδομένων",
|
||||
"DRAFT-LIKE": "Αναζήτηση Προσχέδιων Περιγραφών Συνόλου Δεδομένων",
|
||||
"SELECT-GRANTS": "Επιλογή Επιχορηγήσεων",
|
||||
"ROLE": "Ρόλος",
|
||||
"ORGANIZATION": "Οργανισμός",
|
||||
|
@ -872,7 +873,8 @@
|
|||
"LABEL": "Αναζήτηση",
|
||||
"ROLE": "Ρόλος"
|
||||
},
|
||||
"SELECT": "Επιλογή"
|
||||
"SELECT": "Επιλογή",
|
||||
"LIKE": "Search"
|
||||
},
|
||||
"DATASET-EDITOR": {
|
||||
"TITLE": {
|
||||
|
|
Loading…
Reference in New Issue