Change the profile of DatasetListingModel & RecentActivityModel from String to DatasetProfileModel and Update profileId in openDmpSearchDialogue()
This commit is contained in:
parent
9c9db0b646
commit
62d6ac01df
|
@ -1,3 +1,5 @@
|
||||||
|
import { DatasetProfileModel } from './dataset-profile';
|
||||||
|
|
||||||
export interface DatasetListingModel {
|
export interface DatasetListingModel {
|
||||||
id: string;
|
id: string;
|
||||||
label: String;
|
label: String;
|
||||||
|
@ -6,7 +8,7 @@ export interface DatasetListingModel {
|
||||||
grant: String;
|
grant: String;
|
||||||
grantId: String;
|
grantId: String;
|
||||||
grantAbbreviation: String;
|
grantAbbreviation: String;
|
||||||
profile: String;
|
profile: DatasetProfileModel;
|
||||||
dataRepositories: String;
|
dataRepositories: String;
|
||||||
registries: String;
|
registries: String;
|
||||||
services: String;
|
services: String;
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
import { RecentActivityType } from '@app/core/common/enum/recent-activity-type';
|
import { RecentActivityType } from '@app/core/common/enum/recent-activity-type';
|
||||||
import { UserInfoListingModel } from '../user/user-info-listing';
|
import { UserInfoListingModel } from '../user/user-info-listing';
|
||||||
|
import { DatasetProfileModel } from '../dataset/dataset-profile';
|
||||||
|
|
||||||
export class RecentActivityModel {
|
export class RecentActivityModel {
|
||||||
id: string;
|
id: string;
|
||||||
|
@ -14,7 +15,7 @@ export class RecentActivityModel {
|
||||||
grantId: String;
|
grantId: String;
|
||||||
finalizedAt: Date;
|
finalizedAt: Date;
|
||||||
publishedAt: Date;
|
publishedAt: Date;
|
||||||
profile: String;
|
profile: DatasetProfileModel;
|
||||||
type: RecentActivityType;
|
type: RecentActivityType;
|
||||||
users: UserInfoListingModel[];
|
users: UserInfoListingModel[];
|
||||||
public: boolean;
|
public: boolean;
|
||||||
|
|
|
@ -53,7 +53,7 @@
|
||||||
<!-- <a class="col-auto" [matMenuTriggerFor]="actionsMenu" *ngIf="!publicMode"><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>
|
</div>
|
||||||
<mat-menu #actionsMenu="matMenu">
|
<mat-menu #actionsMenu="matMenu">
|
||||||
<button mat-menu-item (click)="openDmpSearchDialogue(activity.id)" class="menu-item">
|
<button mat-menu-item (click)="openDmpSearchDialogue(activity)" class="menu-item">
|
||||||
<mat-icon>file_copy</mat-icon>{{'DATASET-WIZARD.ACTIONS.COPY-DATASET' | translate}}
|
<mat-icon>file_copy</mat-icon>{{'DATASET-WIZARD.ACTIONS.COPY-DATASET' | translate}}
|
||||||
</button>
|
</button>
|
||||||
<button mat-menu-item *ngIf="!lockStatusMap.get(activity.id)" (click)="openConfirm(activity.id)" class="menu-item">
|
<button mat-menu-item *ngIf="!lockStatusMap.get(activity.id)" (click)="openConfirm(activity.id)" class="menu-item">
|
||||||
|
|
|
@ -152,7 +152,7 @@ export class DraftsComponent extends BaseComponent implements OnInit {
|
||||||
data: {
|
data: {
|
||||||
formControl: formControl,
|
formControl: formControl,
|
||||||
datasetId: dataset.id,
|
datasetId: dataset.id,
|
||||||
datasetProfileId: dataset.profile,
|
datasetProfileId: dataset.profile.id,
|
||||||
datasetProfileExist: false,
|
datasetProfileExist: false,
|
||||||
confirmButton: this.language.instant('DATASET-WIZARD.DIALOGUE.COPY'),
|
confirmButton: this.language.instant('DATASET-WIZARD.DIALOGUE.COPY'),
|
||||||
cancelButton: this.language.instant('DATASET-WIZARD.DIALOGUE.CANCEL')
|
cancelButton: this.language.instant('DATASET-WIZARD.DIALOGUE.CANCEL')
|
||||||
|
|
|
@ -385,7 +385,7 @@ export class RecentEditedActivityComponent extends BaseComponent implements OnIn
|
||||||
data: {
|
data: {
|
||||||
formControl: formControl,
|
formControl: formControl,
|
||||||
datasetId: dataset.id,
|
datasetId: dataset.id,
|
||||||
datasetProfileId: dataset.profile,
|
datasetProfileId: dataset.profile.id,
|
||||||
datasetProfileExist: false,
|
datasetProfileExist: false,
|
||||||
confirmButton: this.language.instant('DATASET-WIZARD.DIALOGUE.COPY'),
|
confirmButton: this.language.instant('DATASET-WIZARD.DIALOGUE.COPY'),
|
||||||
cancelButton: this.language.instant('DATASET-WIZARD.DIALOGUE.CANCEL')
|
cancelButton: this.language.instant('DATASET-WIZARD.DIALOGUE.CANCEL')
|
||||||
|
|
|
@ -53,7 +53,7 @@
|
||||||
<!-- <a class="col-auto" [matMenuTriggerFor]="actionsMenu" *ngIf="!publicMode"><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>
|
</div>
|
||||||
<mat-menu #actionsMenu="matMenu">
|
<mat-menu #actionsMenu="matMenu">
|
||||||
<button mat-menu-item *ngIf="isAuthenticated()" (click)="openDmpSearchDialogue(activity.id)" class="menu-item">
|
<button mat-menu-item *ngIf="isAuthenticated()" (click)="openDmpSearchDialogue(activity)" class="menu-item">
|
||||||
<mat-icon>file_copy</mat-icon>{{'DATASET-WIZARD.ACTIONS.COPY-DATASET' | translate}}
|
<mat-icon>file_copy</mat-icon>{{'DATASET-WIZARD.ACTIONS.COPY-DATASET' | translate}}
|
||||||
</button>
|
</button>
|
||||||
<button mat-menu-item *ngIf="!lockStatusMap.get(activity.id)" (click)="openConfirm(activity.id)" class="menu-item">
|
<button mat-menu-item *ngIf="!lockStatusMap.get(activity.id)" (click)="openConfirm(activity.id)" class="menu-item">
|
||||||
|
|
|
@ -165,7 +165,7 @@ export class RecentEditedDatasetActivityComponent extends BaseComponent implemen
|
||||||
data: {
|
data: {
|
||||||
formControl: formControl,
|
formControl: formControl,
|
||||||
datasetId: dataset.id,
|
datasetId: dataset.id,
|
||||||
datasetProfileId: dataset.profile,
|
datasetProfileId: dataset.profile.id,
|
||||||
datasetProfileExist: false,
|
datasetProfileExist: false,
|
||||||
confirmButton: this.language.instant('DATASET-WIZARD.DIALOGUE.COPY'),
|
confirmButton: this.language.instant('DATASET-WIZARD.DIALOGUE.COPY'),
|
||||||
cancelButton: this.language.instant('DATASET-WIZARD.DIALOGUE.CANCEL')
|
cancelButton: this.language.instant('DATASET-WIZARD.DIALOGUE.CANCEL')
|
||||||
|
|
|
@ -164,7 +164,7 @@ export class DatasetListingItemComponent extends BaseComponent implements OnInit
|
||||||
data: {
|
data: {
|
||||||
formControl: formControl,
|
formControl: formControl,
|
||||||
datasetId: dataset.id,
|
datasetId: dataset.id,
|
||||||
datasetProfileId: dataset.profile,
|
datasetProfileId: dataset.profile.id,
|
||||||
datasetProfileExist: false,
|
datasetProfileExist: false,
|
||||||
confirmButton: this.language.instant('DATASET-WIZARD.DIALOGUE.COPY'),
|
confirmButton: this.language.instant('DATASET-WIZARD.DIALOGUE.COPY'),
|
||||||
cancelButton: this.language.instant('DATASET-WIZARD.DIALOGUE.CANCEL')
|
cancelButton: this.language.instant('DATASET-WIZARD.DIALOGUE.CANCEL')
|
||||||
|
@ -174,8 +174,9 @@ export class DatasetListingItemComponent extends BaseComponent implements OnInit
|
||||||
dialogRef.afterClosed().pipe(takeUntil(this._destroyed))
|
dialogRef.afterClosed().pipe(takeUntil(this._destroyed))
|
||||||
.subscribe(result => {
|
.subscribe(result => {
|
||||||
if (result && result.datasetProfileExist) {
|
if (result && result.datasetProfileExist) {
|
||||||
const newDmpId = result.formControl.value.id
|
const newDmpId = result.formControl.value.id;
|
||||||
this.router.navigate(['/datasets/copy/' + result.datasetId], { queryParams: { newDmpId: newDmpId } });
|
let url = this.router.createUrlTree(['/datasets/copy/', result.datasetId, { newDmpId: newDmpId }]);
|
||||||
|
window.open(url.toString(), '_blank');
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue