aboutsummaryrefslogtreecommitdiffstats
path: root/packages/website/ts/pages
diff options
context:
space:
mode:
authorFabio Berger <me@fabioberger.com>2018-02-27 01:52:08 +0800
committerFabio Berger <me@fabioberger.com>2018-02-27 01:52:08 +0800
commitdd116b3cd62b59772326936356bce2d08fb41439 (patch)
tree61f8d5902d9863f489e40712802196ad27ada033 /packages/website/ts/pages
parent7dd9ce2e3280b8e4e911cf797267db4619dbcae3 (diff)
downloaddexon-sol-tools-dd116b3cd62b59772326936356bce2d08fb41439.tar
dexon-sol-tools-dd116b3cd62b59772326936356bce2d08fb41439.tar.gz
dexon-sol-tools-dd116b3cd62b59772326936356bce2d08fb41439.tar.bz2
dexon-sol-tools-dd116b3cd62b59772326936356bce2d08fb41439.tar.lz
dexon-sol-tools-dd116b3cd62b59772326936356bce2d08fb41439.tar.xz
dexon-sol-tools-dd116b3cd62b59772326936356bce2d08fb41439.tar.zst
dexon-sol-tools-dd116b3cd62b59772326936356bce2d08fb41439.zip
remove docsJsonRoot from docsInfo
Diffstat (limited to 'packages/website/ts/pages')
-rw-r--r--packages/website/ts/pages/documentation/doc_page.tsx13
-rw-r--r--packages/website/ts/pages/documentation/docs_info.ts2
2 files changed, 12 insertions, 3 deletions
diff --git a/packages/website/ts/pages/documentation/doc_page.tsx b/packages/website/ts/pages/documentation/doc_page.tsx
index 2b77bb2be..ff22a7236 100644
--- a/packages/website/ts/pages/documentation/doc_page.tsx
+++ b/packages/website/ts/pages/documentation/doc_page.tsx
@@ -7,10 +7,19 @@ import { TopBar } from 'ts/components/top_bar/top_bar';
import { DocsInfo } from 'ts/pages/documentation/docs_info';
import { Documentation } from 'ts/pages/documentation/documentation';
import { Dispatcher } from 'ts/redux/dispatcher';
-import { DocAgnosticFormat, DoxityDocObj, MenuSubsectionsBySection } from 'ts/types';
+import { DocAgnosticFormat, DoxityDocObj, Environments, MenuSubsectionsBySection } from 'ts/types';
+import { configs } from 'ts/utils/configs';
+import { constants } from 'ts/utils/constants';
import { docUtils } from 'ts/utils/doc_utils';
import { Translate } from 'ts/utils/translate';
+const displayNameToS3BucketName: { [displayName: string]: string } = {
+ '0x.js': configs.ENVIRONMENT === Environments.DEVELOPMENT ? 'staging-0xjs-docs-jsons' : '0xjs-docs-jsons',
+ '0x Smart Contracts': 'smart-contracts-docs-json',
+ '0x Connect':
+ configs.ENVIRONMENT === Environments.DEVELOPMENT ? 'staging-connect-docs-jsons' : 'connect-docs-jsons',
+};
+
export interface DocPageProps {
location: Location;
dispatcher: Dispatcher;
@@ -74,6 +83,8 @@ export class DocPage extends React.Component<DocPageProps, DocPageState> {
);
}
private async _fetchJSONDocsFireAndForgetAsync(preferredVersionIfExists?: string): Promise<void> {
+ const s3BucketName = displayNameToS3BucketName[this.props.docsInfo.displayName];
+ const docsJsonRoot = `${constants.S3_BUCKET_ROOT}/${s3BucketName}`;
const versionToFileName = await docUtils.getVersionToFileNameAsync(this.props.docsInfo.docsJsonRoot);
const versions = _.keys(versionToFileName);
this.props.dispatcher.updateAvailableDocVersions(versions);
diff --git a/packages/website/ts/pages/documentation/docs_info.ts b/packages/website/ts/pages/documentation/docs_info.ts
index 4b1ec122a..f90b39e1f 100644
--- a/packages/website/ts/pages/documentation/docs_info.ts
+++ b/packages/website/ts/pages/documentation/docs_info.ts
@@ -15,7 +15,6 @@ export class DocsInfo {
public packageUrl: string;
public subPackageName?: string;
public websitePath: string;
- public docsJsonRoot: string;
public menu: DocsMenu;
public sections: SectionsMap;
public sectionNameToMarkdown: { [sectionName: string]: string };
@@ -25,7 +24,6 @@ export class DocsInfo {
this.packageUrl = config.packageUrl;
this.subPackageName = config.subPackageName;
this.websitePath = config.websitePath;
- this.docsJsonRoot = config.docsJsonRoot;
this.sections = config.sections;
this.sectionNameToMarkdown = config.sectionNameToMarkdown;
this._docsInfo = config;