diff --git a/package-lock.json b/package-lock.json index 4aa96b911f..22042b77ad 100644 --- a/package-lock.json +++ b/package-lock.json @@ -690,6 +690,14 @@ "webpack-sources": "1.1.0" } }, + "@ngx-lite/json-ld": { + "version": "0.4.2", + "resolved": "https://registry.npmjs.org/@ngx-lite/json-ld/-/json-ld-0.4.2.tgz", + "integrity": "sha512-WmHKgON+1QYGzzgQhjnDTqa1yf9r/rmsiL5G6h2A0bfCthhtVqyYydkU9Z2fCcHlVq2d53RVhould4xqVDPtPg==", + "requires": { + "tslib": "1.9.0" + } + }, "@phenomnomnominal/tsquery": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/@phenomnomnominal/tsquery/-/tsquery-1.0.5.tgz", diff --git a/package.json b/package.json index 50916d7bc4..61027d1106 100644 --- a/package.json +++ b/package.json @@ -32,6 +32,7 @@ "@angular/platform-browser-dynamic": "^6.0.2", "@angular/platform-server": "^6.0.2", "@angular/router": "^6.0.2", + "@ngx-lite/json-ld": "^0.4.2", "@types/elastic.js": "^1.2.8", "@types/elasticsearch": "^5.0.14", "@types/jquery": "^3.3.1", diff --git a/src/app/container/container.component.html b/src/app/container/container.component.html index c79e187b92..95808fc267 100644 --- a/src/app/container/container.component.html +++ b/src/app/container/container.component.html @@ -26,6 +26,7 @@
+

