diff --git a/package.json b/package.json index eeb3586d30..0fe04dd347 100644 --- a/package.json +++ b/package.json @@ -47,7 +47,6 @@ "json2typescript": "^1.0.6", "jsonld": "^1.1.0", "moment": "^2.27.0", - "ngx-clipboard": "^14.0.1", "ngx-color-picker": "^10.0.1", "openseadragon": "^2.4.0", "rxjs": "~6.5.3", diff --git a/src/app/app.module.ts b/src/app/app.module.ts index 7aeb0f7f3f..eea32a3f51 100644 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -1,3 +1,4 @@ +import { ClipboardModule } from '@angular/cdk/clipboard'; import { CommonModule } from '@angular/common'; import { HttpClient, HttpClientModule } from '@angular/common/http'; import { APP_INITIALIZER, NgModule } from '@angular/core'; @@ -83,7 +84,6 @@ import { DatasetTabViewComponent } from './project/board/dataset-tab-view/datase import { AttributionTabViewComponent } from './project/board/attribution-tab-view/attribution-tab-view.component'; import { TermsTabViewComponent } from './project/board/terms-tab-view/terms-tab-view.component'; import { ContactsTabViewComponent } from './project/board/contacts-tab-view/contacts-tab-view.component'; -import { ClipboardModule } from 'ngx-clipboard'; import { AngularSplitModule } from 'angular-split'; import { PersonTemplateComponent } from './project/board/person-template/person-template.component'; diff --git a/src/app/project/board/attribution-tab-view/attribution-tab-view.component.ts b/src/app/project/board/attribution-tab-view/attribution-tab-view.component.ts index 2b2145b047..eeca37f7c7 100644 --- a/src/app/project/board/attribution-tab-view/attribution-tab-view.component.ts +++ b/src/app/project/board/attribution-tab-view/attribution-tab-view.component.ts @@ -18,5 +18,5 @@ export class AttributionTabViewComponent { if (agent.hasOwnProperty('url')){ return 'organisation'; } - }; + } } diff --git a/src/app/project/board/board.component.html b/src/app/project/board/board.component.html index 8f06bd43ae..9b142ad220 100644 --- a/src/app/project/board/board.component.html +++ b/src/app/project/board/board.component.html @@ -125,31 +125,43 @@

Dataset(s)

-

Cite as

-
-

