From 28d63ad8e12389b2a9fa23306e40f4b87be3b469 Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Wed, 14 Mar 2018 16:37:24 +0100 Subject: Add Web3Wrapper docs to website --- packages/website/ts/pages/documentation/doc_page.tsx | 2 ++ 1 file changed, 2 insertions(+) (limited to 'packages/website/ts/pages/documentation/doc_page.tsx') diff --git a/packages/website/ts/pages/documentation/doc_page.tsx b/packages/website/ts/pages/documentation/doc_page.tsx index 1281219c6..5b89054f2 100644 --- a/packages/website/ts/pages/documentation/doc_page.tsx +++ b/packages/website/ts/pages/documentation/doc_page.tsx @@ -22,12 +22,14 @@ const docIdToS3BucketName: { [id: string]: string } = { [DocPackages.ZeroExJs]: isDevelopment ? 'staging-0xjs-docs-jsons' : '0xjs-docs-jsons', [DocPackages.SmartContracts]: 'smart-contracts-docs-json', [DocPackages.Connect]: isDevelopment ? 'staging-connect-docs-jsons' : 'connect-docs-jsons', + [DocPackages.Web3Wrapper]: isDevelopment ? 'staging-web3-wrapper-docs-json' : 'web3-wrapper-docs-json', }; const docIdToSubpackageName: { [id: string]: string } = { [DocPackages.ZeroExJs]: '0x.js', [DocPackages.Connect]: 'connect', [DocPackages.SmartContracts]: 'contracts', + [DocPackages.Web3Wrapper]: 'web3-wrapper', }; export interface DocPageProps { -- cgit v1.2.3 From f9ad97b978ae4017adca032168ae7963c94e4157 Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Thu, 15 Mar 2018 19:23:21 +0100 Subject: Add Deployer docs to website --- packages/website/ts/pages/documentation/doc_page.tsx | 2 ++ 1 file changed, 2 insertions(+) (limited to 'packages/website/ts/pages/documentation/doc_page.tsx') diff --git a/packages/website/ts/pages/documentation/doc_page.tsx b/packages/website/ts/pages/documentation/doc_page.tsx index 5b89054f2..ecae7147d 100644 --- a/packages/website/ts/pages/documentation/doc_page.tsx +++ b/packages/website/ts/pages/documentation/doc_page.tsx @@ -23,6 +23,7 @@ const docIdToS3BucketName: { [id: string]: string } = { [DocPackages.SmartContracts]: 'smart-contracts-docs-json', [DocPackages.Connect]: isDevelopment ? 'staging-connect-docs-jsons' : 'connect-docs-jsons', [DocPackages.Web3Wrapper]: isDevelopment ? 'staging-web3-wrapper-docs-json' : 'web3-wrapper-docs-json', + [DocPackages.Deployer]: isDevelopment ? 'staging-depoyer-docs-jsons' : 'depoyer-docs-jsons', }; const docIdToSubpackageName: { [id: string]: string } = { @@ -30,6 +31,7 @@ const docIdToSubpackageName: { [id: string]: string } = { [DocPackages.Connect]: 'connect', [DocPackages.SmartContracts]: 'contracts', [DocPackages.Web3Wrapper]: 'web3-wrapper', + [DocPackages.Deployer]: 'deployer', }; export interface DocPageProps { -- cgit v1.2.3 From d7bf003d511321ec6cb8814cb1549c46b4efba86 Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Fri, 16 Mar 2018 16:56:53 +0100 Subject: Refactor all docJSON's to reside within the same S3 bucket under different folders --- .../website/ts/pages/documentation/doc_page.tsx | 28 +++++++++++----------- 1 file changed, 14 insertions(+), 14 deletions(-) (limited to 'packages/website/ts/pages/documentation/doc_page.tsx') diff --git a/packages/website/ts/pages/documentation/doc_page.tsx b/packages/website/ts/pages/documentation/doc_page.tsx index ecae7147d..5f09ec9ef 100644 --- a/packages/website/ts/pages/documentation/doc_page.tsx +++ b/packages/website/ts/pages/documentation/doc_page.tsx @@ -17,13 +17,13 @@ import { utils } from 'ts/utils/utils'; const ZERO_EX_JS_VERSION_MISSING_TOPLEVEL_PATH = '0.32.4'; -const isDevelopment = configs.ENVIRONMENT === Environments.DEVELOPMENT; -const docIdToS3BucketName: { [id: string]: string } = { - [DocPackages.ZeroExJs]: isDevelopment ? 'staging-0xjs-docs-jsons' : '0xjs-docs-jsons', - [DocPackages.SmartContracts]: 'smart-contracts-docs-json', - [DocPackages.Connect]: isDevelopment ? 'staging-connect-docs-jsons' : 'connect-docs-jsons', - [DocPackages.Web3Wrapper]: isDevelopment ? 'staging-web3-wrapper-docs-json' : 'web3-wrapper-docs-json', - [DocPackages.Deployer]: isDevelopment ? 'staging-depoyer-docs-jsons' : 'depoyer-docs-jsons', +const isDevelopment = configs.ENVIRONMENT !== Environments.DEVELOPMENT; +const docIdToS3FolderName: { [id: string]: string } = { + [DocPackages.ZeroExJs]: '0xjs', + [DocPackages.SmartContracts]: 'smart-contracts', + [DocPackages.Connect]: 'connect', + [DocPackages.Web3Wrapper]: 'web3-wrapper', + [DocPackages.Deployer]: 'deployer', }; const docIdToSubpackageName: { [id: string]: string } = { @@ -101,25 +101,25 @@ export class DocPage extends React.Component { ); } private async _fetchJSONDocsFireAndForgetAsync(preferredVersionIfExists?: string): Promise { - const s3BucketName = docIdToS3BucketName[this.props.docsInfo.id]; - const docsJsonRoot = `${constants.S3_BUCKET_ROOT}/${s3BucketName}`; - const versionToFileName = await docUtils.getVersionToFileNameAsync(docsJsonRoot); - const versions = _.keys(versionToFileName); + const folderName = docIdToS3FolderName[this.props.docsInfo.id]; + const docBucketRoot = isDevelopment ? constants.S3_STAGING_DOC_BUCKET_ROOT : constants.S3_DOC_BUCKET_ROOT; + const versionToFilePath = await docUtils.getVersionToFilePathAsync(docBucketRoot, folderName); + const versions = _.keys(versionToFilePath); this.props.dispatcher.updateAvailableDocVersions(versions); const sortedVersions = semverSort.desc(versions); const latestVersion = sortedVersions[0]; let versionToFetch = latestVersion; if (!_.isUndefined(preferredVersionIfExists)) { - const preferredVersionFileNameIfExists = versionToFileName[preferredVersionIfExists]; + const preferredVersionFileNameIfExists = versionToFilePath[preferredVersionIfExists]; if (!_.isUndefined(preferredVersionFileNameIfExists)) { versionToFetch = preferredVersionIfExists; } } this.props.dispatcher.updateCurrentDocsVersion(versionToFetch); - const versionFileNameToFetch = versionToFileName[versionToFetch]; - const versionDocObj = await docUtils.getJSONDocFileAsync(versionFileNameToFetch, docsJsonRoot); + const versionFilePathToFetch = versionToFilePath[versionToFetch]; + const versionDocObj = await docUtils.getJSONDocFileAsync(versionFilePathToFetch, docBucketRoot); const docAgnosticFormat = this.props.docsInfo.convertToDocAgnosticFormat(versionDocObj); if (!this._isUnmounted) { -- cgit v1.2.3 From c7302c46e57c4646dbbd0004e09e987b720b5815 Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Sun, 18 Mar 2018 14:54:12 +0100 Subject: Add JSON Schemas docs to website --- packages/website/ts/pages/documentation/doc_page.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'packages/website/ts/pages/documentation/doc_page.tsx') diff --git a/packages/website/ts/pages/documentation/doc_page.tsx b/packages/website/ts/pages/documentation/doc_page.tsx index 5f09ec9ef..55dbe12af 100644 --- a/packages/website/ts/pages/documentation/doc_page.tsx +++ b/packages/website/ts/pages/documentation/doc_page.tsx @@ -17,13 +17,14 @@ import { utils } from 'ts/utils/utils'; const ZERO_EX_JS_VERSION_MISSING_TOPLEVEL_PATH = '0.32.4'; -const isDevelopment = configs.ENVIRONMENT !== Environments.DEVELOPMENT; +const isDevelopment = configs.ENVIRONMENT === Environments.DEVELOPMENT; const docIdToS3FolderName: { [id: string]: string } = { [DocPackages.ZeroExJs]: '0xjs', [DocPackages.SmartContracts]: 'smart-contracts', [DocPackages.Connect]: 'connect', [DocPackages.Web3Wrapper]: 'web3-wrapper', [DocPackages.Deployer]: 'deployer', + [DocPackages.JSONSchemas]: 'json-schemas', }; const docIdToSubpackageName: { [id: string]: string } = { @@ -32,6 +33,7 @@ const docIdToSubpackageName: { [id: string]: string } = { [DocPackages.SmartContracts]: 'contracts', [DocPackages.Web3Wrapper]: 'web3-wrapper', [DocPackages.Deployer]: 'deployer', + [DocPackages.JSONSchemas]: 'json-schemas', }; export interface DocPageProps { -- cgit v1.2.3 From c1d17c83f8ee246c60b277c9c76b4eb9db1dba05 Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Sun, 18 Mar 2018 16:10:02 +0100 Subject: Add sol-cov docs to website --- packages/website/ts/pages/documentation/doc_page.tsx | 2 ++ 1 file changed, 2 insertions(+) (limited to 'packages/website/ts/pages/documentation/doc_page.tsx') diff --git a/packages/website/ts/pages/documentation/doc_page.tsx b/packages/website/ts/pages/documentation/doc_page.tsx index 55dbe12af..78ab9dfa9 100644 --- a/packages/website/ts/pages/documentation/doc_page.tsx +++ b/packages/website/ts/pages/documentation/doc_page.tsx @@ -25,6 +25,7 @@ const docIdToS3FolderName: { [id: string]: string } = { [DocPackages.Web3Wrapper]: 'web3-wrapper', [DocPackages.Deployer]: 'deployer', [DocPackages.JSONSchemas]: 'json-schemas', + [DocPackages.SolCov]: 'sol-cov', }; const docIdToSubpackageName: { [id: string]: string } = { @@ -34,6 +35,7 @@ const docIdToSubpackageName: { [id: string]: string } = { [DocPackages.Web3Wrapper]: 'web3-wrapper', [DocPackages.Deployer]: 'deployer', [DocPackages.JSONSchemas]: 'json-schemas', + [DocPackages.SolCov]: 'sol-cov', }; export interface DocPageProps { -- cgit v1.2.3 From 5468358f2142549c68ffae0085ce7d31ea271ea4 Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Sun, 18 Mar 2018 19:04:16 +0100 Subject: Add Subprovider docs to website --- packages/website/ts/pages/documentation/doc_page.tsx | 2 ++ 1 file changed, 2 insertions(+) (limited to 'packages/website/ts/pages/documentation/doc_page.tsx') diff --git a/packages/website/ts/pages/documentation/doc_page.tsx b/packages/website/ts/pages/documentation/doc_page.tsx index 78ab9dfa9..80c47ea5c 100644 --- a/packages/website/ts/pages/documentation/doc_page.tsx +++ b/packages/website/ts/pages/documentation/doc_page.tsx @@ -26,6 +26,7 @@ const docIdToS3FolderName: { [id: string]: string } = { [DocPackages.Deployer]: 'deployer', [DocPackages.JSONSchemas]: 'json-schemas', [DocPackages.SolCov]: 'sol-cov', + [DocPackages.Subproviders]: 'subproviders', }; const docIdToSubpackageName: { [id: string]: string } = { @@ -36,6 +37,7 @@ const docIdToSubpackageName: { [id: string]: string } = { [DocPackages.Deployer]: 'deployer', [DocPackages.JSONSchemas]: 'json-schemas', [DocPackages.SolCov]: 'sol-cov', + [DocPackages.Subproviders]: 'subproviders', }; export interface DocPageProps { -- cgit v1.2.3 From 72671c10148d304fec072d0c62bcc9788b967f55 Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Tue, 20 Mar 2018 12:26:04 +0000 Subject: Refactor titleToIcon mapping to idToIcon and move to docPage --- packages/website/ts/pages/documentation/doc_page.tsx | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) (limited to 'packages/website/ts/pages/documentation/doc_page.tsx') diff --git a/packages/website/ts/pages/documentation/doc_page.tsx b/packages/website/ts/pages/documentation/doc_page.tsx index 80c47ea5c..b6dfc04b2 100644 --- a/packages/website/ts/pages/documentation/doc_page.tsx +++ b/packages/website/ts/pages/documentation/doc_page.tsx @@ -15,9 +15,20 @@ import { docUtils } from 'ts/utils/doc_utils'; import { Translate } from 'ts/utils/translate'; import { utils } from 'ts/utils/utils'; +const isDevelopment = configs.ENVIRONMENT === Environments.DEVELOPMENT; const ZERO_EX_JS_VERSION_MISSING_TOPLEVEL_PATH = '0.32.4'; -const isDevelopment = configs.ENVIRONMENT === Environments.DEVELOPMENT; +const idToIcon: { [id: string]: string } = { + [DocPackages.ZeroExJs]: 'zeroExJs.png', + [DocPackages.Web3Wrapper]: 'zeroExJs.png', + [DocPackages.Deployer]: 'zeroExJs.png', + [DocPackages.SolCov]: 'zeroExJs.png', + [DocPackages.JSONSchemas]: 'zeroExJs.png', + [DocPackages.Subproviders]: 'zeroExJs.png', + [DocPackages.Connect]: 'connect.png', + [DocPackages.SmartContracts]: 'contracts.png', +}; + const docIdToS3FolderName: { [id: string]: string } = { [DocPackages.ZeroExJs]: '0xjs', [DocPackages.SmartContracts]: 'smart-contracts', @@ -79,6 +90,7 @@ export class DocPage extends React.Component { ? {} : this.props.docsInfo.getMenuSubsectionsBySection(this.state.docAgnosticFormat); const sourceUrl = this._getSourceUrl(); + const iconUrl = idToIcon[this.props.docsInfo.id]; return (
@@ -92,13 +104,14 @@ export class DocPage extends React.Component { docsInfo={this.props.docsInfo} translate={this.props.translate} onVersionSelected={this._onVersionSelected.bind(this)} + sidebarHeader={} /> } + sidebarHeader={} sourceUrl={sourceUrl} topBarHeight={60} onVersionSelected={this._onVersionSelected.bind(this)} -- cgit v1.2.3 From 27880a6059f282cdee833523a6144bcafa8c266b Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Tue, 20 Mar 2018 15:35:48 +0000 Subject: Remove s3 mapping since s3 folder names are now identical to sub-package names --- packages/website/ts/pages/documentation/doc_page.tsx | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) (limited to 'packages/website/ts/pages/documentation/doc_page.tsx') diff --git a/packages/website/ts/pages/documentation/doc_page.tsx b/packages/website/ts/pages/documentation/doc_page.tsx index b6dfc04b2..26a80c745 100644 --- a/packages/website/ts/pages/documentation/doc_page.tsx +++ b/packages/website/ts/pages/documentation/doc_page.tsx @@ -29,17 +29,6 @@ const idToIcon: { [id: string]: string } = { [DocPackages.SmartContracts]: 'contracts.png', }; -const docIdToS3FolderName: { [id: string]: string } = { - [DocPackages.ZeroExJs]: '0xjs', - [DocPackages.SmartContracts]: 'smart-contracts', - [DocPackages.Connect]: 'connect', - [DocPackages.Web3Wrapper]: 'web3-wrapper', - [DocPackages.Deployer]: 'deployer', - [DocPackages.JSONSchemas]: 'json-schemas', - [DocPackages.SolCov]: 'sol-cov', - [DocPackages.Subproviders]: 'subproviders', -}; - const docIdToSubpackageName: { [id: string]: string } = { [DocPackages.ZeroExJs]: '0x.js', [DocPackages.Connect]: 'connect', @@ -120,7 +109,7 @@ export class DocPage extends React.Component { ); } private async _fetchJSONDocsFireAndForgetAsync(preferredVersionIfExists?: string): Promise { - const folderName = docIdToS3FolderName[this.props.docsInfo.id]; + const folderName = docIdToSubpackageName[this.props.docsInfo.id]; const docBucketRoot = isDevelopment ? constants.S3_STAGING_DOC_BUCKET_ROOT : constants.S3_DOC_BUCKET_ROOT; const versionToFilePath = await docUtils.getVersionToFilePathAsync(docBucketRoot, folderName); const versions = _.keys(versionToFilePath); -- cgit v1.2.3 From 07de3a1d94e360cada1c5fc5754014e596865b55 Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Tue, 20 Mar 2018 15:39:32 +0000 Subject: Pass actual iconUrl and add default icon image --- packages/website/ts/pages/documentation/doc_page.tsx | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'packages/website/ts/pages/documentation/doc_page.tsx') diff --git a/packages/website/ts/pages/documentation/doc_page.tsx b/packages/website/ts/pages/documentation/doc_page.tsx index 26a80c745..e2fcca084 100644 --- a/packages/website/ts/pages/documentation/doc_page.tsx +++ b/packages/website/ts/pages/documentation/doc_page.tsx @@ -16,15 +16,11 @@ import { Translate } from 'ts/utils/translate'; import { utils } from 'ts/utils/utils'; const isDevelopment = configs.ENVIRONMENT === Environments.DEVELOPMENT; +const DEFAULT_ICON = 'zeroExJs.png'; const ZERO_EX_JS_VERSION_MISSING_TOPLEVEL_PATH = '0.32.4'; const idToIcon: { [id: string]: string } = { [DocPackages.ZeroExJs]: 'zeroExJs.png', - [DocPackages.Web3Wrapper]: 'zeroExJs.png', - [DocPackages.Deployer]: 'zeroExJs.png', - [DocPackages.SolCov]: 'zeroExJs.png', - [DocPackages.JSONSchemas]: 'zeroExJs.png', - [DocPackages.Subproviders]: 'zeroExJs.png', [DocPackages.Connect]: 'connect.png', [DocPackages.SmartContracts]: 'contracts.png', }; @@ -79,7 +75,8 @@ export class DocPage extends React.Component { ? {} : this.props.docsInfo.getMenuSubsectionsBySection(this.state.docAgnosticFormat); const sourceUrl = this._getSourceUrl(); - const iconUrl = idToIcon[this.props.docsInfo.id]; + const iconFileName = idToIcon[this.props.docsInfo.id] || DEFAULT_ICON; + const iconUrl = `/images/doc_icons/${iconFileName}`; return (
-- cgit v1.2.3 From ed9d1da297c4c0d6d82efa2bfafef93a68fc5b59 Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Thu, 22 Mar 2018 12:46:52 +0000 Subject: Add default docs icon --- packages/website/ts/pages/documentation/doc_page.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'packages/website/ts/pages/documentation/doc_page.tsx') diff --git a/packages/website/ts/pages/documentation/doc_page.tsx b/packages/website/ts/pages/documentation/doc_page.tsx index e2fcca084..030c37438 100644 --- a/packages/website/ts/pages/documentation/doc_page.tsx +++ b/packages/website/ts/pages/documentation/doc_page.tsx @@ -16,7 +16,7 @@ import { Translate } from 'ts/utils/translate'; import { utils } from 'ts/utils/utils'; const isDevelopment = configs.ENVIRONMENT === Environments.DEVELOPMENT; -const DEFAULT_ICON = 'zeroExJs.png'; +const DEFAULT_ICON = 'docs.png'; const ZERO_EX_JS_VERSION_MISSING_TOPLEVEL_PATH = '0.32.4'; const idToIcon: { [id: string]: string } = { -- cgit v1.2.3 From b39d87f357a785ce68d65477f024f24d44cd0dac Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Thu, 22 Mar 2018 15:53:20 +0000 Subject: Remove space --- packages/website/ts/pages/documentation/doc_page.tsx | 1 - 1 file changed, 1 deletion(-) (limited to 'packages/website/ts/pages/documentation/doc_page.tsx') diff --git a/packages/website/ts/pages/documentation/doc_page.tsx b/packages/website/ts/pages/documentation/doc_page.tsx index 030c37438..8ec1a023d 100644 --- a/packages/website/ts/pages/documentation/doc_page.tsx +++ b/packages/website/ts/pages/documentation/doc_page.tsx @@ -69,7 +69,6 @@ export class DocPage extends React.Component { public componentWillUnmount() { this._isUnmounted = true; } - public render() { const menuSubsectionsBySection = _.isUndefined(this.state.docAgnosticFormat) ? {} -- cgit v1.2.3