diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-03-12 15:09:39 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-03-12 15:09:39 +0000 |
commit | dc889678d1de8c09310b2f8f9742bb6c78a6f1a4 (patch) | |
tree | 70945aa6721a271fc8057efa13c3216a03fbac45 /app/assets | |
parent | cd52759ee33051b8ad7b88b02ba7954e4fad7018 (diff) | |
download | gitlab-ce-dc889678d1de8c09310b2f8f9742bb6c78a6f1a4.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/assets')
12 files changed, 212 insertions, 42 deletions
diff --git a/app/assets/javascripts/boards/components/board_list.vue b/app/assets/javascripts/boards/components/board_list.vue index 4a64d9e04f2..c4e2c398d45 100644 --- a/app/assets/javascripts/boards/components/board_list.vue +++ b/app/assets/javascripts/boards/components/board_list.vue @@ -1,7 +1,6 @@ <script> import { Sortable, MultiDrag } from 'sortablejs'; import { GlLoadingIcon } from '@gitlab/ui'; -import _ from 'underscore'; import boardNewIssue from './board_new_issue.vue'; import boardCard from './board_card.vue'; import eventHub from '../eventhub'; @@ -266,11 +265,12 @@ export default { * same list or the other list. Don't remove items if it's same list. */ const isSameList = toList && toList.id === this.list.id; - if (toList && !isSameList && boardsStore.shouldRemoveIssue(this.list, toList)) { const issues = items.map(item => this.list.findIssue(Number(item.dataset.issueId))); - - if (_.compact(issues).length && !boardsStore.issuesAreContiguous(this.list, issues)) { + if ( + issues.filter(Boolean).length && + !boardsStore.issuesAreContiguous(this.list, issues) + ) { const indexes = []; const ids = this.list.issues.map(i => i.id); issues.forEach(issue => { diff --git a/app/assets/javascripts/boards/components/boards_selector.vue b/app/assets/javascripts/boards/components/boards_selector.vue index 8b44ccfd276..fbf487357a5 100644 --- a/app/assets/javascripts/boards/components/boards_selector.vue +++ b/app/assets/javascripts/boards/components/boards_selector.vue @@ -1,5 +1,5 @@ <script> -import { throttle } from 'underscore'; +import { throttle } from 'lodash'; import { GlLoadingIcon, GlSearchBoxByType, diff --git a/app/assets/javascripts/boards/components/issue_card_inner.vue b/app/assets/javascripts/boards/components/issue_card_inner.vue index 00da039c235..daaa12c096b 100644 --- a/app/assets/javascripts/boards/components/issue_card_inner.vue +++ b/app/assets/javascripts/boards/components/issue_card_inner.vue @@ -1,5 +1,5 @@ <script> -import _ from 'underscore'; +import { sortBy } from 'lodash'; import { mapState } from 'vuex'; import { GlLabel, GlTooltipDirective } from '@gitlab/ui'; import issueCardInner from 'ee_else_ce/boards/mixins/issue_card_inner'; @@ -100,10 +100,7 @@ export default { return !groupId ? referencePath.split('#')[0] : null; }, orderedLabels() { - return _.chain(this.issue.labels) - .filter(this.isNonListLabel) - .sortBy('title') - .value(); + return sortBy(this.issue.labels.filter(this.isNonListLabel), 'title'); }, helpLink() { return boardsStore.scopedLabels.helpLink; diff --git a/app/assets/javascripts/boards/components/project_select.vue b/app/assets/javascripts/boards/components/project_select.vue index 4a50b1e2efc..30f1e843e7b 100644 --- a/app/assets/javascripts/boards/components/project_select.vue +++ b/app/assets/javascripts/boards/components/project_select.vue @@ -1,6 +1,6 @@ <script> import $ from 'jquery'; -import _ from 'underscore'; +import { escape } from 'lodash'; import { GlLoadingIcon } from '@gitlab/ui'; import Icon from '~/vue_shared/components/icon.vue'; import { __ } from '~/locale'; @@ -83,7 +83,7 @@ export default { }" data-project-name="${project.name}" data-project-name-with-namespace="${ project.name_with_namespace }"> - ${_.escape(project.name_with_namespace)} + ${escape(project.name_with_namespace)} </a> </li> `; diff --git a/app/assets/javascripts/boards/stores/boards_store.js b/app/assets/javascripts/boards/stores/boards_store.js index 528dc4ed68e..e5447080e37 100644 --- a/app/assets/javascripts/boards/stores/boards_store.js +++ b/app/assets/javascripts/boards/stores/boards_store.js @@ -2,7 +2,7 @@ /* global List */ import $ from 'jquery'; -import _ from 'underscore'; +import { sortBy } from 'lodash'; import Vue from 'vue'; import Cookies from 'js-cookie'; import BoardsStoreEE from 'ee_else_ce/boards/stores/boards_store_ee'; @@ -76,8 +76,7 @@ const boardsStore = { }, addList(listObj) { const list = new List(listObj); - this.state.lists = _.sortBy([...this.state.lists, list], 'position'); - + this.state.lists = sortBy([...this.state.lists, list], 'position'); return list; }, new(listObj) { @@ -90,7 +89,7 @@ const boardsStore = { // Remove any new issues from the backlog // as they will be visible in the new list list.issues.forEach(backlogList.removeIssue.bind(backlogList)); - this.state.lists = _.sortBy(this.state.lists, 'position'); + this.state.lists = sortBy(this.state.lists, 'position'); }) .catch(() => { // https://gitlab.com/gitlab-org/gitlab-foss/issues/30821 @@ -194,10 +193,9 @@ const boardsStore = { moveMultipleIssuesToList({ listFrom, listTo, issues, newIndex }) { const issueTo = issues.map(issue => listTo.findIssue(issue.id)); - const issueLists = _.flatten(issues.map(issue => issue.getLists())); + const issueLists = issues.map(issue => issue.getLists()).flat(); const listLabels = issueLists.map(list => list.label); - - const hasMoveableIssues = _.compact(issueTo).length > 0; + const hasMoveableIssues = issueTo.filter(Boolean).length > 0; if (!hasMoveableIssues) { // Check if target list assignee is already present in this issue diff --git a/app/assets/javascripts/clusters/clusters_bundle.js b/app/assets/javascripts/clusters/clusters_bundle.js index d35dca7b939..dc1328a2236 100644 --- a/app/assets/javascripts/clusters/clusters_bundle.js +++ b/app/assets/javascripts/clusters/clusters_bundle.js @@ -315,10 +315,13 @@ export default class Clusters { this.checkForNewInstalls(prevApplicationMap, this.store.state.applications); this.updateContainer(prevStatus, this.store.state.status, this.store.state.statusReason); - this.toggleIngressDomainHelpText( - prevApplicationMap[INGRESS], - this.store.state.applications[INGRESS], - ); + + if (this.ingressDomainHelpText) { + this.toggleIngressDomainHelpText( + prevApplicationMap[INGRESS], + this.store.state.applications[INGRESS], + ); + } } showToken() { diff --git a/app/assets/javascripts/clusters/components/applications.vue b/app/assets/javascripts/clusters/components/applications.vue index 685fc939c9a..9058f1c0141 100644 --- a/app/assets/javascripts/clusters/components/applications.vue +++ b/app/assets/javascripts/clusters/components/applications.vue @@ -263,7 +263,6 @@ Crossplane runs inside your Kubernetes cluster and supports secure connectivity <template> <section id="cluster-applications"> - <h4>{{ s__('ClusterIntegration|Applications') }}</h4> <p class="append-bottom-0"> {{ s__(`ClusterIntegration|Choose which applications to install on your Kubernetes cluster. diff --git a/app/assets/javascripts/ide/lib/themes/white.js b/app/assets/javascripts/ide/lib/themes/white.js index 273bc783fc6..f06458d8a16 100644 --- a/app/assets/javascripts/ide/lib/themes/white.js +++ b/app/assets/javascripts/ide/lib/themes/white.js @@ -1,12 +1,146 @@ +const BOLD = 'bold'; +const ITALIC = 'italic'; +const BOLD_ITALIC = 'bold italic'; +const UNDERLINE = 'underline'; + export default { base: 'vs', - inherit: true, - rules: [], + inherit: false, + rules: [ + // Standard theme defaults and overrides based on VS theme + // https://github.com/Microsoft/vscode/blob/master/src/vs/editor/standalone/common/themes.ts + // License: MIT (https://github.com/microsoft/vscode/blob/master/LICENSE.txt) + { token: '', foreground: '2e2e2e', background: 'ffffff' }, + { token: 'keyword.css', fontStyle: BOLD, foreground: '999999' }, + { token: 'keyword.less', fontStyle: BOLD, foreground: '999999' }, + { token: 'keyword.scss', fontStyle: BOLD, foreground: '999999' }, + { token: 'keyword.md', fontStyle: BOLD, foreground: '800080' }, + + { token: 'variable', foreground: '008080' }, + { token: 'variable.md', foreground: 'dd1144' }, + { token: 'variable.predefined', foreground: '008080' }, + { token: 'number', foreground: '009999' }, + { token: 'number.hex', foreground: '3030c0' }, + + { token: 'type.identifier.ts', foreground: '445588', fontStyle: BOLD }, + { token: 'type.identifier.swift', foreground: '445588', fontStyle: BOLD }, + { token: 'type.identifier.kt', foreground: '445588', fontStyle: BOLD }, + { token: 'type.identifier.perl', foreground: '2e2e2e', fontStyle: BOLD }, + + { token: 'tag', foreground: '000080' }, + { token: 'tag.class', foreground: '445588', fontStyle: BOLD }, + { token: 'tag.css', foreground: '445588', fontStyle: BOLD }, + { token: 'tag.less', foreground: '445588', fontStyle: BOLD }, + { token: 'tag.scss', foreground: '445588', fontStyle: BOLD }, + { token: 'tag.id.jade', foreground: '445588' }, + { token: 'tag.class.jade', foreground: '445588' }, + { token: 'meta.scss', foreground: '800000' }, + { token: 'metatag', foreground: 'e00000' }, + { token: 'metatag.content.html', foreground: 'e00000' }, + { token: 'metatag.html', foreground: '808080' }, + { token: 'metatag.xml', foreground: '808080' }, + { token: 'metatag.php', fontStyle: BOLD }, + + { token: 'key', foreground: '863b00' }, + { token: 'key.ini', foreground: '008080' }, + { token: 'string.key.json', foreground: '2e2e2e' }, + { token: 'string.value.json', foreground: 'dd1144' }, + { token: 'string.link.md', foreground: 'aa0000' }, + + { token: 'attribute.name', foreground: '008080' }, + { token: 'attribute.name.css', foreground: '2e2e2e' }, + { token: 'attribute.name.json', foreground: '2e2e2e' }, + { token: 'attribute.name.scss', foreground: '2e2e2e' }, + { token: 'attribute.name.less', foreground: '2e2e2e' }, + { token: 'attribute.value', foreground: 'dd1144' }, + { token: 'attribute.value.css', foreground: '0086b3' }, + { token: 'attribute.value.hex', foreground: '0086b3' }, + { token: 'attribute.value.number', foreground: '009999' }, + { token: 'attribute.value.unit', foreground: '009999' }, + { token: 'attribute.value.xml', foreground: 'dd1144' }, + { token: 'attribute.value.html', foreground: 'dd1144' }, + { token: 'attribute.value.md', foreground: 'aa0000' }, + + { token: 'string', foreground: 'dd1144' }, + { token: 'string.target', foreground: 'aa0000' }, + { token: 'string.sql', foreground: 'dd1144' }, + + { token: 'keyword.flow', foreground: '2e2e2e', fontStyle: BOLD }, + { token: 'keyword.st', foreground: '445588', fontStyle: BOLD }, + { token: 'variable.st', foreground: '445588', fontStyle: BOLD }, + { token: 'type.st', foreground: '445588', fontStyle: BOLD }, + + { token: 'operator.scss', foreground: '666666' }, + { token: 'operator.sql', foreground: '2e2e2e', fontStyle: BOLD }, + { token: 'operator.swift', foreground: '666666' }, + { token: 'predefined.sql', foreground: '2e2e2e', fontStyle: BOLD }, + + // GitHub theme based on https://github.com/brijeshb42/monaco-themes/blob/master/themes/GitHub.json + // Customized for Web IDE + // License: MIT (https://github.com/brijeshb42/monaco-themes/blob/master/LICENSE) + { token: 'comment', foreground: '999988', fontStyle: ITALIC }, + { token: 'comment.block.preprocessor', foreground: '999999', fontStyle: BOLD }, + { token: 'comment.documentation', foreground: '999999', fontStyle: BOLD_ITALIC }, + { token: 'comment.block.documentation', foreground: '999999', fontStyle: BOLD_ITALIC }, + { token: 'invalid.illegal', foreground: 'aa0000', background: 'e3d2d2' }, + { token: 'keyword', fontStyle: BOLD, foreground: '2e2e2e' }, + { token: 'storage', fontStyle: BOLD }, + { token: 'keyword.operator', fontStyle: BOLD }, + { token: 'constant.language', fontStyle: BOLD }, + { token: 'support.constant', fontStyle: BOLD }, + { token: 'storage.type', foreground: '445588', fontStyle: BOLD }, + { token: 'support.type', foreground: '445588', fontStyle: BOLD }, + { token: 'entity.other.attribute-name', foreground: '008080' }, + { token: 'variable.other', foreground: '0086b3' }, + { token: 'variable.language', foreground: '999999' }, + { token: 'entity.name.type', foreground: '445588', fontStyle: BOLD }, + { token: 'entity.other.inherited-class', foreground: '445588', fontStyle: BOLD }, + { token: 'support.class', foreground: '445588', fontStyle: BOLD }, + { token: 'variable.other.constant', foreground: '008080' }, + { token: 'constant.character.entity', foreground: '800080' }, + { token: 'entity.name.exception', foreground: 'aa0000' }, + { token: 'entity.name.function', foreground: 'aa0000' }, + { token: 'support.function', foreground: 'aa0000' }, + { token: 'keyword.other.name-of-parameter', foreground: 'aa0000' }, + { token: 'entity.name.section', foreground: '666666' }, + { token: 'entity.name.tag', foreground: '000080' }, + { token: 'variable.parameter', foreground: '008080' }, + { token: 'support.variable', foreground: '008080' }, + { token: 'constant.numeric', foreground: '009999' }, + { token: 'constant.other', foreground: '009999' }, + { token: 'constant.character', foreground: 'dd1144' }, + { token: 'string.regexp', foreground: '009926' }, + { token: 'constant.other.symbol', foreground: '990073' }, + { token: 'punctuation', fontStyle: BOLD }, + { token: 'markup.deleted', foreground: '000000', background: 'ffdddd' }, + { token: 'markup.italic', fontStyle: ITALIC }, + { token: 'markup.error', foreground: 'aa0000' }, + { token: 'markup.heading.1', foreground: '999999' }, + { token: 'markup.inserted', foreground: '000000', background: 'ddffdd' }, + { token: 'markup.output', foreground: '808080' }, + { token: 'markup.raw', foreground: '808080' }, + { token: 'markup.prompt', foreground: '666666' }, + { token: 'markup.bold', fontStyle: BOLD }, + { token: 'markup.heading', foreground: '999999' }, + { token: 'markup.traceback', foreground: 'aa0000' }, + { token: 'markup.underline', fontStyle: UNDERLINE }, + { token: 'meta.diff.range', foreground: '999999', background: 'eaf2f5' }, + { token: 'meta.diff.index', foreground: '999999', background: 'eaf2f5' }, + { token: 'meta.separator', foreground: '999999', background: 'eaf2f5' }, + { token: 'meta.diff.header.from-file', foreground: '999999', background: 'ffdddd' }, + { token: 'meta.diff.header.to-file', foreground: '999999', background: 'ddffdd' }, + { token: 'meta.link', foreground: '4183c4' }, + ], colors: { - 'editorLineNumber.foreground': '#CCCCCC', - 'diffEditor.insertedTextBackground': '#A0F5B420', - 'diffEditor.removedTextBackground': '#f9d7dc20', + 'editor.foreground': '#2e2e2e', 'editor.selectionBackground': '#aad6f8', + 'editor.lineHighlightBackground': '#fffeeb', + 'editorCursor.foreground': '#666666', + 'editorWhitespace.foreground': '#bbbbbb', + + 'editorLineNumber.foreground': '#cccccc', + 'diffEditor.insertedTextBackground': '#a0f5b420', + 'diffEditor.removedTextBackground': '#f9d7dc20', 'editorIndentGuide.activeBackground': '#cccccc', }, }; diff --git a/app/assets/javascripts/releases/components/evidence_block.vue b/app/assets/javascripts/releases/components/evidence_block.vue index edbea33f1d1..0c51fffc96c 100644 --- a/app/assets/javascripts/releases/components/evidence_block.vue +++ b/app/assets/javascripts/releases/components/evidence_block.vue @@ -67,7 +67,7 @@ export default { </template> </expand-button> <clipboard-button - :title="__('Copy commit SHA')" + :title="__('Copy evidence SHA')" :text="sha" css-class="btn-default btn-transparent btn-clipboard" /> diff --git a/app/assets/javascripts/releases/components/release_block.vue b/app/assets/javascripts/releases/components/release_block.vue index f2cc36e38bb..61cd22dc161 100644 --- a/app/assets/javascripts/releases/components/release_block.vue +++ b/app/assets/javascripts/releases/components/release_block.vue @@ -93,7 +93,10 @@ export default { <release-block-header :release="release" /> <div class="card-body"> <div v-if="shouldRenderMilestoneInfo"> - <release-block-milestone-info :milestones="milestones" /> + <release-block-milestone-info + :milestones="milestones" + :open-issues-path="release._links.issuesUrl" + /> <hr class="mb-3 mt-0" /> </div> diff --git a/app/assets/javascripts/releases/components/release_block_assets.vue b/app/assets/javascripts/releases/components/release_block_assets.vue index 06b7f97a8de..f4b92416e47 100644 --- a/app/assets/javascripts/releases/components/release_block_assets.vue +++ b/app/assets/javascripts/releases/components/release_block_assets.vue @@ -34,7 +34,7 @@ export default { <ul v-if="assets.links.length" class="pl-0 mb-0 prepend-top-8 list-unstyled js-assets-list"> <li v-for="link in assets.links" :key="link.name" class="append-bottom-8"> - <gl-link v-gl-tooltip.bottom :title="__('Download asset')" :href="link.url"> + <gl-link v-gl-tooltip.bottom :title="__('Download asset')" :href="link.directAssetUrl"> <icon name="package" class="align-middle append-right-4 align-text-bottom" /> {{ link.name }} <span v-if="link.external">{{ __('(external source)') }}</span> diff --git a/app/assets/javascripts/releases/components/release_block_milestone_info.vue b/app/assets/javascripts/releases/components/release_block_milestone_info.vue index 50accf6b679..d9fbd2884b7 100644 --- a/app/assets/javascripts/releases/components/release_block_milestone_info.vue +++ b/app/assets/javascripts/releases/components/release_block_milestone_info.vue @@ -1,10 +1,15 @@ <script> -import { GlProgressBar, GlLink, GlBadge, GlButton, GlTooltipDirective } from '@gitlab/ui'; +import { + GlProgressBar, + GlLink, + GlBadge, + GlButton, + GlTooltipDirective, + GlSprintf, +} from '@gitlab/ui'; import { __, n__, sprintf } from '~/locale'; import { MAX_MILESTONES_TO_DISPLAY } from '../constants'; - -/** Sums the values of an array. For use with Array.reduce. */ -const sumReducer = (acc, curr) => acc + curr; +import { sum } from 'lodash'; export default { name: 'ReleaseBlockMilestoneInfo', @@ -13,6 +18,7 @@ export default { GlLink, GlBadge, GlButton, + GlSprintf, }, directives: { GlTooltip: GlTooltipDirective, @@ -22,6 +28,16 @@ export default { type: Array, required: true, }, + openIssuesPath: { + type: String, + required: false, + default: '', + }, + closedIssuesPath: { + type: String, + required: false, + default: '', + }, }, data() { return { @@ -42,14 +58,14 @@ export default { allIssueStats() { return this.milestones.map(m => m.issueStats || {}); }, - openIssuesCount() { - return this.allIssueStats.map(stats => stats.opened || 0).reduce(sumReducer); + totalIssuesCount() { + return sum(this.allIssueStats.map(stats => stats.total || 0)); }, closedIssuesCount() { - return this.allIssueStats.map(stats => stats.closed || 0).reduce(sumReducer); + return sum(this.allIssueStats.map(stats => stats.closed || 0)); }, - totalIssuesCount() { - return this.openIssuesCount + this.closedIssuesCount; + openIssuesCount() { + return this.totalIssuesCount - this.closedIssuesCount; }, milestoneLabelText() { return n__('Milestone', 'Milestones', this.milestones.length); @@ -130,7 +146,27 @@ export default { {{ __('Issues') }} <gl-badge pill variant="light" class="font-weight-bold">{{ totalIssuesCount }}</gl-badge> </span> - {{ issueCountsText }} + <div class="d-flex"> + <gl-link v-if="openIssuesPath" ref="openIssuesLink" :href="openIssuesPath"> + <gl-sprintf :message="__('Open: %{openIssuesCount}')"> + <template #openIssuesCount>{{ openIssuesCount }}</template> + </gl-sprintf> + </gl-link> + <span v-else ref="openIssuesText"> + {{ sprintf(__('Open: %{openIssuesCount}'), { openIssuesCount }) }} + </span> + + <span class="mx-1">•</span> + + <gl-link v-if="closedIssuesPath" ref="closedIssuesLink" :href="closedIssuesPath"> + <gl-sprintf :message="__('Closed: %{closedIssuesCount}')"> + <template #closedIssuesCount>{{ closedIssuesCount }}</template> + </gl-sprintf> + </gl-link> + <span v-else ref="closedIssuesText"> + {{ sprintf(__('Closed: %{closedIssuesCount}'), { closedIssuesCount }) }} + </span> + </div> </div> </div> </template> |