diff --git a/domain/link/endpoint.go b/domain/link/endpoint.go index 86ae5aa1..ee545e33 100644 --- a/domain/link/endpoint.go +++ b/domain/link/endpoint.go @@ -97,7 +97,6 @@ func (h *Handler) GetLinkCandidates(w http.ResponseWriter, r *http.Request) { if len(files) == 0 { files = []attachment.Attachment{} } - if err != nil && err != sql.ErrNoRows { response.WriteServerError(w, method, err) h.Runtime.Log.Error(method, err) diff --git a/gui/app/services/link.js b/gui/app/services/link.js index 0b19b6f6..c7dafa47 100644 --- a/gui/app/services/link.js +++ b/gui/app/services/link.js @@ -13,7 +13,7 @@ import Service, { inject as service } from '@ember/service'; import Notifier from '../mixins/notifier'; export default Service.extend(Notifier, { - sessionService: service('session'), + session: service('session'), ajax: service(), appMeta: service(), store: service(), @@ -66,7 +66,13 @@ export default Service.extend(Notifier, { result = `${link.title}`; } if (link.linkType === "file") { - href = `${endpoint}/public/attachments/${orgId}/${link.targetId}`; + // For authenticated users we send server auth token. + let qry = ''; + if (this.get('session.authenticated')) { + qry = '?token=' + this.get('session.authToken'); + } + + href = `${endpoint}/public/attachment/${orgId}/${link.targetId}${qry}`; result = `${link.title}`; } if (link.linkType === "network") { @@ -130,6 +136,7 @@ export default Service.extend(Notifier, { // handle attachment links if (link.linkType === "file") { + link.url = link.url.replace('attachments/', 'attachment/'); window.location.href = link.url; return; } diff --git a/gui/app/styles/core/bootstrap.scss b/gui/app/styles/core/bootstrap.scss index 2bffc1e9..7ac7e37e 100644 --- a/gui/app/styles/core/bootstrap.scss +++ b/gui/app/styles/core/bootstrap.scss @@ -31,6 +31,7 @@ $modal-header-border-color: $color-white; $modal-footer-border-color: $color-white; .modal-header { + // background-color: map-get($gray-shades, 800); background-color: $theme-500; color: map-get($gray-shades, 100); font-size: 1.2rem; diff --git a/gui/app/styles/core/util.scss b/gui/app/styles/core/util.scss index c56e78a0..0a466419 100644 --- a/gui/app/styles/core/util.scss +++ b/gui/app/styles/core/util.scss @@ -21,11 +21,6 @@ a { } } -a.broken-link { - color: map-get($red-shades, 600); - text-decoration: line-through; -} - .no-outline { outline: none !important; border: none !important; diff --git a/gui/app/styles/core/view/document/add-section.scss b/gui/app/styles/core/view/document/add-section.scss index 0677d83b..2425238e 100644 --- a/gui/app/styles/core/view/document/add-section.scss +++ b/gui/app/styles/core/view/document/add-section.scss @@ -13,8 +13,8 @@ white-space: nowrap; padding: 0.375rem 0.75rem; margin: 10px; - background-color: map-get($yellow-shades, 300); - border: 1px solid map-get($yellow-shades, 400); + background-color: map-get($gray-shades, 100); + border: 1px solid map-get($gray-shades, 200); @extend .no-select; @include border-radius(2px); @include button-shadow-light(); @@ -37,13 +37,14 @@ display: inline-block; font-size: 1.1rem; font-weight: 500; - color: map-get($yellow-shades, 900); + color: map-get($gray-shades, 800); letter-spacing: 0.5px; margin-top: 6px; } &:hover { - background-color: map-get($yellow-shades, 400); + background-color: map-get($yellow-shades, 200); + border: 1px solid map-get($yellow-shades, 300); } } @@ -53,8 +54,8 @@ white-space: nowrap; padding: 0.375rem 0.75rem; margin: 10px; - background-color: map-get($yellow-shades, 200); - border: 1px solid map-get($yellow-shades, 300); + background-color: map-get($gray-shades, 100); + border: 1px solid map-get($gray-shades, 200); @extend .no-select; @include border-radius(2px); @include button-shadow-light(); @@ -62,20 +63,21 @@ > .name { font-size: 1.1rem; font-weight: 500; - color: map-get($yellow-shades, 800); + color: map-get($green-shades, 800); letter-spacing: 0.5px; @extend .text-truncate; } > .desc { - color: map-get($yellow-shades, 700); + color: map-get($gray-shades, 800); font-size: 0.9rem; font-weight: 300; @extend .text-truncate; } &:hover { - background-color: map-get($yellow-shades, 300); + background-color: map-get($yellow-shades, 200); + border: 1px solid map-get($yellow-shades, 300); } } } diff --git a/gui/app/styles/core/view/document/section-editor.scss b/gui/app/styles/core/view/document/section-editor.scss index efcbebc1..cb09e3c8 100644 --- a/gui/app/styles/core/view/document/section-editor.scss +++ b/gui/app/styles/core/view/document/section-editor.scss @@ -35,3 +35,8 @@ .block-editor { margin-top: 3rem; } + +a.broken-link { + color: map-get($red-shades, 600); + text-decoration: line-through; +} diff --git a/gui/app/templates/components/document/content-linker.hbs b/gui/app/templates/components/document/content-linker.hbs index 71bdd262..3d61a58e 100644 --- a/gui/app/templates/components/document/content-linker.hbs +++ b/gui/app/templates/components/document/content-linker.hbs @@ -4,8 +4,12 @@