Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'app/assets/javascripts/ide/components/commit_sidebar')
-rw-r--r--app/assets/javascripts/ide/components/commit_sidebar/actions.vue25
-rw-r--r--app/assets/javascripts/ide/components/commit_sidebar/message_field.vue18
2 files changed, 25 insertions, 18 deletions
diff --git a/app/assets/javascripts/ide/components/commit_sidebar/actions.vue b/app/assets/javascripts/ide/components/commit_sidebar/actions.vue
index de4b0a34002..b89329c92ec 100644
--- a/app/assets/javascripts/ide/components/commit_sidebar/actions.vue
+++ b/app/assets/javascripts/ide/components/commit_sidebar/actions.vue
@@ -1,8 +1,8 @@
<script>
-/* eslint-disable vue/no-v-html */
import { escape } from 'lodash';
import { mapState, mapGetters, createNamespacedHelpers } from 'vuex';
-import { sprintf, s__ } from '~/locale';
+import { GlSprintf } from '@gitlab/ui';
+import { s__ } from '~/locale';
import consts from '../../stores/modules/commit/constants';
import RadioGroup from './radio_group.vue';
import NewMergeRequestOption from './new_merge_request_option.vue';
@@ -13,6 +13,7 @@ const { mapState: mapCommitState, mapActions: mapCommitActions } = createNamespa
export default {
components: {
+ GlSprintf,
RadioGroup,
NewMergeRequestOption,
},
@@ -20,12 +21,8 @@ export default {
...mapState(['currentBranchId', 'changedFiles', 'stagedFiles']),
...mapCommitState(['commitAction']),
...mapGetters(['currentBranch', 'emptyRepo', 'canPushToBranch']),
- commitToCurrentBranchText() {
- return sprintf(
- s__('IDE|Commit to %{branchName} branch'),
- { branchName: `<strong class="monospace">${escape(this.currentBranchId)}</strong>` },
- false,
- );
+ currentBranchText() {
+ return escape(this.currentBranchId);
},
containsStagedChanges() {
return this.changedFiles.length > 0 && this.stagedFiles.length > 0;
@@ -77,11 +74,13 @@ export default {
:disabled="!canPushToBranch"
:title="$options.currentBranchPermissionsTooltip"
>
- <span
- class="ide-option-label"
- data-qa-selector="commit_to_current_branch_radio"
- v-html="commitToCurrentBranchText"
- ></span>
+ <span class="ide-option-label" data-qa-selector="commit_to_current_branch_radio">
+ <gl-sprintf :message="s__('IDE|Commit to %{branchName} branch')">
+ <template #branchName>
+ <strong class="monospace">{{ currentBranchText }}</strong>
+ </template>
+ </gl-sprintf>
+ </span>
</radio-group>
<template v-if="!emptyRepo">
<radio-group
diff --git a/app/assets/javascripts/ide/components/commit_sidebar/message_field.vue b/app/assets/javascripts/ide/components/commit_sidebar/message_field.vue
index 2787b10a48b..5b392470e41 100644
--- a/app/assets/javascripts/ide/components/commit_sidebar/message_field.vue
+++ b/app/assets/javascripts/ide/components/commit_sidebar/message_field.vue
@@ -1,5 +1,5 @@
<script>
-import { GlIcon } from '@gitlab/ui';
+import { GlIcon, GlPopover } from '@gitlab/ui';
import { __, sprintf } from '../../../locale';
import popover from '../../../vue_shared/directives/popover';
import { MAX_TITLE_LENGTH, MAX_BODY_LENGTH } from '../../constants';
@@ -10,6 +10,7 @@ export default {
},
components: {
GlIcon,
+ GlPopover,
},
props: {
text: {
@@ -58,7 +59,7 @@ export default {
},
},
popoverOptions: {
- trigger: 'hover',
+ triggers: 'hover',
placement: 'top',
content: sprintf(
__(`
@@ -83,9 +84,16 @@ export default {
<ul class="nav-links">
<li>
{{ __('Commit Message') }}
- <span v-popover="$options.popoverOptions" class="form-text text-muted gl-ml-3">
- <gl-icon name="question" />
- </span>
+ <div id="ide-commit-message-popover-container">
+ <span id="ide-commit-message-question" class="form-text text-muted gl-ml-3">
+ <gl-icon name="question" />
+ </span>
+ <gl-popover
+ target="ide-commit-message-question"
+ container="ide-commit-message-popover-container"
+ v-bind="$options.popoverOptions"
+ />
+ </div>
</li>
</ul>
</div>