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 {
|
||||
id: string;
|
||||
label: String;
|
||||
|
@ -6,7 +8,7 @@ export interface DatasetListingModel {
|
|||
grant: String;
|
||||
grantId: String;
|
||||
grantAbbreviation: String;
|
||||
profile: String;
|
||||
profile: DatasetProfileModel;
|
||||
dataRepositories: String;
|
||||
registries: String;
|
||||
services: String;
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
import { RecentActivityType } from '@app/core/common/enum/recent-activity-type';
|
||||
import { UserInfoListingModel } from '../user/user-info-listing';
|
||||
import { DatasetProfileModel } from '../dataset/dataset-profile';
|
||||
|
||||
export class RecentActivityModel {
|
||||
id: string;
|
||||
|
@ -14,7 +15,7 @@ export class RecentActivityModel {
|
|||
grantId: String;
|
||||
finalizedAt: Date;
|
||||
publishedAt: Date;
|
||||
profile: String;
|
||||
profile: DatasetProfileModel;
|
||||
type: RecentActivityType;
|
||||
users: UserInfoListingModel[];
|
||||
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> -->
|
||||
</div>
|
||||
<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}}
|
||||
</button>
|
||||
<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: {
|
||||
formControl: formControl,
|
||||
datasetId: dataset.id,
|
||||
datasetProfileId: dataset.profile,
|
||||
datasetProfileId: dataset.profile.id,
|
||||
datasetProfileExist: false,
|
||||
confirmButton: this.language.instant('DATASET-WIZARD.DIALOGUE.COPY'),
|
||||
cancelButton: this.language.instant('DATASET-WIZARD.DIALOGUE.CANCEL')
|
||||
|
|
|
@ -385,7 +385,7 @@ export class RecentEditedActivityComponent extends BaseComponent implements OnIn
|
|||
data: {
|
||||
formControl: formControl,
|
||||
datasetId: dataset.id,
|
||||
datasetProfileId: dataset.profile,
|
||||
datasetProfileId: dataset.profile.id,
|
||||
datasetProfileExist: false,
|
||||
confirmButton: this.language.instant('DATASET-WIZARD.DIALOGUE.COPY'),
|
||||
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> -->
|
||||
</div>
|
||||
<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}}
|
||||
</button>
|
||||
<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: {
|
||||
formControl: formControl,
|
||||
datasetId: dataset.id,
|
||||
datasetProfileId: dataset.profile,
|
||||
datasetProfileId: dataset.profile.id,
|
||||
datasetProfileExist: false,
|
||||
confirmButton: this.language.instant('DATASET-WIZARD.DIALOGUE.COPY'),
|
||||
cancelButton: this.language.instant('DATASET-WIZARD.DIALOGUE.CANCEL')
|
||||
|
|
|
@ -164,7 +164,7 @@ export class DatasetListingItemComponent extends BaseComponent implements OnInit
|
|||
data: {
|
||||
formControl: formControl,
|
||||
datasetId: dataset.id,
|
||||
datasetProfileId: dataset.profile,
|
||||
datasetProfileId: dataset.profile.id,
|
||||
datasetProfileExist: false,
|
||||
confirmButton: this.language.instant('DATASET-WIZARD.DIALOGUE.COPY'),
|
||||
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))
|
||||
.subscribe(result => {
|
||||
if (result && result.datasetProfileExist) {
|
||||
const newDmpId = result.formControl.value.id
|
||||
this.router.navigate(['/datasets/copy/' + result.datasetId], { queryParams: { newDmpId: newDmpId } });
|
||||
const newDmpId = result.formControl.value.id;
|
||||
let url = this.router.createUrlTree(['/datasets/copy/', result.datasetId, { newDmpId: newDmpId }]);
|
||||
window.open(url.toString(), '_blank');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue