Commit d1c4a795 authored by Marcin Sedlak-Jakubowski's avatar Marcin Sedlak-Jakubowski Committed by Phil Hughes

Remove deprecated button in project_selector/project_list_item.vue

parent 77836aae
<script> <script>
/* eslint-disable vue/no-v-html */ /* eslint-disable vue/no-v-html */
import { GlDeprecatedButton, GlIcon } from '@gitlab/ui'; import { GlButton, GlIcon } from '@gitlab/ui';
import { isString } from 'lodash'; import { isString } from 'lodash';
import ProjectAvatar from '~/vue_shared/components/project_avatar/default.vue'; import ProjectAvatar from '~/vue_shared/components/project_avatar/default.vue';
import highlight from '~/lib/utils/highlight'; import highlight from '~/lib/utils/highlight';
...@@ -8,7 +8,7 @@ import { truncateNamespace } from '~/lib/utils/text_utility'; ...@@ -8,7 +8,7 @@ import { truncateNamespace } from '~/lib/utils/text_utility';
export default { export default {
name: 'ProjectListItem', name: 'ProjectListItem',
components: { GlIcon, ProjectAvatar, GlDeprecatedButton }, components: { GlIcon, ProjectAvatar, GlButton },
props: { props: {
project: { project: {
type: Object, type: Object,
...@@ -40,17 +40,16 @@ export default { ...@@ -40,17 +40,16 @@ export default {
}; };
</script> </script>
<template> <template>
<gl-deprecated-button <gl-button
class="d-flex align-items-center btn pt-1 pb-1 border-0 project-list-item" category="tertiary"
class="gl-display-flex gl-align-items-center gl-justify-content-start! gl-mb-2 gl-w-full"
@click="onClick" @click="onClick"
> >
<gl-icon <div
class="gl-ml-3 gl-mr-3 flex-shrink-0 position-top-0 js-selected-icon" class="gl-display-flex gl-align-items-center gl-flex-wrap project-namespace-name-container"
:class="{ 'js-selected visible': selected, 'js-unselected invisible': !selected }" >
name="mobile-issue-close" <gl-icon v-if="selected" class="js-selected-icon" name="mobile-issue-close" />
/> <project-avatar class="gl-flex-shrink-0 js-project-avatar" :project="project" :size="32" />
<project-avatar class="flex-shrink-0 js-project-avatar" :project="project" :size="32" />
<div class="d-flex flex-wrap project-namespace-name-container">
<div <div
v-if="truncatedNamespace" v-if="truncatedNamespace"
:title="projectNameWithNamespace" :title="projectNameWithNamespace"
...@@ -65,5 +64,5 @@ export default { ...@@ -65,5 +64,5 @@ export default {
v-html="highlightedProjectName" v-html="highlightedProjectName"
></div> ></div>
</div> </div>
</gl-deprecated-button> </gl-button>
</template> </template>
...@@ -100,7 +100,7 @@ export default { ...@@ -100,7 +100,7 @@ export default {
@bottomReached="bottomReached" @bottomReached="bottomReached"
> >
<template v-if="!showLoadingIndicator" #items> <template v-if="!showLoadingIndicator" #items>
<div class="d-flex flex-column"> <div class="gl-display-flex gl-flex-direction-column gl-p-3">
<project-list-item <project-list-item
v-for="project in projectSearchResults" v-for="project in projectSearchResults"
:key="project.id" :key="project.id"
......
...@@ -47,4 +47,4 @@ exports[`AddContextCommitsModal renders modal with 2 tabs 1`] = ` ...@@ -47,4 +47,4 @@ exports[`AddContextCommitsModal renders modal with 2 tabs 1`] = `
</gl-tab-stub> </gl-tab-stub>
</gl-tabs-stub> </gl-tabs-stub>
</gl-modal-stub> </gl-modal-stub>
`; `;
\ No newline at end of file
...@@ -29,7 +29,7 @@ describe('ProjectListItem component', () => { ...@@ -29,7 +29,7 @@ describe('ProjectListItem component', () => {
it('does not render a check mark icon if selected === false', () => { it('does not render a check mark icon if selected === false', () => {
wrapper = shallowMount(Component, options); wrapper = shallowMount(Component, options);
expect(wrapper.find('.js-selected-icon.js-unselected').exists()).toBe(true); expect(wrapper.find('.js-selected-icon').exists()).toBe(false);
}); });
it('renders a check mark icon if selected === true', () => { it('renders a check mark icon if selected === true', () => {
...@@ -37,7 +37,7 @@ describe('ProjectListItem component', () => { ...@@ -37,7 +37,7 @@ describe('ProjectListItem component', () => {
wrapper = shallowMount(Component, options); wrapper = shallowMount(Component, options);
expect(wrapper.find('.js-selected-icon.js-selected').exists()).toBe(true); expect(wrapper.find('.js-selected-icon').exists()).toBe(true);
}); });
it(`emits a "clicked" event when clicked`, () => { it(`emits a "clicked" event when clicked`, () => {
......
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