diff --git a/Gemfile b/Gemfile index dbeda69ef98..d35cbcf73a7 100644 --- a/Gemfile +++ b/Gemfile @@ -74,6 +74,9 @@ gem 'acme-client', '~> 2.0', '>= 2.0.6' # Browser detection gem 'browser', '~> 4.2' +# OS detection for usage ping +gem 'ohai', '~> 16.10' + # GPG gem 'gpgme', '~> 2.0.19' diff --git a/Gemfile.lock b/Gemfile.lock index 5e06975ec87..a70aa8185ed 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -172,6 +172,14 @@ GEM cbor (0.5.9.6) character_set (1.4.0) charlock_holmes (0.7.7) + chef-config (16.10.17) + addressable + chef-utils (= 16.10.17) + fuzzyurl + mixlib-config (>= 2.2.12, < 4.0) + mixlib-shellout (>= 2.0, < 4.0) + tomlrb (~> 1.2) + chef-utils (16.10.17) childprocess (3.0.0) chunky_png (1.3.5) citrus (3.0.2) @@ -348,6 +356,8 @@ GEM ffi-compiler (1.0.1) ffi (>= 1.0.0) rake + ffi-yajl (2.3.4) + libyajl2 (~> 1.2) flipper (0.17.1) flipper-active_record (0.17.1) activerecord (>= 4.2, < 7) @@ -403,6 +413,7 @@ GEM fuubar (2.2.0) rspec-core (~> 3.0) ruby-progressbar (~> 1.4) + fuzzyurl (0.9.0) gemoji (3.0.1) gemojione (3.3.0) json @@ -668,6 +679,7 @@ GEM actionmailer (>= 3.2) letter_opener (~> 1.0) railties (>= 3.2) + libyajl2 (1.2.0) license_finder (6.0.0) bundler rubyzip (>= 1, < 3) @@ -717,6 +729,12 @@ GEM mini_mime (1.0.2) mini_portile2 (2.5.0) minitest (5.11.3) + mixlib-cli (2.1.8) + mixlib-config (3.0.9) + tomlrb + mixlib-log (3.0.9) + mixlib-shellout (3.2.5) + chef-utils ms_rest (0.7.6) concurrent-ruby (~> 1.0) faraday (>= 0.9, < 2.0.0) @@ -741,6 +759,8 @@ GEM connection_pool (~> 2.2) net-ldap (0.16.3) net-ntp (2.1.3) + net-scp (3.0.0) + net-ssh (>= 2.6.5, < 7.0.0) net-ssh (6.0.0) netrc (0.11.0) nio4r (2.5.4) @@ -764,6 +784,19 @@ GEM octokit (4.20.0) faraday (>= 0.9) sawyer (~> 0.8.0, >= 0.5.3) + ohai (16.10.6) + chef-config (>= 12.8, < 17) + chef-utils (>= 16.0, < 17) + ffi (~> 1.9) + ffi-yajl (~> 2.2) + ipaddress + mixlib-cli (>= 1.7.0) + mixlib-config (>= 2.0, < 4.0) + mixlib-log (>= 2.0.1, < 4.0) + mixlib-shellout (>= 2.0, < 4.0) + plist (~> 3.1) + train-core + wmi-lite (~> 1.0) oj (3.10.6) omniauth (1.9.0) hashie (>= 3.4.6, < 3.7.0) @@ -857,6 +890,7 @@ GEM railties (>= 4.0.0) pg (1.2.3) pg_query (1.3.0) + plist (3.6.0) png_quantizator (0.2.1) po_to_json (1.0.1) json (>= 1.6.0) @@ -1196,9 +1230,17 @@ GEM parslet (~> 1.8.0) toml-rb (1.0.0) citrus (~> 3.0, > 3.0) + tomlrb (1.3.0) tpm-key_attestation (0.9.0) bindata (~> 2.4) openssl-signature_algorithm (~> 0.4.0) + train-core (3.4.9) + addressable (~> 2.5) + ffi (!= 1.13.0) + json (>= 1.8, < 3.0) + mixlib-shellout (>= 2.0, < 4.0) + net-scp (>= 1.2, < 4.0) + net-ssh (>= 2.9, < 7.0) truncato (0.7.11) htmlentities (~> 4.3.1) nokogiri (>= 1.7.0, <= 2.0) @@ -1271,6 +1313,7 @@ GEM expression_parser rinku with_env (1.1.0) + wmi-lite (1.0.5) xml-simple (1.1.5) xpath (3.2.0) nokogiri (~> 1.8) @@ -1443,6 +1486,7 @@ DEPENDENCIES nokogiri (~> 1.11.1) oauth2 (~> 1.4) octokit (~> 4.15) + ohai (~> 16.10) oj (~> 3.10.6) omniauth (~> 1.8) omniauth-atlassian-oauth2 (~> 0.2.0) diff --git a/app/assets/javascripts/boards/components/board_list_header.vue b/app/assets/javascripts/boards/components/board_list_header.vue index a933370427c..7a92aed720d 100644 --- a/app/assets/javascripts/boards/components/board_list_header.vue +++ b/app/assets/javascripts/boards/components/board_list_header.vue @@ -10,7 +10,7 @@ import { } from '@gitlab/ui'; import { mapActions, mapState } from 'vuex'; import { isListDraggable } from '~/boards/boards_util'; -import { isScopedLabel } from '~/lib/utils/common_utils'; +import { isScopedLabel, parseBoolean } from '~/lib/utils/common_utils'; import { BV_HIDE_TOOLTIP } from '~/lib/utils/constants'; import { n__, s__, __ } from '~/locale'; import sidebarEventHub from '~/sidebar/event_hub'; @@ -69,7 +69,7 @@ export default { }, }, computed: { - ...mapState(['activeId']), + ...mapState(['activeId', 'isEpicBoard']), isLoggedIn() { return Boolean(this.currentUserId); }, @@ -97,11 +97,14 @@ export default { showListDetails() { return !this.list.collapsed || !this.isSwimlanesHeader; }, - issuesCount() { + itemsCount() { return this.list.issuesCount; }, - issuesTooltipLabel() { - return n__(`%d issue`, `%d issues`, this.issuesCount); + countIcon() { + return 'issues'; + }, + itemsTooltipLabel() { + return n__(`%d issue`, `%d issues`, this.itemsCount); }, chevronTooltip() { return this.list.collapsed ? this.$options.i18n.expand : this.$options.i18n.collapse; @@ -110,7 +113,7 @@ export default { return this.list.collapsed ? 'chevron-down' : 'chevron-right'; }, isNewIssueShown() { - return this.listType === ListType.backlog || this.showListHeaderButton; + return (this.listType === ListType.backlog || this.showListHeaderButton) && !this.isEpicBoard; }, isSettingsShown() { return ( @@ -131,8 +134,14 @@ export default { return !this.disabled && isListDraggable(this.list); }, }, + created() { + const localCollapsed = parseBoolean(localStorage.getItem(`${this.uniqueKey}.collapsed`)); + if ((!this.isLoggedIn || this.isEpicBoard) && localCollapsed) { + this.toggleListCollapsed({ listId: this.list.id, collapsed: true }); + } + }, methods: { - ...mapActions(['updateList', 'setActiveId']), + ...mapActions(['updateList', 'setActiveId', 'toggleListCollapsed']), openSidebarSettings() { if (this.activeId === inactiveId) { sidebarEventHub.$emit('sidebar.closeAll'); @@ -148,10 +157,10 @@ export default { eventHub.$emit(`toggle-issue-form-${this.list.id}`); }, toggleExpanded() { - // eslint-disable-next-line vue/no-mutating-props - this.list.collapsed = !this.list.collapsed; + const collapsed = !this.list.collapsed; + this.toggleListCollapsed({ listId: this.list.id, collapsed }); - if (!this.isLoggedIn) { + if (!this.isLoggedIn || this.isEpicBoard) { this.addToLocalStorage(); } else { this.updateListFunction(); @@ -163,7 +172,7 @@ export default { }, addToLocalStorage() { if (AccessorUtilities.isLocalStorageAccessSafe()) { - localStorage.setItem(`${this.uniqueKey}.expanded`, !this.list.collapsed); + localStorage.setItem(`${this.uniqueKey}.collapsed`, this.list.collapsed); } }, updateListFunction() { @@ -203,6 +212,7 @@ export default { class="board-title-caret no-drag gl-cursor-pointer" category="tertiary" size="small" + data-testid="board-title-caret" @click="toggleExpanded" /> @@ -301,11 +311,11 @@ export default {
- +
-
• {{ issuesTooltipLabel }}
+
• {{ itemsTooltipLabel }}
@@ -323,13 +333,13 @@ export default { }" > - - - - + + + + -