Commit c7422661 authored by Jose Ivan Vargas's avatar Jose Ivan Vargas

Merge branch 'pb-use-gl-alert-erased-block' into 'master'

Replace alert classes on div with GlAlert

See merge request gitlab-org/gitlab!52810
parents f6481bfe 0fa6f77b
<script> <script>
import { isEmpty } from 'lodash'; import { isEmpty } from 'lodash';
import { GlLink } from '@gitlab/ui'; import { GlAlert, GlLink, GlSprintf } from '@gitlab/ui';
import TimeagoTooltip from '~/vue_shared/components/time_ago_tooltip.vue'; import TimeagoTooltip from '~/vue_shared/components/time_ago_tooltip.vue';
export default { export default {
components: { components: {
TimeagoTooltip, GlAlert,
GlLink, GlLink,
GlSprintf,
TimeagoTooltip,
}, },
props: { props: {
user: { user: {
...@@ -27,17 +29,21 @@ export default { ...@@ -27,17 +29,21 @@ export default {
}; };
</script> </script>
<template> <template>
<div class="gl-mt-3 js-build-erased"> <div class="gl-mt-3">
<div class="erased alert alert-warning"> <gl-alert variant="warning" :dismissible="false">
<template v-if="isErasedByUser"> <template v-if="isErasedByUser">
{{ s__('Job|Job has been erased by') }} <gl-sprintf :message="s__('Job|Job has been erased by %{userLink}')">
<gl-link :href="user.web_url"> {{ user.username }} </gl-link> <template #userLink>
<gl-link :href="user.web_url" target="_blank">{{ user.username }}</gl-link>
</template>
</gl-sprintf>
</template> </template>
<template v-else> <template v-else>
{{ s__('Job|Job has been erased') }} {{ s__('Job|Job has been erased') }}
</template> </template>
<timeago-tooltip :time="erasedAt" /> <timeago-tooltip :time="erasedAt" />
</div> </gl-alert>
</div> </div>
</template> </template>
---
title: Replace erase job alert background color with color consistent with UI
merge_request: 52810
author:
type: changed
...@@ -16723,7 +16723,7 @@ msgstr "" ...@@ -16723,7 +16723,7 @@ msgstr ""
msgid "Job|Job has been erased" msgid "Job|Job has been erased"
msgstr "" msgstr ""
msgid "Job|Job has been erased by" msgid "Job|Job has been erased by %{userLink}"
msgstr "" msgstr ""
msgid "Job|Keep" msgid "Job|Keep"
......
...@@ -10,6 +10,8 @@ describe('Erased block', () => { ...@@ -10,6 +10,8 @@ describe('Erased block', () => {
const timeago = getTimeago(); const timeago = getTimeago();
const formattedDate = timeago.format(erasedAt); const formattedDate = timeago.format(erasedAt);
const findLink = () => wrapper.find(GlLink);
const createComponent = (props) => { const createComponent = (props) => {
wrapper = mount(ErasedBlock, { wrapper = mount(ErasedBlock, {
propsData: props, propsData: props,
...@@ -32,7 +34,7 @@ describe('Erased block', () => { ...@@ -32,7 +34,7 @@ describe('Erased block', () => {
}); });
it('renders username and link', () => { it('renders username and link', () => {
expect(wrapper.find(GlLink).attributes('href')).toEqual('gitlab.com/root'); expect(findLink().attributes('href')).toEqual('gitlab.com/root');
expect(wrapper.text().trim()).toContain('Job has been erased by'); expect(wrapper.text().trim()).toContain('Job has been erased by');
expect(wrapper.text().trim()).toContain('root'); expect(wrapper.text().trim()).toContain('root');
......
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