From c6e4349877b353935b5f431b33f8a32585051227 Mon Sep 17 00:00:00 2001 From: Andrew Duncan Date: Wed, 11 Sep 2019 14:21:56 +0200 Subject: [PATCH] Feature/base url for docs (#783) * add base url option for docs --- package.json | 2 +- src/app/configuration.service.ts | 2 ++ .../versions/versions.component.html | 5 +++- .../container/versions/versions.component.ts | 2 ++ src/app/footer/footer.component.html | 7 ++++- src/app/footer/footer.component.ts | 1 + .../home-logged-out/home.component.html | 7 ++++- .../home-logged-out/home.component.ts | 2 ++ .../logged-in-banner.component.html | 2 +- .../logged-in-banner.component.ts | 2 ++ .../old-home-page.component.html | 2 +- .../old-home-page/old-home-page.component.ts | 3 ++ .../onboarding/onboarding.component.html | 2 +- .../onboarding/onboarding.component.ts | 3 +- .../onboarding/quickstart.component.html | 2 +- .../onboarding/quickstart.component.ts | 2 ++ src/app/navbar/navbar.component.html | 4 +-- src/app/navbar/navbar.component.ts | 2 ++ src/app/shared/date.service.spec.ts | 3 +- src/app/shared/date.service.ts | 3 +- src/app/shared/dockstore.model.ts | 2 ++ .../private-icon/private-icon.component.ts | 3 +- src/app/sitemap/sitemap.component.html | 30 ++++++++----------- src/app/sitemap/sitemap.component.ts | 2 ++ src/app/test/service-stubs.ts | 2 +- .../workflow/info-tab/info-tab.component.html | 8 +++-- .../workflow/info-tab/info-tab.component.ts | 1 + .../workflow/versions/versions.component.html | 5 +++- .../workflow/versions/versions.component.ts | 1 + 29 files changed, 75 insertions(+), 37 deletions(-) diff --git a/package.json b/package.json index ced52897bf..a4638f2064 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,7 @@ "version": "2.3.0", "license": "Apache License 2.0", "config": { - "webservice_version": "1.7.0-beta.6" + "webservice_version": "1.7.0-rc.1" }, "scripts": { "ng": "npx ng", diff --git a/src/app/configuration.service.ts b/src/app/configuration.service.ts index d59d4f3d8f..9462d2a9d5 100644 --- a/src/app/configuration.service.ts +++ b/src/app/configuration.service.ts @@ -67,6 +67,8 @@ export class ConfigurationService { Dockstore.CWL_VISUALIZER_URI = config.cwlVisualizerUri; Dockstore.GITHUB_APP_INSTALLATION_URL = config.gitHubAppInstallationUrl; + + Dockstore.DOCUMENTATION_URL = config.documentationUrl; } /** diff --git a/src/app/container/versions/versions.component.html b/src/app/container/versions/versions.component.html index f5e911ad44..6ff605658a 100644 --- a/src/app/container/versions/versions.component.html +++ b/src/app/container/versions/versions.component.html @@ -30,7 +30,10 @@ > Version - info diff --git a/src/app/container/versions/versions.component.ts b/src/app/container/versions/versions.component.ts index e95fe27d63..ca7f29f810 100644 --- a/src/app/container/versions/versions.component.ts +++ b/src/app/container/versions/versions.component.ts @@ -29,6 +29,7 @@ import { DockstoreTool } from '../../shared/swagger/model/dockstoreTool'; import { Tag } from '../../shared/swagger/model/tag'; import { Versions } from '../../shared/versions'; import { AddTagComponent } from '../add-tag/add-tag.component'; +import { Dockstore } from '../../shared/dockstore.model'; @Component({ selector: 'app-versions-container', @@ -37,6 +38,7 @@ import { AddTagComponent } from '../add-tag/add-tag.component'; }) export class VersionsContainerComponent extends Versions implements OnInit { @Input() versions: Array; + Dockstore = Dockstore; versionTag: Tag; public DockstoreToolType = DockstoreTool; @Input() set selectedVersion(value: Tag) { diff --git a/src/app/footer/footer.component.html b/src/app/footer/footer.component.html index fc93eb8262..cacc9d7528 100644 --- a/src/app/footer/footer.component.html +++ b/src/app/footer/footer.component.html @@ -21,7 +21,12 @@ diff --git a/src/app/loginComponents/onboarding/quickstart.component.ts b/src/app/loginComponents/onboarding/quickstart.component.ts index d5dbe944f6..4e0db311f3 100644 --- a/src/app/loginComponents/onboarding/quickstart.component.ts +++ b/src/app/loginComponents/onboarding/quickstart.component.ts @@ -14,6 +14,7 @@ * limitations under the License. */ import { Component, OnInit } from '@angular/core'; +import { Dockstore } from '../../shared/dockstore.model'; @Component({ selector: 'app-onboarding', @@ -22,6 +23,7 @@ import { Component, OnInit } from '@angular/core'; export class QuickStartComponent implements OnInit { public curStep = 1; public tokenSetComplete; + Dockstore = Dockstore; constructor() {} ngOnInit() { localStorage.setItem('page', '/quick-start'); diff --git a/src/app/navbar/navbar.component.html b/src/app/navbar/navbar.component.html index a2f47c9903..92e019e39f 100644 --- a/src/app/navbar/navbar.component.html +++ b/src/app/navbar/navbar.component.html @@ -26,7 +26,7 @@ Organizations - + Docs @@ -76,7 +76,7 @@ diff --git a/src/app/navbar/navbar.component.ts b/src/app/navbar/navbar.component.ts index aa01ecf9a5..d7996c479f 100644 --- a/src/app/navbar/navbar.component.ts +++ b/src/app/navbar/navbar.component.ts @@ -26,6 +26,7 @@ import { PageInfo } from './../shared/models/PageInfo'; import { PagenumberService } from './../shared/pagenumber.service'; import { User } from './../shared/swagger/model/user'; import { TrackLoginService } from './../shared/track-login.service'; +import { Dockstore } from '../shared/dockstore.model'; @Component({ selector: 'app-navbar', @@ -37,6 +38,7 @@ export class NavbarComponent extends Logout implements OnInit { extendedUser: any; isExtended = false; devMode = devMode; + Dockstore = Dockstore; protected ngUnsubscribe: Subject<{}> = new Subject(); private currentTOSVersion: User.TosversionEnum = User.TosversionEnum.TOSVERSION1; private currentPrivacyPolicyVersion: User.PrivacyPolicyVersionEnum = User.PrivacyPolicyVersionEnum.PRIVACYPOLICYVERSION25; diff --git a/src/app/shared/date.service.spec.ts b/src/app/shared/date.service.spec.ts index 5fbeb1e4e0..1d562dc32c 100644 --- a/src/app/shared/date.service.spec.ts +++ b/src/app/shared/date.service.spec.ts @@ -20,6 +20,7 @@ import { ContainersStubService } from '../test/service-stubs'; import { ContainersService } from './swagger/api/containers.service'; import { ImageProviderService } from './image-provider.service'; import { TestBed, inject } from '@angular/core/testing'; +import { Dockstore } from '../shared/dockstore.model'; describe('DateService', () => { beforeEach(() => { @@ -40,7 +41,7 @@ describe('DateService', () => { expect(service.getAgoMessage(1498675698000)).toContain(' days ago'); })); it('should be getVerifiedLink', inject([DateService], (service: DateService) => { - expect(service.getVerifiedLink()).toEqual('https://docs.dockstore.org/faq/#what-is-a-verified-tool-or-workflow'); + expect(service.getVerifiedLink()).toEqual(Dockstore.DOCUMENTATION_URL + '/faq.html#what-is-a-verified-tool-or-workflow'); })); it('should be ISO8601Format when given number', inject([DateService], (service: DateService) => { expect(service.getISO8601Format(1498675698000)).toEqual('2017-06-28T18:48:18.000Z'); diff --git a/src/app/shared/date.service.ts b/src/app/shared/date.service.ts index 24232857f1..05e51d83e5 100644 --- a/src/app/shared/date.service.ts +++ b/src/app/shared/date.service.ts @@ -15,6 +15,7 @@ */ import { Injectable } from '@angular/core'; +import { Dockstore } from '../shared/dockstore.model'; @Injectable() export class DateService { @@ -40,7 +41,7 @@ export class DateService { /*Note: change this link if necessary */ getVerifiedLink(): string { - return 'https://docs.dockstore.org/faq/#what-is-a-verified-tool-or-workflow'; + return Dockstore.DOCUMENTATION_URL + '/faq.html#what-is-a-verified-tool-or-workflow'; } getAgoMessage(timestamp: number): string | null { diff --git a/src/app/shared/dockstore.model.ts b/src/app/shared/dockstore.model.ts index 97e28e8f91..1ec6c4dfb5 100644 --- a/src/app/shared/dockstore.model.ts +++ b/src/app/shared/dockstore.model.ts @@ -68,6 +68,8 @@ export class Dockstore { static GITHUB_APP_INSTALLATION_URL = 'will be filled in by configuration.service'; + static DOCUMENTATION_URL = 'https://docs.dockstore.org'; + static FEATURES = { enableCwlViewer: true }; diff --git a/src/app/shared/private-icon/private-icon.component.ts b/src/app/shared/private-icon/private-icon.component.ts index 9f8b4142bf..46df84a945 100644 --- a/src/app/shared/private-icon/private-icon.component.ts +++ b/src/app/shared/private-icon/private-icon.component.ts @@ -1,4 +1,5 @@ import { Component, OnInit } from '@angular/core'; +import { Dockstore } from '../../shared/dockstore.model'; @Component({ selector: 'app-private-icon', @@ -7,6 +8,6 @@ import { Component, OnInit } from '@angular/core'; }) export class PrivateIconComponent { // Change this link if necessary - readonly privateDocsLink = 'https://docs.dockstore.org/docs/publisher-tutorials/public-and-private-tools/'; + readonly privateDocsLink = Dockstore.DOCUMENTATION_URL + '/advanced-topics/public-and-private-tools.html'; constructor() {} } diff --git a/src/app/sitemap/sitemap.component.html b/src/app/sitemap/sitemap.component.html index 638d63aabd..518bcc411e 100644 --- a/src/app/sitemap/sitemap.component.html +++ b/src/app/sitemap/sitemap.component.html @@ -42,17 +42,17 @@

Tools and Workflows

Using Dockstore