diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-05-17 19:05:49 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-05-17 19:05:49 +0300 |
commit | 43a25d93ebdabea52f99b05e15b06250cd8f07d7 (patch) | |
tree | dceebdc68925362117480a5d672bcff122fb625b /app/assets/javascripts/lib/swagger.js | |
parent | 20c84b99005abd1c82101dfeff264ac50d2df211 (diff) |
Add latest changes from gitlab-org/gitlab@16-0-stable-eev16.0.0-rc42
Diffstat (limited to 'app/assets/javascripts/lib/swagger.js')
-rw-r--r-- | app/assets/javascripts/lib/swagger.js | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/app/assets/javascripts/lib/swagger.js b/app/assets/javascripts/lib/swagger.js index ed646176604..fcdab18c623 100644 --- a/app/assets/javascripts/lib/swagger.js +++ b/app/assets/javascripts/lib/swagger.js @@ -1,6 +1,13 @@ import { SwaggerUIBundle } from 'swagger-ui-dist'; import { safeLoad } from 'js-yaml'; import { isObject } from '~/lib/utils/type_utility'; +import { getParameterByName } from '~/lib/utils/url_utility'; +import { resetServiceWorkersPublicPath } from '~/lib/utils/webpack'; + +const resetWebpackPublicPath = () => { + window.gon = { relative_url_root: getParameterByName('relativeRootPath') }; + resetServiceWorkersPublicPath(); +}; const renderSwaggerUI = (value) => { /* SwaggerUIBundle accepts openapi definition @@ -12,6 +19,8 @@ const renderSwaggerUI = (value) => { spec = safeLoad(spec, { json: true }); } + resetWebpackPublicPath(); + Promise.all([import(/* webpackChunkName: 'openapi' */ 'swagger-ui-dist/swagger-ui.css')]) .then(() => { SwaggerUIBundle({ |