From 72c24f9756faaa223656e51c23f75c72fcd47656 Mon Sep 17 00:00:00 2001 From: Matteo Vivona Date: Fri, 14 Feb 2020 18:32:00 +0100 Subject: [PATCH 01/14] build(docker): improves dockerfile and updates dockerignore --- .dockerignore | 20 +++++++++++++++++++- .travis.yml | 2 +- Dockerfile | 36 ++++++------------------------------ nginx.conf | 15 +++++++++++++++ package.json | 1 - 5 files changed, 41 insertions(+), 33 deletions(-) create mode 100644 nginx.conf diff --git a/.dockerignore b/.dockerignore index 3c3629e647..cb6ae5b604 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1 +1,19 @@ -node_modules +# Items that don't need to be in a Docker image. +# Anything not used by the build system should go here. +.gitignore +*.md +*.yml +.git +*.js +azure +.editorconfig +.github +.npmrc +.nvmrc +.prettierrc +.replit +.vscode +LICENSE +docs +*.log +.env* diff --git a/.travis.yml b/.travis.yml index e07ec5f55c..49e8f2df19 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,7 +1,7 @@ language: node_js node_js: - - "lts/*" + - 'lts/*' branches: only: diff --git a/Dockerfile b/Dockerfile index 708546b211..0be4980bdd 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,41 +1,17 @@ -FROM node:10-alpine as build -LABEL maintainer="Michael Feher, Matteo Vivona, Maksim Sinik" +FROM node:12-alpine as build -# set app basepath ENV HOME=/home/app - -# copy all app files COPY . $HOME/node/ -# change workgin dir and install deps in quiet mode WORKDIR $HOME/node RUN npm ci -q -# compile typescript and build all production stuff RUN npm run build - -# remove dev dependencies that are not needed in production RUN npm prune --production -# start new image for lower size -FROM node:10-alpine - -# create use with no permissions -RUN addgroup -g 101 -S app && adduser -u 100 -S -G app -s /bin/false app - -# set app basepath -ENV HOME=/home/app - -# copy production complied node app to the new image -COPY --from=build $HOME/node/ $HOME/node/ -RUN chown -R app:app $HOME/* - -# run app with low permissions level user -USER app -WORKDIR $HOME/node - -EXPOSE 3000 - -ENV NODE_ENV=production +FROM nginx:stable-alpine -CMD [ "yarn", "start" ] +COPY --from=build /home/app/node/build/ /usr/share/nginx/html +COPY nginx.conf /etc/nginx/conf.d/default.conf +EXPOSE 80 +CMD ["nginx", "-g", "daemon off;"] diff --git a/nginx.conf b/nginx.conf new file mode 100644 index 0000000000..2400141c1e --- /dev/null +++ b/nginx.conf @@ -0,0 +1,15 @@ +server { + listen 80; + server_name localhost; + location / { + root /usr/share/nginx/html; + index index.html index.htm; + try_files $uri /index.html; + } + + error_page 500 502 503 504 /50x.html; + + location = /50x.html { + root /usr/share/nginx/html; + } +} diff --git a/package.json b/package.json index 77a4098bba..f653727bf7 100644 --- a/package.json +++ b/package.json @@ -91,7 +91,6 @@ "commit": "npx git-cz", "start": "react-scripts start", "build": "react-scripts build", - "start:serve": "npm run build && serve -s build", "prepublishOnly": "npm run build", "test": "react-scripts test --detectOpenHandles", "test:ci": "cross-env CI=true react-scripts test", From d7906d4a4fd710e51b4ec3833bf1010b77ac166c Mon Sep 17 00:00:00 2001 From: Matteo Vivona Date: Sat, 15 Feb 2020 11:04:55 +0100 Subject: [PATCH 02/14] ci(build): removes azure pipeline and updates github ci --- .github/workflows/ci.yml | 26 +++++++++++++++++++------- azure-pipeline.yml | 22 ---------------------- azure/azure-pipelines-npm.yml | 22 ---------------------- azure/azure-pipelines-yarn.yml | 22 ---------------------- 4 files changed, 19 insertions(+), 73 deletions(-) delete mode 100644 azure-pipeline.yml delete mode 100644 azure/azure-pipelines-npm.yml delete mode 100644 azure/azure-pipelines-yarn.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 943df5a20e..254e5dbe70 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -9,16 +9,17 @@ jobs: strategy: matrix: node-version: [12.x, 13.x] - os: [ubuntu-18.04] + os: [ubuntu-latest, windows-latest, macOS-latest] + exclude: + - os: windows-latest + node-version: 13.x steps: - uses: actions/checkout@v1 - - name: Use Node.js uses: actions/setup-node@v1 with: node-version: ${{ matrix.node-version }} - - name: Install with npm run: | npm install @@ -31,22 +32,24 @@ jobs: - name: Run tests run: | npm run test:ci + # - name: Coveralls Parallel + # uses: coverallsapp/github-action@master + # with: + # github-token: ${{ secrets.GH_TOKEN }} + # parallel: true + yarn: runs-on: ${{ matrix.os }} - strategy: matrix: node-version: [12.x, 13.x] os: [ubuntu-18.04] - steps: - uses: actions/checkout@v1 - - name: Use Node.js uses: actions/setup-node@v1 with: node-version: ${{ matrix.node-version }} - - name: Install with yarn run: | curl -o- -L https://yarnpkg.com/install.sh | bash @@ -60,3 +63,12 @@ jobs: - name: Run tests run: | yarn test:ci + # coverage: + # needs: test + # runs-on: ubuntu-latest + # steps: + # - name: Coveralls Finished + # uses: coverallsapp/github-action@master + # with: + # github-token: ${{ secrets.GH_TOKEN }} + # parallel-finished: true diff --git a/azure-pipeline.yml b/azure-pipeline.yml deleted file mode 100644 index 7b38dfedfa..0000000000 --- a/azure-pipeline.yml +++ /dev/null @@ -1,22 +0,0 @@ -trigger: - branches: - include: - - master - -jobs: - - template: azure/azure-pipelines-npm.yml - parameters: - name: Windows_npm - vmImage: vs2017-win2016 - - template: azure/azure-pipelines-npm.yml - parameters: - name: macOs_npm - vmImage: macOS-10.14 - - template: azure/azure-pipelines-yarn.yml - parameters: - name: Windows_yarn - vmImage: vs2017-win2016 - - template: azure/azure-pipelines-yarn.yml - parameters: - name: macOS_yarn - vmImage: macOS-10.14 diff --git a/azure/azure-pipelines-npm.yml b/azure/azure-pipelines-npm.yml deleted file mode 100644 index c503c9e0c9..0000000000 --- a/azure/azure-pipelines-npm.yml +++ /dev/null @@ -1,22 +0,0 @@ -jobs: - - job: ${{ parameters.name }} - pool: - vmImage: ${{ parameters.vmImage }} - - strategy: - matrix: - node_12_x: - node_version: 12.x - maxParallel: 5 - - steps: - - task: NodeTool@0 - inputs: - versionSpec: $(node_version) - displayName: Install Node.js - - - bash: npm i - displayName: Install dependencies - - - bash: npm run build - displayName: Lint and Build diff --git a/azure/azure-pipelines-yarn.yml b/azure/azure-pipelines-yarn.yml deleted file mode 100644 index c220d502fd..0000000000 --- a/azure/azure-pipelines-yarn.yml +++ /dev/null @@ -1,22 +0,0 @@ -jobs: - - job: ${{ parameters.name }} - pool: - vmImage: ${{ parameters.vmImage }} - - strategy: - matrix: - node_12_x: - node_version: 12.x - maxParallel: 5 - - steps: - - task: NodeTool@0 - inputs: - versionSpec: $(node_version) - displayName: Install Node.js - - - bash: yarn install - displayName: Install dependencies - - - bash: yarn build - displayName: Lint and Build From 1fbd9658b4869d7f98b4ae918e731012e4b4b9a3 Mon Sep 17 00:00:00 2001 From: Matteo Vivona Date: Sat, 15 Feb 2020 11:13:14 +0100 Subject: [PATCH 03/14] fix(prettier): changes endofline option --- .github/workflows/ci.yml | 6 +++--- .prettierrc | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 254e5dbe70..9ebd32b7a7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -10,9 +10,9 @@ jobs: matrix: node-version: [12.x, 13.x] os: [ubuntu-latest, windows-latest, macOS-latest] - exclude: - - os: windows-latest - node-version: 13.x + # exclude: + # - os: windows-latest + # node-version: 13.x steps: - uses: actions/checkout@v1 diff --git a/.prettierrc b/.prettierrc index 8231751c8b..b05e85d771 100644 --- a/.prettierrc +++ b/.prettierrc @@ -7,5 +7,5 @@ "bracketSpacing": true, "jsxBracketSameLine": false, "arrowParens": "always", - "endOfLine": "lf" + "endOfLine": "auto" } From 8796c7f803663edf36a54a652fb0154e1d37a120 Mon Sep 17 00:00:00 2001 From: Matteo Vivona Date: Sat, 15 Feb 2020 11:29:36 +0100 Subject: [PATCH 04/14] build(build): updates github ci strategy --- .github/workflows/ci.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9ebd32b7a7..7cb8362604 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -5,7 +5,6 @@ on: [push, pull_request] jobs: npm: runs-on: ${{ matrix.os }} - strategy: matrix: node-version: [12.x, 13.x] @@ -13,7 +12,6 @@ jobs: # exclude: # - os: windows-latest # node-version: 13.x - steps: - uses: actions/checkout@v1 - name: Use Node.js @@ -43,7 +41,10 @@ jobs: strategy: matrix: node-version: [12.x, 13.x] - os: [ubuntu-18.04] + os: [ubuntu-latest, windows-latest, macOS-latest] + # exclude: + # - os: windows-latest + # node-version: 13.x steps: - uses: actions/checkout@v1 - name: Use Node.js From e89265a37d3edeab51ef17549ee75ea24bfef331 Mon Sep 17 00:00:00 2001 From: Matteo Vivona Date: Sat, 15 Feb 2020 12:46:40 +0100 Subject: [PATCH 05/14] docs(readme): removes azure pipeline badge --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index afa127194b..3237cfa5f6 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@
![Status](https://img.shields.io/badge/Status-developing-brightgree) [![Release](https://img.shields.io/github/release/HospitalRun/hospitalrun-frontend.svg)](https://github.com/HospitalRun/hospitalrun-frontend/releases) [![Version](https://img.shields.io/github/package-json/v/hospitalrun/hospitalrun-frontend)](https://github.com/HospitalRun/hospitalrun-frontend/releases) -[![GitHub CI](https://github.com/HospitalRun/frontend/workflows/GitHub%20CI/badge.svg)](https://github.com/HospitalRun/frontend/actions) [![Build Status](https://dev.azure.com/HospitalRun/hospitalrun-frontend/_apis/build/status/HospitalRun.hospitalrun-frontend?branchName=master)](https://dev.azure.com/HospitalRun/hospitalrun-frontend/_build/latest?definitionId=3&branchName=master) [![Build Status](https://travis-ci.com/HospitalRun/hospitalrun-frontend.svg?branch=master)](https://travis-ci.com/HospitalRun/hospitalrun-frontend) [![Coverage Status](https://coveralls.io/repos/github/HospitalRun/hospitalrun-frontend/badge.svg?branch=master)](https://coveralls.io/github/HospitalRun/hospitalrun-frontend?branch=master) [![Language grade: JavaScript](https://img.shields.io/lgtm/grade/javascript/g/HospitalRun/hospitalrun-frontend.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/HospitalRun/hospitalrun-frontend/context:javascript) [![Documentation Status](https://readthedocs.org/projects/hospitalrun-frontend/badge/?version=latest)](https://hospitalrun-frontend.readthedocs.io) +[![GitHub CI](https://github.com/HospitalRun/frontend/workflows/GitHub%20CI/badge.svg)](https://github.com/HospitalRun/frontend/actions) [![Build Status](https://travis-ci.com/HospitalRun/hospitalrun-frontend.svg?branch=master)](https://travis-ci.com/HospitalRun/hospitalrun-frontend) [![Coverage Status](https://coveralls.io/repos/github/HospitalRun/hospitalrun-frontend/badge.svg?branch=master)](https://coveralls.io/github/HospitalRun/hospitalrun-frontend?branch=master) [![Language grade: JavaScript](https://img.shields.io/lgtm/grade/javascript/g/HospitalRun/hospitalrun-frontend.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/HospitalRun/hospitalrun-frontend/context:javascript) [![Documentation Status](https://readthedocs.org/projects/hospitalrun-frontend/badge/?version=latest)](https://hospitalrun-frontend.readthedocs.io) [![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2FHospitalRun%2Fhospitalrun-frontend.svg?type=shield)](https://app.fossa.io/projects/git%2Bgithub.com%2FHospitalRun%2Fhospitalrun-frontend?ref=badge_large) [![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/) ![dependabot](https://api.dependabot.com/badges/status?host=github&repo=HospitalRun/hospitalrun-frontend) [![Slack](https://hospitalrun-slack.herokuapp.com/badge.svg)](https://hospitalrun-slack.herokuapp.com) [![Join the community on Spectrum](https://withspectrum.github.io/badge/badge.svg)](https://spectrum.chat/hospitalrun) [![Run on Repl.it](https://repl.it/badge/github/HospitalRun/hospitalrun-frontend)](https://repl.it/github/HospitalRun/hospitalrun-frontend) From 76f57e3d4ddd9328eb849b8f424675bd689b8ff3 Mon Sep 17 00:00:00 2001 From: Matteo Vivona Date: Sat, 15 Feb 2020 13:15:57 +0100 Subject: [PATCH 06/14] ci(azure): adds new azure pipeline yaml --- azure.yaml | 80 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 80 insertions(+) create mode 100644 azure.yaml diff --git a/azure.yaml b/azure.yaml new file mode 100644 index 0000000000..54eefc3aa4 --- /dev/null +++ b/azure.yaml @@ -0,0 +1,80 @@ +trigger: + branches: + include: + - refs/tags/v* + +jobs: + - job: npm_job + continueOnError: false + pool: + vmImage: ubuntu-latest + strategy: + matrix: + node_12_x: + node_version: 12.x + maxParallel: 5 + steps: + - task: NodeTool@0 + inputs: + versionSpec: $(node_version) + displayName: 'Install Node.js' + - bash: npm install + displayName: 'Install dependencies' + - bash: npm lint + displayName: 'Lint code' + - bash: npm run build + displayName: 'Build code' + - bash: npm run test:ci + displayName: 'Test compiled code' + + - job: yarn_job + continueOnError: false + pool: + vmImage: ubuntu-latest + strategy: + matrix: + node_12_x: + node_version: 12.x + maxParallel: 5 + steps: + - task: NodeTool@0 + inputs: + versionSpec: $(node_version) + displayName: 'Install Node.js' + - bash: yarn install + displayName: 'Install dependencies' + - bash: yarn lint + displayName: 'Lint code' + - bash: yarn build + displayName: 'Build code' + - bash: yarn test:ci + displayName: 'Test compiled code' + + - job: docker_job + dependsOn: [npm_job, yarn_job] + continueOnError: false + pool: + vmImage: ubuntu-latest + steps: + - script: | + echo '{ "experimental": true }' | sudo tee /etc/docker/daemon.json + sudo service docker restart + displayName: 'Enable Docker Engine experimental ' + - script: | + GIT_TAG=`git describe --tags` && VERSION_TAG="$(cut -d'-' -f1 <<<"$GIT_TAG")" && echo "##vso[task.setvariable variable=VERSION_TAG]$VERSION_TAG" + displayName: 'Get Git Tag' + - task: Docker@0 + displayName: 'Build an image' + inputs: + containerregistrytype: 'Container Registry' + dockerRegistryConnection: Docker + dockerFile: ./Dockerfile + buildArguments: '--rm --squash' + imageName: '$(Build.Repository.Name):$(VERSION_TAG)' + - task: Docker@0 + displayName: 'Push an image' + inputs: + containerregistrytype: 'Container Registry' + dockerRegistryConnection: Docker + action: 'Push an image' + imageName: '$(Build.Repository.Name):$(VERSION_TAG)' From 93d8c4df510c49542c8cac3b5e56cf6b11b169a7 Mon Sep 17 00:00:00 2001 From: Matteo Vivona Date: Sat, 15 Feb 2020 13:22:27 +0100 Subject: [PATCH 07/14] ci(azure): updates azure pipeline yaml --- azure.yaml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/azure.yaml b/azure.yaml index 54eefc3aa4..9ae7fdfbdf 100644 --- a/azure.yaml +++ b/azure.yaml @@ -3,6 +3,8 @@ trigger: include: - refs/tags/v* +pr: none + jobs: - job: npm_job continueOnError: false @@ -20,7 +22,7 @@ jobs: displayName: 'Install Node.js' - bash: npm install displayName: 'Install dependencies' - - bash: npm lint + - bash: npm run lint displayName: 'Lint code' - bash: npm run build displayName: 'Build code' @@ -67,7 +69,7 @@ jobs: displayName: 'Build an image' inputs: containerregistrytype: 'Container Registry' - dockerRegistryConnection: Docker + dockerRegistryConnection: Docker # it is necessary to create a new "service connection" via Azure DevOps portal dockerFile: ./Dockerfile buildArguments: '--rm --squash' imageName: '$(Build.Repository.Name):$(VERSION_TAG)' @@ -75,6 +77,6 @@ jobs: displayName: 'Push an image' inputs: containerregistrytype: 'Container Registry' - dockerRegistryConnection: Docker + dockerRegistryConnection: Docker # it is necessary to create a new "service connection" via Azure DevOps portal action: 'Push an image' imageName: '$(Build.Repository.Name):$(VERSION_TAG)' From 7907fbb6616c41a0cc6583575b9c8ae52f9003ce Mon Sep 17 00:00:00 2001 From: Matteo Vivona Date: Sat, 15 Feb 2020 13:48:18 +0100 Subject: [PATCH 08/14] chore(release): 2.0.0-alpha.2 --- CHANGELOG.md | 29 +++++++++++++++++++++++++++++ package.json | 2 +- 2 files changed, 30 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 32f339281f..31772c6db3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,35 @@ All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. +## [2.0.0-alpha.2](https://github.com/HospitalRun/hospitalrun-frontend/compare/v2.0.0-alpha.1...v2.0.0-alpha.2) (2020-02-15) + + +### Features + +* **appointmentslist:** add an appointments tab to the patient view ([deee00e](https://github.com/HospitalRun/hospitalrun-frontend/commit/deee00e52f2bab2fec8518d4e8cdfa6f67c2cf75)), closes [#1769](https://github.com/HospitalRun/hospitalrun-frontend/issues/1769) +* **edit patient:** implement Edit Patient functionality ([8e3355f](https://github.com/HospitalRun/hospitalrun-frontend/commit/8e3355f2124186b6ead1a710abb3010695e51abf)) +* **edit patient:** moved buttons out of GeneralInformation ([403e49f](https://github.com/HospitalRun/hospitalrun-frontend/commit/403e49feb130d16718fb014e1a27ea218915bb7e)) +* **env:** adds hospitalrun server information ([7f0fe7f](https://github.com/HospitalRun/hospitalrun-frontend/commit/7f0fe7fa47d0705d585f7ca15d4796e1c90c2f16)) +* **env:** change env variable names ([cddc812](https://github.com/HospitalRun/hospitalrun-frontend/commit/cddc812ae5bd1f1b05e7310b5a504b51ecee1981)) +* add documentation folder ([d22300e](https://github.com/HospitalRun/hospitalrun-frontend/commit/d22300e8a56be56c7edef6f914d7b9c5381aea7f)) +* **navigation:** navigate to patients profile on related person click ([c6acecc](https://github.com/HospitalRun/hospitalrun-frontend/commit/c6acecc3c89b0aeb96fa6c6fea15b316ee0669a2)), closes [#1763](https://github.com/HospitalRun/hospitalrun-frontend/issues/1763) +* **relatedpersontab:** add cursor icon to related persons list ([ef7e19c](https://github.com/HospitalRun/hospitalrun-frontend/commit/ef7e19cabf596afd08d4e15449a96285541149d1)), closes [#1792](https://github.com/HospitalRun/hospitalrun-frontend/issues/1792) +* **test:** add navigate to related person profile onclick test ([29fbffe](https://github.com/HospitalRun/hospitalrun-frontend/commit/29fbffec0848f0e0fed54b133513cfb1471ddacb)), closes [#1792](https://github.com/HospitalRun/hospitalrun-frontend/issues/1792) + + +### Bug Fixes + +* **patient-slice.ts:** conditionally render family name and suffix ([d20e294](https://github.com/HospitalRun/hospitalrun-frontend/commit/d20e294340a155cb90138ea9bf5210e6e697ea71)), closes [#1818](https://github.com/HospitalRun/hospitalrun-frontend/issues/1818) +* **patients:** add test for displaying No Related Persons warning ([da6bdb1](https://github.com/HospitalRun/hospitalrun-frontend/commit/da6bdb19e3609e1d8fca6d08349c71814162f536)), closes [#1789](https://github.com/HospitalRun/hospitalrun-frontend/issues/1789) +* **patients:** internationalize No Related Persons warning & loading ([099e50d](https://github.com/HospitalRun/hospitalrun-frontend/commit/099e50d846e1574dff2b28aafd77b7d01c4da955)), closes [#1789](https://github.com/HospitalRun/hospitalrun-frontend/issues/1789) +* **patients:** replace "Loading..." text with Spinner component ([e6ce4cb](https://github.com/HospitalRun/hospitalrun-frontend/commit/e6ce4cb979d3f3cd7c3704490ad4251955f4922f)), closes [#1789](https://github.com/HospitalRun/hospitalrun-frontend/issues/1789) +* **patients:** stop "Loading..." when patient has no related persons ([e513b17](https://github.com/HospitalRun/hospitalrun-frontend/commit/e513b172e25f24126969564a0e7d4f421758e626)), closes [#1789](https://github.com/HospitalRun/hospitalrun-frontend/issues/1789) +* **persons:** replace "No related persons" message with a warning ([c156b5b](https://github.com/HospitalRun/hospitalrun-frontend/commit/c156b5bba25b008be3bd7d11cd393e2f12fb49cb)), closes [#1789](https://github.com/HospitalRun/hospitalrun-frontend/issues/1789) +* **prettier:** changes endofline option ([1fbd965](https://github.com/HospitalRun/hospitalrun-frontend/commit/1fbd9658b4869d7f98b4ae918e731012e4b4b9a3)) +* **test:** add related test, and revert test changes ([9bead70](https://github.com/HospitalRun/hospitalrun-frontend/commit/9bead7078f8ea94680f24d865f576ae786ce5178)), closes [#1792](https://github.com/HospitalRun/hospitalrun-frontend/issues/1792) +* **test:** remove extra whitespace ([155b4e9](https://github.com/HospitalRun/hospitalrun-frontend/commit/155b4e939151beb994808bae22dd2cd74845da39)), closes [#1792](https://github.com/HospitalRun/hospitalrun-frontend/issues/1792) +* **test:** remove unused import ([fc3a78d](https://github.com/HospitalRun/hospitalrun-frontend/commit/fc3a78d70f285a120a9d0f690320d6c6fa5e5696)), closes [#1792](https://github.com/HospitalRun/hospitalrun-frontend/issues/1792) + ## 2.0.0-alpha.1 (2020-02-07) diff --git a/package.json b/package.json index 92b7e3378c..cc8817b34b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@hospitalrun/frontend", - "version": "2.0.0-alpha.1", + "version": "2.0.0-alpha.2", "description": "React frontend for HospitalRun", "private": false, "license": "MIT", From 814e712be03fa7ccbe587a9c7ef8b8cda4a12f7f Mon Sep 17 00:00:00 2001 From: Matteo Vivona Date: Sat, 15 Feb 2020 13:54:44 +0100 Subject: [PATCH 09/14] fix(build): fixes yarn install on github ci --- .github/workflows/ci.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7cb8362604..d577ead329 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -51,9 +51,11 @@ jobs: uses: actions/setup-node@v1 with: node-version: ${{ matrix.node-version }} + - name: Init yarn + run: | + npm install -g yarn - name: Install with yarn run: | - curl -o- -L https://yarnpkg.com/install.sh | bash yarn install - name: Lint code run: | @@ -61,6 +63,9 @@ jobs: - name: Build run: | yarn build + - name: Storybook build + run: | + yarn build-storybook - name: Run tests run: | yarn test:ci From 12ca8dea33e954de31a83b1f2d94564587b3297b Mon Sep 17 00:00:00 2001 From: Matteo Vivona Date: Sat, 15 Feb 2020 14:01:05 +0100 Subject: [PATCH 10/14] build(docker): updates install method removing c option on npm i command --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 0be4980bdd..cf8345253b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,7 +4,7 @@ ENV HOME=/home/app COPY . $HOME/node/ WORKDIR $HOME/node -RUN npm ci -q +RUN npm install -q RUN npm run build RUN npm prune --production From eaf28e429e29e2cc79b34b8936e1077d69abb650 Mon Sep 17 00:00:00 2001 From: Matteo Vivona Date: Sat, 15 Feb 2020 14:06:42 +0100 Subject: [PATCH 11/14] build(azure): adds stages on azure pipeline yaml --- azure.yaml | 151 +++++++++++++++++++++++++++-------------------------- 1 file changed, 77 insertions(+), 74 deletions(-) diff --git a/azure.yaml b/azure.yaml index 9ae7fdfbdf..f5cdfa2cc4 100644 --- a/azure.yaml +++ b/azure.yaml @@ -5,78 +5,81 @@ trigger: pr: none -jobs: - - job: npm_job - continueOnError: false - pool: - vmImage: ubuntu-latest - strategy: - matrix: - node_12_x: - node_version: 12.x - maxParallel: 5 - steps: - - task: NodeTool@0 - inputs: - versionSpec: $(node_version) - displayName: 'Install Node.js' - - bash: npm install - displayName: 'Install dependencies' - - bash: npm run lint - displayName: 'Lint code' - - bash: npm run build - displayName: 'Build code' - - bash: npm run test:ci - displayName: 'Test compiled code' +stages: + - stage: Build, lint and test code + jobs: + - job: npm_job + continueOnError: false + pool: + vmImage: ubuntu-latest + strategy: + matrix: + node_12_x: + node_version: 12.x + maxParallel: 5 + steps: + - task: NodeTool@0 + inputs: + versionSpec: $(node_version) + displayName: 'Install Node.js' + - bash: npm install + displayName: 'Install dependencies' + - bash: npm run lint + displayName: 'Lint code' + - bash: npm run build + displayName: 'Build code' + - bash: npm run test:ci + displayName: 'Test compiled code' + - job: yarn_job + continueOnError: false + pool: + vmImage: ubuntu-latest + strategy: + matrix: + node_12_x: + node_version: 12.x + maxParallel: 5 + steps: + - task: NodeTool@0 + inputs: + versionSpec: $(node_version) + displayName: 'Install Node.js' + - bash: yarn install + displayName: 'Install dependencies' + - bash: yarn lint + displayName: 'Lint code' + - bash: yarn build + displayName: 'Build code' + - bash: yarn test:ci + displayName: 'Test compiled code' - - job: yarn_job - continueOnError: false - pool: - vmImage: ubuntu-latest - strategy: - matrix: - node_12_x: - node_version: 12.x - maxParallel: 5 - steps: - - task: NodeTool@0 - inputs: - versionSpec: $(node_version) - displayName: 'Install Node.js' - - bash: yarn install - displayName: 'Install dependencies' - - bash: yarn lint - displayName: 'Lint code' - - bash: yarn build - displayName: 'Build code' - - bash: yarn test:ci - displayName: 'Test compiled code' - - - job: docker_job - dependsOn: [npm_job, yarn_job] - continueOnError: false - pool: - vmImage: ubuntu-latest - steps: - - script: | - echo '{ "experimental": true }' | sudo tee /etc/docker/daemon.json - sudo service docker restart - displayName: 'Enable Docker Engine experimental ' - - script: | - GIT_TAG=`git describe --tags` && VERSION_TAG="$(cut -d'-' -f1 <<<"$GIT_TAG")" && echo "##vso[task.setvariable variable=VERSION_TAG]$VERSION_TAG" - displayName: 'Get Git Tag' - - task: Docker@0 - displayName: 'Build an image' - inputs: - containerregistrytype: 'Container Registry' - dockerRegistryConnection: Docker # it is necessary to create a new "service connection" via Azure DevOps portal - dockerFile: ./Dockerfile - buildArguments: '--rm --squash' - imageName: '$(Build.Repository.Name):$(VERSION_TAG)' - - task: Docker@0 - displayName: 'Push an image' - inputs: - containerregistrytype: 'Container Registry' - dockerRegistryConnection: Docker # it is necessary to create a new "service connection" via Azure DevOps portal - action: 'Push an image' - imageName: '$(Build.Repository.Name):$(VERSION_TAG)' + - stage: Docker image build and push + jobs: + - job: docker_job + dependsOn: [npm_job, yarn_job] + continueOnError: false + pool: + vmImage: ubuntu-latest + steps: + - script: | + echo '{ "experimental": true }' | sudo tee /etc/docker/daemon.json + sudo service docker restart + displayName: 'Enable Docker Engine experimental ' + - script: | + GIT_TAG=`git describe --tags` && VERSION_TAG="$(cut -d'-' -f1 <<<"$GIT_TAG")" && echo "##vso[task.setvariable variable=VERSION_TAG]$VERSION_TAG" + displayName: 'Get Git Tag' + - task: Docker@0 + displayName: 'Build an image' + inputs: + containerregistrytype: 'Container Registry' + dockerRegistryConnection: Docker # it is necessary to create a new "service connection" via Azure DevOps portal + dockerFile: ./Dockerfile + buildArguments: '--rm --squash' + imageName: '$(Build.Repository.Name):$(VERSION_TAG)' + - task: Docker@0 + displayName: 'Push an image' + inputs: + containerregistrytype: 'Container Registry' + dockerRegistryConnection: Docker # it is necessary to create a new "service connection" via Azure DevOps portal + action: 'Push an image' + imageName: '$(Build.Repository.Name):$(VERSION_TAG)' From eb55decad73ecd0e2afbc2a1049747fbe6074ce1 Mon Sep 17 00:00:00 2001 From: Matteo Vivona Date: Sat, 15 Feb 2020 14:10:22 +0100 Subject: [PATCH 12/14] build(azure): fixes stage name on azure pipeline yaml --- azure.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/azure.yaml b/azure.yaml index f5cdfa2cc4..4930c93cae 100644 --- a/azure.yaml +++ b/azure.yaml @@ -6,7 +6,7 @@ trigger: pr: none stages: - - stage: Build, lint and test code + - stage: Build jobs: - job: npm_job continueOnError: false @@ -53,7 +53,7 @@ stages: - bash: yarn test:ci displayName: 'Test compiled code' - - stage: Docker image build and push + - stage: Docker jobs: - job: docker_job dependsOn: [npm_job, yarn_job] From d57539a5fa2453ec7af7d32edb79c21d4a33c3ac Mon Sep 17 00:00:00 2001 From: Matteo Vivona Date: Sat, 15 Feb 2020 14:16:02 +0100 Subject: [PATCH 13/14] build(azure): improves azure pipeline stage conditions --- azure.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/azure.yaml b/azure.yaml index 4930c93cae..fd12bc8a1d 100644 --- a/azure.yaml +++ b/azure.yaml @@ -56,7 +56,8 @@ stages: - stage: Docker jobs: - job: docker_job - dependsOn: [npm_job, yarn_job] + dependsOn: Build + condition: succeeded('Build') continueOnError: false pool: vmImage: ubuntu-latest From f5f3b29eb2cb373cff160ab64bc640cdf39243e7 Mon Sep 17 00:00:00 2001 From: Matteo Vivona Date: Sat, 15 Feb 2020 14:22:27 +0100 Subject: [PATCH 14/14] build(azure): fixes docker stage --- azure.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/azure.yaml b/azure.yaml index fd12bc8a1d..febd24e57c 100644 --- a/azure.yaml +++ b/azure.yaml @@ -56,7 +56,6 @@ stages: - stage: Docker jobs: - job: docker_job - dependsOn: Build condition: succeeded('Build') continueOnError: false pool: