diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-03-11 09:09:48 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-03-11 09:09:48 +0000 |
commit | 3f3e4bcc50a3280d03299c2c263eafd9c8e3bd7b (patch) | |
tree | eccfc6b87b404f2871cc795bf2f7223a7e391939 /app/assets | |
parent | 65a1175e466105fca1f40cb5a995fdb100ff334e (diff) | |
download | gitlab-ce-3f3e4bcc50a3280d03299c2c263eafd9c8e3bd7b.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/assets')
14 files changed, 80 insertions, 75 deletions
diff --git a/app/assets/javascripts/clusters_list/components/clusters.vue b/app/assets/javascripts/clusters_list/components/clusters.vue index a1b581dc627..f9f23fd556f 100644 --- a/app/assets/javascripts/clusters_list/components/clusters.vue +++ b/app/assets/javascripts/clusters_list/components/clusters.vue @@ -28,6 +28,10 @@ export default { label: __('Size'), }, { + key: 'memory', + label: __('Total memory (GB)'), + }, + { key: 'clusterType', label: __('Cluster level'), formatter: value => CLUSTER_TYPES[value], diff --git a/app/assets/javascripts/error_tracking/components/error_tracking_list.vue b/app/assets/javascripts/error_tracking/components/error_tracking_list.vue index 80a88489545..0e160e8d568 100644 --- a/app/assets/javascripts/error_tracking/components/error_tracking_list.vue +++ b/app/assets/javascripts/error_tracking/components/error_tracking_list.vue @@ -20,7 +20,7 @@ import TimeAgo from '~/vue_shared/components/time_ago_tooltip.vue'; import { __ } from '~/locale'; import { isEmpty } from 'lodash'; -export const tableDataClass = 'table-col d-flex d-sm-table-cell align-items-center'; +export const tableDataClass = 'table-col d-flex d-md-table-cell align-items-center'; export default { FIRST_PAGE: 1, @@ -35,7 +35,7 @@ export default { key: 'error', label: __('Error'), thClass: 'w-60p', - tdClass: `${tableDataClass} px-3`, + tdClass: `${tableDataClass} px-3 rounded-top`, }, { key: 'events', @@ -58,11 +58,11 @@ export default { { key: 'status', label: '', - tdClass: `${tableDataClass} text-center`, + tdClass: `table-col d-none d-md-table-cell align-items-center pl-md-0`, }, { key: 'details', - tdClass: 'table-col d-sm-none d-flex align-items-center', + tdClass: 'table-col d-md-none d-flex align-items-center rounded-bottom bg-secondary', thClass: 'invisible w-0', }, ], @@ -221,7 +221,7 @@ export default { <div class="error-list"> <div v-if="errorTrackingEnabled"> <div class="row flex-column flex-sm-row align-items-sm-center row-top m-0 mt-sm-2 p-0 p-sm-3"> - <div class="search-box flex-fill mr-sm-2 my-3 m-sm-0 p-3 p-sm-0"> + <div class="search-box flex-fill mr-sm-2 my-3 m-sm-0 p-3 p-sm-0 bg-secondary"> <div class="filtered-search-box mb-0"> <gl-dropdown :text="__('Recent searches')" @@ -321,25 +321,25 @@ export default { </div> <template v-else> - <h4 class="d-block d-sm-none my-3">{{ __('Open errors') }}</h4> + <h4 class="d-block d-md-none my-3">{{ __('Open errors') }}</h4> <gl-table - class="mt-3" + class="error-list-table mt-3" :items="errors" :fields="$options.fields" :show-empty="true" fixed - stacked="sm" + stacked="md" tbody-tr-class="table-row mb-4" > <template #head(error)> - <div class="d-none d-sm-block">{{ __('Open errors') }}</div> + <div class="d-none d-md-block">{{ __('Open errors') }}</div> </template> <template #head(events)="data"> - <div class="text-sm-right">{{ data.label }}</div> + <div class="text-md-right">{{ data.label }}</div> </template> <template #head(users)="data"> - <div class="text-sm-right">{{ data.label }}</div> + <div class="text-md-right">{{ data.label }}</div> </template> <template #cell(error)="errors"> @@ -361,7 +361,7 @@ export default { </template> <template #cell(lastSeen)="errors"> - <div class="text-md-left text-right"> + <div class="text-lg-left text-right"> <time-ago :time="errors.item.lastSeen" class="text-secondary" /> </div> </template> @@ -381,9 +381,28 @@ export default { </template> <template #cell(details)="errors"> <gl-button + category="primary" + variant="info" + block + class="mb-1 mt-2" + @click="updateIssueStatus(errors.item.id, 'resolved')" + > + {{ __('Resolve') }} + </gl-button> + <gl-button + category="secondary" + variant="default" + block + class="mb-2" + @click="updateIssueStatus(errors.item.id, 'ignored')" + > + {{ __('Ignore') }} + </gl-button> + <gl-button :href="getDetailsLink(errors.item.id)" - variant="outline-info" - class="d-block" + category="secondary" + variant="info" + class="d-block mb-2" > {{ __('More details') }} </gl-button> diff --git a/app/assets/javascripts/lib/utils/datetime_utility.js b/app/assets/javascripts/lib/utils/datetime_utility.js index a70bab013c6..f6077673ad5 100644 --- a/app/assets/javascripts/lib/utils/datetime_utility.js +++ b/app/assets/javascripts/lib/utils/datetime_utility.js @@ -566,6 +566,14 @@ export const getDateInPast = (date, daysInPast) => export const getDateInFuture = (date, daysInFuture) => new Date(newDate(date).setDate(date.getDate() + daysInFuture)); +/** + * Checks if a given date-instance was created with a valid date + * + * @param {Date} date + * @returns boolean + */ +export const isValidDate = date => date instanceof Date && !Number.isNaN(date.getTime()); + /* * Appending T00:00:00 makes JS assume local time and prevents it from shifting the date * to match the user's time zone. We want to display the date in server time for now, to diff --git a/app/assets/javascripts/pages/projects/settings/operations/show/index.js b/app/assets/javascripts/pages/projects/settings/operations/show/index.js index a32c188909c..721d4a31fe4 100644 --- a/app/assets/javascripts/pages/projects/settings/operations/show/index.js +++ b/app/assets/javascripts/pages/projects/settings/operations/show/index.js @@ -7,5 +7,7 @@ document.addEventListener('DOMContentLoaded', () => { mountErrorTrackingForm(); mountOperationSettings(); mountGrafanaIntegration(); - initSettingsPanels(); + if (!IS_EE) { + initSettingsPanels(); + } }); diff --git a/app/assets/javascripts/vue_merge_request_widget/components/mr_widget_header.vue b/app/assets/javascripts/vue_merge_request_widget/components/mr_widget_header.vue index 7c71463c949..b85be8b9652 100644 --- a/app/assets/javascripts/vue_merge_request_widget/components/mr_widget_header.vue +++ b/app/assets/javascripts/vue_merge_request_widget/components/mr_widget_header.vue @@ -1,5 +1,5 @@ <script> -import _ from 'underscore'; +import { escape as esc } from 'lodash'; import { n__, s__, sprintf } from '~/locale'; import { mergeUrlParams, webIDEUrl } from '~/lib/utils/url_utility'; import Icon from '~/vue_shared/components/icon.vue'; @@ -35,7 +35,7 @@ export default { 'mrWidget|The source branch is %{commitsBehindLinkStart}%{commitsBehind}%{commitsBehindLinkEnd} the target branch', ), { - commitsBehindLinkStart: `<a href="${_.escape(this.mr.targetBranchPath)}">`, + commitsBehindLinkStart: `<a href="${esc(this.mr.targetBranchPath)}">`, commitsBehind: n__('%d commit behind', '%d commits behind', this.mr.divergedCommitsCount), commitsBehindLinkEnd: '</a>', }, diff --git a/app/assets/javascripts/vue_merge_request_widget/components/mr_widget_pipeline_container.vue b/app/assets/javascripts/vue_merge_request_widget/components/mr_widget_pipeline_container.vue index 90fb254ecca..d81e99d3c09 100644 --- a/app/assets/javascripts/vue_merge_request_widget/components/mr_widget_pipeline_container.vue +++ b/app/assets/javascripts/vue_merge_request_widget/components/mr_widget_pipeline_container.vue @@ -1,5 +1,5 @@ <script> -import _ from 'underscore'; +import { isNumber } from 'lodash'; import ArtifactsApp from './artifacts_list_app.vue'; import Deployment from './deployment/deployment.vue'; import MrWidgetContainer from './mr_widget_container.vue'; @@ -67,7 +67,7 @@ export default { return this.mr.visualReviewAppAvailable && this.glFeatures.anonymousVisualReviewFeedback; }, showMergeTrainPositionIndicator() { - return _.isNumber(this.mr.mergeTrainIndex); + return isNumber(this.mr.mergeTrainIndex); }, }, }; diff --git a/app/assets/javascripts/vue_merge_request_widget/components/states/commits_header.vue b/app/assets/javascripts/vue_merge_request_widget/components/states/commits_header.vue index 01524f4b650..266c07ead25 100644 --- a/app/assets/javascripts/vue_merge_request_widget/components/states/commits_header.vue +++ b/app/assets/javascripts/vue_merge_request_widget/components/states/commits_header.vue @@ -1,6 +1,6 @@ <script> import { GlButton } from '@gitlab/ui'; -import _ from 'underscore'; +import { escape as esc } from 'lodash'; import { __, n__, sprintf, s__ } from '~/locale'; import Icon from '~/vue_shared/components/icon.vue'; @@ -60,7 +60,7 @@ export default { { commitCount: `<strong class="commits-count-message">${this.commitsCountMessage}</strong>`, mergeCommitCount: `<strong>${s__('mrWidgetCommitsAdded|1 merge commit')}</strong>`, - targetBranch: `<span class="label-branch">${_.escape(this.targetBranch)}</span>`, + targetBranch: `<span class="label-branch">${esc(this.targetBranch)}</span>`, }, false, ); diff --git a/app/assets/javascripts/vue_merge_request_widget/components/states/mr_widget_auto_merge_enabled.vue b/app/assets/javascripts/vue_merge_request_widget/components/states/mr_widget_auto_merge_enabled.vue index ad80a51c5f9..a368e29d086 100644 --- a/app/assets/javascripts/vue_merge_request_widget/components/states/mr_widget_auto_merge_enabled.vue +++ b/app/assets/javascripts/vue_merge_request_widget/components/states/mr_widget_auto_merge_enabled.vue @@ -1,5 +1,4 @@ <script> -import _ from 'underscore'; import autoMergeMixin from 'ee_else_ce/vue_merge_request_widget/mixins/auto_merge'; import Flash from '../../../flash'; import statusIcon from '../mr_widget_status_icon.vue'; @@ -72,7 +71,7 @@ export default { .merge(options) .then(res => res.data) .then(data => { - if (_.includes(AUTO_MERGE_STRATEGIES, data.status)) { + if (AUTO_MERGE_STRATEGIES.includes(data.status)) { eventHub.$emit('MRWidgetUpdateRequested'); } }) diff --git a/app/assets/javascripts/vue_merge_request_widget/components/states/mr_widget_conflicts.vue b/app/assets/javascripts/vue_merge_request_widget/components/states/mr_widget_conflicts.vue index 3df4a777aca..139cbe17e35 100644 --- a/app/assets/javascripts/vue_merge_request_widget/components/states/mr_widget_conflicts.vue +++ b/app/assets/javascripts/vue_merge_request_widget/components/states/mr_widget_conflicts.vue @@ -1,6 +1,6 @@ <script> import $ from 'jquery'; -import _ from 'underscore'; +import { escape as esc } from 'lodash'; import { s__, sprintf } from '~/locale'; import { mouseenter, debouncedMouseleave, togglePopover } from '~/shared/popover'; import StatusIcon from '../mr_widget_status_icon.vue'; @@ -50,7 +50,7 @@ export default { content: sprintf( s__('mrWidget|%{link_start}Learn more about resolving conflicts%{link_end}'), { - link_start: `<a href="${_.escape( + link_start: `<a href="${esc( this.mr.conflictsDocsPath, )}" target="_blank" rel="noopener noreferrer">`, link_end: '</a>', diff --git a/app/assets/javascripts/vue_merge_request_widget/components/states/ready_to_merge.vue b/app/assets/javascripts/vue_merge_request_widget/components/states/ready_to_merge.vue index 5eccc0c543d..e34060c3393 100644 --- a/app/assets/javascripts/vue_merge_request_widget/components/states/ready_to_merge.vue +++ b/app/assets/javascripts/vue_merge_request_widget/components/states/ready_to_merge.vue @@ -1,5 +1,5 @@ <script> -import _ from 'underscore'; +import { isEmpty } from 'lodash'; import { GlIcon, GlButton } from '@gitlab/ui'; import successSvg from 'icons/_icon_status_success.svg'; import warningSvg from 'icons/_icon_status_warning.svg'; @@ -51,7 +51,7 @@ export default { }, computed: { isAutoMergeAvailable() { - return !_.isEmpty(this.mr.availableAutoMergeStrategies); + return !isEmpty(this.mr.availableAutoMergeStrategies); }, status() { const { pipeline, isPipelineFailed, hasCI, ciStatus } = this.mr; @@ -158,7 +158,7 @@ export default { .then(data => { const hasError = data.status === 'failed' || data.status === 'hook_validation_error'; - if (_.includes(AUTO_MERGE_STRATEGIES, data.status)) { + if (AUTO_MERGE_STRATEGIES.includes(data.status)) { eventHub.$emit('MRWidgetUpdateRequested'); } else if (data.status === 'success') { this.initiateMergePolling(); diff --git a/app/assets/javascripts/vue_merge_request_widget/mr_widget_options.vue b/app/assets/javascripts/vue_merge_request_widget/mr_widget_options.vue index df86725c025..8b12e8ffb73 100644 --- a/app/assets/javascripts/vue_merge_request_widget/mr_widget_options.vue +++ b/app/assets/javascripts/vue_merge_request_widget/mr_widget_options.vue @@ -1,5 +1,5 @@ <script> -import _ from 'underscore'; +import { isEmpty } from 'lodash'; import MRWidgetStore from 'ee_else_ce/vue_merge_request_widget/stores/mr_widget_store'; import MRWidgetService from 'ee_else_ce/vue_merge_request_widget/services/mr_widget_service'; import stateMaps from 'ee_else_ce/vue_merge_request_widget/stores/state_maps'; @@ -118,7 +118,7 @@ export default { return this.mr.allowCollaboration && this.mr.isOpen; }, shouldRenderMergedPipeline() { - return this.mr.state === 'merged' && !_.isEmpty(this.mr.mergePipeline); + return this.mr.state === 'merged' && !isEmpty(this.mr.mergePipeline); }, showMergePipelineForkWarning() { return Boolean( diff --git a/app/assets/javascripts/vue_merge_request_widget/stores/mr_widget_store.js b/app/assets/javascripts/vue_merge_request_widget/stores/mr_widget_store.js index 2aecd0938e4..321b9270dde 100644 --- a/app/assets/javascripts/vue_merge_request_widget/stores/mr_widget_store.js +++ b/app/assets/javascripts/vue_merge_request_widget/stores/mr_widget_store.js @@ -1,5 +1,4 @@ import { format } from 'timeago.js'; -import _ from 'underscore'; import getStateKey from 'ee_else_ce/vue_merge_request_widget/stores/get_state_key'; import { stateKey } from './state_maps'; import { formatDate } from '../../lib/utils/datetime_utility'; @@ -228,11 +227,13 @@ export default class MergeRequestStore { } static getPreferredAutoMergeStrategy(availableAutoMergeStrategies) { - if (_.includes(availableAutoMergeStrategies, MTWPS_MERGE_STRATEGY)) { + if (availableAutoMergeStrategies === undefined) return undefined; + + if (availableAutoMergeStrategies.includes(MTWPS_MERGE_STRATEGY)) { return MTWPS_MERGE_STRATEGY; - } else if (_.includes(availableAutoMergeStrategies, MT_MERGE_STRATEGY)) { + } else if (availableAutoMergeStrategies.includes(MT_MERGE_STRATEGY)) { return MT_MERGE_STRATEGY; - } else if (_.includes(availableAutoMergeStrategies, MWPS_MERGE_STRATEGY)) { + } else if (availableAutoMergeStrategies.includes(MWPS_MERGE_STRATEGY)) { return MWPS_MERGE_STRATEGY; } diff --git a/app/assets/stylesheets/pages/error_list.scss b/app/assets/stylesheets/pages/error_list.scss index f97953ce824..88fdcc47492 100644 --- a/app/assets/stylesheets/pages/error_list.scss +++ b/app/assets/stylesheets/pages/error_list.scss @@ -20,47 +20,19 @@ $gray-border: 1px solid $border-color; } } - @include media-breakpoint-down(xs) { - .table-row { - border: $gray-border; - border-radius: 4px; - } - - .search-box { - border-top: $gray-border; - border-bottom: $gray-border; - background-color: $gray-50; - } - - .table-col { - min-height: 68px; - - &::before { - text-align: left !important; - } - - &:first-child { - div { - padding: 0 !important; - align-items: flex-end; - } - } - - &:last-child { - height: 64px; - background-color: $gray-normal; - - &::before { - content: none !important; - } - - div { - width: 100% !important; - padding: 0 !important; + @include media-breakpoint-down(md) { + .error-list-table { + .table-col { + min-height: 68px; + + &:last-child { + &::before { + content: none !important; + } - a { - color: $blue-500; - border-color: $blue-500; + div { + width: 100% !important; + padding: 0 !important; } } } diff --git a/app/assets/stylesheets/pages/groups.scss b/app/assets/stylesheets/pages/groups.scss index 3085f5e89b5..305956e1baf 100644 --- a/app/assets/stylesheets/pages/groups.scss +++ b/app/assets/stylesheets/pages/groups.scss @@ -420,7 +420,7 @@ table.pipeline-project-metrics tr td { p { @include str-truncated; - max-width: none; + max-width: 100%; } } |