Commit 253bcaad authored by Maxym Borodenko's avatar Maxym Borodenko

#1 Initial version

parent 58dab195
{
"presets": [
"env",
"react"
]
}
/target/
.awesome-typescript-loader-cache/
node_modules
.idea
*.iml
\ No newline at end of file
variables:
IMAGE_VERSION: "1.9-SNAPSHOT"
DOCKER_HOST: "genesys1.swarm.genesys-pgr.org"
ARTIFACTS: "target/app"
stages:
- package
- dockerize
- deploy
.package_template: &node_package
image: node:8.4-alpine
cache:
paths:
- node_modules/
before_script:
- npm install
artifacts:
name: "${CI_PROJECT_NAME}-${CI_COMMIT_REF_NAME}"
expire_in: 1 day
paths:
- ${ARTIFACTS}
package master or tag:
<<: *node_package
stage: package
script:
- npm run build:ssr
only:
- master
- tags
package the branch:
<<: *node_package
stage: package
# when: manual
allow_failure: false
script:
- npm run build:ssr
except:
- master
- tags
.docker_image_template: &docker_image
image: docker:latest
before_script:
- echo Building docker image ${CI_REGISTRY_IMAGE} on ${DOCKER_HOST}
- echo Registry ${CI_REGISTRY} user=${CI_REGISTRY_USER} ${CI_REGISTRY_PASSWORD}
# Configuration
- TLS_PATH=~/.docker/${DOCKER_HOST}/certs && mkdir -p ${TLS_PATH}
- echo "${DOCKER_TLS_CA}" > ${TLS_PATH}/ca.pem
- echo "${DOCKER_TLS_KEY}" > ${TLS_PATH}/key.pem
- echo "${DOCKER_TLS_CERT}" > ${TLS_PATH}/cert.pem
- export DOCKER_TLS_VERIFY=1
- export DOCKER_CERT_PATH=${TLS_PATH}
- DOCKER_CMD="docker --tlsverify=false"
# - ls -la ${DOCKER_CERT_PATH}
# - set | grep DOCKER
script:
# Actions
- cp -r ${ARTIFACTS} docker
# - find docker -type f -exec ls -l {} \;
- cd docker
- if [ "${CI_COMMIT_REF_SLUG}" = "master" ] ; then
export IMAGE_TAG="${IMAGE_VERSION}";
else
export IMAGE_TAG="${IMAGE_VERSION}-${CI_COMMIT_REF_SLUG}";
fi
- "echo The image tag: ${IMAGE_TAG}"
- ${DOCKER_CMD} build -t ${CI_REGISTRY_IMAGE}:${IMAGE_TAG} .
- ${DOCKER_CMD} login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY
- ${DOCKER_CMD} push ${CI_REGISTRY_IMAGE}:${IMAGE_TAG}
- ${DOCKER_CMD} logout $CI_REGISTRY
dockerize master or tag:
<<: *docker_image
stage: dockerize
dependencies:
- package master or tag
only:
- master
- tags
dockerize the branch:
<<: *docker_image
stage: dockerize
dependencies:
- package the branch
# when: manual
allow_failure: false
except:
- master
- tags
deploy for review:
stage: dockerize
image: docker:latest
when: manual
except:
- master
environment:
name: catalog/$CI_COMMIT_REF_SLUG
url: https://${CI_ENVIRONMENT_SLUG}.review.genesys-pgr.org
on_stop: remove review instance
before_script:
# Address the swarm
- export DOCKER_HOST=swarm.genesys-pgr.org
# Configuration
- TLS_PATH=~/.docker/${DOCKER_HOST}/certs && mkdir -p ${TLS_PATH}
- echo "${DOCKER_TLS_CA}" > ${TLS_PATH}/ca.pem
- echo "${DOCKER_TLS_KEY}" > ${TLS_PATH}/key.pem
- echo "${DOCKER_TLS_CERT}" > ${TLS_PATH}/cert.pem
- export DOCKER_TLS_VERIFY=1
- export DOCKER_CERT_PATH=${TLS_PATH}
- DOCKER_CMD=docker
script:
# Actions
- apk add --no-cache gettext
- if [ "${CI_COMMIT_REF_SLUG}" = "master" ] ; then
export IMAGE_TAG="${IMAGE_VERSION}";
else
export IMAGE_TAG="${IMAGE_VERSION}-${CI_COMMIT_REF_SLUG}";
fi
- export CATALOG_API_URL=https://api.catalog.demo.genesys-pgr.org
- export CATALOG_FRONTEND_HOSTNAME=${CI_ENVIRONMENT_SLUG}.review.genesys-pgr.org
- echo "Deploying ${CI_REGISTRY_IMAGE}:${IMAGE_TAG} for review as ${CATALOG_FRONTEND_HOSTNAME}"
- echo "Settings CLIENT_ID=${CATALOG_CLIENT_ID} CLIENT_SECRET=${CATALOG_CLIENT_SECRET}"
- envsubst < docker/review-compose-template.yml > review-composed.yml
- cat review-composed.yml
- ${DOCKER_CMD} stack rm ${CI_ENVIRONMENT_SLUG} || true
- ${DOCKER_CMD} stack deploy -c review-composed.yml ${CI_ENVIRONMENT_SLUG}
remove review instance:
stage: dockerize
image: docker:latest
when: manual
except:
- master
variables:
GIT_STRATEGY: none
environment:
name: catalog/$CI_COMMIT_REF_SLUG
url: https://${CI_ENVIRONMENT_SLUG}.review.genesys-pgr.org
action: stop
before_script:
- echo Removing review https\://${CI_ENVIRONMENT_SLUG}.review.genesys\-pgr.org
# Address the swarm
- export DOCKER_HOST=swarm.genesys-pgr.org
# Configuration
- TLS_PATH=~/.docker/${DOCKER_HOST}/certs && mkdir -p ${TLS_PATH}
- echo "${DOCKER_TLS_CA}" > ${TLS_PATH}/ca.pem
- echo "${DOCKER_TLS_KEY}" > ${TLS_PATH}/key.pem
- echo "${DOCKER_TLS_CERT}" > ${TLS_PATH}/cert.pem
- export DOCKER_TLS_VERIFY=1
- export DOCKER_CERT_PATH=${TLS_PATH}
- DOCKER_CMD=docker
script:
# Actions
- ${DOCKER_CMD} stack rm ${CI_ENVIRONMENT_SLUG} || true
deploy to sandbox:
stage: deploy
image: docker:latest
only:
- master
before_script:
# Address the swarm
- export DOCKER_HOST=swarm.genesys-pgr.org
# Configuration
- TLS_PATH=~/.docker/${DOCKER_HOST}/certs && mkdir -p ${TLS_PATH}
- echo "${DOCKER_TLS_CA}" > ${TLS_PATH}/ca.pem
- echo "${DOCKER_TLS_KEY}" > ${TLS_PATH}/key.pem
- echo "${DOCKER_TLS_CERT}" > ${TLS_PATH}/cert.pem
- export DOCKER_TLS_VERIFY=1
- export DOCKER_CERT_PATH=${TLS_PATH}
- DOCKER_CMD=docker
script:
# Actions
- ${DOCKER_CMD} service update --image ${CI_REGISTRY_IMAGE}:${IMAGE_VERSION} catalog-sandbox_frontend
environment:
name: sandbox
url: https://catalog.demo.genesys-pgr.org
# Changelog
This diff is collapsed.
# Genesys UI
React application.
# Development
This project uses npm, gulp and webpack to package the React TypeScript application.
Optional params supported:
`CLIENT_SECRET` - ui app secret used for OAuth 2 authentication in java server
`CLIENT_ID` - ui app id used for OAuth 2 authentication in java server
`GENESYS_API_URL` - url to java server
~~`googleClientId` - id of google project, used for OAuth authentication with Google.~~
~~Google api for configure projects: <https://console.developers.google.com>~~
To start a live-reload server and work on the application, run:
```bash
npm run serve
```
This starts the _webpack-dev-server_ on port 3000:
- <http://localhost:3000/webpack-dev-server/>
- <http://localhost:3000/>
Pack the React application for production and test server-side loading (run express server):
```bash
npm run serve:ssr
```
Example of using optional params:
```bash
CLIENT_ID=client-id CLIENT_SECRET=client-secret GENESYS_API_URL=http://localhost:8080 npm run serve
```
## Documentation
We rely on the following libraries to make things work:
- Material UI: <https://material-ui-1dab0.firebaseapp.com/>
- Material Icons: <https://material.io/icons/>
- Immutability helpers: <https://github.com/kolodny/immutability-helper>
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 19.2.1, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="0 0 22.7 22.7" style="enable-background:new 0 0 22.7 22.7;" xml:space="preserve">
<style type="text/css">
.st0{fill:#88B941;}
</style>
<path class="st0" d="M11.3,0C5.1,0,0,5.1,0,11.3c0,6.3,5.1,11.3,11.3,11.3s11.3-5.1,11.3-11.3C22.7,5.1,17.6,0,11.3,0z M11.4,19.7
c0,0.1-0.1,0.2,0,0.2c0,0,0,0.1,0,0.1c0,0.1,0,0.1,0,0.2c0,0,0,0.1-0.1,0.1l-0.1,0.1c-2.2-0.6-4-2.3-5.4-4c-1.5-1.9-2.7-4.2-3.1-6.6
C2.5,8.5,2.5,7.2,3,5.9c2.5,1.6,4.6,3.9,6.2,6.4C10.5,14.5,11.4,17,11.4,19.7C11.4,19.6,11.4,19.6,11.4,19.7z M11.5,11.7
c0,0-0.1,0.1-0.1,0.1c0,0,0,0,0,0c0,0-0.1,0-0.1,0.1c0,0,0,0-0.1,0l-0.1,0c-0.9-1-1.3-2.4-1.5-3.7C9.4,6.9,9.5,5.4,10,4.1
c0.3-0.7,0.7-1.4,1.3-1.9c0.8,1.6,1.2,3.3,1.2,5.1C12.6,8.8,12.3,10.4,11.5,11.7C11.5,11.7,11.5,11.7,11.5,11.7z M17.3,12.6
c-1.2,1.7-2.8,3.2-4.7,4c0,0,0,0,0,0c-0.1,0-0.1,0-0.2,0c0,0-0.1,0-0.1,0c-0.1,0-0.1,0-0.1,0c0,0-0.1,0-0.1,0l-0.1-0.1
c-0.2-1.8,0.4-3.7,1.3-5.3c1-1.7,2.3-3.3,4-4.4c0.9-0.6,1.9-1,3-1C19.7,8.3,18.7,10.6,17.3,12.6z"/>
</svg>
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 19.2.1, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="0 0 56.2 14" style="enable-background:new 0 0 56.2 14; padding-top: 3px" xml:space="preserve">
<style type="text/css">
.st0{fill:#FFFFFF;}
</style>
<g>
<path class="st0" d="M8.2,9.4c-0.3,0.4-0.7,0.7-1.3,1.1C6.2,10.8,5.4,11,4.4,11c-1.3,0-2.3-0.4-3.2-1.2C0.4,8.9,0,7.9,0,6.6V4.4
C0,3.1,0.4,2,1.2,1.2C1.9,0.4,2.9,0,4.2,0C5.4,0,6.3,0.3,7,0.9s1.1,1.4,1.1,2.3l0,0H6.7c0-0.6-0.3-1.1-0.7-1.5
C5.6,1.3,5,1.1,4.2,1.1c-0.8,0-1.5,0.3-2,0.9S1.5,3.4,1.5,4.4v2.2c0,0.9,0.3,1.7,0.8,2.3s1.3,0.9,2.1,0.9c0.6,0,1.1-0.1,1.5-0.2
C6.3,9.4,6.6,9.3,6.7,9V6.6H4.4V5.5h3.8V9.4z"/>
<path class="st0" d="M13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.5,0.8,1,0.8,1.7l0,0h-1.4c0-0.3-0.1-0.7-0.4-0.9
C54,4,53.6,3.9,53.1,3.9c-0.5,0-0.9,0.1-1.1,0.3c-0.2,0.2-0.4,0.5-0.4,0.8c0,0.3,0.1,0.6,0.3,0.7c0.2,0.2,0.7,0.3,1.3,0.5
c1,0.2,1.7,0.5,2.2,0.9C56,7.5,56.2,8,56.2,8.6c0,0.7-0.3,1.3-0.9,1.7c-0.6,0.4-1.3,0.7-2.2,0.7c-1,0-1.8-0.3-2.4-0.8
s-0.9-1.1-0.8-1.8l0,0h1.4c0,0.5,0.2,0.9,0.6,1.1c0.4,0.2,0.8,0.4,1.3,0.4c0.5,0,0.9-0.1,1.2-0.3C54.6,9.3,54.8,9,54.8,8.7z"/>
</g>
</svg>
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 16.0.2, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
width="612px" height="152.455px" viewBox="0 319.772 612 152.455" enable-background="new 0 319.772 612 152.455"
xml:space="preserve" style="padding-top: 3px">
<g>
<path fill="#2B2924" d="M89.295,422.135c-3.267,4.356-7.623,7.623-14.157,11.979c-7.623,3.267-16.334,5.444-27.224,5.444
c-14.157,0-25.046-4.355-34.847-13.067C4.356,416.69,0,405.801,0,391.644v-23.957c0-14.157,4.356-26.135,13.067-34.847
c7.623-8.712,18.513-13.067,32.669-13.067c13.067,0,22.868,3.267,30.491,9.8c7.623,6.534,11.979,15.246,11.979,25.046l0,0H72.961
c0-6.534-3.267-11.979-7.623-16.334c-4.355-4.356-10.89-6.534-19.601-6.534c-8.712,0-16.334,3.267-21.779,9.801
c-5.445,6.534-7.623,15.246-7.623,26.135v23.957c0,9.801,3.267,18.512,8.712,25.046s14.156,9.801,22.868,9.801
c6.534,0,11.979-1.089,16.334-2.178c4.356-2.179,7.623-3.268,8.712-6.534v-26.135H47.915v-11.979h41.381V422.135z"/>
<path fill="#2B2924" d="M149.188,439.559c-11.979,0-21.779-4.355-28.313-11.979c-7.623-7.623-10.89-18.513-10.89-31.58v-3.267
c0-11.979,3.267-22.868,10.89-30.491c7.623-7.623,16.334-11.979,26.135-11.979c11.979,0,20.69,3.267,26.135,10.89
c5.445,6.534,8.711,16.334,8.711,28.313v9.801H126.32l0,0c0,8.711,2.178,15.245,6.534,20.689c4.356,5.445,9.801,7.623,17.423,7.623
c5.445,0,9.801-1.089,14.157-2.178s7.623-3.268,10.89-6.534l6.534,9.801c-3.267,3.267-7.623,5.445-11.979,7.623
C162.256,438.47,155.723,439.559,149.188,439.559z M147.011,362.242c-5.445,0-9.801,2.178-13.068,6.534
c-3.267,4.356-6.534,9.801-6.534,16.334l0,0h40.292v-1.089c0-6.534-2.178-10.89-5.445-15.246
C158.989,364.42,153.544,362.242,147.011,362.242z"/>
<path fill="#2B2924" d="M213.438,351.353l1.089,13.067c3.267-4.356,6.534-7.623,10.89-10.89c4.356-2.178,9.801-3.267,15.246-3.267
c9.801,0,16.334,3.267,21.779,8.712s7.623,14.157,7.623,25.046v54.448h-15.246v-54.448c0-7.623-1.089-13.068-4.355-16.334
c-3.267-3.267-7.623-4.356-14.157-4.356c-4.356,0-8.712,1.089-11.979,3.267c-4.356,1.089-6.534,4.356-8.712,7.623v63.16H200.37
v-86.028H213.438z"/>
<path fill="#2B2924" d="M327.779,439.559c-11.979,0-21.779-4.355-28.313-11.979c-7.623-7.623-10.889-18.513-10.889-31.58v-3.267
c0-11.979,3.267-22.868,10.889-30.491c7.623-7.623,16.335-11.979,26.136-11.979c11.979,0,20.69,3.267,26.135,10.89
c5.445,6.534,8.712,16.334,8.712,28.313v9.801h-55.537l0,0c0,8.711,2.178,15.245,6.534,20.689c4.355,5.445,9.8,7.623,17.423,7.623
c5.445,0,9.801-1.089,14.157-2.178c4.355-1.089,7.622-3.268,10.89-6.534l6.533,9.801c-3.267,3.267-7.623,5.445-11.979,7.623
C341.936,438.47,335.402,439.559,327.779,439.559z M325.602,362.242c-5.445,0-9.801,2.178-13.067,6.534
c-3.268,4.356-6.534,9.801-6.534,16.334l0,0h40.292v-1.089c0-6.534-2.178-10.89-5.445-15.246
C337.58,364.42,332.135,362.242,325.602,362.242z"/>
<path fill="#2B2924" d="M429.054,414.513c0-3.267-1.089-6.534-4.356-8.712c-2.178-2.178-7.622-4.355-15.245-5.445
c-10.89-2.178-18.513-5.444-23.958-9.8c-5.444-4.356-7.622-8.712-7.622-16.334c0-6.534,3.267-13.068,8.712-17.423
c5.444-5.445,14.156-7.623,22.868-7.623c9.801,0,18.513,2.178,23.957,7.623c5.445,5.445,8.712,10.89,8.712,18.512l0,0h-15.246
c0-3.267-1.089-7.623-4.355-9.801c-3.267-3.267-7.623-4.356-13.067-4.356c-5.445,0-9.801,1.089-11.979,3.267
c-2.179,2.178-4.356,5.445-4.356,8.712c0,3.267,1.089,6.534,3.267,7.623c2.179,2.178,7.623,3.267,14.157,5.445
c10.89,2.178,18.513,5.445,23.957,9.801c5.445,4.355,7.623,9.801,7.623,16.334c0,7.623-3.268,14.157-9.801,18.513
c-6.534,4.356-14.156,7.623-23.957,7.623c-10.89,0-19.602-3.267-26.136-8.712c-6.534-5.444-9.801-11.979-8.712-19.602l0,0h15.246
c0,5.445,2.178,9.801,6.533,11.979c4.356,2.179,8.712,4.356,14.157,4.356c5.444,0,9.801-1.089,13.067-3.267
C426.875,421.046,429.054,417.779,429.054,414.513z"/>
<path fill="#2B2924" d="M490.035,405.801l3.268,10.89l0,0l20.69-65.338h17.423l-34.847,99.096
c-2.178,5.445-5.444,10.89-9.801,15.246c-4.355,4.355-9.801,6.533-16.334,6.533c-1.09,0-3.268,0-4.356,0s-3.267-1.089-4.355-1.089
l1.089-11.979c0,0,1.089,0,3.267,0s3.267,0,4.355,0c3.268,0,6.534-1.089,8.712-4.355c2.179-3.268,4.356-6.534,5.445-9.801
l3.267-8.712l-31.58-84.939h17.424L490.035,405.801z"/>
<path fill="#2B2924" d="M596.755,414.513c0-3.267-1.089-6.534-4.356-8.712c-2.178-2.178-7.623-4.355-15.245-5.445
c-10.89-2.178-18.513-5.444-23.958-9.8c-5.444-4.356-7.622-8.712-7.622-16.334c0-6.534,3.267-13.068,8.712-17.423
c5.444-5.445,14.156-7.623,22.868-7.623c9.801,0,18.512,2.178,23.957,7.623c5.444,5.445,8.712,10.89,8.712,18.512l0,0h-15.246
c0-3.267-1.089-7.623-4.355-9.801c-2.178-2.178-6.534-3.267-11.979-3.267c-5.445,0-9.801,1.089-11.979,3.267
c-2.179,2.178-4.356,5.445-4.356,8.712c0,3.267,1.089,6.534,3.268,7.623c2.178,2.178,7.622,3.267,14.156,5.445
c10.89,2.178,18.513,5.445,23.957,9.801c6.534,4.356,8.712,9.801,8.712,16.335c0,7.622-3.267,14.156-9.801,18.512
c-6.533,4.356-14.156,7.623-23.957,7.623c-10.89,0-19.602-3.267-26.136-8.712c-6.533-5.444-9.801-11.979-8.712-19.601l0,0h15.246
c0,5.444,2.178,9.8,6.534,11.979c4.355,2.178,8.711,4.355,14.156,4.355c5.444,0,9.801-1.089,13.067-3.267
C594.576,421.046,596.755,417.779,596.755,414.513z"/>
</g>
</svg>
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 22.1.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="0 0 24 24" enable-background="new 0 0 24 24" xml:space="preserve">
<path fill="#2B2924" d="M12,0C5.4,0,0,5.4,0,12s5.4,12,12,12s12-5.4,12-12S18.6,0,12,0z M13.2,18h-2.4v-7.2h2.4V18z M13.2,8.4h-2.4
V6h2.4V8.4z"/>
</svg>
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 22.1.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="0 0 24 24" enable-background="new 0 0 24 24" xml:space="preserve">
<circle fill="#2B2924" cx="12" cy="12" r="12"/>
<g>
<circle fill="#FFFFFF" cx="10.1" cy="9.5" r="2.5"/>
<path fill="#FFFFFF" d="M10.1,13.3c-1.7,0-5.1,0.9-5.1,2.5v1.3h10.2v-1.3C15.2,14.2,11.8,13.3,10.1,13.3z M15,7.2L14,8.3
c0.5,0.8,0.5,1.7,0,2.5l1.1,1.1C16.3,10.5,16.3,8.6,15,7.2z M17.1,5l-1,1c1.8,1.9,1.8,4.8,0,6.8l1,1C19.6,11.5,19.6,7.6,17.1,5z"/>
</g>
</svg>
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 22.1.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="0 0 24 24" enable-background="new 0 0 24 24" xml:space="preserve">
<path fill="#fff" d="M15.5,14h-0.8l-0.3-0.3c1-1.1,1.6-2.6,1.6-4.2C16,5.9,13.1,3,9.5,3S3,5.9,3,9.5S5.9,16,9.5,16c1.6,0,3.1-0.6,4.2-1.6
l0.3,0.3v0.8l5,5l1.5-1.5L15.5,14z M9.5,14C7,14,5,12,5,9.5S7,5,9.5,5S14,7,14,9.5S12,14,9.5,14z"/>
<path fill="none" d="M0,0h24v24H0V0z"/>
</svg>
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 22.1.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="0 0 24 24" enable-background="new 0 0 24 24" xml:space="preserve">
<circle fill="#2B2924" cx="12" cy="12" r="12"/>
<path fill="#FFFFFF" d="M17,7H7C6.3,7,5.8,7.6,5.8,8.3l0,7.5C5.8,16.4,6.3,17,7,17h10c0.7,0,1.2-0.6,1.2-1.2V8.3
C18.2,7.6,17.7,7,17,7z M17,15.7H7V9.5l5,3.1l5-3.1V15.7z M12,11.4L7,8.3h10L12,11.4z"/>
</svg>
const path = require('path');
const webpack = require('webpack');
const webpackMerge = require('webpack-merge');
const UglifyJsPlugin = require('uglifyjs-webpack-plugin');
const commonConfig = require('./webpack-base.config.js');
module.exports = {
name: 'server',
target: 'node',
entry: {
server: ['./server/index.ts']
},
output: {
filename: '[name].js',
chunkFilename: '[name].js',
path: path.join(process.cwd(), 'target/app/server')
},
resolve: {
extensions: [
'.ts', '.tsx', '.js', '.jsx'
],
modules: [path.resolve('./src'), 'node_modules']
},
module: {
rules: [
{
enforce: 'pre',
test: /\.tsx?$/,
loader: 'tslint-loader'
},
// All files with a '.ts' or '.tsx' extension will be handled by 'awesome-typescript-loader'.
{
test: /\.tsx?$/,
use: ["awesome-typescript-loader"]
}
]
},
plugins: [
new webpack.NoEmitOnErrorsPlugin(),
// https://facebook.github.io/react/docs/optimizing-performance.html#use-the-production-build
new webpack.DefinePlugin({
'process.env': {
NODE_ENV: JSON.stringify('production')
}
}),
new UglifyJsPlugin({
beautify: false,
mangle: {
screw_ie8: true,
keep_fnames: true
},
compress: {
screw_ie8: true,
warnings: false
},
comments: false
}),
]
};
const path = require('path');
const webpack = require('webpack');
const ExtractTextPlugin = require("extract-text-webpack-plugin");
const HtmlWebpackPlugin = require('html-webpack-plugin');
const ScriptExtHtmlWebpackPlugin = require('script-ext-html-webpack-plugin');
const HtmlWebpackExcludeAssetsPlugin = require('html-webpack-exclude-assets-plugin');
const WebpackChunkHash = require("webpack-chunk-hash");
const ManifestPlugin = require('webpack-manifest-plugin');
const CopyWebpackPlugin = require('copy-webpack-plugin');
// devserver configuration
const HOST = process.env.HOST || 'localhost';
const PORT = process.env.PORT || 3000;
// other...
const GOOGLE_CLIENT_ID = process.env.GOOGLE_CLIENT_ID;
const SSR = process.env.SSR;
const GENESYS_API_URL = process.env.GENESYS_API_URL || 'http://localhost:8080';
const CLIENT_ID = process.env.CLIENT_ID || 'my-trusted-client';
const CLIENT_SECRET = process.env.CLIENT_SECRET || 'my-secret-client';
const sortedChunks = function(list) {
return function(chunk1, chunk2) {
var index1 = list.indexOf(chunk1.names[0]);
var index2 = list.indexOf(chunk2.names[0]);
if (index2 == -1 || index1 < index2) {
return -1;
}
if (index1 == -1 || index1 > index2) {
return 1;
}
return 0;
};
};
module.exports = {
stats: {
colors: true
},
devServer: {
historyApiFallback: true,
hot: true,
inline: true,
contentBase: false,
compress: true,
port: PORT,
host: HOST,
overlay: {
warnings: true,
errors: true
},
clientLogLevel: "warning",
proxy: {
'/api/genesys': {
target: GENESYS_API_URL,
logLevel: 'debug',
ws: true,
// secure: false,
pathRewrite(path, req) {
let p = path.replace('/api/genesys', '');
if (p.startsWith('/oauth/token')) {
const grantType = req.query['grant_type'];
if(grantType === 'client_credentials' || grantType === 'password') {
p = `${p}&client_id=${CLIENT_ID}&client_secret=${CLIENT_SECRET}`;
}
// remove all headers from request
req.headers = {};
} else {
p = path.replace('/api/genesys', '/api');
req.headers = { ...req.headers };
// scrub headers
delete req.headers['host'];
delete req.headers['origin'];
delete req.headers['referer'];
delete req.headers['cookie'];
}
console.log(`Proxy headers: `, req.headers);
console.log(`HTTP proxy ${path} to ${GENESYS_API_URL}${p}`);
return p;
},
onError(err, req, res) {
console.log(err);
},
onClose(res, socket, head) {
// view disconnected websocket connections
console.log('Client disconnected', res);
}
}
},
},
entry: {
vendor: ['babel-polyfill', './entrypoints/vendor.ts', 'react', 'react-dom'],
catalog: ['./entrypoints/client.tsx']
},
output: {
filename: '[name].[chunkhash].js',
chunkFilename: '[name].[chunkhash].js',
path: path.join(process.cwd(), 'target/app/assets'),
publicPath: '/'
},
resolve: {
extensions: ['.ts', '.tsx', '.js', '.jsx'],
modules: [path.resolve('./src'), 'node_modules']
},
module: {
rules: [{
enforce: 'pre',
test: /\.tsx?$/,
loader: 'tslint-loader'
},
// All files with a '.ts' or '.tsx' extension will be handled by 'awesome-typescript-loader'.
{
test: /\.tsx?$/,
use: ["awesome-typescript-loader"]
},
// {
// test: /\.js?$/,
// exclude: /node_modules/,
// loader: 'babel-loader',
// options: {
//
// }
// },
// {
// test: /\.jsx$/,
// exclude: /node_modules/,
// loader: 'babel-loader'
// },
{
test: /\.scss$/,
use: ExtractTextPlugin.extract({
use: [{
loader: