diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-10-27 21:08:45 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-10-27 21:08:45 +0000 |
commit | d440531cf8d33834541da20aa2427c726d39e5ef (patch) | |
tree | fbb1f5a8f61d6afdb9b102fb241110d42f4feeb2 /app | |
parent | f3b9e205bb8dc4f0e8ebff79cf364fede886014b (diff) | |
download | gitlab-ce-d440531cf8d33834541da20aa2427c726d39e5ef.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app')
-rw-r--r-- | app/assets/javascripts/clusters_list/components/clusters.vue | 4 | ||||
-rw-r--r-- | app/assets/javascripts/diffs/components/diff_file.vue | 23 | ||||
-rw-r--r-- | app/assets/javascripts/diffs/i18n.js | 13 | ||||
-rw-r--r-- | app/workers/container_expiration_policy_worker.rb | 16 |
4 files changed, 36 insertions, 20 deletions
diff --git a/app/assets/javascripts/clusters_list/components/clusters.vue b/app/assets/javascripts/clusters_list/components/clusters.vue index 3e06e8264d3..08fd7db40a1 100644 --- a/app/assets/javascripts/clusters_list/components/clusters.vue +++ b/app/assets/javascripts/clusters_list/components/clusters.vue @@ -1,7 +1,7 @@ <script> import { mapState, mapActions } from 'vuex'; import { - GlDeprecatedBadge as GlBadge, + GlBadge, GlLink, GlLoadingIcon, GlPagination, @@ -294,7 +294,7 @@ export default { </template> <template #cell(cluster_type)="{value}"> - <gl-badge variant="light"> + <gl-badge variant="muted"> {{ value }} </gl-badge> </template> diff --git a/app/assets/javascripts/diffs/components/diff_file.vue b/app/assets/javascripts/diffs/components/diff_file.vue index 0d5181d5720..564d64c38c4 100644 --- a/app/assets/javascripts/diffs/components/diff_file.vue +++ b/app/assets/javascripts/diffs/components/diff_file.vue @@ -3,7 +3,7 @@ import { mapActions, mapGetters, mapState } from 'vuex'; import { escape } from 'lodash'; import { GlLoadingIcon, GlSafeHtmlDirective as SafeHtml } from '@gitlab/ui'; import glFeatureFlagsMixin from '~/vue_shared/mixins/gl_feature_flags_mixin'; -import { __, sprintf } from '~/locale'; +import { sprintf } from '~/locale'; import { deprecatedCreateFlash as createFlash } from '~/flash'; import { hasDiff } from '~/helpers/diffs_helper'; import eventHub from '../../notes/event_hub'; @@ -12,6 +12,7 @@ import DiffContent from './diff_content.vue'; import { diffViewerErrors } from '~/ide/constants'; import { collapsedType, isCollapsed } from '../diff_file'; import { DIFF_FILE_AUTOMATIC_COLLAPSE, DIFF_FILE_MANUAL_COLLAPSE } from '../constants'; +import { DIFF_FILE, GENERIC_ERROR } from '../i18n'; export default { components: { @@ -49,13 +50,17 @@ export default { isCollapsed: isCollapsed(this.file), }; }, + i18n: { + ...DIFF_FILE, + genericError: GENERIC_ERROR, + }, computed: { ...mapState('diffs', ['currentDiffFileId']), ...mapGetters(['isNotesFetched']), ...mapGetters('diffs', ['getDiffFileDiscussions']), viewBlobLink() { return sprintf( - __('You can %{linkStart}view the blob%{linkEnd} instead.'), + this.$options.i18n.blobView, { linkStart: `<a href="${escape(this.file.view_path)}">`, linkEnd: '</a>', @@ -77,9 +82,7 @@ export default { }, forkMessage() { return sprintf( - __( - "You're not allowed to %{tag_start}edit%{tag_end} files in this project directly. Please fork this project, make your changes there, and submit a merge request.", - ), + this.$options.i18n.editInFork, { tag_start: '<span class="js-file-fork-suggestion-section-action">', tag_end: '</span>', @@ -187,7 +190,7 @@ export default { }) .catch(() => { this.isLoadingCollapsedDiff = false; - createFlash(__('Something went wrong on our end. Please try again!')); + createFlash(this.$options.i18n.genericError); }); }, showForkMessage() { @@ -229,14 +232,14 @@ export default { <a :href="file.fork_path" class="js-fork-suggestion-button btn btn-grouped btn-inverted btn-success" - >{{ __('Fork') }}</a + >{{ $options.i18n.fork }}</a > <button class="js-cancel-fork-suggestion-button btn btn-grouped" type="button" @click="hideForkMessage" > - {{ __('Cancel') }} + {{ $options.i18n.cancel }} </button> </div> <template v-else> @@ -255,14 +258,14 @@ export default { </div> <template v-else> <div v-show="showWarning" class="nothing-here-block diff-collapsed"> - {{ __('This diff is collapsed.') }} + {{ $options.i18n.collapsed }} <a class="click-to-expand" data-testid="toggle-link" href="#" @click.prevent="handleToggle" > - {{ __('Click to expand it.') }} + {{ $options.i18n.expand }} </a> </div> <diff-content diff --git a/app/assets/javascripts/diffs/i18n.js b/app/assets/javascripts/diffs/i18n.js index 8699cd88a18..361f8e1a6da 100644 --- a/app/assets/javascripts/diffs/i18n.js +++ b/app/assets/javascripts/diffs/i18n.js @@ -1,5 +1,18 @@ import { __ } from '~/locale'; +export const GENERIC_ERROR = __('Something went wrong on our end. Please try again!'); + export const DIFF_FILE_HEADER = { optionsDropdownTitle: __('Options'), }; + +export const DIFF_FILE = { + blobView: __('You can %{linkStart}view the blob%{linkEnd} instead.'), + editInFork: __( + "You're not allowed to %{tag_start}edit%{tag_end} files in this project directly. Please fork this project, make your changes there, and submit a merge request.", + ), + fork: __('Fork'), + cancel: __('Cancel'), + collapsed: __('This diff is collapsed.'), + expand: __('Click to expand it.'), +}; diff --git a/app/workers/container_expiration_policy_worker.rb b/app/workers/container_expiration_policy_worker.rb index c22cea98e0d..43dbea027f2 100644 --- a/app/workers/container_expiration_policy_worker.rb +++ b/app/workers/container_expiration_policy_worker.rb @@ -30,11 +30,13 @@ class ContainerExpirationPolicyWorker # rubocop:disable Scalability/IdempotentWo def perform_throttled try_obtain_lease do with_runnable_policy do |policy| - policy.schedule_next_run! - ContainerRepository.for_project_id(policy.id) - .each_batch do |relation| - relation.update_all(expiration_policy_cleanup_status: :cleanup_scheduled) - end + ContainerExpirationPolicy.transaction do + policy.schedule_next_run! + ContainerRepository.for_project_id(policy.id) + .each_batch do |relation| + relation.update_all(expiration_policy_cleanup_status: :cleanup_scheduled) + end + end end ContainerExpirationPolicies::CleanupContainerRepositoryWorker.perform_with_capacity @@ -53,9 +55,7 @@ class ContainerExpirationPolicyWorker # rubocop:disable Scalability/IdempotentWo scope.each do |policy| if policy.valid? - ContainerExpirationPolicy.transaction do - yield policy - end + yield policy else disable_invalid_policy!(policy) end |