diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-02-17 18:09:00 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-02-17 18:09:00 +0000 |
commit | eb1f5a3e087b7d6a3e85f2724b5a475cc9d9d37d (patch) | |
tree | d572a6d931152ae0dd10427237f5811893438552 /app/assets | |
parent | b304a72312465ed4c0a568ee6a6ea5e97f705c9b (diff) | |
download | gitlab-ce-eb1f5a3e087b7d6a3e85f2724b5a475cc9d9d37d.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/assets')
6 files changed, 51 insertions, 49 deletions
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 a90f446159d..70f257180c6 100644 --- a/app/assets/javascripts/error_tracking/components/error_tracking_list.vue +++ b/app/assets/javascripts/error_tracking/components/error_tracking_list.vue @@ -19,7 +19,7 @@ import AccessorUtils from '~/lib/utils/accessor'; import Icon from '~/vue_shared/components/icon.vue'; import TimeAgo from '~/vue_shared/components/time_ago_tooltip.vue'; import { __ } from '~/locale'; -import _ from 'underscore'; +import { isEmpty } from 'lodash'; export const tableDataClass = 'table-col d-flex d-sm-table-cell align-items-center'; @@ -139,7 +139,7 @@ export default { 'cursor', ]), paginationRequired() { - return !_.isEmpty(this.pagination); + return !isEmpty(this.pagination); }, }, watch: { diff --git a/app/assets/javascripts/error_tracking/components/stacktrace_entry.vue b/app/assets/javascripts/error_tracking/components/stacktrace_entry.vue index 4e63e167260..8db0b1c5da0 100644 --- a/app/assets/javascripts/error_tracking/components/stacktrace_entry.vue +++ b/app/assets/javascripts/error_tracking/components/stacktrace_entry.vue @@ -1,5 +1,5 @@ <script> -import _ from 'underscore'; +import { escape as esc } from 'lodash'; import { GlTooltip } from '@gitlab/ui'; import { __, sprintf } from '~/locale'; import ClipboardButton from '~/vue_shared/components/clipboard_button.vue'; @@ -62,7 +62,7 @@ export default { ? sprintf( __(`%{spanStart}in%{spanEnd} %{errorFn}`), { - errorFn: `<strong>${_.escape(this.errorFn)}</strong>`, + errorFn: `<strong>${esc(this.errorFn)}</strong>`, spanStart: `<span class="text-tertiary">`, spanEnd: `</span>`, }, diff --git a/app/assets/javascripts/mirrors/mirror_repos.js b/app/assets/javascripts/mirrors/mirror_repos.js index 33e9b1c4e46..e5acaaf9366 100644 --- a/app/assets/javascripts/mirrors/mirror_repos.js +++ b/app/assets/javascripts/mirrors/mirror_repos.js @@ -1,5 +1,5 @@ import $ from 'jquery'; -import _ from 'underscore'; +import { debounce } from 'lodash'; import { __ } from '~/locale'; import Flash from '~/flash'; import axios from '~/lib/utils/axios_utils'; @@ -62,7 +62,7 @@ export default class MirrorRepos { } registerUpdateListeners() { - this.debouncedUpdateUrl = _.debounce(() => this.updateUrl(), 200); + this.debouncedUpdateUrl = debounce(() => this.updateUrl(), 200); this.$urlInput.on('input', () => this.debouncedUpdateUrl()); this.$protectedBranchesInput.on('change', () => this.updateProtectedBranches()); this.$table.on('click', '.js-delete-mirror', event => this.deleteMirror(event)); diff --git a/app/assets/javascripts/mirrors/ssh_mirror.js b/app/assets/javascripts/mirrors/ssh_mirror.js index bb5ae6ce2d1..550e1aeeb9c 100644 --- a/app/assets/javascripts/mirrors/ssh_mirror.js +++ b/app/assets/javascripts/mirrors/ssh_mirror.js @@ -1,5 +1,5 @@ import $ from 'jquery'; -import _ from 'underscore'; +import { escape as esc } from 'lodash'; import { __ } from '~/locale'; import axios from '~/lib/utils/axios_utils'; import Flash from '~/flash'; @@ -162,7 +162,7 @@ export default class SSHMirror { const $fingerprintsList = this.$hostKeysInformation.find('.js-fingerprints-list'); let fingerprints = ''; sshHostKeys.fingerprints.forEach(fingerprint => { - const escFingerprints = _.escape(fingerprint.fingerprint); + const escFingerprints = esc(fingerprint.fingerprint); fingerprints += `<code>${escFingerprints}</code>`; }); diff --git a/app/assets/javascripts/registry/settings/components/registry_settings_app.vue b/app/assets/javascripts/registry/settings/components/registry_settings_app.vue index 2156c4469da..87e65d354bb 100644 --- a/app/assets/javascripts/registry/settings/components/registry_settings_app.vue +++ b/app/assets/javascripts/registry/settings/components/registry_settings_app.vue @@ -1,7 +1,7 @@ <script> import { mapActions, mapState } from 'vuex'; -import { GlAlert } from '@gitlab/ui'; -import { sprintf, s__ } from '~/locale'; +import { GlAlert, GlSprintf, GlLink } from '@gitlab/ui'; +import { s__ } from '~/locale'; import { FETCH_SETTINGS_ERROR_MESSAGE } from '../../shared/constants'; @@ -11,22 +11,16 @@ export default { components: { SettingsForm, GlAlert, + GlSprintf, + GlLink, + }, + i18n: { + unavailableFeatureText: s__( + 'ContainerRegistry|Currently, the Container Registry tag expiration feature is not available for projects created before GitLab version 12.8. For updates and more information, visit Issue %{linkStart}#196124%{linkEnd}', + ), }, computed: { ...mapState(['isDisabled']), - notAvailableMessage() { - return sprintf( - s__( - 'ContainerRegistry|Currently, the Container Registry tag expiration feature is not available for projects created before GitLab version 12.8. For updates and more information, visit Issue %{linkStart}#196124%{linkEnd}', - ), - { - linkStart: - '<a href="https://gitlab.com/gitlab-org/gitlab/issues/196124" target="_blank" rel="noopener noreferrer">', - linkEnd: '</a>', - }, - false, - ); - }, }, mounted() { this.fetchSettings().catch(() => @@ -56,7 +50,15 @@ export default { </ul> <settings-form v-if="!isDisabled" /> <gl-alert v-else :dismissible="false"> - <p v-html="notAvailableMessage"></p> + <p> + <gl-sprintf :message="$options.i18n.unavailableFeatureText"> + <template #link="{content}"> + <gl-link href="https://gitlab.com/gitlab-org/gitlab/issues/196124" target="_blank"> + {{ content }} + </gl-link> + </template> + </gl-sprintf> + </p> </gl-alert> </div> </template> diff --git a/app/assets/javascripts/registry/shared/components/expiration_policy_fields.vue b/app/assets/javascripts/registry/shared/components/expiration_policy_fields.vue index a15b854cb9b..3e212f09e35 100644 --- a/app/assets/javascripts/registry/shared/components/expiration_policy_fields.vue +++ b/app/assets/javascripts/registry/shared/components/expiration_policy_fields.vue @@ -1,7 +1,7 @@ <script> import { uniqueId } from 'lodash'; -import { GlFormGroup, GlToggle, GlFormSelect, GlFormTextarea } from '@gitlab/ui'; -import { s__, __, sprintf } from '~/locale'; +import { GlFormGroup, GlToggle, GlFormSelect, GlFormTextarea, GlSprintf } from '@gitlab/ui'; +import { s__, __ } from '~/locale'; import { NAME_REGEX_LENGTH } from '../constants'; import { mapComputedToEvent } from '../utils'; @@ -11,6 +11,7 @@ export default { GlToggle, GlFormSelect, GlFormTextarea, + GlSprintf, }, props: { formOptions: { @@ -70,27 +71,6 @@ export default { policyEnabledText() { return this.enabled ? __('enabled') : __('disabled'); }, - toggleDescriptionText() { - return sprintf( - s__('ContainerRegistry|Docker tag expiration policy is %{toggleStatus}'), - { - toggleStatus: `<strong>${this.policyEnabledText}</strong>`, - }, - false, - ); - }, - regexHelpText() { - return sprintf( - s__( - 'ContainerRegistry|Wildcards such as %{codeStart}.*-stable%{codeEnd} or %{codeStart}production/.*%{codeEnd} are supported. To select all tags, use %{codeStart}.*%{codeEnd}', - ), - { - codeStart: '<code>', - codeEnd: '</code>', - }, - false, - ); - }, nameRegexState() { return this.name_regex ? this.name_regex.length <= NAME_REGEX_LENGTH : null; }, @@ -139,7 +119,15 @@ export default { v-model="enabled" :disabled="isLoading" /> - <span class="mb-2 ml-1 lh-2" v-html="toggleDescriptionText"></span> + <span class="mb-2 ml-1 lh-2"> + <gl-sprintf + :message="s__('ContainerRegistry|Docker tag expiration policy is %{toggleStatus}')" + > + <template #toggleStatus> + <strong>{{ policyEnabledText }}</strong> + </template> + </gl-sprintf> + </span> </div> </gl-form-group> @@ -190,7 +178,19 @@ export default { trim /> <template #description> - <span ref="regex-description" v-html="regexHelpText"></span> + <span ref="regex-description"> + <gl-sprintf + :message=" + s__( + 'ContainerRegistry|Wildcards such as %{codeStart}.*-stable%{codeEnd} or %{codeStart}production/.*%{codeEnd} are supported. To select all tags, use %{codeStart}.*%{codeEnd}', + ) + " + > + <template #code="{content}"> + <code>{{ content }}</code> + </template> + </gl-sprintf> + </span> </template> </gl-form-group> </div> |