Commit bd859cb1 authored by Coung Ngo's avatar Coung Ngo Committed by David O'Regan

Convert Threat Monitoring environment picker to GlDropdown

Convert the dropdown from GlDeprecatedDropdown to GlDropdown
parent 5aecf245
---
title: Convert Threat Monitoring environment picker to GlDropdown
merge_request: 54309
author:
type: changed
<script> <script>
import { GlFormGroup, GlDeprecatedDropdown, GlDeprecatedDropdownItem } from '@gitlab/ui'; import { GlFormGroup, GlDropdown, GlDropdownItem } from '@gitlab/ui';
import { mapActions, mapGetters, mapState } from 'vuex'; import { mapActions, mapGetters, mapState } from 'vuex';
import { ALL_ENVIRONMENT_NAME } from '../constants'; import { ALL_ENVIRONMENT_NAME } from '../constants';
export default { export default {
components: { components: {
GlFormGroup, GlFormGroup,
GlDeprecatedDropdown, GlDropdown,
GlDeprecatedDropdownItem, GlDropdownItem,
}, },
props: { props: {
includeAll: { includeAll: {
...@@ -40,27 +40,27 @@ export default { ...@@ -40,27 +40,27 @@ export default {
:label-for="$options.environmentFilterId" :label-for="$options.environmentFilterId"
class="col-sm-6 col-md-4 col-lg-3 col-xl-2" class="col-sm-6 col-md-4 col-lg-3 col-xl-2"
> >
<gl-deprecated-dropdown <gl-dropdown
:id="$options.environmentFilterId" :id="$options.environmentFilterId"
ref="environmentsDropdown" ref="environmentsDropdown"
class="mb-0 d-flex" class="gl-display-flex"
toggle-class="d-flex justify-content-between text-truncate" toggle-class="gl-truncate"
:text="environmentName" :text="environmentName"
:disabled="!canChangeEnvironment" :disabled="!canChangeEnvironment"
> >
<gl-deprecated-dropdown-item <gl-dropdown-item
v-for="environment in environments" v-for="environment in environments"
:key="environment.id" :key="environment.id"
ref="environmentsDropdownItem" ref="environmentsDropdownItem"
@click="setCurrentEnvironmentId(environment.id)" @click="setCurrentEnvironmentId(environment.id)"
>{{ environment.name }}</gl-deprecated-dropdown-item >{{ environment.name }}</gl-dropdown-item
> >
<gl-deprecated-dropdown-item <gl-dropdown-item
v-if="includeAll" v-if="includeAll"
ref="environmentsDropdownItem" ref="environmentsDropdownItem"
@click="setAllEnvironments" @click="setAllEnvironments"
>{{ $options.ALL_ENVIRONMENT_NAME }}</gl-deprecated-dropdown-item >{{ $options.ALL_ENVIRONMENT_NAME }}</gl-dropdown-item
> >
</gl-deprecated-dropdown> </gl-dropdown>
</gl-form-group> </gl-form-group>
</template> </template>
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