+
-
- Persistent identifier +
+
+ Persistent identifier +
+
-
- License +
+
+ License +
+
{{ selectedDataset.license.value }} diff --git a/src/app/project/board/board.component.scss b/src/app/project/board/board.component.scss index 5f46cb8548..ebbb2e495f 100644 --- a/src/app/project/board/board.component.scss +++ b/src/app/project/board/board.component.scss @@ -87,14 +87,9 @@ section { display: inline-block; } - .copy-to-clipboard { - display: inline-block; - float: right; - - button { - cursor: pointer; - border: none; - } + .btn-copy-to-clipboard { + padding: 0px 10px; + min-width: auto; } .mat-radio-button { @@ -155,7 +150,7 @@ section { } .property:not(:last-child) { - margin-bottom: 13px; + margin-bottom: 20px; } } diff --git a/src/app/project/board/board.component.ts b/src/app/project/board/board.component.ts index d651aac75a..72d53f846b 100644 --- a/src/app/project/board/board.component.ts +++ b/src/app/project/board/board.component.ts @@ -1,6 +1,7 @@ import { Component, Inject, OnInit } from '@angular/core'; import { MatDialog, MatDialogConfig } from '@angular/material/dialog'; import { MatRadioChange } from '@angular/material/radio'; +import { MatSnackBar } from '@angular/material/snack-bar'; import { Title } from '@angular/platform-browser'; import { ActivatedRoute, Params } from '@angular/router'; import { @@ -11,7 +12,6 @@ import { ReadProject } from '@dasch-swiss/dsp-js'; import { DspApiConnectionToken, Session, SessionService } from '@dasch-swiss/dsp-ui'; -import { ClipboardService } from 'ngx-clipboard'; import { DialogComponent } from 'src/app/main/dialog/dialog.component'; import { ErrorHandlerService } from 'src/app/main/error/error-handler.service'; import { CacheService } from '../../main/cache/cache.service'; @@ -71,7 +71,7 @@ export class BoardComponent implements OnInit { private _dialog: MatDialog, private _route: ActivatedRoute, private _titleService: Title, - private _clipboardService: ClipboardService + private _snackBar: MatSnackBar ) { // get the shortcode of the current project this._route.parent.paramMap.subscribe((params: Params) => { @@ -422,8 +422,15 @@ export class BoardComponent implements OnInit { this.selectedDataset = this.datasets[event.value]; } - copyHowToCiteToClipboard() { - this._clipboardService.copyFromContent(this.selectedDataset.howToCite); + // copy link to clipboard + copyToClipboard(msg: string) { + const message = 'Copied to clipboard!'; + const action = msg; + this._snackBar.open(message, action, { + duration: 3000, + horizontalPosition: 'center', + verticalPosition: 'top' + }); } openDialog(mode: string, name: string, id?: string): void { diff --git a/src/app/project/board/dataset-metadata.ts b/src/app/project/board/dataset-metadata.ts index 7ae52a9c14..e0d7370e62 100644 --- a/src/app/project/board/dataset-metadata.ts +++ b/src/app/project/board/dataset-metadata.ts @@ -1,10 +1,8 @@ -/* Interface for url type */ export interface UrlProperty { type: string; value: string; } -/* Interface to add address metadata */ export interface IAddress { type: string; streetAddress: string; @@ -12,7 +10,6 @@ export interface IAddress { addressLocality: string; } -/* Interface to add organisation metadata */ export interface IOrganisation { type: string; id: string; @@ -22,7 +19,6 @@ export interface IOrganisation { url?: string; } -/* Interface to add person metadata */ export interface IPerson { type: string; id: string; @@ -36,14 +32,12 @@ export interface IPerson { address?: IAddress | IAddress[]; } -/* Interface for Attribution array available for every dataset */ export interface IAttribution { type: string; role: string; agent: IPerson | IOrganisation; } -/* Interface to add DMP metadata */ export interface IDMP { type: string; id: string; @@ -51,23 +45,19 @@ export interface IDMP { url?: UrlProperty; } -/* Interface to add SpatialCoverage: place metadata */ export interface IPlace { name: string; url: string; } -/* Interface to add SpatialCoverage metadata */ export interface ISpatialCoverage { place: IPlace; } -/* Interface for funder metadata */ export interface IFunder { id: string; } -/* Interface to add grant metadata */ export interface IGrant { type: string; id: string; @@ -77,7 +67,6 @@ export interface IGrant { url?: UrlProperty; } -/* Interface to add project metadata */ export interface IProject { type: string; id: string; @@ -99,7 +88,6 @@ export interface IProject { alternateName?: string | string[]; } -/* Interface to add dataset metadata */ export interface IDataset { type: string; id: string; diff --git a/src/app/project/board/project-tab-view/project-tab-view.component.html b/src/app/project/board/project-tab-view/project-tab-view.component.html index 166e415348..762cb2c822 100644 --- a/src/app/project/board/project-tab-view/project-tab-view.component.html +++ b/src/app/project/board/project-tab-view/project-tab-view.component.html @@ -11,34 +11,34 @@

- + - + - + - + - +
{{ kword }}
- +

{{ metadata.dataManagementPlan.isAvailable? 'Available' : 'Unavailable' }}

@@ -46,7 +46,7 @@

- +
{{ metadata.grant.name }}

Id: {{ metadata.grant.id }}

@@ -58,14 +58,14 @@

- +
{{ coverage.place.name }} ( {{ coverage.place.url }} )
- +
{{ prop.value }}