Commit 00d8c820 authored by Vitaly Slobodin's avatar Vitaly Slobodin

Update slot usages in the code base

We forced all slot names to be kebas-cased.

In order to reflect that we also need to update

all slot names across the code base.
parent 0d0efbad
...@@ -66,7 +66,7 @@ export default { ...@@ -66,7 +66,7 @@ export default {
<template> <template>
<div class="js-file-title file-title-flex-parent"> <div class="js-file-title file-title-flex-parent">
<blob-filepath :blob="blob"> <blob-filepath :blob="blob">
<template #filepathPrepend> <template #filepath-prepend>
<slot name="prepend"></slot> <slot name="prepend"></slot>
</template> </template>
</blob-filepath> </blob-filepath>
......
...@@ -549,8 +549,8 @@ export default { ...@@ -549,8 +549,8 @@ export default {
@set="setKnativeDomain" @set="setKnativeDomain"
/> />
</template> </template>
<template v-if="cloudRun" #installedVia> <template v-if="cloudRun" #installed-via>
<span data-testid="installedVia"> <span data-testid="installed-via">
<gl-sprintf <gl-sprintf
:message="s__('ClusterIntegration|installed via %{linkStart}Cloud Run%{linkEnd}')" :message="s__('ClusterIntegration|installed via %{linkStart}Cloud Run%{linkEnd}')"
> >
......
...@@ -210,7 +210,7 @@ export default { ...@@ -210,7 +210,7 @@ export default {
:class="{ 'gl-bg-blue-50': isDiscussionActive }" :class="{ 'gl-bg-blue-50': isDiscussionActive }"
@error="$emit('update-note-error', $event)" @error="$emit('update-note-error', $event)"
> >
<template v-if="discussion.resolvable" #resolveDiscussion> <template v-if="discussion.resolvable" #resolve-discussion>
<button <button
v-gl-tooltip v-gl-tooltip
:class="{ 'is-active': discussion.resolved }" :class="{ 'is-active': discussion.resolved }"
...@@ -224,7 +224,7 @@ export default { ...@@ -224,7 +224,7 @@ export default {
<gl-loading-icon v-else inline /> <gl-loading-icon v-else inline />
</button> </button>
</template> </template>
<template v-if="discussion.resolved" #resolvedStatus> <template v-if="discussion.resolved" #resolved-status>
<p class="gl-text-gray-500 gl-font-sm gl-m-0 gl-mt-5" data-testid="resolved-message"> <p class="gl-text-gray-500 gl-font-sm gl-m-0 gl-mt-5" data-testid="resolved-message">
{{ __('Resolved by') }} {{ __('Resolved by') }}
<gl-link <gl-link
...@@ -277,7 +277,7 @@ export default { ...@@ -277,7 +277,7 @@ export default {
@submit-form="mutate" @submit-form="mutate"
@cancel-form="hideForm" @cancel-form="hideForm"
> >
<template v-if="discussion.resolvable" #resolveCheckbox> <template v-if="discussion.resolvable" #resolve-checkbox>
<label data-testid="resolve-checkbox"> <label data-testid="resolve-checkbox">
<input v-model="shouldChangeResolvedStatus" type="checkbox" /> <input v-model="shouldChangeResolvedStatus" type="checkbox" />
{{ resolveCheckboxText }} {{ resolveCheckboxText }}
......
...@@ -383,7 +383,7 @@ export default { ...@@ -383,7 +383,7 @@ export default {
@toggleResolvedComments="toggleResolvedComments" @toggleResolvedComments="toggleResolvedComments"
@todoError="onTodoError" @todoError="onTodoError"
> >
<template #replyForm> <template #reply-form>
<apollo-mutation <apollo-mutation
v-if="isAnnotating" v-if="isAnnotating"
#default="{ mutate, loading }" #default="{ mutate, loading }"
......
...@@ -228,7 +228,7 @@ export default { ...@@ -228,7 +228,7 @@ export default {
:deploy-boards-help-path="deployBoardsHelpPath" :deploy-boards-help-path="deployBoardsHelpPath"
@onChangePage="onChangePage" @onChangePage="onChangePage"
> >
<template v-if="!isLoading && state.environments.length === 0" #emptyState> <template v-if="!isLoading && state.environments.length === 0" #empty-state>
<empty-state :help-path="helpPagePath" /> <empty-state :help-path="helpPagePath" />
</template> </template>
</container> </container>
......
...@@ -419,7 +419,7 @@ export default { ...@@ -419,7 +419,7 @@ export default {
</template> </template>
</gl-table> </gl-table>
</template> </template>
<template #emtpy-state> <template #empty-state>
<gl-empty-state <gl-empty-state
:title="emptyStateData.title" :title="emptyStateData.title"
:svg-path="emptyListSvgPath" :svg-path="emptyListSvgPath"
......
...@@ -423,7 +423,7 @@ export default { ...@@ -423,7 +423,7 @@ export default {
:prometheus-alerts-available="prometheusAlertsAvailable" :prometheus-alerts-available="prometheusAlertsAvailable"
@timerangezoom="onTimeRangeZoom" @timerangezoom="onTimeRangeZoom"
> >
<template #topLeft> <template #top-left>
<gl-button <gl-button
ref="goBackBtn" ref="goBackBtn"
v-gl-tooltip v-gl-tooltip
......
...@@ -134,7 +134,7 @@ export default { ...@@ -134,7 +134,7 @@ export default {
class="mr-widget-section grouped-security-reports mr-report" class="mr-widget-section grouped-security-reports mr-report"
@toggleEvent="handleToggleEvent" @toggleEvent="handleToggleEvent"
> >
<template v-if="showViewFullReport" #actionButtons> <template v-if="showViewFullReport" #action-buttons>
<gl-button <gl-button
:href="testTabURL" :href="testTabURL"
target="_blank" target="_blank"
...@@ -145,7 +145,7 @@ export default { ...@@ -145,7 +145,7 @@ export default {
{{ s__('ciReport|View full report') }} {{ s__('ciReport|View full report') }}
</gl-button> </gl-button>
</template> </template>
<template v-if="hasRecentFailures(summary)" #subHeading> <template v-if="hasRecentFailures(summary)" #sub-heading>
{{ recentFailuresText(summary) }} {{ recentFailuresText(summary) }}
</template> </template>
<template #body> <template #body>
......
...@@ -308,6 +308,6 @@ export default { ...@@ -308,6 +308,6 @@ export default {
@input="handlePageChange" @input="handlePageChange"
/> />
<slot v-if="!showItems" name="emtpy-state"></slot> <slot v-if="!showItems" name="empty-state"></slot>
</div> </div>
</template> </template>
...@@ -147,7 +147,7 @@ export default { ...@@ -147,7 +147,7 @@ export default {
</gl-link> </gl-link>
</template> </template>
<template #subheading> <template #sub-heading>
{{ $options.i18n.analyzersSubHeading }} {{ $options.i18n.analyzersSubHeading }}
</template> </template>
......
...@@ -39,8 +39,8 @@ export default { ...@@ -39,8 +39,8 @@ export default {
<component :is="headingTag" class="gl-font-size-h2 gl-mt-0" data-testid="heading"> <component :is="headingTag" class="gl-font-size-h2 gl-mt-0" data-testid="heading">
<slot name="heading"></slot> <slot name="heading"></slot>
</component> </component>
<p class="gl-mb-0" data-testid="subheading"> <p class="gl-mb-0" data-testid="sub-heading">
<slot name="subheading"></slot> <slot name="sub-heading"></slot>
</p> </p>
</div> </div>
......
...@@ -186,7 +186,7 @@ export default { ...@@ -186,7 +186,7 @@ export default {
</span> </span>
</h5> </h5>
</template> </template>
<template #subTitle> <template #sub-title>
<p class="gl-m-0 gl-ml-7 gl-pb-2 gl-text-gray-500">{{ severityGroup.warning }}</p> <p class="gl-m-0 gl-ml-7 gl-pb-2 gl-text-gray-500">{{ severityGroup.warning }}</p>
</template> </template>
<div class="gl-ml-7 gl-pb-3"> <div class="gl-ml-7 gl-pb-3">
......
...@@ -118,7 +118,7 @@ export default { ...@@ -118,7 +118,7 @@ export default {
:loading-error-illustrations="loadingErrorIllustrations" :loading-error-illustrations="loadingErrorIllustrations"
:security-report-summary="securityReportSummary" :security-report-summary="securityReportSummary"
> >
<template #emptyState> <template #empty-state>
<gl-empty-state v-bind="emptyStateProps" /> <gl-empty-state v-bind="emptyStateProps" />
</template> </template>
</security-dashboard> </security-dashboard>
......
...@@ -129,7 +129,7 @@ export default { ...@@ -129,7 +129,7 @@ export default {
</template> </template>
<security-dashboard-table> <security-dashboard-table>
<template #emptyState> <template #empty-state>
<slot name="empty-state"></slot> <slot name="empty-state"></slot>
</template> </template>
</security-dashboard-table> </security-dashboard-table>
......
...@@ -179,7 +179,7 @@ export default { ...@@ -179,7 +179,7 @@ export default {
</gl-link> </gl-link>
</div> </div>
</template> </template>
<div v-if="showActionButtons" slot="actionButtons" class="gl-mr-3"> <div v-if="showActionButtons" slot="action-buttons" class="gl-mr-3">
<a <a
v-if="licenseManagementSettingsPath" v-if="licenseManagementSettingsPath"
:class="{ 'gl-mr-3': fullReportPath }" :class="{ 'gl-mr-3': fullReportPath }"
......
...@@ -401,7 +401,7 @@ export default { ...@@ -401,7 +401,7 @@ export default {
<security-summary :key="slot" :message="groupedSummaryText" /> <security-summary :key="slot" :message="groupedSummaryText" />
</template> </template>
<template v-if="pipelinePath" #actionButtons> <template v-if="pipelinePath" #action-buttons>
<gl-button <gl-button
:href="securityTab" :href="securityTab"
target="_blank" target="_blank"
...@@ -412,7 +412,7 @@ export default { ...@@ -412,7 +412,7 @@ export default {
</gl-button> </gl-button>
</template> </template>
<template v-if="isMRActive && isBaseSecurityReportOutOfDate" #subHeading> <template v-if="isMRActive && isBaseSecurityReportOutOfDate" #sub-heading>
<div class="text-secondary-700 text-1"> <div class="text-secondary-700 text-1">
<gl-sprintf <gl-sprintf
v-if="isMRBranchOutdated" v-if="isMRBranchOutdated"
......
...@@ -264,7 +264,7 @@ export default { ...@@ -264,7 +264,7 @@ export default {
<template #headerText> <template #headerText>
{{ $options.i18n.relatedIssues }} {{ $options.i18n.relatedIssues }}
</template> </template>
<template v-if="canCreateIssue" #headerActions> <template v-if="canCreateIssue" #header-actions>
<gl-button <gl-button
ref="createIssue" ref="createIssue"
variant="success" variant="success"
......
...@@ -10,7 +10,7 @@ describe('ExpandableSection component', () => { ...@@ -10,7 +10,7 @@ describe('ExpandableSection component', () => {
const findButton = () => wrapper.find('button'); const findButton = () => wrapper.find('button');
const findHeading = () => wrapper.find('[data-testid="heading"]'); const findHeading = () => wrapper.find('[data-testid="heading"]');
const findSubHeading = () => wrapper.find('[data-testid="subheading"]'); const findSubHeading = () => wrapper.find('[data-testid="sub-heading"]');
const findContent = () => wrapper.find('[data-testid="content"]'); const findContent = () => wrapper.find('[data-testid="content"]');
afterEach(() => { afterEach(() => {
...@@ -50,7 +50,7 @@ describe('ExpandableSection component', () => { ...@@ -50,7 +50,7 @@ describe('ExpandableSection component', () => {
describe('subheading slot', () => { describe('subheading slot', () => {
beforeEach(() => { beforeEach(() => {
createComponent({ createComponent({
slots: { subheading: 'some subheading' }, slots: { 'sub-heading': 'some subheading' },
}); });
}); });
......
...@@ -98,7 +98,7 @@ describe('Pipeline Security Dashboard component', () => { ...@@ -98,7 +98,7 @@ describe('Pipeline Security Dashboard component', () => {
beforeEach(() => { beforeEach(() => {
factory({ factory({
stubs: { stubs: {
'security-dashboard': { template: '<div><slot name="emptyState"></slot></div>' }, 'security-dashboard': { template: '<div><slot name="empty-state"></slot></div>' },
}, },
}); });
}); });
......
...@@ -118,7 +118,7 @@ describe('Security Dashboard Table', () => { ...@@ -118,7 +118,7 @@ describe('Security Dashboard Table', () => {
localVue, localVue,
store, store,
slots: { slots: {
emptyState: '<div class="customEmptyState">Hello World</div>', 'empty-state': '<div class="customEmptyState">Hello World</div>',
}, },
}); });
......
...@@ -65,7 +65,7 @@ describe('Blob Header Filepath', () => { ...@@ -65,7 +65,7 @@ describe('Blob Header Filepath', () => {
{}, {},
{ {
scopedSlots: { scopedSlots: {
filepathPrepend: `<span>${slotContent}</span>`, 'filepath-prepend': `<span>${slotContent}</span>`,
}, },
}, },
); );
......
...@@ -73,7 +73,7 @@ exports[`Applications Ingress application shows the correct warning message 1`] ...@@ -73,7 +73,7 @@ exports[`Applications Ingress application shows the correct warning message 1`]
exports[`Applications Knative application shows the correct description 1`] = ` exports[`Applications Knative application shows the correct description 1`] = `
<span <span
data-testid="installedVia" data-testid="installed-via"
> >
installed via installed via
<a <a
......
...@@ -429,7 +429,7 @@ describe('Applications', () => { ...@@ -429,7 +429,7 @@ describe('Applications', () => {
await wrapper.vm.$nextTick(); await wrapper.vm.$nextTick();
expect(findByTestId('installedVia').element).toMatchSnapshot(); expect(findByTestId('installed-via').element).toMatchSnapshot();
}); });
it('emits saveKnativeDomain event when knative domain editor emits save event', () => { it('emits saveKnativeDomain event when knative domain editor emits save event', () => {
......
...@@ -56,7 +56,7 @@ describe('RelatedIssuesBlock', () => { ...@@ -56,7 +56,7 @@ describe('RelatedIssuesBlock', () => {
pathIdSeparator: PathIdSeparator.Issue, pathIdSeparator: PathIdSeparator.Issue,
issuableType: 'issue', issuableType: 'issue',
}, },
slots: { headerText }, slots: { 'header-text': headerText },
}); });
expect(wrapper.find('.card-title').html()).toContain(headerText); expect(wrapper.find('.card-title').html()).toContain(headerText);
...@@ -72,7 +72,7 @@ describe('RelatedIssuesBlock', () => { ...@@ -72,7 +72,7 @@ describe('RelatedIssuesBlock', () => {
pathIdSeparator: PathIdSeparator.Issue, pathIdSeparator: PathIdSeparator.Issue,
issuableType: 'issue', issuableType: 'issue',
}, },
slots: { headerActions }, slots: { 'header-actions': headerActions },
}); });
expect(wrapper.find('[data-testid="custom-button"]').html()).toBe(headerActions); expect(wrapper.find('[data-testid="custom-button"]').html()).toBe(headerActions);
......
...@@ -106,7 +106,7 @@ describe('Dashboard Panel', () => { ...@@ -106,7 +106,7 @@ describe('Dashboard Panel', () => {
{}, {},
{ {
slots: { slots: {
topLeft: `<div class="top-left-content">OK</div>`, 'top-left': `<div class="top-left-content">OK</div>`,
}, },
}, },
); );
......
...@@ -508,7 +508,7 @@ describe('Dashboard', () => { ...@@ -508,7 +508,7 @@ describe('Dashboard', () => {
const mockKeyup = key => window.dispatchEvent(new KeyboardEvent('keyup', { key })); const mockKeyup = key => window.dispatchEvent(new KeyboardEvent('keyup', { key }));
const MockPanel = { const MockPanel = {
template: `<div><slot name="topLeft"/></div>`, template: `<div><slot name="top-left"/></div>`,
}; };
beforeEach(() => { beforeEach(() => {
......
...@@ -244,7 +244,7 @@ describe('Report section', () => { ...@@ -244,7 +244,7 @@ describe('Report section', () => {
hasIssues: true, hasIssues: true,
}, },
slots: { slots: {
actionButtons: ['Action!'], 'action-buttons': ['Action!'],
}, },
}); });
}); });
......
...@@ -70,7 +70,7 @@ describe('AlertManagementEmptyState', () => { ...@@ -70,7 +70,7 @@ describe('AlertManagementEmptyState', () => {
...props, ...props,
}, },
slots: { slots: {
'emtpy-state': EmptyStateSlot, 'empty-state': EmptyStateSlot,
'header-actions': HeaderActionsSlot, 'header-actions': HeaderActionsSlot,
title: TitleSlot, title: TitleSlot,
table: TableSlot, table: TableSlot,
......
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