Commit c602330a authored by Nick Kipling's avatar Nick Kipling

Fixes inconsistent icon colours in package title

Updated package tags icon colour
Updated package title icon colour
Now both use the new gl-text-gray-700 class
parent 98b59f13
...@@ -51,7 +51,7 @@ export default { ...@@ -51,7 +51,7 @@ export default {
{{ packageEntity.name }} {{ packageEntity.name }}
</h1> </h1>
<div class="gl-display-flex gl-align-items-center text-secondary"> <div class="gl-display-flex gl-align-items-center gl-text-gray-700">
<gl-icon name="eye" class="gl-mr-3" /> <gl-icon name="eye" class="gl-mr-3" />
<gl-sprintf :message="$options.i18n.packageInfo"> <gl-sprintf :message="$options.i18n.packageInfo">
<template #version> <template #version>
...@@ -70,7 +70,7 @@ export default { ...@@ -70,7 +70,7 @@ export default {
<div class="gl-display-flex gl-flex-wrap gl-align-items-center gl-mb-3"> <div class="gl-display-flex gl-flex-wrap gl-align-items-center gl-mb-3">
<div v-if="packageTypeDisplay" class="gl-display-flex gl-align-items-center gl-mr-5"> <div v-if="packageTypeDisplay" class="gl-display-flex gl-align-items-center gl-mr-5">
<gl-icon name="package" class="text-secondary gl-mr-3" /> <gl-icon name="package" class="gl-text-gray-700 gl-mr-3" />
<span data-testid="package-type" class="gl-font-weight-bold">{{ packageTypeDisplay }}</span> <span data-testid="package-type" class="gl-font-weight-bold">{{ packageTypeDisplay }}</span>
</div> </div>
...@@ -79,7 +79,7 @@ export default { ...@@ -79,7 +79,7 @@ export default {
</div> </div>
<div v-if="packagePipeline" class="gl-display-flex gl-align-items-center gl-mr-5"> <div v-if="packagePipeline" class="gl-display-flex gl-align-items-center gl-mr-5">
<gl-icon name="review-list" class="text-secondary gl-mr-3" /> <gl-icon name="review-list" class="gl-text-gray-700 gl-mr-3" />
<gl-link <gl-link
data-testid="pipeline-project" data-testid="pipeline-project"
:href="packagePipeline.project.web_url" :href="packagePipeline.project.web_url"
...@@ -94,7 +94,7 @@ export default { ...@@ -94,7 +94,7 @@ export default {
data-testid="package-ref" data-testid="package-ref"
class="gl-display-flex gl-align-items-center gl-mr-5" class="gl-display-flex gl-align-items-center gl-mr-5"
> >
<gl-icon name="branch" class="text-secondary gl-mr-3" /> <gl-icon name="branch" class="gl-text-gray-700 gl-mr-3" />
<span <span
v-gl-tooltip v-gl-tooltip
class="gl-font-weight-bold text-truncate mw-xs" class="gl-font-weight-bold text-truncate mw-xs"
...@@ -104,7 +104,7 @@ export default { ...@@ -104,7 +104,7 @@ export default {
</div> </div>
<div class="gl-display-flex gl-align-items-center gl-mr-5"> <div class="gl-display-flex gl-align-items-center gl-mr-5">
<gl-icon name="disk" class="text-secondary gl-mr-3" /> <gl-icon name="disk" class="gl-text-gray-700 gl-mr-3" />
<span data-testid="package-size" class="gl-font-weight-bold">{{ totalSize }}</span> <span data-testid="package-size" class="gl-font-weight-bold">{{ totalSize }}</span>
</div> </div>
</div> </div>
......
...@@ -56,10 +56,10 @@ export default { ...@@ -56,10 +56,10 @@ export default {
methods: { methods: {
tagBadgeClass(index) { tagBadgeClass(index) {
return { return {
'd-none': true, 'gl-display-none': true,
'd-flex': this.tagCount === 1, 'gl-display-flex': this.tagCount === 1,
'd-md-flex': this.tagCount > 1, 'd-md-flex': this.tagCount > 1,
'append-right-4': index !== this.tagsToRender.length - 1, 'gl-mr-2': index !== this.tagsToRender.length - 1,
'gl-ml-3': !this.hideLabel && index === 0, 'gl-ml-3': !this.hideLabel && index === 0,
}; };
}, },
...@@ -68,16 +68,16 @@ export default { ...@@ -68,16 +68,16 @@ export default {
</script> </script>
<template> <template>
<div class="d-flex align-items-center"> <div class="gl-display-flex gl-align-items-center">
<div v-if="!hideLabel" ref="tagLabel" class="d-flex align-items-center"> <div v-if="!hideLabel" data-testid="tagLabel" class="gl-display-flex gl-align-items-center">
<gl-icon name="labels" class="gl-mr-3" /> <gl-icon name="labels" class="gl-text-gray-700 gl-mr-3" />
<strong class="js-tags-count">{{ tagsDisplay }}</strong> <span class="gl-font-weight-bold">{{ tagsDisplay }}</span>
</div> </div>
<gl-badge <gl-badge
v-for="(tag, index) in tagsToRender" v-for="(tag, index) in tagsToRender"
:key="index" :key="index"
ref="tagBadge" data-testid="tagBadge"
:class="tagBadgeClass(index)" :class="tagBadgeClass(index)"
variant="info" variant="info"
>{{ tag.name }}</gl-badge >{{ tag.name }}</gl-badge
...@@ -85,11 +85,11 @@ export default { ...@@ -85,11 +85,11 @@ export default {
<gl-badge <gl-badge
v-if="moreTagsDisplay" v-if="moreTagsDisplay"
ref="moreBadge"
v-gl-tooltip v-gl-tooltip
data-testid="moreBadge"
variant="muted" variant="muted"
:title="moreTagsTooltip" :title="moreTagsTooltip"
class="d-none d-md-flex gl-ml-2" class="gl-display-none d-md-flex gl-ml-2"
><gl-sprintf :message="__('+%{tags} more')"> ><gl-sprintf :message="__('+%{tags} more')">
<template #tags> <template #tags>
{{ moreTagsDisplay }} {{ moreTagsDisplay }}
...@@ -99,7 +99,7 @@ export default { ...@@ -99,7 +99,7 @@ export default {
<gl-badge <gl-badge
v-if="moreTagsDisplay && hideLabel" v-if="moreTagsDisplay && hideLabel"
ref="moreBadge" data-testid="moreBadge"
variant="muted" variant="muted"
class="d-md-none gl-ml-2" class="d-md-none gl-ml-2"
>{{ tagsDisplay }}</gl-badge >{{ tagsDisplay }}</gl-badge
......
---
title: Fixes inconsistent package title icon colors
merge_request: 33933
author:
type: added
...@@ -21,7 +21,7 @@ exports[`PackageTitle renders with tags 1`] = ` ...@@ -21,7 +21,7 @@ exports[`PackageTitle renders with tags 1`] = `
</h1> </h1>
<div <div
class="gl-display-flex gl-align-items-center text-secondary" class="gl-display-flex gl-align-items-center gl-text-gray-700"
> >
<gl-icon-stub <gl-icon-stub
class="gl-mr-3" class="gl-mr-3"
...@@ -43,7 +43,7 @@ exports[`PackageTitle renders with tags 1`] = ` ...@@ -43,7 +43,7 @@ exports[`PackageTitle renders with tags 1`] = `
class="gl-display-flex gl-align-items-center gl-mr-5" class="gl-display-flex gl-align-items-center gl-mr-5"
> >
<gl-icon-stub <gl-icon-stub
class="text-secondary gl-mr-3" class="gl-text-gray-700 gl-mr-3"
name="package" name="package"
size="16" size="16"
/> />
...@@ -73,7 +73,7 @@ exports[`PackageTitle renders with tags 1`] = ` ...@@ -73,7 +73,7 @@ exports[`PackageTitle renders with tags 1`] = `
class="gl-display-flex gl-align-items-center gl-mr-5" class="gl-display-flex gl-align-items-center gl-mr-5"
> >
<gl-icon-stub <gl-icon-stub
class="text-secondary gl-mr-3" class="gl-text-gray-700 gl-mr-3"
name="disk" name="disk"
size="16" size="16"
/> />
...@@ -110,7 +110,7 @@ exports[`PackageTitle renders without tags 1`] = ` ...@@ -110,7 +110,7 @@ exports[`PackageTitle renders without tags 1`] = `
</h1> </h1>
<div <div
class="gl-display-flex gl-align-items-center text-secondary" class="gl-display-flex gl-align-items-center gl-text-gray-700"
> >
<gl-icon-stub <gl-icon-stub
class="gl-mr-3" class="gl-mr-3"
...@@ -132,7 +132,7 @@ exports[`PackageTitle renders without tags 1`] = ` ...@@ -132,7 +132,7 @@ exports[`PackageTitle renders without tags 1`] = `
class="gl-display-flex gl-align-items-center gl-mr-5" class="gl-display-flex gl-align-items-center gl-mr-5"
> >
<gl-icon-stub <gl-icon-stub
class="text-secondary gl-mr-3" class="gl-text-gray-700 gl-mr-3"
name="package" name="package"
size="16" size="16"
/> />
...@@ -155,7 +155,7 @@ exports[`PackageTitle renders without tags 1`] = ` ...@@ -155,7 +155,7 @@ exports[`PackageTitle renders without tags 1`] = `
class="gl-display-flex gl-align-items-center gl-mr-5" class="gl-display-flex gl-align-items-center gl-mr-5"
> >
<gl-icon-stub <gl-icon-stub
class="text-secondary gl-mr-3" class="gl-text-gray-700 gl-mr-3"
name="disk" name="disk"
size="16" size="16"
/> />
......
...@@ -16,9 +16,9 @@ describe('PackageTags', () => { ...@@ -16,9 +16,9 @@ describe('PackageTags', () => {
}); });
} }
const tagLabel = () => wrapper.find({ ref: 'tagLabel' }); const tagLabel = () => wrapper.find('[data-testid="tagLabel"]');
const tagBadges = () => wrapper.findAll({ ref: 'tagBadge' }); const tagBadges = () => wrapper.findAll('[data-testid="tagBadge"]');
const moreBadge = () => wrapper.find({ ref: 'moreBadge' }); const moreBadge = () => wrapper.find('[data-testid="moreBadge"]');
afterEach(() => { afterEach(() => {
if (wrapper) wrapper.destroy(); if (wrapper) wrapper.destroy();
...@@ -68,12 +68,12 @@ describe('PackageTags', () => { ...@@ -68,12 +68,12 @@ describe('PackageTags', () => {
}); });
describe('tagBadgeStyle', () => { describe('tagBadgeStyle', () => {
const defaultStyle = ['badge', 'badge-info', 'd-none']; const defaultStyle = ['badge', 'badge-info', 'gl-display-none'];
it('shows tag badge when there is only one', () => { it('shows tag badge when there is only one', () => {
createComponent([mockTags[0]]); createComponent([mockTags[0]]);
const expectedStyle = [...defaultStyle, 'd-flex', 'gl-ml-3']; const expectedStyle = [...defaultStyle, 'gl-display-flex', 'gl-ml-3'];
expect( expect(
tagBadges() tagBadges()
...@@ -100,7 +100,7 @@ describe('PackageTags', () => { ...@@ -100,7 +100,7 @@ describe('PackageTags', () => {
}); });
const expectedStyleWithoutAppend = [...defaultStyle, 'd-md-flex']; const expectedStyleWithoutAppend = [...defaultStyle, 'd-md-flex'];
const expectedStyleWithAppend = [...expectedStyleWithoutAppend, 'append-right-4']; const expectedStyleWithAppend = [...expectedStyleWithoutAppend, 'gl-mr-2'];
const allBadges = tagBadges(); const allBadges = tagBadges();
......
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