diff --git a/apps/files/js/dist/personal-settings.js b/apps/files/js/dist/personal-settings.js index d1241013730ef2e5c51136f9d856e1fc9abe6503..35fbd51419e63d3d3212532878535152234b5444 100644 Binary files a/apps/files/js/dist/personal-settings.js and b/apps/files/js/dist/personal-settings.js differ diff --git a/apps/files/js/dist/personal-settings.js.map b/apps/files/js/dist/personal-settings.js.map index aa382f7d62b3a6c010a71cedc0757df3b4fec70e..dc172c9b149e22a939e5e28c31783b1730b8ece0 100644 Binary files a/apps/files/js/dist/personal-settings.js.map and b/apps/files/js/dist/personal-settings.js.map differ diff --git a/apps/files/js/dist/sidebar.js b/apps/files/js/dist/sidebar.js index 9d78d14a6c97f02562d3b382350b0c2d91ede1a9..0815e1329dcfa268b7d0651e65620508cf367445 100644 Binary files a/apps/files/js/dist/sidebar.js and b/apps/files/js/dist/sidebar.js differ diff --git a/apps/files/js/dist/sidebar.js.map b/apps/files/js/dist/sidebar.js.map index d85b37bde59f68d44935d62fbd6faecd63ebc1f1..b4956474f4d9d2f90044600388aa29449f913767 100644 Binary files a/apps/files/js/dist/sidebar.js.map and b/apps/files/js/dist/sidebar.js.map differ diff --git a/apps/files/js/filelist.js b/apps/files/js/filelist.js index fd7624e452a1b5a4f7f56d12adcba8ed2de5c216..821a11804b4848dba3d7e6c5f559bf93f69d4ebb 100644 --- a/apps/files/js/filelist.js +++ b/apps/files/js/filelist.js @@ -630,7 +630,7 @@ * @param {string|OCA.Files.FileInfoModel} fileName file name from the current list or a FileInfoModel object * @param {boolean} [show=true] whether to open the sidebar if it was closed */ - _updateDetailsView: function(fileName) { + _updateDetailsView: function(fileName, show) { if (!(OCA.Files && OCA.Files.Sidebar)) { console.error('No sidebar available'); return; @@ -650,8 +650,18 @@ var model = this.getModelForFile(tr) var path = model.attributes.path + '/' + model.attributes.name + // make sure the file list has the correct context available + if (this._currentFileModel) { + this._currentFileModel.off(); + } + this.$fileList.children().removeClass('highlighted'); + tr.addClass('highlighted'); + this._currentFileModel = model; + // open sidebar and set file - OCA.Files.Sidebar.open(path.replace('//', '/')) + if (typeof show === 'undefined' || !!show || (OCA.Files.Sidebar.file !== '')) { + OCA.Files.Sidebar.open(path.replace('//', '/')) + } }, /** diff --git a/apps/files/src/views/Sidebar.vue b/apps/files/src/views/Sidebar.vue index 4bee3c67759eb5c214b67ce4c60c884df466c4cc..81c4e7283801394562cf6cfc4ea6e30d164b7985 100644 --- a/apps/files/src/views/Sidebar.vue +++ b/apps/files/src/views/Sidebar.vue @@ -25,6 +25,7 @@ v-if="file" ref="sidebar" v-bind="appSidebar" + :force-menu="true" @close="onClose" @update:active="setActiveTab" @update:starred="toggleStarred" @@ -37,6 +38,19 @@ :file-info="fileInfo" /> </template> + <!-- Actions menu --> + <template v-if="fileInfo" #secondary-actions> + <!-- TODO: create proper api for apps to register actions + And inject themselves here. --> + <ActionButton + v-if="isSystemTagsEnabled" + :close-after-click="true" + icon="icon-tag" + @click="toggleTags"> + {{ t('files_sharing', 'Tags') }} + </ActionButton> + </template> + <!-- Error display --> <div v-if="error" class="emptycontent"> <div class="icon-error" /> @@ -60,6 +74,7 @@ import $ from 'jquery' import axios from '@nextcloud/axios' import AppSidebar from 'nextcloud-vue/dist/Components/AppSidebar' +import ActionButton from 'nextcloud-vue/dist/Components/ActionButton' import FileInfo from '../services/FileInfo' import LegacyTab from '../components/LegacyTab' import LegacyView from '../components/LegacyView' @@ -69,6 +84,7 @@ export default { name: 'Sidebar', components: { + ActionButton, AppSidebar, LegacyView, }, @@ -218,6 +234,10 @@ export default { defaultActionListener() { return this.defaultAction ? 'figure-click' : null }, + + isSystemTagsEnabled() { + return OCA && 'SystemTags' in OCA + } }, watch: { @@ -377,6 +397,15 @@ export default { }) } }, + + /** + * Toggle the tags selector + */ + toggleTags() { + if (OCA.SystemTags && OCA.SystemTags.View) { + OCA.SystemTags.View.toggle() + } + } }, } </script> diff --git a/apps/files_sharing/js/dist/files_sharing_tab.js b/apps/files_sharing/js/dist/files_sharing_tab.js index b77c78e947f757f3b9dfbde9e480e47f9e413658..17c58e2815c23f86ecf5c5e76b5018effeab4d4a 100644 Binary files a/apps/files_sharing/js/dist/files_sharing_tab.js and b/apps/files_sharing/js/dist/files_sharing_tab.js differ diff --git a/apps/files_sharing/js/dist/files_sharing_tab.js.map b/apps/files_sharing/js/dist/files_sharing_tab.js.map index 97cf5074a5b7c9fce7e795f09b54cbf962e379ca..08c1e44b06e444e8831f1b12478be90b2226e2f0 100644 Binary files a/apps/files_sharing/js/dist/files_sharing_tab.js.map and b/apps/files_sharing/js/dist/files_sharing_tab.js.map differ diff --git a/apps/settings/js/vue-0.js b/apps/settings/js/vue-0.js index ce6955b83e61cad8ce029b8f844819b0a45f6177..ded87d3fa8c6b77bd424ce14d3bc4fa5a43667ed 100644 Binary files a/apps/settings/js/vue-0.js and b/apps/settings/js/vue-0.js differ diff --git a/apps/settings/js/vue-0.js.map b/apps/settings/js/vue-0.js.map index 243e2bdedee38cc331df3e891e8035dcd3a855eb..fcc43b0366155f524086e02ba293efabd11cda7b 100644 Binary files a/apps/settings/js/vue-0.js.map and b/apps/settings/js/vue-0.js.map differ diff --git a/apps/settings/js/vue-settings-admin-security.js b/apps/settings/js/vue-settings-admin-security.js index 44c27cf1d1d4c56e52b0cef78aaa71f0897dd16a..883266b188ee3fffff4c530a68e12715b49bb9c4 100644 Binary files a/apps/settings/js/vue-settings-admin-security.js and b/apps/settings/js/vue-settings-admin-security.js differ diff --git a/apps/settings/js/vue-settings-admin-security.js.map b/apps/settings/js/vue-settings-admin-security.js.map index 1a87ecb7eee979a9e7ff051f3041915e277cd720..a31d651ff5759ed205c6dfa3c1032800964ad46d 100644 Binary files a/apps/settings/js/vue-settings-admin-security.js.map and b/apps/settings/js/vue-settings-admin-security.js.map differ diff --git a/apps/settings/js/vue-settings-apps-users-management.js b/apps/settings/js/vue-settings-apps-users-management.js index 3f10483f671849b0137e6d303857ec2f4963d555..355c89af96e2dc8889df7af0d06b54c84b372ec5 100644 Binary files a/apps/settings/js/vue-settings-apps-users-management.js and b/apps/settings/js/vue-settings-apps-users-management.js differ diff --git a/apps/settings/js/vue-settings-apps-users-management.js.map b/apps/settings/js/vue-settings-apps-users-management.js.map index 3096d0dc8f0babbfce5f1904618f5c8e2e8cdfaa..dab1f98209b916eac216c8376fcc18f2470ccc12 100644 Binary files a/apps/settings/js/vue-settings-apps-users-management.js.map and b/apps/settings/js/vue-settings-apps-users-management.js.map differ diff --git a/apps/settings/js/vue-settings-personal-security.js b/apps/settings/js/vue-settings-personal-security.js index 5b58cafe5f8c05641167e92dad0d07f9978c1c42..e4cd168a8129526eaa5c74d79654b949c3e89724 100644 Binary files a/apps/settings/js/vue-settings-personal-security.js and b/apps/settings/js/vue-settings-personal-security.js differ diff --git a/apps/settings/js/vue-settings-personal-security.js.map b/apps/settings/js/vue-settings-personal-security.js.map index e4bcfe28114f2ecba665f242b5c0e6ac6ca53fe9..c8eba3585d4f36aa85ca264b8dda220676ab2c3d 100644 Binary files a/apps/settings/js/vue-settings-personal-security.js.map and b/apps/settings/js/vue-settings-personal-security.js.map differ diff --git a/apps/systemtags/js/systemtags.js b/apps/systemtags/js/systemtags.js index 28696b710792468d22e881e6946b77c2d6c21146..8f1f8a88db46420936999978a52a6cd1d7c48010 100644 Binary files a/apps/systemtags/js/systemtags.js and b/apps/systemtags/js/systemtags.js differ diff --git a/apps/systemtags/js/systemtags.js.map b/apps/systemtags/js/systemtags.js.map index 540fed484cab666ac27bca0952709b893858ded6..c1c13dbf82518449a8713196779e65db01e85f30 100644 Binary files a/apps/systemtags/js/systemtags.js.map and b/apps/systemtags/js/systemtags.js.map differ diff --git a/apps/systemtags/src/css/systemtagsfilelist.scss b/apps/systemtags/src/css/systemtagsfilelist.scss index d2d96d0c2c19b1de0c67615e8edd8aec57ee45bb..4068eb2d8c532bfd16972ab221818e0500f9ba59 100644 --- a/apps/systemtags/src/css/systemtagsfilelist.scss +++ b/apps/systemtags/src/css/systemtagsfilelist.scss @@ -12,12 +12,11 @@ margin-left: 10px; } -#app-sidebar .mainFileInfoView .tag-label { +#app-sidebar .app-sidebar-header__action .tag-label { cursor: pointer; - padding: 13px; -} - -#app-sidebar .mainFileInfoView .icon-tag { - opacity: .5; - vertical-align: middle; + padding: 13px 0; + display: flex; + color: var(--color-text-light); + position: relative; + margin-top: -20px; } diff --git a/apps/systemtags/src/filesplugin.js b/apps/systemtags/src/filesplugin.js index 41f95e65c9e17663709bf3bb452863d162966217..cf60d5f864724d205271a112d96805a833e0aedd 100644 --- a/apps/systemtags/src/filesplugin.js +++ b/apps/systemtags/src/filesplugin.js @@ -33,27 +33,7 @@ const systemTagsInfoView = new OCA.SystemTags.SystemTagsInfoView() fileList.registerDetailView(systemTagsInfoView) - - _.each(fileList.getRegisteredDetailViews(), function(detailView) { - if (detailView instanceof OCA.Files.MainFileInfoDetailView) { - const systemTagsInfoViewToggleView - = new OCA.SystemTags.SystemTagsInfoViewToggleView({ - systemTagsInfoView: systemTagsInfoView, - }) - systemTagsInfoViewToggleView.render() - - // The toggle view element is detached before the - // MainFileInfoDetailView is rendered to prevent its event - // handlers from being removed. - systemTagsInfoViewToggleView.listenTo(detailView, 'pre-render', function() { - systemTagsInfoViewToggleView.$el.detach() - }) - systemTagsInfoViewToggleView.listenTo(detailView, 'post-render', function() { - detailView.$el.find('.file-details').append(systemTagsInfoViewToggleView.$el) - }) - - } - }) + OCA.SystemTags.View = systemTagsInfoView }, } diff --git a/apps/systemtags/src/systemtags.js b/apps/systemtags/src/systemtags.js index 80033742a8b256a4fe256a655627a2e5e3ff488a..308c1e7b44a290a3809a1aa84609b076683f28b0 100644 --- a/apps/systemtags/src/systemtags.js +++ b/apps/systemtags/src/systemtags.js @@ -2,7 +2,6 @@ import './app' import './systemtagsfilelist' import './filesplugin' import './systemtagsinfoview' -import './systemtagsinfoviewtoggleview' import './css/systemtagsfilelist.scss' window.OCA.SystemTags = OCA.SystemTags diff --git a/apps/systemtags/src/systemtagsinfoview.js b/apps/systemtags/src/systemtagsinfoview.js index 1da346882b36f8c6a083e7dbc3bff861a324b64c..ed9a517400f5a31ef8cdca4d8d1a7991261124fa 100644 --- a/apps/systemtags/src/systemtagsinfoview.js +++ b/apps/systemtags/src/systemtagsinfoview.js @@ -123,8 +123,9 @@ const appliedTags = collection.map(modelToSelection) self._inputView.setData(appliedTags) - - self.show() + if (appliedTags.length > 0) { + self.show() + } }, }) } @@ -152,6 +153,10 @@ this.$el.addClass('hidden') }, + toggle: function() { + this.$el.toggleClass('hidden') + }, + openDropdown: function() { this.$el.find('.systemTagsInputField').select2('open') }, diff --git a/apps/systemtags/src/systemtagsinfoviewtoggleview.js b/apps/systemtags/src/systemtagsinfoviewtoggleview.js deleted file mode 100644 index d0c35550e5dabe088978312ffa93101a7ba21927..0000000000000000000000000000000000000000 --- a/apps/systemtags/src/systemtagsinfoviewtoggleview.js +++ /dev/null @@ -1,97 +0,0 @@ -/** - * - * @copyright Copyright (c) 2017, Daniel Calviño Sánchez (danxuliu@gmail.com) - * - * @license GNU AGPL version 3 or any later version - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as - * published by the Free Software Foundation, either version 3 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - * - */ - -(function(OCA) { - - /** - * @class OCA.SystemTags.SystemTagsInfoViewToggleView - * @classdesc - * - * View to toggle the visibility of a SystemTagsInfoView. - * - * This toggle view must be explicitly rendered before it is used. - */ - const SystemTagsInfoViewToggleView = OC.Backbone.View.extend( - /** @lends OC.Backbone.View.prototype */ { - - tagName: 'span', - - className: 'tag-label', - - events: { - 'click': 'click', - }, - - /** - * @type OCA.SystemTags.SystemTagsInfoView - */ - _systemTagsInfoView: null, - - template: function(data) { - return '<span class="icon icon-tag"/>' + t('systemtags', 'Tags') - }, - - /** - * Initialize this toggle view. - * - * The options must provide a systemTagsInfoView parameter that - * references the SystemTagsInfoView to associate to this toggle view. - * @param {Object} options options - */ - initialize: function(options) { - options = options || {} - - this._systemTagsInfoView = options.systemTagsInfoView - if (!this._systemTagsInfoView) { - throw new Error('Missing required parameter "systemTagsInfoView"') - } - }, - - /** - * Toggles the visibility of the associated SystemTagsInfoView. - * - * When the systemTagsInfoView is shown its dropdown is also opened. - */ - click: function() { - if (this._systemTagsInfoView.isVisible()) { - this._systemTagsInfoView.hide() - } else { - this._systemTagsInfoView.show() - this._systemTagsInfoView.openDropdown() - } - }, - - /** - * Renders this toggle view. - * - * @returns {OCA.SystemTags.SystemTagsInfoViewToggleView} this object. - */ - render: function() { - this.$el.html(this.template()) - - return this - }, - - }) - - OCA.SystemTags.SystemTagsInfoViewToggleView = SystemTagsInfoViewToggleView - -})(OCA) diff --git a/apps/systemtags/tests/js/systemtagsinfoviewtoggleviewSpec.js b/apps/systemtags/tests/js/systemtagsinfoviewtoggleviewSpec.js deleted file mode 100644 index 5e6c2c820e9bf393264192d7a7a43f1666fb64d8..0000000000000000000000000000000000000000 --- a/apps/systemtags/tests/js/systemtagsinfoviewtoggleviewSpec.js +++ /dev/null @@ -1,93 +0,0 @@ -/** - * - * @copyright Copyright (c) 2017, Daniel Calviño Sánchez (danxuliu@gmail.com) - * - * @license GNU AGPL version 3 or any later version - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as - * published by the Free Software Foundation, either version 3 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - * - */ - -describe('OCA.SystemTags.SystemTagsInfoViewToggleView', function () { - - var systemTagsInfoView; - var view; - - beforeEach(function() { - systemTagsInfoView = new OCA.SystemTags.SystemTagsInfoView(); - view = new OCA.SystemTags.SystemTagsInfoViewToggleView({ systemTagsInfoView: systemTagsInfoView }); - }); - - afterEach(function() { - view.remove(); - systemTagsInfoView.remove(); - }); - - describe('initialize', function() { - it('fails if a "systemTagsInfoView" parameter is not provided', function() { - var constructor = function() { - return new OCA.SystemTags.SystemTagsInfoViewToggleView({}); - } - - expect(constructor).toThrow(); - }); - }); - - describe('click on element', function() { - - var isVisibleStub; - var showStub; - var hideStub; - var openDropdownStub; - - beforeEach(function() { - isVisibleStub = sinon.stub(systemTagsInfoView, 'isVisible'); - showStub = sinon.stub(systemTagsInfoView, 'show'); - hideStub = sinon.stub(systemTagsInfoView, 'hide'); - openDropdownStub = sinon.stub(systemTagsInfoView, 'openDropdown'); - }); - - afterEach(function() { - isVisibleStub.restore(); - showStub.restore(); - hideStub.restore(); - openDropdownStub.restore(); - }); - - it('shows a not visible SystemTagsInfoView', function() { - isVisibleStub.returns(false); - - view.$el.click(); - - expect(isVisibleStub.calledOnce).toBeTruthy(); - expect(showStub.calledOnce).toBeTruthy(); - expect(openDropdownStub.calledOnce).toBeTruthy(); - expect(openDropdownStub.calledAfter(showStub)).toBeTruthy(); - expect(hideStub.notCalled).toBeTruthy(); - }); - - it('hides a visible SystemTagsInfoView', function() { - isVisibleStub.returns(true); - - view.$el.click(); - - expect(isVisibleStub.calledOnce).toBeTruthy(); - expect(hideStub.calledOnce).toBeTruthy(); - expect(showStub.notCalled).toBeTruthy(); - expect(openDropdownStub.notCalled).toBeTruthy(); - }); - - }); - -}); diff --git a/apps/updatenotification/js/updatenotification.js b/apps/updatenotification/js/updatenotification.js index 30b2fdfaa7c8061939582c051469434f9ec36116..e733644cb9311d96b4fbb077c3bcea25a5cc2899 100644 Binary files a/apps/updatenotification/js/updatenotification.js and b/apps/updatenotification/js/updatenotification.js differ diff --git a/apps/updatenotification/js/updatenotification.js.map b/apps/updatenotification/js/updatenotification.js.map index 33e6d377be4bd870bba18c1473ab8cd6349bd6f1..4762bd708daffeeb074f88f8f3d75cd6e15af623 100644 Binary files a/apps/updatenotification/js/updatenotification.js.map and b/apps/updatenotification/js/updatenotification.js.map differ diff --git a/apps/workflowengine/js/workflowengine.js b/apps/workflowengine/js/workflowengine.js index 9da841d5409435db9cd7756a4316853025c9342a..fdb9f6a8fc42e9818c89482d2507fe933c681d84 100644 Binary files a/apps/workflowengine/js/workflowengine.js and b/apps/workflowengine/js/workflowengine.js differ diff --git a/apps/workflowengine/js/workflowengine.js.map b/apps/workflowengine/js/workflowengine.js.map index f1e0c1b03cadc40333a992daf804a1d094ed1124..92e1e3354188b56d8058f7850ba1326cc6469a6d 100644 Binary files a/apps/workflowengine/js/workflowengine.js.map and b/apps/workflowengine/js/workflowengine.js.map differ diff --git a/package-lock.json b/package-lock.json index 08ae4d512fbc9ce03ca84a0ab2b88e91342deead..64dd884ed02ab00c9b28585d614b21339c5aed4e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -7174,9 +7174,9 @@ } }, "nextcloud-vue": { - "version": "0.12.8", - "resolved": "https://registry.npmjs.org/nextcloud-vue/-/nextcloud-vue-0.12.8.tgz", - "integrity": "sha512-4TU5Ji7560cRo14iaRgvVo4+Z6iQCWw6VU26dQaYWD8G3BUoZMQXCrETGyMW5kpP/ODW4cLVVzjlYaVosyqoOA==", + "version": "0.12.11", + "resolved": "https://registry.npmjs.org/nextcloud-vue/-/nextcloud-vue-0.12.11.tgz", + "integrity": "sha512-3zzgSRpWtPMqIi+DpZsh0YxACACHv+j8bWmMYyiUJVB2JjVADYpzb/lbUxQCE/A8rB3N75zIfkQOf0gd9BC9oA==", "requires": { "@babel/polyfill": "^7.4.4", "escape-html": "^1.0.3", diff --git a/package.json b/package.json index fdd470e8d11bb71a4a2ee6e42f330e8f38cd1c2d..d4e5a2c690c82f8b141e0998f55ccc2ca42f843e 100644 --- a/package.json +++ b/package.json @@ -56,7 +56,7 @@ "moment-timezone": "^0.5.27", "nextcloud-password-confirmation": "^0.4.2", "nextcloud-router": "0.0.9", - "nextcloud-vue": "^0.12.8", + "nextcloud-vue": "^0.12.11", "nextcloud-vue-collections": "^0.7.1", "p-limit": "^2.2.2", "p-queue": "^6.2.1",