diff --git a/platform/docs/docs/README.md b/platform/docs/docs/README.md index 459c28c61..aa29e7dcd 100644 --- a/platform/docs/docs/README.md +++ b/platform/docs/docs/README.md @@ -33,18 +33,20 @@ annotating, and reporting on DICOM images in 2D (slices) and 3D (volumes). of our medical image web viewers from the start. The summary of changes include: - Addition of workflow modes - - - Often, medical imaging use cases involves lots of specific workflows that re-use - functionalities. We have added the capability of workflow modes, that enable people - to customize user interface and configure application for specific workflow. - - The idea is to re-use the functionalities that extensions provide and create a workflow. - Brain segmentation workflow is different from prostate segmentation in UI for sure; however, they share the segmentation tools that can be re-used. - - Our vision is that technical people focus of developing extensions which provides - core functionalities, and experts to build modes by picking the appropriate functionalities - from each extension. + - Often, medical imaging use cases involves lots of specific workflows that + re-use functionalities. We have added the capability of workflow modes, that + enable people to customize user interface and configure application for + specific workflow. + - The idea is to re-use the functionalities that extensions provide and create + a workflow. Brain segmentation workflow is different from prostate + segmentation in UI for sure; however, they share the segmentation tools that + can be re-used. + - Our vision is that technical people focus of developing extensions which + provides core functionalities, and experts to build modes by picking the + appropriate functionalities from each extension. * Redux store has been removed from the viewer, and a cleaner, more powerful -* tailwind CSS +* Tailwind CSS * End-to-end test suite Below, you can find the gap analysis between the `OHIF-v2` and `OHIF-v3`: diff --git a/platform/docs/docusaurus.config.js b/platform/docs/docusaurus.config.js index db9aee299..66263cc19 100644 --- a/platform/docs/docusaurus.config.js +++ b/platform/docs/docusaurus.config.js @@ -33,7 +33,7 @@ const isDev = process.env.NODE_ENV === 'development'; const isDeployPreview = process.env.NETLIFY && process.env.CONTEXT === 'deploy-preview'; -const baseUrl = process.env.BASE_URL || '/docs/'; +const baseUrl = process.env.BASE_URL || '/'; const isBootstrapPreset = process.env.DOCUSAURUS_PRESET === 'bootstrap'; // Special deployment for staging locales until they get enough translations @@ -59,9 +59,9 @@ const isI18nStaging = process.env.I18N_STAGING === 'true'; ['en'] : isI18nStaging ? // Staging locales: https://docusaurus-i18n-staging.netlify.app/ - ['en', 'ja'] + ['en'] : // Production locales - ['en', 'fr', 'ko', 'zh-CN'], + ['en'], }, onBrokenLinks: 'warn', onBrokenMarkdownLinks: 'warn', @@ -122,7 +122,7 @@ const isI18nStaging = process.env.I18N_STAGING === 'true'; 'queryString', ], // swRegister: false, - swCustom: path.resolve(__dirname, 'src/sw.js'), + // swCustom: path.resolve(__dirname, 'src/sw.js'), pwaHead: [ { tagName: 'link', diff --git a/platform/docs/netlify.toml b/platform/docs/netlify.toml new file mode 100644 index 000000000..20dc48f58 --- /dev/null +++ b/platform/docs/netlify.toml @@ -0,0 +1,38 @@ +# Netlify Config +# +# TOML Reference: +# https://www.netlify.com/docs/netlify-toml-reference/ +# +# We use Netlify for deploy previews and for publishing docs (gh-pages branch). +# https://viewer.ohif.org is created using a different process that is +# managed by CircleCI and deployed to our Google Hosting +# + +#[build] +# ignore = "git diff --quiet $CACHED_COMMIT_REF $COMMIT_REF" + +# NODE_VERSION in root `.nvmrc` takes priority +# YARN_FLAGS: https://www.netlify.com/docs/build-gotchas/#yarn +[build.environment] + # If 'production', `yarn install` does not install devDependencies + NODE_ENV = "development" + NODE_VERSION = "12.13.0" + YARN_VERSION = "1.22.0" + RUBY_VERSION = "2.6.2" + YARN_FLAGS = "--no-ignore-optional --pure-lockfile" + NETLIFY_USE_YARN = "true" + +[[headers]] + # Define which paths this specific [[headers]] block will cover. + for = "/*" + + [headers.values] + X-Frame-Options = "DENY" + X-XSS-Protection = "1; mode=block" + + # Multi-key header rules are expressed with multi-line strings. + cache-control = ''' + max-age=0, + no-cache, + no-store, + must-revalidate''' diff --git a/platform/ui/doczrc.js b/platform/ui/doczrc.js index 719c2ac5b..846bc777d 100644 --- a/platform/ui/doczrc.js +++ b/platform/ui/doczrc.js @@ -11,5 +11,5 @@ export default { // 'Other', ], ignore: ['README.md'], - base: '/ui/', + base: '/', }; diff --git a/platform/ui/netlify.toml b/platform/ui/netlify.toml new file mode 100644 index 000000000..7d70aa5e6 --- /dev/null +++ b/platform/ui/netlify.toml @@ -0,0 +1,40 @@ +# Netlify Config +# +# TOML Reference: +# https://www.netlify.com/docs/netlify-toml-reference/ +# +# We use Netlify for deploy previews and for publishing docs (gh-pages branch). +# https://viewer.ohif.org is created using a different process that is +# managed by CircleCI and deployed to our Google Hosting +# + +[build] + base = "" + publish = ".docz/dist" + ignore = "git diff --quiet $CACHED_COMMIT_REF $COMMIT_REF . ../i18n/" + +# NODE_VERSION in root `.nvmrc` takes priority +# YARN_FLAGS: https://www.netlify.com/docs/build-gotchas/#yarn +[build.environment] + # If 'production', `yarn install` does not install devDependencies + NODE_ENV = "development" + NODE_VERSION = "12.13.0" + YARN_VERSION = "1.22.0" + RUBY_VERSION = "2.6.2" + YARN_FLAGS = "--no-ignore-optional --pure-lockfile" + NETLIFY_USE_YARN = "true" + +[[headers]] + # Define which paths this specific [[headers]] block will cover. + for = "/*" + + [headers.values] + X-Frame-Options = "DENY" + X-XSS-Protection = "1; mode=block" + + # Multi-key header rules are expressed with multi-line strings. + cache-control = ''' + max-age=0, + no-cache, + no-store, + must-revalidate''' diff --git a/platform/ui/package.json b/platform/ui/package.json index 9ff999df0..7ffbd558d 100644 --- a/platform/ui/package.json +++ b/platform/ui/package.json @@ -20,7 +20,6 @@ "start": "yarn run dev", "build": "docz build", "build:ui:ci": "docz build", - "build:ui:deploy-preview": "docz build --base=/ui/", "dev": "docz dev", "serve": "docz serve", "docs:preview": "yarn run dev" diff --git a/platform/ui/src/gatsby-theme-docz/tailwind.css b/platform/ui/src/gatsby-theme-docz/tailwind.css index 52dd0e5de..4772a6cf1 100644 --- a/platform/ui/src/gatsby-theme-docz/tailwind.css +++ b/platform/ui/src/gatsby-theme-docz/tailwind.css @@ -3,7 +3,7 @@ @tailwind utilities; /* IMPORT CUSTOM FONT */ -@import url('https://fonts.googleapis.com/css?family=Lato:300,400,700&display=swap'); +@import url('https://fonts.googleapis.com/css?family=Lato:100,300,400,500,700&display=swap'); /* Trincate 2 lines utility */ .truncate-2-lines { diff --git a/platform/ui/tailwind.config.js b/platform/ui/tailwind.config.js index 91872cfc8..66ed3dc32 100644 --- a/platform/ui/tailwind.config.js +++ b/platform/ui/tailwind.config.js @@ -2,7 +2,7 @@ module.exports = { prefix: '', important: false, separator: ':', - purge: ['./src/**/*.jsx'], + //purge: ['./src/**/*.jsx'], theme: { screens: { sm: '640px', diff --git a/platform/viewer/.webpack/webpack.pwa.js b/platform/viewer/.webpack/webpack.pwa.js index e406fedd7..9336c8e92 100644 --- a/platform/viewer/.webpack/webpack.pwa.js +++ b/platform/viewer/.webpack/webpack.pwa.js @@ -12,8 +12,6 @@ const CopyWebpackPlugin = require('copy-webpack-plugin'); const ExtractCssChunksPlugin = require('extract-css-chunks-webpack-plugin'); const HtmlWebpackPlugin = require('html-webpack-plugin'); const { InjectManifest } = require('workbox-webpack-plugin'); -const TerserJSPlugin = require('terser-webpack-plugin'); -const OptimizeCSSAssetsPlugin = require('optimize-css-assets-webpack-plugin'); // ~~ Rules const extractStyleChunksRule = require('./rules/extractStyleChunks.js'); // ~~ Directories diff --git a/netlify.toml b/platform/viewer/netlify.toml similarity index 76% rename from netlify.toml rename to platform/viewer/netlify.toml index cebb22d90..f868d9ac3 100644 --- a/netlify.toml +++ b/platform/viewer/netlify.toml @@ -10,8 +10,10 @@ [build] base = "" - publish = ".netlify/www/" - command = ".netlify/build-deploy-preview.sh" + build = "yarn run build:viewer:ci" + publish = "dist" + ignore = "git diff --quiet $CACHED_COMMIT_REF $COMMIT_REF . ../ui/ ../core/ ../i18n/" + # NODE_VERSION in root `.nvmrc` takes priority # YARN_FLAGS: https://www.netlify.com/docs/build-gotchas/#yarn @@ -22,12 +24,7 @@ YARN_VERSION = "1.22.0" RUBY_VERSION = "2.6.2" YARN_FLAGS = "--no-ignore-optional --pure-lockfile" - NETLIFY_RESTORE = "1" - -# Production context: all deploys from the Production branch set in your site's -# deploy contexts will inherit these settings. -[context.production] - ignore = "exit 0" # Never build production; We'll let our CI do that + NETLIFY_USE_YARN = "true" [[headers]] # Define which paths this specific [[headers]] block will cover. diff --git a/platform/viewer/package.json b/platform/viewer/package.json index 47a6238bd..91073a12b 100644 --- a/platform/viewer/package.json +++ b/platform/viewer/package.json @@ -18,7 +18,7 @@ "proxy": "http://localhost:8042", "scripts": { "build:viewer": "cross-env NODE_ENV=production node --max_old_space_size=4096 ./../../node_modules/webpack/bin/webpack.js --config .webpack/webpack.pwa.js --progress", - "build:viewer:ci": "cross-env NODE_ENV=production PUBLIC_URL=/pwa/ APP_CONFIG=config/netlify.js QUICK_BUILD=true node --max_old_space_size=4096 ./../../node_modules/webpack/bin/webpack.js --config .webpack/webpack.pwa.js", + "build:viewer:ci": "cross-env NODE_ENV=production PUBLIC_URL=/ APP_CONFIG=config/netlify.js QUICK_BUILD=true node --max_old_space_size=4096 ./../../node_modules/webpack/bin/webpack.js --config .webpack/webpack.pwa.js", "build:viewer:demo": "cross-env NODE_ENV=production APP_CONFIG=config/demo.js HTML_TEMPLATE=rollbar.html QUICK_BUILD=true node --max_old_space_size=4096 ./../../node_modules/webpack/bin/webpack.js --progress --config .webpack/webpack.pwa.js", "dev": "cross-env NODE_ENV=development webpack-dev-server --config .webpack/webpack.pwa.js --watch", "dev:orthanc": "cross-env NODE_ENV=development PROXY_TARGET=/dicom-web PROXY_DOMAIN=http://localhost:8042 APP_CONFIG=config/docker_nginx-orthanc.js webpack-dev-server --config .webpack/webpack.pwa.js --watch", diff --git a/platform/viewer/public/config/netlify.js b/platform/viewer/public/config/netlify.js index b8134cb3c..bae63f6ef 100644 --- a/platform/viewer/public/config/netlify.js +++ b/platform/viewer/public/config/netlify.js @@ -1,5 +1,5 @@ window.config = { - routerBasename: '/pwa', + routerBasename: '/', // whiteLabelling: {}, extensions: [], modes: [],