Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ <h4 class="fontsize-l" [ngClass]="{'singleDataset': state.singleDataset}">
</ng-container>
<ng-container matColumnDef="copyLink">
<mat-cell *matCellDef="let element" class="copy-to-clipboard fontsize-xxs">
<copy-to-clipboard [copyToClipboardLink]="getReleaseFileUrl(element.url)"></copy-to-clipboard>
<copy-to-clipboard [copyToClipboardLink]="getReleaseFileUrl(element.url)"
(copyClicked)="trackReleaseFileUrlCopied(state.releaseDataset, element)"></copy-to-clipboard>
</mat-cell>
</ng-container>
<mat-row *matRowDef="let row; columns: columnsToDisplay;"></mat-row>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,23 @@ export class ReleaseFilesModalComponent implements OnDestroy, OnInit {
});
}

/**
* Track copy to clipboard of release file URL.
*
* @param {string} releaseDatasetView
* @param {ReleaseDatasetView} releaseFile
*/
public trackReleaseFileUrlCopied(releaseDatasetView: ReleaseDatasetView, releaseFile: ReleaseFileView): void {

this.gtmService.trackEvent(GACategory.DATASET, GAAction.COPY_TO_CLIPBOARD, releaseDatasetView.datasetId, {
[GADimension.ENTITY_URL]: this.getReleaseFileUrl(releaseFile.url),
[GADimension.FILE_TYPE]: releaseFile.type,
[GADimension.FILE_FORMAT]: releaseFile.extension,
[GADimension.FILE_NAME]: releaseFile.url,
[GADimension.RELEASE_NAME]: ReleaseName.RELEASE_2020_MAR
});
}

/**
* Create model of dataset to back modal. The specified release is expected to have a single project containing a
* single dataset; the dataset we want to display.
Expand Down