|
@@ -24,6 +24,7 @@ import huePubSub from 'utils/huePubSub';
|
|
|
import I18n from 'utils/i18n';
|
|
import I18n from 'utils/i18n';
|
|
|
import { DOCUMENT_TYPES } from 'doc/docSupport';
|
|
import { DOCUMENT_TYPES } from 'doc/docSupport';
|
|
|
import { ASSIST_DOC_HIGHLIGHT_EVENT, ASSIST_SHOW_DOC_EVENT } from './events';
|
|
import { ASSIST_DOC_HIGHLIGHT_EVENT, ASSIST_SHOW_DOC_EVENT } from './events';
|
|
|
|
|
+import { CONFIG_REFRESHED_EVENT, getLastKnownConfig } from 'utils/hueConfig';
|
|
|
|
|
|
|
|
export const REFRESH_DOC_ASSIST_EVENT = 'assist.document.refresh';
|
|
export const REFRESH_DOC_ASSIST_EVENT = 'assist.document.refresh';
|
|
|
|
|
|
|
@@ -46,9 +47,11 @@ const TEMPLATE = `
|
|
|
'Delete document'
|
|
'Delete document'
|
|
|
)}</a></li>
|
|
)}</a></li>
|
|
|
<!-- /ko -->
|
|
<!-- /ko -->
|
|
|
|
|
+ <!-- ko if: $containerContext.sharingEnabled -->
|
|
|
<li><a href="javascript: void(0);" data-bind="publish: { 'doc.show.share.modal': $data }"><i class="fa fa-fw fa-users"></i> ${I18n(
|
|
<li><a href="javascript: void(0);" data-bind="publish: { 'doc.show.share.modal': $data }"><i class="fa fa-fw fa-users"></i> ${I18n(
|
|
|
'Share'
|
|
'Share'
|
|
|
)}</a></li>
|
|
)}</a></li>
|
|
|
|
|
+ <!-- /ko -->
|
|
|
</script>
|
|
</script>
|
|
|
|
|
|
|
|
<script type="text/html" id="assist-document-header-actions">
|
|
<script type="text/html" id="assist-document-header-actions">
|
|
@@ -198,7 +201,7 @@ const TEMPLATE = `
|
|
|
</ul>
|
|
</ul>
|
|
|
<!-- /ko -->
|
|
<!-- /ko -->
|
|
|
<ul class="assist-tables" data-bind="foreachVisible: { data: filteredEntries, minHeight: 27, container: '.assist-file-scrollable' }">
|
|
<ul class="assist-tables" data-bind="foreachVisible: { data: filteredEntries, minHeight: 27, container: '.assist-file-scrollable' }">
|
|
|
- <li class="assist-entry assist-file-entry" data-bind="appAwareTemplateContextMenu: { template: 'document-context-items', scrollContainer: '.assist-file-scrollable', beforeOpen: beforeContextOpen }, assistFileDroppable, assistFileDraggable, visibleOnHover: { 'selector': '.assist-file-actions' }">
|
|
|
|
|
|
|
+ <li class="assist-entry assist-file-entry" data-bind="appAwareTemplateContextMenu: { template: 'document-context-items', containerContext: $parents[2], scrollContainer: '.assist-file-scrollable', beforeOpen: beforeContextOpen }, assistFileDroppable, assistFileDraggable, visibleOnHover: { 'selector': '.assist-file-actions' }">
|
|
|
<div class="assist-file-actions table-actions">
|
|
<div class="assist-file-actions table-actions">
|
|
|
<a class="inactive-action" href="javascript:void(0)" data-bind="popoverOnHover: showContextPopover, css: { 'blue': statsVisible }"><i class="fa fa-fw fa-info" title="${I18n(
|
|
<a class="inactive-action" href="javascript:void(0)" data-bind="popoverOnHover: showContextPopover, css: { 'blue': statsVisible }"><i class="fa fa-fw fa-info" title="${I18n(
|
|
|
'Show details'
|
|
'Show details'
|
|
@@ -237,6 +240,16 @@ class AssistDocumentsPanel {
|
|
|
self.activeEntry = ko.observable();
|
|
self.activeEntry = ko.observable();
|
|
|
self.activeSort = ko.observable('defaultAsc');
|
|
self.activeSort = ko.observable('defaultAsc');
|
|
|
self.typeFilter = ko.observable(DOCUMENT_TYPES[0]); // all is first
|
|
self.typeFilter = ko.observable(DOCUMENT_TYPES[0]); // all is first
|
|
|
|
|
+ self.sharingEnabled = ko.observable(false);
|
|
|
|
|
+
|
|
|
|
|
+ const updateFromConfig = hueConfig => {
|
|
|
|
|
+ self.sharingEnabled(
|
|
|
|
|
+ hueConfig && (hueConfig.hue_config.is_admin || hueConfig.hue_config.enable_sharing)
|
|
|
|
|
+ );
|
|
|
|
|
+ };
|
|
|
|
|
+
|
|
|
|
|
+ updateFromConfig(getLastKnownConfig());
|
|
|
|
|
+ huePubSub.subscribe(CONFIG_REFRESHED_EVENT, updateFromConfig);
|
|
|
|
|
|
|
|
self.highlightTypeFilter = ko.observable(false);
|
|
self.highlightTypeFilter = ko.observable(false);
|
|
|
|
|
|