Commit a42b2270 authored by Phil Hughes's avatar Phil Hughes

Merge branch 'fix-vue-no-lone-template' into 'master'

Fix vue/no-lone-template violations

See merge request gitlab-org/gitlab!51393
parents 05a199dc 260cbd35
...@@ -51,7 +51,6 @@ rules: ...@@ -51,7 +51,6 @@ rules:
# new ones, to ease migration to v7, so violations of each can be fixed # new ones, to ease migration to v7, so violations of each can be fixed
# separately. # separately.
vue/no-mutating-props: off vue/no-mutating-props: off
vue/no-lone-template: off
# END eslint-plugin-vue@7 overrides # END eslint-plugin-vue@7 overrides
overrides: overrides:
- files: - files:
......
...@@ -88,15 +88,13 @@ export default { ...@@ -88,15 +88,13 @@ export default {
</gl-button> </gl-button>
</div> </div>
</template> </template>
<template> <gl-datepicker
<gl-datepicker ref="datePicker"
ref="datePicker" :value="parsedDueDate"
:value="parsedDueDate" show-clear-button
show-clear-button @input="setDueDate"
@input="setDueDate" @clear="setDueDate(null)"
@clear="setDueDate(null)" />
/>
</template>
</board-editable-item> </board-editable-item>
</template> </template>
<style> <style>
......
...@@ -136,36 +136,34 @@ export default { ...@@ -136,36 +136,34 @@ export default {
<template #collapsed> <template #collapsed>
<span class="gl-text-gray-800">{{ issue.referencePath }}</span> <span class="gl-text-gray-800">{{ issue.referencePath }}</span>
</template> </template>
<template> <gl-alert v-if="showChangesAlert" variant="warning" class="gl-mb-5" :dismissible="false">
<gl-alert v-if="showChangesAlert" variant="warning" class="gl-mb-5" :dismissible="false"> {{ $options.i18n.reviewYourChanges }}
{{ $options.i18n.reviewYourChanges }} </gl-alert>
</gl-alert> <gl-form @submit.prevent="setTitle">
<gl-form @submit.prevent="setTitle"> <gl-form-group :invalid-feedback="$options.i18n.invalidFeedback" :state="validationState">
<gl-form-group :invalid-feedback="$options.i18n.invalidFeedback" :state="validationState"> <gl-form-input
<gl-form-input v-model="title"
v-model="title" v-autofocusonshow
v-autofocusonshow :placeholder="$options.i18n.issueTitlePlaceholder"
:placeholder="$options.i18n.issueTitlePlaceholder" :state="validationState"
:state="validationState" />
/> </gl-form-group>
</gl-form-group>
<div class="gl-display-flex gl-w-full gl-justify-content-space-between gl-mt-5"> <div class="gl-display-flex gl-w-full gl-justify-content-space-between gl-mt-5">
<gl-button <gl-button
variant="success" variant="success"
size="small" size="small"
data-testid="submit-button" data-testid="submit-button"
:disabled="!title" :disabled="!title"
@click="setTitle" @click="setTitle"
> >
{{ $options.i18n.submitButton }} {{ $options.i18n.submitButton }}
</gl-button> </gl-button>
<gl-button size="small" data-testid="cancel-button" @click="cancel"> <gl-button size="small" data-testid="cancel-button" @click="cancel">
{{ $options.i18n.cancelButton }} {{ $options.i18n.cancelButton }}
</gl-button> </gl-button>
</div> </div>
</gl-form> </gl-form>
</template>
</board-editable-item> </board-editable-item>
</template> </template>
...@@ -122,40 +122,38 @@ export default { ...@@ -122,40 +122,38 @@ export default {
<template v-if="hasMilestone" #collapsed> <template v-if="hasMilestone" #collapsed>
<strong class="gl-text-gray-900">{{ activeIssue.milestone.title }}</strong> <strong class="gl-text-gray-900">{{ activeIssue.milestone.title }}</strong>
</template> </template>
<template> <gl-dropdown
<gl-dropdown ref="dropdown"
ref="dropdown" :text="dropdownText"
:text="dropdownText" :header-text="$options.i18n.assignMilestone"
:header-text="$options.i18n.assignMilestone" block
block >
<gl-search-box-by-type ref="search" v-model.trim="searchTitle" class="gl-m-3" />
<gl-dropdown-item
data-testid="no-milestone-item"
:is-check-item="true"
:is-checked="!activeIssue.milestone"
@click="setMilestone(null)"
> >
<gl-search-box-by-type ref="search" v-model.trim="searchTitle" class="gl-m-3" /> {{ $options.i18n.noMilestone }}
</gl-dropdown-item>
<gl-dropdown-divider />
<gl-loading-icon v-if="$apollo.loading" class="gl-py-4" />
<template v-else-if="milestones.length > 0">
<gl-dropdown-item <gl-dropdown-item
data-testid="no-milestone-item" v-for="milestone in milestones"
:key="milestone.id"
:is-check-item="true" :is-check-item="true"
:is-checked="!activeIssue.milestone" :is-checked="activeIssue.milestone && milestone.id === activeIssue.milestone.id"
@click="setMilestone(null)" data-testid="milestone-item"
@click="setMilestone(milestone.id)"
> >
{{ $options.i18n.noMilestone }} {{ milestone.title }}
</gl-dropdown-item> </gl-dropdown-item>
<gl-dropdown-divider /> </template>
<gl-loading-icon v-if="$apollo.loading" class="gl-py-4" /> <gl-dropdown-text v-else data-testid="no-milestones-found">
<template v-else-if="milestones.length > 0"> {{ $options.i18n.noMilestonesFound }}
<gl-dropdown-item </gl-dropdown-text>
v-for="milestone in milestones" </gl-dropdown>
:key="milestone.id"
:is-check-item="true"
:is-checked="activeIssue.milestone && milestone.id === activeIssue.milestone.id"
data-testid="milestone-item"
@click="setMilestone(milestone.id)"
>
{{ milestone.title }}
</gl-dropdown-item>
</template>
<gl-dropdown-text v-else data-testid="no-milestones-found">
{{ $options.i18n.noMilestonesFound }}
</gl-dropdown-text>
</gl-dropdown>
</template>
</board-editable-item> </board-editable-item>
</template> </template>
...@@ -131,48 +131,46 @@ export default { ...@@ -131,48 +131,46 @@ export default {
:title="modalTitle" :title="modalTitle"
kind="danger" kind="danger"
> >
<template> <p>{{ warningMessage }}</p>
<p>{{ warningMessage }}</p> <div v-if="confirmCleanup">
<div v-if="confirmCleanup"> {{ s__('ClusterIntegration|This will permanently delete the following resources:') }}
{{ s__('ClusterIntegration|This will permanently delete the following resources:') }} <ul>
<ul> <li>
<li> {{ s__('ClusterIntegration|All installed applications and related resources') }}
{{ s__('ClusterIntegration|All installed applications and related resources') }} </li>
</li> <li>
<li> <gl-sprintf :message="s__('ClusterIntegration|The %{gitlabNamespace} namespace')">
<gl-sprintf :message="s__('ClusterIntegration|The %{gitlabNamespace} namespace')"> <template #gitlabNamespace>
<template #gitlabNamespace> <!-- eslint-disable-next-line @gitlab/vue-require-i18n-strings -->
<!-- eslint-disable-next-line @gitlab/vue-require-i18n-strings --> <code>{{ 'gitlab-managed-apps' }}</code>
<code>{{ 'gitlab-managed-apps' }}</code> </template>
</template> </gl-sprintf>
</gl-sprintf> </li>
</li> <li>{{ s__('ClusterIntegration|Any project namespaces') }}</li>
<li>{{ s__('ClusterIntegration|Any project namespaces') }}</li> <!-- eslint-disable @gitlab/vue-require-i18n-strings -->
<!-- eslint-disable @gitlab/vue-require-i18n-strings --> <li><code>clusterroles</code></li>
<li><code>clusterroles</code></li> <li><code>clusterrolebindings</code></li>
<li><code>clusterrolebindings</code></li> <!-- eslint-enable @gitlab/vue-require-i18n-strings -->
<!-- eslint-enable @gitlab/vue-require-i18n-strings --> </ul>
</ul> </div>
</div> <strong v-html="confirmationTextLabel"></strong>
<strong v-html="confirmationTextLabel"></strong> <form ref="form" :action="clusterPath" method="post" class="gl-mb-5">
<form ref="form" :action="clusterPath" method="post" class="gl-mb-5"> <input ref="method" type="hidden" name="_method" value="delete" />
<input ref="method" type="hidden" name="_method" value="delete" /> <input :value="csrfToken" type="hidden" name="authenticity_token" />
<input :value="csrfToken" type="hidden" name="authenticity_token" /> <input ref="cleanup" type="hidden" name="cleanup" value="true" />
<input ref="cleanup" type="hidden" name="cleanup" value="true" /> <gl-form-input
<gl-form-input v-model="enteredClusterName"
v-model="enteredClusterName" autofocus
autofocus type="text"
type="text" name="confirm_cluster_name_input"
name="confirm_cluster_name_input" autocomplete="off"
autocomplete="off" />
/> </form>
</form> <span v-if="confirmCleanup">{{
<span v-if="confirmCleanup">{{ s__(
s__( 'ClusterIntegration|If you do not wish to delete all associated GitLab resources, you can simply remove the integration.',
'ClusterIntegration|If you do not wish to delete all associated GitLab resources, you can simply remove the integration.', )
) }}</span>
}}</span>
</template>
<template #modal-footer> <template #modal-footer>
<gl-button variant="secondary" @click="handleCancel">{{ s__('Cancel') }}</gl-button> <gl-button variant="secondary" @click="handleCancel">{{ s__('Cancel') }}</gl-button>
<template v-if="confirmCleanup"> <template v-if="confirmCleanup">
......
...@@ -68,41 +68,39 @@ export default { ...@@ -68,41 +68,39 @@ export default {
<span data-testid="feature-flags-tab-title">{{ title }}</span> <span data-testid="feature-flags-tab-title">{{ title }}</span>
<gl-badge size="sm" class="gl-tab-counter-badge">{{ itemCount }}</gl-badge> <gl-badge size="sm" class="gl-tab-counter-badge">{{ itemCount }}</gl-badge>
</template> </template>
<template> <gl-alert
<gl-alert v-for="(message, index) in alerts"
v-for="(message, index) in alerts" :key="index"
:key="index" data-testid="serverErrors"
data-testid="serverErrors" variant="danger"
variant="danger" @dismiss="clearAlert(index)"
@dismiss="clearAlert(index)" >
> {{ message }}
{{ message }} </gl-alert>
</gl-alert>
<gl-loading-icon v-if="isLoading" :label="loadingLabel" size="md" class="gl-mt-4" /> <gl-loading-icon v-if="isLoading" :label="loadingLabel" size="md" class="gl-mt-4" />
<gl-empty-state <gl-empty-state
v-else-if="errorState" v-else-if="errorState"
:title="errorTitle" :title="errorTitle"
:description="s__(`FeatureFlags|Try again in a few moments or contact your support team.`)" :description="s__(`FeatureFlags|Try again in a few moments or contact your support team.`)"
:svg-path="errorStateSvgPath" :svg-path="errorStateSvgPath"
data-testid="error-state" data-testid="error-state"
/> />
<gl-empty-state <gl-empty-state
v-else-if="emptyState" v-else-if="emptyState"
:title="emptyTitle" :title="emptyTitle"
:svg-path="errorStateSvgPath" :svg-path="errorStateSvgPath"
data-testid="empty-state" data-testid="empty-state"
> >
<template #description> <template #description>
{{ emptyDescription }} {{ emptyDescription }}
<gl-link :href="featureFlagsHelpPagePath" target="_blank"> <gl-link :href="featureFlagsHelpPagePath" target="_blank">
{{ s__('FeatureFlags|More information') }} {{ s__('FeatureFlags|More information') }}
</gl-link> </gl-link>
</template> </template>
</gl-empty-state> </gl-empty-state>
<slot> </slot> <slot> </slot>
</template>
</gl-tab> </gl-tab>
</template> </template>
...@@ -201,9 +201,7 @@ export default { ...@@ -201,9 +201,7 @@ export default {
/> />
<template v-else>{{ clusterNameOrLink.name }}</template> <template v-else>{{ clusterNameOrLink.name }}</template>
</template> </template>
<template #kubernetesNamespace> <template #kubernetesNamespace>{{ kubernetesNamespace }}</template>
<template>{{ kubernetesNamespace }}</template>
</template>
<template #deploymentLink> <template #deploymentLink>
<gl-link <gl-link
:href="deploymentLink.path" :href="deploymentLink.path"
......
...@@ -85,38 +85,36 @@ export default { ...@@ -85,38 +85,36 @@ export default {
<template> <template>
<gl-modal ref="modal" modal-id="delete-user-modal" :title="modalTitle" kind="danger"> <gl-modal ref="modal" modal-id="delete-user-modal" :title="modalTitle" kind="danger">
<template> <p>
<p> <gl-sprintf :message="content">
<gl-sprintf :message="content"> <template #username>
<template #username> <strong>{{ username }}</strong>
<strong>{{ username }}</strong> </template>
</template> <template #strong="props">
<template #strong="props"> <strong>{{ props.content }}</strong>
<strong>{{ props.content }}</strong> </template>
</template> </gl-sprintf>
</gl-sprintf> </p>
</p>
<p> <p>
<gl-sprintf :message="s__('AdminUsers|To confirm, type %{username}')"> <gl-sprintf :message="s__('AdminUsers|To confirm, type %{username}')">
<template #username> <template #username>
<code>{{ username }}</code> <code>{{ username }}</code>
</template> </template>
</gl-sprintf> </gl-sprintf>
</p> </p>
<form ref="form" :action="deleteUserUrl" method="post" @submit.prevent> <form ref="form" :action="deleteUserUrl" method="post" @submit.prevent>
<input ref="method" type="hidden" name="_method" value="delete" /> <input ref="method" type="hidden" name="_method" value="delete" />
<input :value="csrfToken" type="hidden" name="authenticity_token" /> <input :value="csrfToken" type="hidden" name="authenticity_token" />
<gl-form-input <gl-form-input
v-model="enteredUsername" v-model="enteredUsername"
autofocus autofocus
type="text" type="text"
name="username" name="username"
autocomplete="off" autocomplete="off"
/> />
</form> </form>
</template>
<template #modal-footer> <template #modal-footer>
<gl-button @click="onCancel">{{ s__('Cancel') }}</gl-button> <gl-button @click="onCancel">{{ s__('Cancel') }}</gl-button>
<gl-button <gl-button
......
...@@ -123,17 +123,15 @@ export default { ...@@ -123,17 +123,15 @@ export default {
:width="`${containerMeasurements.width}px`" :width="`${containerMeasurements.width}px`"
:height="`${containerMeasurements.height}px`" :height="`${containerMeasurements.height}px`"
> >
<template> <path
<path v-for="link in links"
v-for="link in links" :key="link.path"
:key="link.path" :ref="link.ref"
:ref="link.ref" :d="link.path"
:d="link.path" class="gl-fill-transparent gl-transition-duration-slow gl-transition-timing-function-ease"
class="gl-fill-transparent gl-transition-duration-slow gl-transition-timing-function-ease" :class="getLinkClasses(link)"
:class="getLinkClasses(link)" :stroke-width="$options.STROKE_WIDTH"
:stroke-width="$options.STROKE_WIDTH" />
/>
</template>
</svg> </svg>
<slot></slot> <slot></slot>
</div> </div>
......
...@@ -224,17 +224,15 @@ export default { ...@@ -224,17 +224,15 @@ export default {
data-testid="graph-container" data-testid="graph-container"
> >
<svg :viewBox="viewBox" :width="width" :height="height" class="gl-absolute"> <svg :viewBox="viewBox" :width="width" :height="height" class="gl-absolute">
<template> <path
<path v-for="link in links"
v-for="link in links" :key="link.path"
:key="link.path" :ref="link.ref"
:ref="link.ref" :d="link.path"
:d="link.path" class="gl-fill-transparent gl-transition-duration-slow gl-transition-timing-function-ease"
class="gl-fill-transparent gl-transition-duration-slow gl-transition-timing-function-ease" :class="getLinkClasses(link)"
:class="getLinkClasses(link)" :stroke-width="$options.STROKE_WIDTH"
:stroke-width="$options.STROKE_WIDTH" />
/>
</template>
</svg> </svg>
<div <div
v-for="(stage, index) in pipelineStages" v-for="(stage, index) in pipelineStages"
......
...@@ -69,18 +69,16 @@ export default { ...@@ -69,18 +69,16 @@ export default {
<div v-else-if="isInstalled"> <div v-else-if="isInstalled">
<div v-if="hasFunctionData"> <div v-if="hasFunctionData">
<template> <div class="groups-list-tree-container js-functions-wrapper">
<div class="groups-list-tree-container js-functions-wrapper"> <ul class="content-list group-list-tree">
<ul class="content-list group-list-tree"> <environment-row
<environment-row v-for="(env, index) in getFunctions"
v-for="(env, index) in getFunctions" :key="index"
:key="index" :env="env"
:env="env" :env-name="index"
:env-name="index" />
/> </ul>
</ul> </div>
</div>
</template>
<gl-loading-icon v-if="isLoading" size="lg" class="gl-mt-3 gl-mb-3 js-functions-loader" /> <gl-loading-icon v-if="isLoading" size="lg" class="gl-mt-3 gl-mb-3 js-functions-loader" />
</div> </div>
<div v-else class="empty-state js-empty-state"> <div v-else class="empty-state js-empty-state">
......
...@@ -22,11 +22,6 @@ export default { ...@@ -22,11 +22,6 @@ export default {
<template> <template>
<gl-drawer class="gl-pt-8" :open="isOpen" @close="$emit('close')"> <gl-drawer class="gl-pt-8" :open="isOpen" @close="$emit('close')">
<template #header>{{ __('Page settings') }}</template> <template #header>{{ __('Page settings') }}</template>
<template> <front-matter-controls :settings="settings" @updateSettings="$emit('updateSettings', $event)" />
<front-matter-controls
:settings="settings"
@updateSettings="$emit('updateSettings', $event)"
/>
</template>
</gl-drawer> </gl-drawer>
</template> </template>
...@@ -36,10 +36,8 @@ export default { ...@@ -36,10 +36,8 @@ export default {
aria-expanded="false" aria-expanded="false"
> >
<gl-loading-icon v-show="isLoading" :inline="true" /> <gl-loading-icon v-show="isLoading" :inline="true" />
<template> <slot v-if="$slots.default"></slot>
<slot v-if="$slots.default"></slot> <span v-else class="dropdown-toggle-text"> {{ toggleText }} </span>
<span v-else class="dropdown-toggle-text"> {{ toggleText }} </span>
</template>
<gl-icon <gl-icon
v-show="!isLoading" v-show="!isLoading"
class="gl-absolute gl-top-3 gl-right-3 gl-text-gray-500" class="gl-absolute gl-top-3 gl-right-3 gl-text-gray-500"
......
...@@ -60,9 +60,7 @@ export default { ...@@ -60,9 +60,7 @@ export default {
</div> </div>
<span v-if="canAttachFile" class="uploading-container"> <span v-if="canAttachFile" class="uploading-container">
<span class="uploading-progress-container hide"> <span class="uploading-progress-container hide">
<template> <gl-icon name="media" />
<gl-icon name="media" />
</template>
<span class="attaching-file-message"></span> <span class="attaching-file-message"></span>
<!-- eslint-disable-next-line @gitlab/vue-require-i18n-strings --> <!-- eslint-disable-next-line @gitlab/vue-require-i18n-strings -->
<span class="uploading-progress">0%</span> <span class="uploading-progress">0%</span>
......
...@@ -144,40 +144,38 @@ export default { ...@@ -144,40 +144,38 @@ export default {
</slot> </slot>
</template> </template>
<template> <slot name="label-dropdown-list-header">
<slot name="label-dropdown-list-header"> <gl-dropdown-section-header>{{ __('Select a label') }} </gl-dropdown-section-header>
<gl-dropdown-section-header>{{ __('Select a label') }} </gl-dropdown-section-header> </slot>
</slot> <div class="mb-3 px-3">
<div class="mb-3 px-3"> <gl-search-box-by-type v-model.trim="searchTerm" />
<gl-search-box-by-type v-model.trim="searchTerm" /> </div>
<div class="mb-3 px-3">
<gl-dropdown-item
v-for="label in labels"
:key="label.id"
:class="{
'pl-4': multiselect && !isSelectedLabel(label.id),
'cursor-not-allowed': disabled,
}"
:active="isSelectedLabel(label.id)"
@click.prevent="$emit('selectLabel', label.id, selectedLabelIds)"
>
<gl-icon
v-if="multiselect && isSelectedLabel(label.id)"
class="text-gray-700 mr-1 vertical-align-middle"
name="mobile-issue-close"
/>
<span :style="{ backgroundColor: label.color }" class="d-inline-block dropdown-label-box">
</span>
{{ labelTitle(label) }}
</gl-dropdown-item>
<div v-show="loading" class="text-center">
<gl-loading-icon :inline="true" size="md" />
</div> </div>
<div class="mb-3 px-3"> <div v-show="noMatchingLabels" class="text-secondary">
<gl-dropdown-item {{ __('No matching labels') }}
v-for="label in labels"
:key="label.id"
:class="{
'pl-4': multiselect && !isSelectedLabel(label.id),
'cursor-not-allowed': disabled,
}"
:active="isSelectedLabel(label.id)"
@click.prevent="$emit('selectLabel', label.id, selectedLabelIds)"
>
<gl-icon
v-if="multiselect && isSelectedLabel(label.id)"
class="text-gray-700 mr-1 vertical-align-middle"
name="mobile-issue-close"
/>
<span :style="{ backgroundColor: label.color }" class="d-inline-block dropdown-label-box">
</span>
{{ labelTitle(label) }}
</gl-dropdown-item>
<div v-show="loading" class="text-center">
<gl-loading-icon :inline="true" size="md" />
</div>
<div v-show="noMatchingLabels" class="text-secondary">
{{ __('No matching labels') }}
</div>
</div> </div>
</template> </div>
</gl-dropdown> </gl-dropdown>
</template> </template>
...@@ -51,16 +51,14 @@ export default { ...@@ -51,16 +51,14 @@ export default {
> >
<template #header>{{ __('Issue details') }}</template> <template #header>{{ __('Issue details') }}</template>
<template> <board-sidebar-issue-title />
<board-sidebar-issue-title /> <board-assignee-dropdown />
<board-assignee-dropdown /> <board-sidebar-epic-select />
<board-sidebar-epic-select /> <board-sidebar-milestone-select />
<board-sidebar-milestone-select /> <board-sidebar-time-tracker class="swimlanes-sidebar-time-tracker" />
<board-sidebar-time-tracker class="swimlanes-sidebar-time-tracker" /> <board-sidebar-due-date />
<board-sidebar-due-date /> <board-sidebar-labels-select />
<board-sidebar-labels-select /> <board-sidebar-weight-input v-if="glFeatures.issueWeights" />
<board-sidebar-weight-input v-if="glFeatures.issueWeights" /> <board-sidebar-subscription />
<board-sidebar-subscription />
</template>
</gl-drawer> </gl-drawer>
</template> </template>
...@@ -81,18 +81,16 @@ export default { ...@@ -81,18 +81,16 @@ export default {
{{ storedEpic.title }} {{ storedEpic.title }}
</a> </a>
</template> </template>
<template> <epics-select
<epics-select ref="epicSelect"
ref="epicSelect" class="gl-w-full"
class="gl-w-full" :group-id="groupId"
:group-id="groupId" :can-edit="true"
:can-edit="true" :initial-epic="storedEpic"
:initial-epic="storedEpic" :initial-epic-loading="false"
:initial-epic-loading="false" variant="standalone"
variant="standalone" :show-header="false"
:show-header="false" @onEpicSelect="setEpic"
@onEpicSelect="setEpic" />
/>
</template>
</board-editable-item> </board-editable-item>
</template> </template>
...@@ -87,16 +87,14 @@ export default { ...@@ -87,16 +87,14 @@ export default {
</gl-button> </gl-button>
</div> </div>
</template> </template>
<template> <gl-form @submit.prevent="handleFormSubmit()">
<gl-form @submit.prevent="handleFormSubmit()"> <gl-form-input
<gl-form-input v-model.number="weight"
v-model.number="weight" v-autofocusonshow
v-autofocusonshow type="number"
type="number" min="0"
min="0" :placeholder="__('Enter a number')"
:placeholder="__('Enter a number')" />
/> </gl-form>
</gl-form>
</template>
</board-editable-item> </board-editable-item>
</template> </template>
...@@ -233,9 +233,7 @@ export default { ...@@ -233,9 +233,7 @@ export default {
@cancel="hideNodeActionModal" @cancel="hideNodeActionModal"
@ok="handleNodeAction" @ok="handleNodeAction"
> >
<template> {{ modalMessage }}
{{ modalMessage }}
</template>
</gl-modal> </gl-modal>
</div> </div>
</template> </template>
...@@ -144,10 +144,8 @@ export default { ...@@ -144,10 +144,8 @@ export default {
:options="$options.selectOptions" :options="$options.selectOptions"
/> />
</div> </div>
<template name="valid-feedback"> <template v-if="showValidFeedback" #description>
<gl-form-text v-show="showValidFeedback" class="gl-font-base gl-text-gray-400!"> {{ $options.i18n.validFeedback }}
{{ $options.i18n.validFeedback }}
</gl-form-text>
</template> </template>
</gl-form-group> </gl-form-group>
<gl-button variant="success" type="submit" :disabled="disableSubmit" :loading="loading"> <gl-button variant="success" type="submit" :disabled="disableSubmit" :loading="loading">
......
...@@ -93,13 +93,12 @@ export default { ...@@ -93,13 +93,12 @@ export default {
@primary.prevent="onUpload" @primary.prevent="onUpload"
> >
<p>{{ $options.i18n.modalDescription }}</p> <p>{{ $options.i18n.modalDescription }}</p>
<gl-form-group :label="__('URL')" label-for="upload-url-input"> <gl-form-group
:label="__('URL')"
label-for="upload-url-input"
:description="s__('Incidents|Must start with http or https')"
>
<gl-form-input id="upload-url-input" v-model="modalUrl" /> <gl-form-input id="upload-url-input" v-model="modalUrl" />
<template name="description">
<p class="gl-text-gray-500 gl-mt-3 gl-mb-0">
{{ s__('Incidents|Must start with http or https') }}
</p>
</template>
</gl-form-group> </gl-form-group>
</gl-modal> </gl-modal>
<metrics-image v-for="metric in metricImages" :key="metric.id" v-bind="metric" /> <metrics-image v-for="metric in metricImages" :key="metric.id" v-bind="metric" />
......
...@@ -246,58 +246,56 @@ export default { ...@@ -246,58 +246,56 @@ export default {
/> />
</div> </div>
</template> </template>
<template> <issuable-body
<issuable-body :issuable="requirementObject"
:issuable="requirementObject" :enable-edit="canEditRequirement"
:enable-edit="canEditRequirement" :enable-autocomplete="false"
:enable-autocomplete="false" :enable-autosave="false"
:enable-autosave="false" :edit-form-visible="enableRequirementEdit || isCreate"
:edit-form-visible="enableRequirementEdit || isCreate" :show-field-title="true"
:show-field-title="true" :description-preview-path="descriptionPreviewPath"
:description-preview-path="descriptionPreviewPath" :description-help-path="descriptionHelpPath"
:description-help-path="descriptionHelpPath" status-badge-class="status-box-open"
status-badge-class="status-box-open" status-icon="issue-open-m"
status-icon="issue-open-m" @edit-issuable="$emit($options.events.enableEdit, $event)"
@edit-issuable="$emit($options.events.enableEdit, $event)" @keydown-title.escape.exact.stop="handleFormInputKeyDown"
@keydown-title.escape.exact.stop="handleFormInputKeyDown" @keydown-description.escape.exact.stop="handleFormInputKeyDown"
@keydown-description.escape.exact.stop="handleFormInputKeyDown" @keydown-title.meta.enter="handleSave(arguments[1])"
@keydown-title.meta.enter="handleSave(arguments[1])" @keydown-title.ctrl.enter="handleSave(arguments[1])"
@keydown-title.ctrl.enter="handleSave(arguments[1])" @keydown-description.meta.enter="handleSave(arguments[1])"
@keydown-description.meta.enter="handleSave(arguments[1])" @keydown-description.ctrl.enter="handleSave(arguments[1])"
@keydown-description.ctrl.enter="handleSave(arguments[1])" >
> <template #edit-form-actions="issuableMeta">
<template #edit-form-actions="issuableMeta"> <gl-form-checkbox v-if="!isCreate" v-model="satisfied" class="gl-mt-6">{{
<gl-form-checkbox v-if="!isCreate" v-model="satisfied" class="gl-mt-6">{{ __('Satisfied')
__('Satisfied') }}</gl-form-checkbox>
}}</gl-form-checkbox> <div class="gl-display-flex requirement-form-actions gl-mt-6">
<div class="gl-display-flex requirement-form-actions gl-mt-6"> <gl-button
<gl-button :disabled="
:disabled=" requirementRequestActive ||
requirementRequestActive || issuableMeta.issuableTitle.length > $options.maxTitleLength ||
issuableMeta.issuableTitle.length > $options.maxTitleLength || !issuableMeta.issuableTitle.length
!issuableMeta.issuableTitle.length "
" :loading="requirementRequestActive"
:loading="requirementRequestActive" data-testid="requirement-save"
data-testid="requirement-save" variant="success"
variant="success" category="primary"
category="primary" class="gl-mr-auto js-requirement-save"
class="gl-mr-auto js-requirement-save" @click="handleSave(issuableMeta)"
@click="handleSave(issuableMeta)" >
> {{ saveButtonLabel }}
{{ saveButtonLabel }} </gl-button>
</gl-button> <gl-button
<gl-button data-testid="requirement-cancel"
data-testid="requirement-cancel" variant="default"
variant="default" category="primary"
category="primary" class="js-requirement-cancel"
class="js-requirement-cancel" @click="handleCancel"
@click="handleCancel" >
> {{ __('Cancel') }}
{{ __('Cancel') }} </gl-button>
</gl-button> </div>
</div> </template>
</template> </issuable-body>
</issuable-body>
</template>
</gl-drawer> </gl-drawer>
</template> </template>
...@@ -277,29 +277,27 @@ export default { ...@@ -277,29 +277,27 @@ export default {
</div> </div>
</div> </div>
</template> </template>
<template> <div v-if="hasSelectedPolicy">
<div v-if="hasSelectedPolicy"> <policy-drawer v-if="shouldShowCiliumDrawer" v-model="selectedPolicy.manifest" />
<policy-drawer v-if="shouldShowCiliumDrawer" v-model="selectedPolicy.manifest" />
<div v-else> <div v-else>
<h5>{{ s__('NetworkPolicies|Policy definition') }}</h5> <h5>{{ s__('NetworkPolicies|Policy definition') }}</h5>
<p> <p>
{{ s__("NetworkPolicies|Define this policy's location, conditions and actions.") }} {{ s__("NetworkPolicies|Define this policy's location, conditions and actions.") }}
</p> </p>
<div class="gl-p-3 gl-bg-gray-50"> <div class="gl-p-3 gl-bg-gray-50">
<network-policy-editor <network-policy-editor
ref="policyEditor" ref="policyEditor"
v-model="selectedPolicy.manifest" v-model="selectedPolicy.manifest"
class="network-policy-editor" class="network-policy-editor"
/> />
</div>
</div> </div>
<h5 class="gl-mt-6">{{ s__('NetworkPolicies|Enforcement status') }}</h5>
<p>{{ s__('NetworkPolicies|Choose whether to enforce this policy.') }}</p>
<gl-toggle v-model="selectedPolicy.isEnabled" data-testid="policyToggle" />
</div> </div>
</template>
<h5 class="gl-mt-6">{{ s__('NetworkPolicies|Enforcement status') }}</h5>
<p>{{ s__('NetworkPolicies|Choose whether to enforce this policy.') }}</p>
<gl-toggle v-model="selectedPolicy.isEnabled" data-testid="policyToggle" />
</div>
</gl-drawer> </gl-drawer>
</div> </div>
</template> </template>
...@@ -101,7 +101,7 @@ export default { ...@@ -101,7 +101,7 @@ export default {
:aria-describedby="`js-${option.value}-license-radio`" :aria-describedby="`js-${option.value}-license-radio`"
:class="{ 'mb-3': isDescriptionEnabled }" :class="{ 'mb-3': isDescriptionEnabled }"
> >
<template>{{ option.label }}</template> {{ option.label }}
<div v-if="isDescriptionEnabled" class="text-secondary"> <div v-if="isDescriptionEnabled" class="text-secondary">
{{ option.description }} {{ option.description }}
</div> </div>
......
...@@ -59,16 +59,6 @@ exports[`Alert integration settings form should match the default snapshot 1`] = ...@@ -59,16 +59,6 @@ exports[`Alert integration settings form should match the default snapshot 1`] =
value="minutes" value="minutes"
/> />
</div> </div>
<gl-form-text-stub
class="gl-font-base gl-text-gray-400!"
tag="small"
textvariant="muted"
>
Time limit must be a multiple of 15 minutes
</gl-form-text-stub>
</gl-form-group-stub> </gl-form-group-stub>
<gl-button-stub <gl-button-stub
......
...@@ -7,7 +7,9 @@ exports[`AddLicenseForm template does not show radio button descriptions, if lic ...@@ -7,7 +7,9 @@ exports[`AddLicenseForm template does not show radio button descriptions, if lic
data-qa-selector="approved_license_radio" data-qa-selector="approved_license_radio"
value="approved" value="approved"
> >
Allow
Allow
<!----> <!---->
</gl-form-radio-stub> </gl-form-radio-stub>
`; `;
...@@ -19,7 +21,9 @@ exports[`AddLicenseForm template does not show radio button descriptions, if lic ...@@ -19,7 +21,9 @@ exports[`AddLicenseForm template does not show radio button descriptions, if lic
data-qa-selector="blacklisted_license_radio" data-qa-selector="blacklisted_license_radio"
value="blacklisted" value="blacklisted"
> >
Deny
Deny
<!----> <!---->
</gl-form-radio-stub> </gl-form-radio-stub>
`; `;
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