Commit 57d87f8b authored by Kushal Pandya's avatar Kushal Pandya

Merge branch 'Fix-bad-escape-in-empty_state.vue' into 'master'

Fix Bad Escape in Issue Board Empty State

See merge request gitlab-org/gitlab!45465
parents fe62abdc b53d448e
<script> <script>
/* eslint-disable vue/no-v-html */ import { GlButton, GlSprintf } from '@gitlab/ui';
import { GlButton } from '@gitlab/ui'; import { __ } from '~/locale';
import { __, sprintf } from '~/locale';
import ModalStore from '../../stores/modal_store'; import ModalStore from '../../stores/modal_store';
import modalMixin from '../../mixins/modal_mixins'; import modalMixin from '../../mixins/modal_mixins';
export default { export default {
components: { components: {
GlButton, GlButton,
GlSprintf,
}, },
mixins: [modalMixin], mixins: [modalMixin],
props: { props: {
...@@ -34,11 +34,8 @@ export default { ...@@ -34,11 +34,8 @@ export default {
if (this.activeTab === 'selected') { if (this.activeTab === 'selected') {
obj.title = __("You haven't selected any issues yet"); obj.title = __("You haven't selected any issues yet");
obj.content = sprintf( obj.content = __(
__( 'Go back to %{tagStart}Open issues%{tagEnd} and select some issues to add to your board.',
'Go back to %{startTag}Open issues%{endTag} and select some issues to add to your board.',
),
{ startTag: '<strong>', endTag: '</strong>' },
); );
} }
...@@ -57,7 +54,13 @@ export default { ...@@ -57,7 +54,13 @@ export default {
<div class="col-12 col-md-6 order-md-first"> <div class="col-12 col-md-6 order-md-first">
<div class="text-content"> <div class="text-content">
<h4>{{ contents.title }}</h4> <h4>{{ contents.title }}</h4>
<p v-html="contents.content"></p> <p>
<gl-sprintf :message="contents.content">
<template #tag="{ content }">
<strong>{{ content }}</strong>
</template>
</gl-sprintf>
</p>
<gl-button <gl-button
v-if="activeTab === 'all'" v-if="activeTab === 'all'"
:href="newIssuePath" :href="newIssuePath"
......
---
title: Fix Bad Escape in Issue Board Empty State
merge_request: 45465
author: Kev @KevSlashNull
type: fixed
...@@ -12804,7 +12804,7 @@ msgstr "" ...@@ -12804,7 +12804,7 @@ msgstr ""
msgid "Go back (while searching for files)" msgid "Go back (while searching for files)"
msgstr "" msgstr ""
msgid "Go back to %{startTag}Open issues%{endTag} and select some issues to add to your board." msgid "Go back to %{tagStart}Open issues%{tagEnd} and select some issues to add to your board."
msgstr "" msgstr ""
msgid "Go full screen" msgid "Go full screen"
......
...@@ -87,11 +87,12 @@ RSpec.describe 'Issue Boards add issue modal', :js do ...@@ -87,11 +87,12 @@ RSpec.describe 'Issue Boards add issue modal', :js do
end end
end end
it 'shows selected issues' do it 'shows selected issues tab and empty state message' do
page.within('.add-issues-modal') do page.within('.add-issues-modal') do
click_link 'Selected issues' click_link 'Selected issues'
expect(page).not_to have_selector('.board-card') expect(page).not_to have_selector('.board-card')
expect(page).to have_content("Go back to Open issues and select some issues to add to your board.")
end end
end end
...@@ -147,7 +148,7 @@ RSpec.describe 'Issue Boards add issue modal', :js do ...@@ -147,7 +148,7 @@ RSpec.describe 'Issue Boards add issue modal', :js do
end end
end end
context 'selecing issues' do context 'selecting issues' do
it 'selects single issue' do it 'selects single issue' do
page.within('.add-issues-modal') do page.within('.add-issues-modal') do
first('.board-card .board-card-number').click first('.board-card .board-card-number').click
...@@ -206,7 +207,7 @@ RSpec.describe 'Issue Boards add issue modal', :js do ...@@ -206,7 +207,7 @@ RSpec.describe 'Issue Boards add issue modal', :js do
end end
end end
it 'selects all that arent already selected' do it "selects all that aren't already selected" do
page.within('.add-issues-modal') do page.within('.add-issues-modal') do
first('.board-card .board-card-number').click first('.board-card .board-card-number').click
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment