Commit e06eca1f authored by Scott Hampton's avatar Scott Hampton

Merge branch...

Merge branch '229308-migrate-bootstrap-button-to-gitlab-ui-glbutton-in-app-assets-javascripts-pages-projects' into 'master'

Migrate button to GlButton in …/pipeline_schedules_callout.vue

See merge request gitlab-org/gitlab!46264
parents f17d1cc4 448966c9
<script> <script>
import Vue from 'vue'; import Vue from 'vue';
import Cookies from 'js-cookie'; import Cookies from 'js-cookie';
import { GlIcon } from '@gitlab/ui'; import { GlButton } from '@gitlab/ui';
import Translate from '../../../../../vue_shared/translate'; import Translate from '../../../../../vue_shared/translate';
import { parseBoolean } from '~/lib/utils/common_utils'; import { parseBoolean } from '~/lib/utils/common_utils';
...@@ -12,7 +12,7 @@ const cookieKey = 'pipeline_schedules_callout_dismissed'; ...@@ -12,7 +12,7 @@ const cookieKey = 'pipeline_schedules_callout_dismissed';
export default { export default {
name: 'PipelineSchedulesCallout', name: 'PipelineSchedulesCallout',
components: { components: {
GlIcon, GlButton,
}, },
data() { data() {
return { return {
...@@ -32,9 +32,13 @@ export default { ...@@ -32,9 +32,13 @@ export default {
<template> <template>
<div v-if="!calloutDismissed" class="pipeline-schedules-user-callout user-callout"> <div v-if="!calloutDismissed" class="pipeline-schedules-user-callout user-callout">
<div class="bordered-box landing content-block"> <div class="bordered-box landing content-block">
<button id="dismiss-callout-btn" class="btn btn-default close" @click="dismissCallout"> <gl-button
<gl-icon name="close" aria-hidden="true" /> category="tertiary"
</button> icon="close"
:aria-label="__('Dismiss')"
class="gl-absolute gl-top-2 gl-right-2"
@click="dismissCallout"
/>
<div class="svg-container"> <div class="svg-container">
<img :src="imageUrl" /> <img :src="imageUrl" />
</div> </div>
......
...@@ -50,11 +50,7 @@ ...@@ -50,11 +50,7 @@
.bordered-box.content-block { .bordered-box.content-block {
border: 1px solid var(--border-color, $border-color); border: 1px solid var(--border-color, $border-color);
background-color: transparent; background-color: transparent;
padding: 16px; padding: $gl-spacing-scale-5;
}
#dismiss-callout-btn {
color: var(--gl-text-color, $gl-text-color);
} }
} }
......
---
title: Replace close button in Scheduling Pipelines user notice with GlButton
merge_request: 46264
author:
type: other
import Vue from 'vue'; import Vue from 'vue';
import Cookies from 'js-cookie'; import Cookies from 'js-cookie';
import { getByRole } from '@testing-library/dom';
import PipelineSchedulesCallout from '~/pages/projects/pipeline_schedules/shared/components/pipeline_schedules_callout.vue'; import PipelineSchedulesCallout from '~/pages/projects/pipeline_schedules/shared/components/pipeline_schedules_callout.vue';
const PipelineSchedulesCalloutComponent = Vue.extend(PipelineSchedulesCallout); const PipelineSchedulesCalloutComponent = Vue.extend(PipelineSchedulesCallout);
...@@ -80,7 +81,7 @@ describe('Pipeline Schedule Callout', () => { ...@@ -80,7 +81,7 @@ describe('Pipeline Schedule Callout', () => {
}); });
it('updates calloutDismissed when close button is clicked', done => { it('updates calloutDismissed when close button is clicked', done => {
calloutComponent.$el.querySelector('#dismiss-callout-btn').click(); getByRole(calloutComponent.$el, 'button', /dismiss/i).click();
Vue.nextTick(() => { Vue.nextTick(() => {
expect(calloutComponent.calloutDismissed).toBe(true); expect(calloutComponent.calloutDismissed).toBe(true);
...@@ -98,7 +99,7 @@ describe('Pipeline Schedule Callout', () => { ...@@ -98,7 +99,7 @@ describe('Pipeline Schedule Callout', () => {
}); });
it('is hidden when close button is clicked', done => { it('is hidden when close button is clicked', done => {
calloutComponent.$el.querySelector('#dismiss-callout-btn').click(); getByRole(calloutComponent.$el, 'button', /dismiss/i).click();
Vue.nextTick(() => { Vue.nextTick(() => {
expect(calloutComponent.$el.childNodes.length).toBe(0); expect(calloutComponent.$el.childNodes.length).toBe(0);
......
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