From c77cd0c1c6b248bd71c773f6e604d5bd7e147052 Mon Sep 17 00:00:00 2001 From: gpapavgeri Date: Mon, 27 Jul 2020 11:52:42 +0300 Subject: [PATCH] open links in new tab --- .../ui/dashboard/drafts/drafts.component.html | 4 +-- .../ui/dashboard/drafts/drafts.component.ts | 5 ++-- .../recent-edited-activity.component.html | 14 +++++----- .../recent-edited-activity.component.ts | 28 +++++++++---------- ...ent-edited-dataset-activity.component.html | 4 +-- ...ecent-edited-dataset-activity.component.ts | 4 +-- .../recent-edited-dmp-activity.component.html | 10 +++---- .../recent-edited-dmp-activity.component.ts | 17 +++++------ .../dataset-listing-item.component.html | 2 +- .../dmp-listing-item.component.html | 8 +++--- .../dmp-listing-item.component.ts | 19 ++++++++----- .../dmp/overview/dmp-overview.component.html | 11 ++++---- .../ui/dmp/overview/dmp-overview.module.ts | 4 ++- 13 files changed, 68 insertions(+), 62 deletions(-) diff --git a/dmp-frontend/src/app/ui/dashboard/drafts/drafts.component.html b/dmp-frontend/src/app/ui/dashboard/drafts/drafts.component.html index 593c66afe..a48626cb8 100644 --- a/dmp-frontend/src/app/ui/dashboard/drafts/drafts.component.html +++ b/dmp-frontend/src/app/ui/dashboard/drafts/drafts.component.html @@ -21,7 +21,7 @@
- +
open_in_new{{'DATASET-LISTING.ACTIONS.EXPORT' | translate}} group_add{{'DATASET-LISTING.ACTIONS.INVITE-COLLABORATORS' | translate}} diff --git a/dmp-frontend/src/app/ui/dashboard/drafts/drafts.component.ts b/dmp-frontend/src/app/ui/dashboard/drafts/drafts.component.ts index 73e00068d..8efdd2a0a 100644 --- a/dmp-frontend/src/app/ui/dashboard/drafts/drafts.component.ts +++ b/dmp-frontend/src/app/ui/dashboard/drafts/drafts.component.ts @@ -153,8 +153,9 @@ export class DraftsComponent 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'); } }); } diff --git a/dmp-frontend/src/app/ui/dashboard/recent-edited-activity/recent-edited-activity.component.html b/dmp-frontend/src/app/ui/dashboard/recent-edited-activity/recent-edited-activity.component.html index b5abbdf77..7e402570a 100644 --- a/dmp-frontend/src/app/ui/dashboard/recent-edited-activity/recent-edited-activity.component.html +++ b/dmp-frontend/src/app/ui/dashboard/recent-edited-activity/recent-edited-activity.component.html @@ -22,7 +22,7 @@
- +
open_in_new{{'DATASET-LISTING.ACTIONS.EXPORT' | translate}} group_add{{'DATASET-LISTING.ACTIONS.INVITE-COLLABORATORS' | translate}} diff --git a/dmp-frontend/src/app/ui/dashboard/recent-edited-activity/recent-edited-activity.component.ts b/dmp-frontend/src/app/ui/dashboard/recent-edited-activity/recent-edited-activity.component.ts index 0ac0dfe6a..6a24d7c2d 100644 --- a/dmp-frontend/src/app/ui/dashboard/recent-edited-activity/recent-edited-activity.component.ts +++ b/dmp-frontend/src/app/ui/dashboard/recent-edited-activity/recent-edited-activity.component.ts @@ -141,11 +141,6 @@ export class RecentEditedActivityComponent extends BaseComponent implements OnIn this.router.navigate(['/plans/edit/' + dmp.id]); } - cloneClicked(dmp: DmpListingModel) { - let url = this.router.createUrlTree(['/plans/clone/', dmp.id]); - window.open(url.toString(), '_blank'); - } - deleteDmpClicked(dmp: DmpListingModel) { this.lockService.checkLockStatus(dmp.id).pipe(takeUntil(this._destroyed)) .subscribe(lockStatus => { @@ -375,19 +370,20 @@ export class RecentEditedActivityComponent extends BaseComponent implements OnIn return filename; } - addDataset(activityId: String) { - this.router.navigate(['/datasets/new/' + activityId]); - } - newVersion(id: String, label: String) { - this.router.navigate(['/plans/new_version/' + id, { dmpLabel: label }]); + let url = this.router.createUrlTree(['/plans/new_version/', id, { dmpLabel: label }]); + window.open(url.toString(), '_blank'); } viewVersions(rowId: String, rowLabel: String, activity: DmpListingModel) { - if (activity.public && !this.isUserOwner) { - this.router.navigate(['/explore-plans/versions/' + rowId], { queryParams: { groupLabel: rowLabel } }); + if (activity.public && !this.isUserOwner(activity)) { + let url = this.router.createUrlTree(['/explore-plans/versions/', rowId, { groupLabel: rowLabel }]); + window.open(url.toString(), '_blank'); + // this.router.navigate(['/explore-plans/versions/' + rowId], { queryParams: { groupLabel: rowLabel } }); } else { - this.router.navigate(['/plans/versions/' + rowId], { queryParams: { groupLabel: rowLabel } }); + let url = this.router.createUrlTree(['/plans/versions/', rowId, { groupLabel: rowLabel }]); + window.open(url.toString(), '_blank'); + // this.router.navigate(['/plans/versions/' + rowId], { queryParams: { groupLabel: rowLabel } }); } } @@ -409,8 +405,10 @@ export class RecentEditedActivityComponent extends BaseComponent implements OnIn 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'); + // this.router.navigate(['/datasets/copy/' + result.datasetId], { queryParams: { newDmpId: newDmpId } }); } }); } diff --git a/dmp-frontend/src/app/ui/dashboard/recent-edited-dataset-activity/recent-edited-dataset-activity.component.html b/dmp-frontend/src/app/ui/dashboard/recent-edited-dataset-activity/recent-edited-dataset-activity.component.html index 81547c174..802b5895f 100644 --- a/dmp-frontend/src/app/ui/dashboard/recent-edited-dataset-activity/recent-edited-dataset-activity.component.html +++ b/dmp-frontend/src/app/ui/dashboard/recent-edited-dataset-activity/recent-edited-dataset-activity.component.html @@ -21,7 +21,7 @@
- +
open_in_new{{'DATASET-LISTING.ACTIONS.EXPORT' | translate}} group_add{{'DATASET-LISTING.ACTIONS.INVITE-COLLABORATORS' | translate}} diff --git a/dmp-frontend/src/app/ui/dashboard/recent-edited-dataset-activity/recent-edited-dataset-activity.component.ts b/dmp-frontend/src/app/ui/dashboard/recent-edited-dataset-activity/recent-edited-dataset-activity.component.ts index 2ec825c63..2c36090ed 100644 --- a/dmp-frontend/src/app/ui/dashboard/recent-edited-dataset-activity/recent-edited-dataset-activity.component.ts +++ b/dmp-frontend/src/app/ui/dashboard/recent-edited-dataset-activity/recent-edited-dataset-activity.component.ts @@ -167,8 +167,8 @@ export class RecentEditedDatasetActivityComponent extends BaseComponent implemen .subscribe(result => { if (result && result.datasetProfileExist) { const newDmpId = result.formControl.value.id; - let url = this.router.createUrlTree(['/datasets/copy/', result.datasetId, { newDmpId: newDmpId } ]) - window.open(url.toString(), '_blank') + let url = this.router.createUrlTree(['/datasets/copy/', result.datasetId, { newDmpId: newDmpId } ]); + window.open(url.toString(), '_blank'); } }); } diff --git a/dmp-frontend/src/app/ui/dashboard/recent-edited-dmp-activity/recent-edited-dmp-activity.component.html b/dmp-frontend/src/app/ui/dashboard/recent-edited-dmp-activity/recent-edited-dmp-activity.component.html index 1cd0c2176..43d543868 100644 --- a/dmp-frontend/src/app/ui/dashboard/recent-edited-dmp-activity/recent-edited-dmp-activity.component.html +++ b/dmp-frontend/src/app/ui/dashboard/recent-edited-dmp-activity/recent-edited-dmp-activity.component.html @@ -21,7 +21,7 @@
+ @@ -78,7 +78,7 @@ - -
- -
+
diff --git a/dmp-frontend/src/app/ui/dmp/overview/dmp-overview.module.ts b/dmp-frontend/src/app/ui/dmp/overview/dmp-overview.module.ts index 269c70146..0ab7ac9d5 100644 --- a/dmp-frontend/src/app/ui/dmp/overview/dmp-overview.module.ts +++ b/dmp-frontend/src/app/ui/dmp/overview/dmp-overview.module.ts @@ -7,6 +7,7 @@ import { UrlListingModule } from '@app/library/url-listing/url-listing.module'; import { DmpOverviewComponent } from '@app/ui/dmp/overview/dmp-overview.component'; import { CommonFormsModule } from '@common/forms/common-forms.module'; import { CommonUiModule } from '@common/ui/common-ui.module'; +import { RouterModule } from '@angular/router'; @NgModule({ imports: [ @@ -16,7 +17,8 @@ import { CommonUiModule } from '@common/ui/common-ui.module'; ConfirmationDialogModule, ExportMethodDialogModule, FormattingModule, - AutoCompleteModule + AutoCompleteModule, + RouterModule ], declarations: [ DmpOverviewComponent