diff --git a/src/app/container/container.component.ts b/src/app/container/container.component.ts index a2947fbf71..72843f2fa4 100644 --- a/src/app/container/container.component.ts +++ b/src/app/container/container.component.ts @@ -15,17 +15,15 @@ */ import { Location } from '@angular/common'; import { Component } from '@angular/core'; -import { Router, ActivatedRoute } from '@angular/router'; -import { ENTER, COMMA } from '@angular/cdk/keycodes'; +import { ActivatedRoute, Router } from '@angular/router'; +import { COMMA, ENTER } from '@angular/cdk/keycodes'; import { MatChipInputEvent } from '@angular/material'; -import { Subscription } from 'rxjs'; import { takeUntil } from 'rxjs/operators'; import { ListContainersService } from '../containers/list/list.service'; import { CommunicatorService } from '../shared/communicator.service'; import { ContainerService } from '../shared/container.service'; import { DateService } from '../shared/date.service'; -import { Dockstore } from '../shared/dockstore.model'; import { DockstoreService } from '../shared/dockstore.service'; import { Entry } from '../shared/entry'; import { ImageProviderService } from '../shared/image-provider.service'; @@ -61,6 +59,7 @@ export class ContainerComponent extends Entry { public DockstoreToolType = DockstoreTool; validTabs = ['info', 'launch', 'versions', 'files']; separatorKeysCodes = [ENTER, COMMA]; + public schema; constructor(private dockstoreService: DockstoreService, dateService: DateService, @@ -121,6 +120,13 @@ export class ContainerComponent extends Entry { toolRef = this.imageProviderService.setUpImageProvider(toolRef); } this.resetContainerEditData(); + // messy prototype for a carousel https://developers.google.com/search/docs/guides/mark-up-listings + // will need to be aggregated with a summary page + this.schema = { + '@type': 'ListItem', + 'position': this.tool.id, + 'url': this.shareURL + }; } public subscriptions(): void { diff --git a/src/app/shared/entry/entry.module.ts b/src/app/shared/entry/entry.module.ts index 06bba19e4a..b770a59b4d 100644 --- a/src/app/shared/entry/entry.module.ts +++ b/src/app/shared/entry/entry.module.ts @@ -16,6 +16,7 @@ import { CommonModule } from '@angular/common'; import { NgModule } from '@angular/core'; import { FormsModule } from '@angular/forms'; +import { NgxJsonLdModule } from '@ngx-lite/json-ld'; import { ModalModule } from 'ngx-bootstrap/modal'; import { TooltipModule } from 'ngx-bootstrap/tooltip'; @@ -34,13 +35,15 @@ import { VerifiedDisplayComponent } from './verified-display/verified-display.co import { VerifiedPlatformsPipe } from './verified-platforms.pipe'; import { VersionProviderUrlPipe } from './versionProviderUrl.pipe'; + @NgModule({ imports: [ CommonModule, TooltipModule.forRoot(), FormsModule, ModalModule, - CustomMaterialModule + CustomMaterialModule, + NgxJsonLdModule ], declarations: [ InfoTabCheckerWorkflowPathComponent, @@ -67,7 +70,8 @@ import { VersionProviderUrlPipe } from './versionProviderUrl.pipe'; VerifiedByComponent, VerifiedDisplayComponent, VerifiedPlatformsPipe, - VersionProviderUrlPipe + VersionProviderUrlPipe, + NgxJsonLdModule ] }) export class EntryModule { } diff --git a/src/app/workflow/workflow.component.html b/src/app/workflow/workflow.component.html index a5a5523b48..5e915cc5a0 100644 --- a/src/app/workflow/workflow.component.html +++ b/src/app/workflow/workflow.component.html @@ -40,6 +40,7 @@

The workflow linked to could not be found!

+

diff --git a/src/app/workflow/workflow.component.ts b/src/app/workflow/workflow.component.ts index 379dd41e1b..54a336d827 100644 --- a/src/app/workflow/workflow.component.ts +++ b/src/app/workflow/workflow.component.ts @@ -15,7 +15,7 @@ */ import { Location } from '@angular/common'; import { Component, Input } from '@angular/core'; -import { ENTER, COMMA } from '@angular/cdk/keycodes'; +import { COMMA, ENTER } from '@angular/cdk/keycodes'; import { MatChipInputEvent } from '@angular/material'; import { ActivatedRoute, Router } from '@angular/router'; import { takeUntil } from 'rxjs/operators'; @@ -25,7 +25,7 @@ import { DockstoreService } from '../shared/dockstore.service'; import { Entry } from '../shared/entry'; import { ProviderService } from '../shared/provider.service'; import { Tag } from '../shared/swagger/model/tag'; -import {WorkflowVersion } from '../shared/swagger/model/workflowVersion'; +import { WorkflowVersion } from '../shared/swagger/model/workflowVersion'; import { TrackLoginService } from '../shared/track-login.service'; import { WorkflowService } from '../shared/workflow.service'; import { ErrorService } from './../shared/error.service'; @@ -42,7 +42,7 @@ import RoleEnum = Permission.RoleEnum; @Component({ selector: 'app-workflow', templateUrl: './workflow.component.html', - styleUrls: ['./workflow.component.css'] + styleUrls: ['./workflow.component.css'], }) export class WorkflowComponent extends Entry { workflowEditData: any; @@ -64,6 +64,7 @@ export class WorkflowComponent extends Entry { protected readers = []; protected writers = []; protected owners = []; + public schema; @Input() user; constructor(private dockstoreService: DockstoreService, dateService: DateService, private refreshService: RefreshService, @@ -130,6 +131,13 @@ export class WorkflowComponent extends Entry { workflowRef.versionVerified = this.dockstoreService.getVersionVerified(workflowRef.workflowVersions); workflowRef.verifiedSources = this.dockstoreService.getVerifiedWorkflowSources(workflowRef); this.resetWorkflowEditData(); + // messy prototype for a carousel https://developers.google.com/search/docs/guides/mark-up-listings + // will need to be aggregated with a summary page + this.schema = { + '@type': 'ListItem', + 'position': this.workflow.id, + 'url': this.shareURL + }; } public getDefaultVersionName(): string { diff --git a/src/index.html b/src/index.html index 04b41335ca..9be67c82f9 100644 --- a/src/index.html +++ b/src/index.html @@ -1,5 +1,12 @@ - + + @@ -8,6 +15,32 @@ + +