From 35632da05127c6643b36fd85f18f2670156ff9e2 Mon Sep 17 00:00:00 2001 From: Miguel Serrano Date: Wed, 6 Nov 2019 10:52:15 +0100 Subject: [PATCH] Added flag to disable URL file linking (#2316) GitOrigin-RevId: c178d2d629b361534d1b96bf80de015a72ab2047 --- services/web/app/src/infrastructure/Features.js | 2 ++ .../web/app/views/project/editor/new-file-modal.pug | 11 ++++++----- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/services/web/app/src/infrastructure/Features.js b/services/web/app/src/infrastructure/Features.js index f58fadec9e..1249be9dba 100644 --- a/services/web/app/src/infrastructure/Features.js +++ b/services/web/app/src/infrastructure/Features.js @@ -53,6 +53,8 @@ module.exports = Features = { return Settings.apis.references.url != null case 'saml': return Settings.enableSaml + case 'link-url': + return Settings.apis.linkedUrlProxy && Settings.apis.linkedUrlProxy.url default: throw new Error(`unknown feature: ${feature}`) } diff --git a/services/web/app/views/project/editor/new-file-modal.pug b/services/web/app/views/project/editor/new-file-modal.pug index df8b6d0133..47dff03a55 100644 --- a/services/web/app/views/project/editor/new-file-modal.pug +++ b/services/web/app/views/project/editor/new-file-modal.pug @@ -21,11 +21,12 @@ script(type='text/ng-template', id='newFileModalTemplate') i.fa.fa-fw.fa-folder-open | | From Another Project - li(ng-class="type == 'url' ? 'active' : null") - a(href, ng-click="type = 'url'") - i.fa.fa-fw.fa-globe - | - | From External URL + if hasFeature('link-url') + li(ng-class="type == 'url' ? 'active' : null") + a(href, ng-click="type = 'url'") + i.fa.fa-fw.fa-globe + | + | From External URL != moduleIncludes("newFileModal:selector", locals) td(class="modal-new-file--body modal-new-file--body-{{type}}")