Commit 3dde7748 authored by Kushal Pandya's avatar Kushal Pandya

Merge branch 'ph/341041/updateLevel2ExtensionSpacing' into 'master'

Updated spacing for MR extension level 2/3

See merge request gitlab-org/gitlab!71659
parents 7f6f70fc 907086e0
...@@ -6,6 +6,7 @@ import { ...@@ -6,6 +6,7 @@ import {
GlBadge, GlBadge,
GlSafeHtmlDirective, GlSafeHtmlDirective,
GlTooltipDirective, GlTooltipDirective,
GlIntersectionObserver,
} from '@gitlab/ui'; } from '@gitlab/ui';
import { sprintf, s__, __ } from '~/locale'; import { sprintf, s__, __ } from '~/locale';
import SmartVirtualList from '~/vue_shared/components/smart_virtual_list.vue'; import SmartVirtualList from '~/vue_shared/components/smart_virtual_list.vue';
...@@ -25,6 +26,7 @@ export default { ...@@ -25,6 +26,7 @@ export default {
GlLoadingIcon, GlLoadingIcon,
GlLink, GlLink,
GlBadge, GlBadge,
GlIntersectionObserver,
SmartVirtualList, SmartVirtualList,
StatusIcon, StatusIcon,
Actions, Actions,
...@@ -39,6 +41,7 @@ export default { ...@@ -39,6 +41,7 @@ export default {
collapsedData: null, collapsedData: null,
fullData: null, fullData: null,
isCollapsed: true, isCollapsed: true,
showFade: false,
}; };
}, },
computed: { computed: {
...@@ -117,6 +120,16 @@ export default { ...@@ -117,6 +120,16 @@ export default {
throw e; throw e;
}); });
}, },
appear(index) {
if (index === this.fullData.length - 1) {
this.showFade = false;
}
},
disappear(index) {
if (index === this.fullData.length - 1) {
this.showFade = true;
}
},
}, },
EXTENSION_ICON_CLASS, EXTENSION_ICON_CLASS,
}; };
...@@ -154,7 +167,7 @@ export default { ...@@ -154,7 +167,7 @@ export default {
</div> </div>
<div <div
v-if="!isCollapsed" v-if="!isCollapsed"
class="mr-widget-grouped-section" class="mr-widget-grouped-section gl-relative"
data-testid="widget-extension-collapsed-section" data-testid="widget-extension-collapsed-section"
> >
<div v-if="isLoadingExpanded" class="report-block-container"> <div v-if="isLoadingExpanded" class="report-block-container">
...@@ -167,16 +180,24 @@ export default { ...@@ -167,16 +180,24 @@ export default {
:size="32" :size="32"
wtag="ul" wtag="ul"
wclass="report-block-list" wclass="report-block-list"
class="report-block-container" class="report-block-container gl-px-5 gl-py-0"
> >
<li <li
v-for="data in fullData" v-for="(data, index) in fullData"
:key="data.id" :key="data.id"
class="gl-display-flex gl-align-items-center" :class="{
'gl-border-b-solid gl-border-b-1 gl-border-gray-100': index !== fullData.length - 1,
}"
class="gl-display-flex gl-align-items-center gl-py-3 gl-pl-7"
data-testid="extension-list-item" data-testid="extension-list-item"
> >
<status-icon v-if="data.icon" :icon-name="data.icon.name" :size="12" /> <status-icon v-if="data.icon" :icon-name="data.icon.name" :size="12" />
<div class="gl-mt-2 gl-mb-2 gl-flex-wrap gl-align-self-center gl-display-flex"> <gl-intersection-observer
:options="{ rootMargin: '100px', thresholds: 0.1 }"
class="gl-flex-wrap gl-align-self-center gl-display-flex"
@appear="appear(index)"
@disappear="disappear(index)"
>
<div v-safe-html="data.text" class="gl-mr-4"></div> <div v-safe-html="data.text" class="gl-mr-4"></div>
<div v-if="data.link"> <div v-if="data.link">
<gl-link :href="data.link.href">{{ data.link.text }}</gl-link> <gl-link :href="data.link.href">{{ data.link.text }}</gl-link>
...@@ -184,9 +205,13 @@ export default { ...@@ -184,9 +205,13 @@ export default {
<gl-badge v-if="data.badge" :variant="data.badge.variant || 'info'"> <gl-badge v-if="data.badge" :variant="data.badge.variant || 'info'">
{{ data.badge.text }} {{ data.badge.text }}
</gl-badge> </gl-badge>
</div> </gl-intersection-observer>
</li> </li>
</smart-virtual-list> </smart-virtual-list>
<div
:class="{ show: showFade }"
class="fade mr-extenson-scrim gl-absolute gl-left-0 gl-bottom-0 gl-w-full gl-h-7"
></div>
</div> </div>
</section> </section>
</template> </template>
...@@ -45,8 +45,9 @@ export default { ...@@ -45,8 +45,9 @@ export default {
:class="[ :class="[
$options.EXTENSION_ICON_CLASS[iconName], $options.EXTENSION_ICON_CLASS[iconName],
{ 'mr-widget-extension-icon': !isLoading && size === 16 }, { 'mr-widget-extension-icon': !isLoading && size === 16 },
{ 'gl-p-2': isLoading || size === 16 },
]" ]"
class="align-self-center gl-rounded-full gl-mr-3 gl-relative gl-p-2" class="align-self-center gl-rounded-full gl-mr-3 gl-relative"
> >
<gl-loading-icon v-if="isLoading" size="md" inline class="gl-display-block" /> <gl-loading-icon v-if="isLoading" size="md" inline class="gl-display-block" />
<gl-icon <gl-icon
......
...@@ -57,10 +57,10 @@ export default { ...@@ -57,10 +57,10 @@ export default {
name: issue.state === 'closed' ? EXTENSION_ICONS.error : EXTENSION_ICONS.success, name: issue.state === 'closed' ? EXTENSION_ICONS.error : EXTENSION_ICONS.success,
}, },
// Badges get rendered next to the text on each row // Badges get rendered next to the text on each row
badge: issue.state === 'closed' && { // badge: issue.state === 'closed' && {
text: 'Closed', // Required: Text to be used inside of the badge // text: 'Closed', // Required: Text to be used inside of the badge
// variant: 'info', // Optional: The variant of the badge, maps to GitLab UI variants // // variant: 'info', // Optional: The variant of the badge, maps to GitLab UI variants
}, // },
// Each row can have its own link that will take the user elsewhere // Each row can have its own link that will take the user elsewhere
// link: { // link: {
// href: 'https://google.com', // Required: href for the link // href: 'https://google.com', // Required: href for the link
......
...@@ -109,3 +109,12 @@ ...@@ -109,3 +109,12 @@
} }
} }
} }
// TODO: Move to GitLab UI
.mr-extenson-scrim {
background: linear-gradient(to bottom, rgba($gray-light, 0), rgba($gray-light, 1));
.gl-dark & {
background: linear-gradient(to bottom, rgba(#333, 0), rgba(#333, 1));
}
}
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