Skip to content

Commit

Permalink
Feature/base url for docs (#783)
Browse files Browse the repository at this point in the history
* add base url option for docs
  • Loading branch information
agduncan94 authored Sep 11, 2019
1 parent 761b7ae commit c6e4349
Show file tree
Hide file tree
Showing 29 changed files with 75 additions and 37 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 2 additions & 0 deletions src/app/configuration.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

/**
Expand Down
5 changes: 4 additions & 1 deletion src/app/container/versions/versions.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,10 @@
>
Version
</label>
<a *ngIf="!publicPage" href="http://docs.dockstore.org/faq/#what-is-a-default-version-of-a-tool-or-workflow" target="_blank"
<a
*ngIf="!publicPage"
href="{{ Dockstore.DOCUMENTATION_URL }}/faq.html#what-is-a-default-version-of-a-tool-or-workflow"
target="_blank"
><mat-icon>info</mat-icon></a
>
<fa-icon class="pull-right" [icon]="getIconClass('name')" (click)="clickSortColumn('name')"></fa-icon>
Expand Down
2 changes: 2 additions & 0 deletions src/app/container/versions/versions.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand All @@ -37,6 +38,7 @@ import { AddTagComponent } from '../add-tag/add-tag.component';
})
export class VersionsContainerComponent extends Versions implements OnInit {
@Input() versions: Array<any>;
Dockstore = Dockstore;
versionTag: Tag;
public DockstoreToolType = DockstoreTool;
@Input() set selectedVersion(value: Tag) {
Expand Down
7 changes: 6 additions & 1 deletion src/app/footer/footer.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,12 @@
<ul class="footer-list m-0">
<li class="m-0">Dockstore</li>
<li class="m-0">
<a href="https://docs.dockstore.org/docs/" target="_blank" rel="noopener noreferrer" class="footer-link">
<a
href="{{ Dockstore.DOCUMENTATION_URL }}/dockstore-introduction.html"
target="_blank"
rel="noopener noreferrer"
class="footer-link"
>
<small>About</small>
</a>
</li>
Expand Down
1 change: 1 addition & 0 deletions src/app/footer/footer.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ export class FooterComponent extends Base implements OnInit {
tag: string;
public prod = true;
public dsServerURI: any;
Dockstore = Dockstore;

constructor(private metadataService: MetadataService) {
super();
Expand Down
7 changes: 6 additions & 1 deletion src/app/home-page/home-logged-out/home.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,12 @@ <h3 class="text-center">Local launch</h3>
<h3 class="text-center">Next steps</h3>

<div fxLayout="row wrap" fxLayout.lt-md="column" fxLayoutAlign="center center" fxLayoutGap="20px" class="mb-4">
<a mat-stroked-button href="https://docs.dockstore.org/docs/user-tutorials" target="_blank" rel="noopener noreferrer">
<a
mat-stroked-button
href="{{ Dockstore.DOCUMENTATION_URL }}/end-user-topics/end-user-topics.html"
target="_blank"
rel="noopener noreferrer"
>
Getting Started Guide
</a>
<button mat-stroked-button routerLink="/organizations" (click)="scrollToTop()">
Expand Down
2 changes: 2 additions & 0 deletions src/app/home-page/home-logged-out/home.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import { Observable, Subject } from 'rxjs';
import { User } from '../../shared/swagger/model/user';
import { TwitterService } from '../../shared/twitter.service';
import { UserQuery } from '../../shared/user/user.query';
import { Dockstore } from '../../shared/dockstore.model';

/**
* Simple youtube iframe component, too simple to have its own file
Expand All @@ -46,6 +47,7 @@ export class HomeComponent implements OnInit, AfterViewInit {
public user$: Observable<User>;
public selectedTab = 'toolTab';
protected ngUnsubscribe: Subject<{}> = new Subject();
Dockstore = Dockstore;

@ViewChild('youtube') youtube: ElementRef;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ <h2 class="unpadded-caption">Docker Tools and Workflows for the Sciences</h2>
/>
</div>
<div class="m-2" fxLayout="column" fxLayoutAlign="center" fxLayoutGap="0.5rem">
<a mat-flat-button color="accent" href="https://docs.dockstore.org/docs/#about-the-dockstore" class="big-button">
<a mat-flat-button color="accent" href="{{ Dockstore.DOCUMENTATION_URL }}/dockstore-introduction.html" class="big-button">
About
</a>
<button mat-flat-button color="accent" routerLink="/quick-start" class="big-button">Quickstart</button>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
import { Component } from '@angular/core';
import { HomePageService } from 'app/home-page/home-page.service';
import { Dockstore } from '../../shared/dockstore.model';

@Component({
selector: 'app-logged-in-banner',
templateUrl: './logged-in-banner.component.html',
styleUrls: ['./logged-in-banner.component.scss']
})
export class LoggedInBannerComponent {
Dockstore = Dockstore;
constructor(private homePageService: HomePageService) {}

goToSearch(searchValue: string) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ <h4 class="title caption">
<a mat-raised-button color="accent" routerLink="onboarding">Setup Account <mat-icon>chevron_right</mat-icon></a>
</div>
<div class="col-sm-6 col-xs-12 col-md-12">
<a mat-raised-button color="accent" href="https://docs.dockstore.org/news/"
<a mat-raised-button color="accent" href="{{ Dockstore.DOCUMENTATION_URL }}/news/"
>News and Events <mat-icon>chevron_right</mat-icon></a
>
</div>
Expand Down
3 changes: 3 additions & 0 deletions src/app/home-page/old-home-page/old-home-page.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ import { TwitterService } from 'app/shared/twitter.service';
import { UserQuery } from 'app/shared/user/user.query';
import { TabDirective } from 'ngx-bootstrap/tabs';
import { Observable } from 'rxjs';
import { Dockstore } from '../../shared/dockstore.model';

/**
* Simple youtube iframe component, too simple to have its own file
*
Expand All @@ -46,6 +48,7 @@ export class OldHomePageComponent implements OnInit, AfterViewInit {
public browseWorkflowsTab = 'browseWorkflowsTab';
public user$: Observable<User>;
public selectedTab = 'toolTab';
Dockstore = Dockstore;

@ViewChild('youtube') youtube: ElementRef;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ <h5>Dockstore External Services</h5>
<a
mat-raised-button
color="primary"
href="https://docs.dockstore.org/docs/prereqs/getting-started-with-docker/"
href="{{ Dockstore.DOCUMENTATION_URL }}/getting-started/getting-started-with-docker.html"
class="pull-right ml-1"
>Go to Docs<mat-icon>navigate_next</mat-icon></a
>
Expand Down
3 changes: 2 additions & 1 deletion src/app/loginComponents/onboarding/onboarding.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import { distinctUntilChanged, takeUntil } from 'rxjs/operators';

import { ExtendedUserData, User, UsersService } from '../../shared/swagger';
import { UserQuery } from '../../shared/user/user.query';
import { TokenService } from '../../shared/state/token.service';
import { TokenQuery } from '../../shared/state/token.query';
import { Dockstore } from '../../shared/dockstore.model';

@Component({
selector: 'app-onboarding',
Expand All @@ -17,6 +17,7 @@ export class OnboardingComponent implements OnInit, OnDestroy {
extendedUser: ExtendedUserData;
user: User;
ready = false;
Dockstore = Dockstore;
constructor(private userQuery: UserQuery, private usersService: UsersService, private tokenService: TokenQuery) {}
ngOnInit() {
localStorage.setItem('page', '/onboarding');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
<button class="changePage" (click)="prevStep()"><mat-icon>chevron_left</mat-icon>Previous</button>
</li>
<li>
<a href="https://docs.dockstore.org/docs/user-tutorials/launch/">Finish<mat-icon>chevron_right</mat-icon></a>
<a href="{{ Dockstore.DOCUMENTATION_URL }}/end-user-topics/launch.html">Finish<mat-icon>chevron_right</mat-icon></a>
</li>
</ul>
</nav>
Expand Down
2 changes: 2 additions & 0 deletions src/app/loginComponents/onboarding/quickstart.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
* limitations under the License.
*/
import { Component, OnInit } from '@angular/core';
import { Dockstore } from '../../shared/dockstore.model';

@Component({
selector: 'app-onboarding',
Expand All @@ -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');
Expand Down
4 changes: 2 additions & 2 deletions src/app/navbar/navbar.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
<a mat-button class="icon" (click)="resetPageNumber()" routerLink="/organizations">
<mat-icon class="hidden-sm">people</mat-icon> Organizations
</a>
<a mat-button class="icon" href="http://docs.dockstore.org/">
<a mat-button class="icon" href="{{ Dockstore.DOCUMENTATION_URL }}">
<img class="site-icons-small hidden-sm" src="../assets/images/dockstore/dockstore-documentation.png" /> Docs
</a>
<span class="spacer"></span>
Expand Down Expand Up @@ -76,7 +76,7 @@
<div class="container-fluid navbar-holder">
<a mat-button class="icon icon-sm" routerLink="/search">Search</a>
<a mat-button class="icon icon-sm" routerLink="/organizations">Organizations</a>
<a mat-button class="icon icon-sm" href="http://docs.dockstore.org/">Docs</a>
<a mat-button class="icon icon-sm" href="{{ Dockstore.DOCUMENTATION_URL }}">Docs</a>
</div>
</mat-toolbar-row>
</mat-toolbar>
Expand Down
2 changes: 2 additions & 0 deletions src/app/navbar/navbar.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand All @@ -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;
Expand Down
3 changes: 2 additions & 1 deletion src/app/shared/date.service.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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(() => {
Expand All @@ -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');
Expand Down
3 changes: 2 additions & 1 deletion src/app/shared/date.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
*/

import { Injectable } from '@angular/core';
import { Dockstore } from '../shared/dockstore.model';

@Injectable()
export class DateService {
Expand All @@ -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 {
Expand Down
2 changes: 2 additions & 0 deletions src/app/shared/dockstore.model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
};
Expand Down
3 changes: 2 additions & 1 deletion src/app/shared/private-icon/private-icon.component.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { Component, OnInit } from '@angular/core';
import { Dockstore } from '../../shared/dockstore.model';

@Component({
selector: 'app-private-icon',
Expand All @@ -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() {}
}
30 changes: 12 additions & 18 deletions src/app/sitemap/sitemap.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -42,17 +42,17 @@ <h3 class="documentation">Tools and Workflows</h3>
<h3 class="documentation">Using Dockstore</h3>
<ul>
<li>
<a target="_blank" href="https://docs.dockstore.org/news/">
<a target="_blank" href="{{ Dockstore.DOCUMENTATION_URL }}/news/">
News and Events
</a>
</li>
<li>
<a target="_blank" href="https://docs.dockstore.org/docs/publisher-tutorials/advanced-features/">
<a target="_blank" href="{{ Dockstore.DOCUMENTATION_URL }}/advanced-topics/advanced-features.html">
Advanced Features
</a>
</li>
<li>
<a target="_blank" href="https://docs.dockstore.org/faq/">
<a target="_blank" href="{{ Dockstore.DOCUMENTATION_URL }}/faq.html">
FAQ
</a>
</li>
Expand All @@ -77,56 +77,50 @@ <h3 class="documentation">Using Dockstore</h3>
<h3>Adding to Dockstore</h3>
<ul>
<li>
<a
target="_blank"
href="https://docs.dockstore.org/docs/publisher-tutorials/getting-started-with-dockstore/#getting-started-with-dockstore"
>
<a target="_blank" href="{{ Dockstore.DOCUMENTATION_URL }}/getting-started/register-on-dockstore.html">
Sign Up for Accounts
</a>
</li>
<li>
<a target="_blank" href="https://docs.dockstore.org/docs/prereqs/getting-started-with-docker/">
<a target="_blank" href="{{ Dockstore.DOCUMENTATION_URL }}/getting-started/getting-started-with-docker.html">
Create Your Tool
</a>
</li>
<li>
<a target="_blank" href="https://docs.dockstore.org/docs/prereqs/getting-started-with-cwl/">
<a target="_blank" href="{{ Dockstore.DOCUMENTATION_URL }}/getting-started/getting-started-with-cwl.html">
Describe Your Tool
</a>
</li>
<li>
<a
target="_blank"
href="https://docs.dockstore.org/docs/publisher-tutorials/getting-started-with-dockstore/#register-your-tool-in-dockstore"
>
<a target="_blank" href="{{ Dockstore.DOCUMENTATION_URL }}/getting-started/dockstore-tools.html">
Register Your Tool in Dockstore
</a>
</li>
</ul>
<h3>About Dockstore</h3>
<ul>
<li>
<a target="_blank" href="https://docs.dockstore.org/docs/#about-the-dockstore">
<a target="_blank" href="{{ Dockstore.DOCUMENTATION_URL }}/dockstore-introduction.html">
About the Dockstore
</a>
</li>
<li>
<a target="_blank" href="https://docs.dockstore.org/docs/#built-with-quayio-and-github">
<a target="_blank" href="{{ Dockstore.DOCUMENTATION_URL }}/dockstore-introduction.html#built-with-docker-and-git">
Built with Quay.io and Github
</a>
</li>
<li>
<a target="_blank" href="https://docs.dockstore.org/docs/#best-practices">
<a target="_blank" href="{{ Dockstore.DOCUMENTATION_URL }}/dockstore-introduction.html#strategies">
Best Practices
</a>
</li>
<li>
<a target="_blank" href="https://docs.dockstore.org/docs/#promoting-standards">
<a target="_blank" href="{{ Dockstore.DOCUMENTATION_URL }}/dockstore-introduction.html#promoting-standards">
Promoting Standards
</a>
</li>
<li>
<a target="_blank" href="https://docs.dockstore.org/docs/#future-plans">
<a target="_blank" href="{{ Dockstore.DOCUMENTATION_URL }}/dockstore-introduction.html#future-plans">
Future Plans
</a>
</li>
Expand Down
2 changes: 2 additions & 0 deletions src/app/sitemap/sitemap.component.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { Component, OnInit } from '@angular/core';
import { devMode } from 'app/shared/constants';
import { Dockstore } from '../shared/dockstore.model';

@Component({
selector: 'sitemap',
Expand All @@ -8,6 +9,7 @@ import { devMode } from 'app/shared/constants';
})
export class SitemapComponent implements OnInit {
devMode = devMode;
Dockstore = Dockstore;
constructor() {}

ngOnInit() {}
Expand Down
Loading

0 comments on commit c6e4349

Please sign in to comment.