From 1f6bdfb8c515eb875a4a09a71a0ab0b6def40bf6 Mon Sep 17 00:00:00 2001 From: Fahd Date: Wed, 14 Aug 2019 11:33:18 -0400 Subject: [PATCH 01/11] chore(issuer): add sonar scanner --- .circleci/config.yml | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index 30d31e623..48b719c61 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -19,8 +19,26 @@ references: run: name: Yarn install command: yarn install --frozen-lockfile + run_sonar: &run_sonar + run: + name: Run Sonarqube scanner + command: > + export SONAR_SCANNER_OPTS="-Xmx2048m" + eval ./sonar-scanner-3.2.0.1227-linux/bin/sonar-scanner + -Dsonar.projectKey=issuer \ + -Dsonar.sources=. \ + -Dsonar.sourceEncoding=US-ASCII \ + -Dsonar.exclusions=vendor/bundle/** \ + -Dsonar.host.url=https://sonarqube.onehq.com \ + -Dsonar.projectVersion=0 \ + -Dsonar.login=${SONARQUBE_TOKEN} $SONAR_SCANNER_OPTS_CUSTOM jobs: + run: + name: Install SonarScanner + command: + wget https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-4.0.0.1744-linux.zip + unzip sonar-scanner-cli-4.0.0.1744-linux.zip install_dependencies: <<: *container_config steps: @@ -56,6 +74,7 @@ jobs: <<: *container_config steps: - checkout + - *run_sonar - *restore_yarn_cache - *yarn_install - *save_cache From 46a2e0ecbd37f2908b5f641643a13618984adb30 Mon Sep 17 00:00:00 2001 From: Fahd Date: Wed, 14 Aug 2019 11:39:17 -0400 Subject: [PATCH 02/11] chore(issuer): add docker field --- .circleci/config.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index 48b719c61..784765b35 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -35,6 +35,7 @@ references: jobs: run: + <<: *container_config name: Install SonarScanner command: wget https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-4.0.0.1744-linux.zip From 3e68f91c880f6f91a667f3da707e323af3e5ddc3 Mon Sep 17 00:00:00 2001 From: Fahd Date: Wed, 14 Aug 2019 11:43:02 -0400 Subject: [PATCH 03/11] chore(issuer): test --- .circleci/config.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 784765b35..78897e1b1 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -15,6 +15,12 @@ references: key: yarn-packages-{{ checksum "yarn.lock" }} paths: - ~/.cache/yarn + install_sonar: &install_sonar + run: + name: Install SonarScanner + command: + wget https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-4.0.0.1744-linux.zip + unzip sonar-scanner-cli-4.0.0.1744-linux.zip yarn_install: &yarn_install run: name: Yarn install @@ -34,12 +40,6 @@ references: -Dsonar.login=${SONARQUBE_TOKEN} $SONAR_SCANNER_OPTS_CUSTOM jobs: - run: - <<: *container_config - name: Install SonarScanner - command: - wget https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-4.0.0.1744-linux.zip - unzip sonar-scanner-cli-4.0.0.1744-linux.zip install_dependencies: <<: *container_config steps: From 98d7a004aea22987486a5148fca8b54e43044857 Mon Sep 17 00:00:00 2001 From: Fahd Date: Wed, 14 Aug 2019 11:50:26 -0400 Subject: [PATCH 04/11] chore(issuer): test --- .circleci/config.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 78897e1b1..b498d1996 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -30,7 +30,7 @@ references: name: Run Sonarqube scanner command: > export SONAR_SCANNER_OPTS="-Xmx2048m" - eval ./sonar-scanner-3.2.0.1227-linux/bin/sonar-scanner + eval ./sonar-scanner-4.0.0.1744-linux/bin/sonar-scanner -Dsonar.projectKey=issuer \ -Dsonar.sources=. \ -Dsonar.sourceEncoding=US-ASCII \ @@ -75,6 +75,7 @@ jobs: <<: *container_config steps: - checkout + - *install_sonar - *run_sonar - *restore_yarn_cache - *yarn_install From fa6755409e22633bd5a04e1ebd433466c393c2b8 Mon Sep 17 00:00:00 2001 From: Fahd Date: Wed, 14 Aug 2019 14:39:25 -0400 Subject: [PATCH 05/11] chore(issuer): multiline command --- .circleci/config.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index b498d1996..c51be8912 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -18,7 +18,7 @@ references: install_sonar: &install_sonar run: name: Install SonarScanner - command: + command: | wget https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-4.0.0.1744-linux.zip unzip sonar-scanner-cli-4.0.0.1744-linux.zip yarn_install: &yarn_install @@ -28,7 +28,7 @@ references: run_sonar: &run_sonar run: name: Run Sonarqube scanner - command: > + command: | export SONAR_SCANNER_OPTS="-Xmx2048m" eval ./sonar-scanner-4.0.0.1744-linux/bin/sonar-scanner -Dsonar.projectKey=issuer \ From 6be079dee5e31bfac988343a933cd86b4f0e45c4 Mon Sep 17 00:00:00 2001 From: Fahd Date: Wed, 14 Aug 2019 16:54:37 -0400 Subject: [PATCH 06/11] chore(issuer): set correct url --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index c51be8912..e6aaf41d6 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -35,7 +35,7 @@ references: -Dsonar.sources=. \ -Dsonar.sourceEncoding=US-ASCII \ -Dsonar.exclusions=vendor/bundle/** \ - -Dsonar.host.url=https://sonarqube.onehq.com \ + -Dsonar.host.url=https://sonarcloud.io \ -Dsonar.projectVersion=0 \ -Dsonar.login=${SONARQUBE_TOKEN} $SONAR_SCANNER_OPTS_CUSTOM From 4d08d77173de06a1221fc36392ff613b1a18dcba Mon Sep 17 00:00:00 2001 From: Fahd Date: Fri, 16 Aug 2019 11:10:38 -0400 Subject: [PATCH 07/11] chore(issuer): fix circleci --- .circleci/config.yml | 21 --------------------- 1 file changed, 21 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index e6aaf41d6..30d31e623 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -15,29 +15,10 @@ references: key: yarn-packages-{{ checksum "yarn.lock" }} paths: - ~/.cache/yarn - install_sonar: &install_sonar - run: - name: Install SonarScanner - command: | - wget https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-4.0.0.1744-linux.zip - unzip sonar-scanner-cli-4.0.0.1744-linux.zip yarn_install: &yarn_install run: name: Yarn install command: yarn install --frozen-lockfile - run_sonar: &run_sonar - run: - name: Run Sonarqube scanner - command: | - export SONAR_SCANNER_OPTS="-Xmx2048m" - eval ./sonar-scanner-4.0.0.1744-linux/bin/sonar-scanner - -Dsonar.projectKey=issuer \ - -Dsonar.sources=. \ - -Dsonar.sourceEncoding=US-ASCII \ - -Dsonar.exclusions=vendor/bundle/** \ - -Dsonar.host.url=https://sonarcloud.io \ - -Dsonar.projectVersion=0 \ - -Dsonar.login=${SONARQUBE_TOKEN} $SONAR_SCANNER_OPTS_CUSTOM jobs: install_dependencies: @@ -75,8 +56,6 @@ jobs: <<: *container_config steps: - checkout - - *install_sonar - - *run_sonar - *restore_yarn_cache - *yarn_install - *save_cache From 7ba4057de1a6ed969db790b42f4481addb0094e4 Mon Sep 17 00:00:00 2001 From: Remon Nashid Date: Fri, 16 Aug 2019 12:19:47 -0400 Subject: [PATCH 08/11] chore(issuer): alter provider form text on testnet --- .../src/pages/providers/ApplyForm.js | 41 ++++++++++++++----- 1 file changed, 31 insertions(+), 10 deletions(-) diff --git a/packages/polymath-issuer/src/pages/providers/ApplyForm.js b/packages/polymath-issuer/src/pages/providers/ApplyForm.js index 8f1043469..4e9ff2e07 100644 --- a/packages/polymath-issuer/src/pages/providers/ApplyForm.js +++ b/packages/polymath-issuer/src/pages/providers/ApplyForm.js @@ -65,7 +65,8 @@ const linkTooltip = (title: string) => ( ); -export const ApplyFormComponent = ({ handleSubmit, onClose }) => { +export const ApplyFormComponent = args => { + const { handleSubmit, onClose, networkId } = args; return (
@@ -145,25 +146,45 @@ export const ApplyFormComponent = ({ handleSubmit, onClose }) => {

-

- When you click submit, an email which contains the information entered - on that screen will be sent to the Advisory firm(s) you have selected. - None of this information is stored on Polymath servers, only your - browser's cache. To clear this information, simply clear your - browser's cache. -

+ {networkId === 1 ? ( +

+ When you click submit, an email which contains the information entered + on that screen will be sent to the Advisory firm(s) you have selected. + None of this information is stored on Polymath servers, only your + browser's cache. To clear this information, simply clear your + browser's cache. +

+ ) : ( +

+ + + You are using Token Studio in a testnet environment. When you + click submit, an email WILL NOT be sent to the providers you have + selected. To send an email to the selected providers, please log + into Token Studio with mainnet. +
+ None of this information is stored on Polymath servers, only your + browser's cache. To clear this information, simply clear your + browser's cache. +
+
+

+ )}
); }; -const mapStateToProps = ({ providers: { application } }) => ({ application }); +const mapStateToProps = ({ + providers: { application }, + network: { id: networkId }, +}) => ({ application, networkId }); const formikEnhancer = withFormik({ validationSchema: formSchema, displayName: 'ApplyForm', validatOnChange: false, - mapPropsToValues: ({ application }) => { + mapPropsToValues: ({ application, networkId }) => { const { companyName, companyDesc, From 319189359229bbf8193aa4a7c13cfb425bd63271 Mon Sep 17 00:00:00 2001 From: Remon Nashid Date: Fri, 16 Aug 2019 12:22:07 -0400 Subject: [PATCH 09/11] chore(issuer): remove unnecessary code --- packages/polymath-issuer/src/pages/providers/ApplyForm.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/polymath-issuer/src/pages/providers/ApplyForm.js b/packages/polymath-issuer/src/pages/providers/ApplyForm.js index 4e9ff2e07..9baa74b74 100644 --- a/packages/polymath-issuer/src/pages/providers/ApplyForm.js +++ b/packages/polymath-issuer/src/pages/providers/ApplyForm.js @@ -184,7 +184,7 @@ const formikEnhancer = withFormik({ validationSchema: formSchema, displayName: 'ApplyForm', validatOnChange: false, - mapPropsToValues: ({ application, networkId }) => { + mapPropsToValues: ({ application }) => { const { companyName, companyDesc, From af25dad5ebb7c3d2db6c95b07ae1f03635d2b007 Mon Sep 17 00:00:00 2001 From: Remon Nashid Date: Fri, 16 Aug 2019 15:05:17 -0400 Subject: [PATCH 10/11] chore(issuer): use MAINNET_NETWORK_ID --- packages/polymath-issuer/src/pages/providers/ApplyForm.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/polymath-issuer/src/pages/providers/ApplyForm.js b/packages/polymath-issuer/src/pages/providers/ApplyForm.js index 9baa74b74..28f2299d0 100644 --- a/packages/polymath-issuer/src/pages/providers/ApplyForm.js +++ b/packages/polymath-issuer/src/pages/providers/ApplyForm.js @@ -10,7 +10,7 @@ import { TextArea, } from '@polymathnetwork/ui'; import validator from '@polymathnetwork/ui/validator'; - +import { MAINNET_NETWORK_ID } from '@polymathnetwork/shared/constants'; import { applyProviders } from '../../actions/providers'; const requiredMessage = 'Required.'; @@ -146,7 +146,7 @@ export const ApplyFormComponent = args => {

- {networkId === 1 ? ( + {networkId === MAINNET_NETWORK_ID ? (

When you click submit, an email which contains the information entered on that screen will be sent to the Advisory firm(s) you have selected. From 5129639f0307d102be4a65f909dc3ffe274a5c6b Mon Sep 17 00:00:00 2001 From: Remon Nashid Date: Fri, 16 Aug 2019 15:15:06 -0400 Subject: [PATCH 11/11] chore(issuer): replace args with props --- packages/polymath-issuer/src/pages/providers/ApplyForm.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/polymath-issuer/src/pages/providers/ApplyForm.js b/packages/polymath-issuer/src/pages/providers/ApplyForm.js index 28f2299d0..ae939059c 100644 --- a/packages/polymath-issuer/src/pages/providers/ApplyForm.js +++ b/packages/polymath-issuer/src/pages/providers/ApplyForm.js @@ -65,8 +65,8 @@ const linkTooltip = (title: string) => ( ); -export const ApplyFormComponent = args => { - const { handleSubmit, onClose, networkId } = args; +export const ApplyFormComponent = props => { + const { handleSubmit, onClose, networkId } = props; return (