diff --git a/.circleci/config.yml b/.circleci/config.yml index 803b34a7..7bc56b64 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -36,7 +36,7 @@ install_test_dependency: &install_test_dependency install_deploysuite: &install_deploysuite name: Installation of install_deploysuite. command: | - git clone --branch v1.4 https://github.com/topcoder-platform/tc-deploy-scripts ../buildscript + git clone --branch v1.4.15 https://github.com/topcoder-platform/tc-deploy-scripts ../buildscript cp ./../buildscript/master_deploy.sh . cp ./../buildscript/buildenv.sh . cp ./../buildscript/awsconfiguration.sh . @@ -116,6 +116,17 @@ jobs: APPNAME: "challenge-engine-ui" steps: *builddeploy_steps + + "build-qa": + <<: *defaults + environment: + DEPLOY_ENV: "QA" + LOGICAL_ENV: "qa" + NODE_ENV: "qa" + BABEL_ENV: "development" + APPNAME: "work-manager" + steps: *builddeploy_steps + "build-prod": <<: *defaults environment: @@ -154,6 +165,12 @@ workflows: branches: only: ['develop', 'multiround'] + - "build-qa": + context : org-global + filters: &filters-dev + branches: + only: ['qa'] + # Production builds are exectuted only on tagged commits to the # master branch. - "build-prod": diff --git a/config/constants/development.js b/config/constants/development.js index b24ee6d4..edf77395 100644 --- a/config/constants/development.js +++ b/config/constants/development.js @@ -1,4 +1,4 @@ -const DOMAIN = 'topcoder-dev.com' +const DOMAIN = 'topcoder-qa.com' const DEV_API_HOSTNAME = `https://api.${DOMAIN}` module.exports = { @@ -47,7 +47,7 @@ module.exports = { // duration to show the prompt saying user will be logged out, before actually logging out the user IDLE_TIMEOUT_GRACE_MINUTES: 5, MULTI_ROUND_CHALLENGE_TEMPLATE_ID: 'd4201ca4-8437-4d63-9957-3f7708184b07', - UNIVERSAL_NAV_URL: '//uni-nav.topcoder-dev.com/v1/tc-universal-nav.js', + UNIVERSAL_NAV_URL: '//uni-nav.topcoder-qa.com/v1/tc-universal-nav.js', HEADER_AUTH_URLS_HREF: `https://accounts-auth0.${DOMAIN}?utm_source=community-app-main`, HEADER_AUTH_URLS_LOCATION: `https://accounts-auth0.${DOMAIN}?retUrl=%S&utm_source=community-app-main` } diff --git a/config/constants/index.js b/config/constants/index.js index d3b29612..cc7ee77c 100644 --- a/config/constants/index.js +++ b/config/constants/index.js @@ -5,6 +5,8 @@ module.exports = (() => { if (env === 'production') { return require('./production') } - + if (env === 'qa') { + return require('./qa') + } return require('./development') })() diff --git a/config/constants/qa.js b/config/constants/qa.js new file mode 100644 index 00000000..b24ee6d4 --- /dev/null +++ b/config/constants/qa.js @@ -0,0 +1,53 @@ +const DOMAIN = 'topcoder-dev.com' +const DEV_API_HOSTNAME = `https://api.${DOMAIN}` + +module.exports = { + ACCOUNTS_APP_CONNECTOR_URL: `https://accounts-auth0.${DOMAIN}`, + ACCOUNTS_APP_LOGIN_URL: `https://accounts-auth0.${DOMAIN}`, + COMMUNITY_APP_URL: `https://www.${DOMAIN}`, + MEMBER_API_URL: `${DEV_API_HOSTNAME}/v5/members`, + MEMBER_API_V3_URL: `${DEV_API_HOSTNAME}/v3/members`, + CHALLENGE_API_URL: `${DEV_API_HOSTNAME}/v5/challenges`, + CHALLENGE_TIMELINE_TEMPLATES_URL: `${DEV_API_HOSTNAME}/v5/timeline-templates`, + CHALLENGE_TYPES_URL: `${DEV_API_HOSTNAME}/v5/challenge-types`, + CHALLENGE_TRACKS_URL: `${DEV_API_HOSTNAME}/v5/challenge-tracks`, + CHALLENGE_PHASES_URL: `${DEV_API_HOSTNAME}/v5/challenge-phases`, + CHALLENGE_TIMELINES_URL: `${DEV_API_HOSTNAME}/v5/challenge-timelines`, + PROJECT_API_URL: `${DEV_API_HOSTNAME}/v5/projects`, + GROUPS_API_URL: `${DEV_API_HOSTNAME}/v5/groups`, + TERMS_API_URL: `${DEV_API_HOSTNAME}/v5/terms`, + RESOURCES_API_URL: `${DEV_API_HOSTNAME}/v5/resources`, + RESOURCE_ROLES_API_URL: `${DEV_API_HOSTNAME}/v5/resource-roles`, + SUBMISSIONS_API_URL: `${DEV_API_HOSTNAME}/v5/submissions`, + PLATFORMS_V4_API_URL: `${DEV_API_HOSTNAME}/v4/platforms`, + TECHNOLOGIES_V4_API_URL: `${DEV_API_HOSTNAME}/v4/technologies`, + SUBMISSION_REVIEW_APP_URL: `https://submission-review.${DOMAIN}/challenges`, + STUDIO_URL: `https://studio.${DOMAIN}`, + CONNECT_APP_URL: `https://connect.${DOMAIN}`, + DIRECT_PROJECT_URL: `https://www.${DOMAIN}/direct`, + ONLINE_REVIEW_URL: `https://software.${DOMAIN}`, + DEFAULT_TERM_UUID: '317cd8f9-d66c-4f2a-8774-63c612d99cd4', // Terms & Conditions of Use at TopCoder + DEFAULT_NDA_UUID: 'e5811a7b-43d1-407a-a064-69e5015b4900', // NDA v3.0 + SUBMITTER_ROLE_UUID: '732339e7-8e30-49d7-9198-cccf9451e221', + DEV_TRACK_ID: '9b6fc876-f4d9-4ccb-9dfd-419247628825', + DES_TRACK_ID: '5fa04185-041f-49a6-bfd1-fe82533cd6c8', + DS_TRACK_ID: 'c0f5d461-8219-4c14-878a-c3a3f356466d', + QA_TRACK_ID: '36e6a8d0-7e1e-4608-a673-64279d99c115', + CP_TRACK_ID: '9d6e0de8-df14-4c76-ba0a-a9a8cb03a4ea', + CHALLENGE_TYPE_ID: '927abff4-7af9-4145-8ba1-577c16e64e2e', + MARATHON_TYPE_ID: '929bc408-9cf2-4b3e-ba71-adfbf693046c', + SEGMENT_API_KEY: 'QBtLgV8vCiuRX1lDikbMjcoe9aCHkF6n', + CREATE_FORUM_TYPE_IDS: ['927abff4-7af9-4145-8ba1-577c16e64e2e', 'dc876fa4-ef2d-4eee-b701-b555fcc6544c', 'ecd58c69-238f-43a4-a4bb-d172719b9f31'], + FILE_PICKER_API_KEY: process.env.FILE_PICKER_API_KEY, + FILE_PICKER_CONTAINER_NAME: 'tc-challenge-v5-dev', + FILE_PICKER_REGION: 'us-east-1', + FILE_PICKER_CNAME: 'fs.topcoder.com', + // if idle for this many minutes, show user a prompt saying they'll be logged out + IDLE_TIMEOUT_MINUTES: 10, + // duration to show the prompt saying user will be logged out, before actually logging out the user + IDLE_TIMEOUT_GRACE_MINUTES: 5, + MULTI_ROUND_CHALLENGE_TEMPLATE_ID: 'd4201ca4-8437-4d63-9957-3f7708184b07', + UNIVERSAL_NAV_URL: '//uni-nav.topcoder-dev.com/v1/tc-universal-nav.js', + HEADER_AUTH_URLS_HREF: `https://accounts-auth0.${DOMAIN}?utm_source=community-app-main`, + HEADER_AUTH_URLS_LOCATION: `https://accounts-auth0.${DOMAIN}?retUrl=%S&utm_source=community-app-main` +} diff --git a/docker/Dockerfile b/docker/Dockerfile index a3262e42..56c24ad2 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -12,10 +12,10 @@ ENV FILE_PICKER_API_KEY=$FILE_PICKER_API_KEY ENV FORCE_DEV=$FORCE_DEV # Copy the current directory into the Docker image -COPY . /challenge-engine-ui +COPY . /work-manager # Set working directory for future use -WORKDIR /challenge-engine-ui +WORKDIR /work-manager # Install the dependencies from package.json RUN echo "NODE ENV in Docker: $NODE_ENV" diff --git a/docker/docker-compose.yml b/docker/docker-compose.yml index d0793dd6..4e4c6ef6 100644 --- a/docker/docker-compose.yml +++ b/docker/docker-compose.yml @@ -1,7 +1,7 @@ version: '3' services: - challenge-engine-ui: - image: challenge-engine-ui:latest + work-manager: + image: work-manager:latest build: context: ../ dockerfile: docker/Dockerfile \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 4f9932ec..acb2abec 100644 --- a/package-lock.json +++ b/package-lock.json @@ -5655,7 +5655,7 @@ "codemirror-spell-checker": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/codemirror-spell-checker/-/codemirror-spell-checker-1.1.2.tgz", - "integrity": "sha512-2Tl6n0v+GJRsC9K3MLCdLaMOmvWL0uukajNJseorZJsslaxZyZMgENocPU8R0DyoTAiKsyqiemSOZo7kjGV0LQ==", + "integrity": "sha1-HGYPkIlIPMtRE7m6nKGcP0mTNx4=", "requires": { "typo-js": "*" } diff --git a/server.js b/server.js index f5fb9cf6..bebeb386 100644 --- a/server.js +++ b/server.js @@ -28,6 +28,7 @@ app.use((req, res, next) => { "frame-ancestors 'none';" + "script-src 'report-sample' 'self' 'unsafe-inline' 'unsafe-eval'" + ' https://uni-nav.topcoder-dev.com' + + ' https://uni-nav.topcoder-qa.com' + ' https://uni-nav.topcoder.com' ) diff --git a/src/actions/auth.js b/src/actions/auth.js index 6ed70d57..cb4d2454 100644 --- a/src/actions/auth.js +++ b/src/actions/auth.js @@ -1,5 +1,5 @@ import { configureConnector, decodeToken } from 'tc-auth-lib' -import { fetchProfile } from '../services/user' +import { fetchProfileV5 } from '../services/user' import { LOAD_USER_SUCCESS, SAVE_AUTH_TOKEN @@ -26,7 +26,7 @@ export function loadUser () { if (!getState().auth.user) { if (getState().auth.token) { const { handle } = decodeToken(getState().auth.token) - fetchProfile(handle).then(user => { + fetchProfileV5(handle).then(user => { dispatch({ type: LOAD_USER_SUCCESS, user diff --git a/src/services/user.js b/src/services/user.js index fc7bd888..229d8807 100644 --- a/src/services/user.js +++ b/src/services/user.js @@ -16,7 +16,7 @@ export async function fetchProfile (handle) { * @returns {Promise<*>} */ export async function fetchProfileV5 (handle) { - const response = await axiosInstance.get(`${MEMBER_API_URL}?handle=${handle}`) + const response = await axiosInstance.get(`${MEMBER_API_URL}/${handle}`) const data = _.get(response, 'data') return data.length ? data[0] : undefined }