Commit 519b7790 authored by Natalia Tepluhina's avatar Natalia Tepluhina

Merge branch...

Merge branch '230720-tabs-vue-migrate-app-assets-javascripts-environments-folder-environments_folder_view-vue-to' into 'master'

Migrate environments folder tabs to GlTabs

See merge request gitlab-org/gitlab!42894
parents 8b1a187f a51594a1
<script> <script>
import { GlBadge, GlTab, GlTabs } from '@gitlab/ui';
import environmentsMixin from '../mixins/environments_mixin'; import environmentsMixin from '../mixins/environments_mixin';
import CIPaginationMixin from '../../vue_shared/mixins/ci_pagination_api_mixin'; import CIPaginationMixin from '../../vue_shared/mixins/ci_pagination_api_mixin';
import StopEnvironmentModal from '../components/stop_environment_modal.vue'; import StopEnvironmentModal from '../components/stop_environment_modal.vue';
...@@ -6,8 +7,11 @@ import DeleteEnvironmentModal from '../components/delete_environment_modal.vue'; ...@@ -6,8 +7,11 @@ import DeleteEnvironmentModal from '../components/delete_environment_modal.vue';
export default { export default {
components: { components: {
StopEnvironmentModal,
DeleteEnvironmentModal, DeleteEnvironmentModal,
GlBadge,
GlTab,
GlTabs,
StopEnvironmentModal,
}, },
mixins: [environmentsMixin, CIPaginationMixin], mixins: [environmentsMixin, CIPaginationMixin],
...@@ -73,9 +77,21 @@ export default { ...@@ -73,9 +77,21 @@ export default {
<b>{{ folderName }}</b> <b>{{ folderName }}</b>
</h4> </h4>
<div class="top-area"> <gl-tabs v-if="!isLoading" scope="environments" content-class="gl-display-none">
<tabs v-if="!isLoading" :tabs="tabs" scope="environments" @onChangeTab="onChangeTab" /> <gl-tab
</div> v-for="(tab, i) in tabs"
:key="`${tab.name}-${i}`"
:active="tab.isActive"
:title-item-class="tab.isActive ? 'gl-outline-none' : ''"
:title-link-attributes="{ 'data-testid': `environments-tab-${tab.scope}` }"
@click="onChangeTab(tab.scope)"
>
<template #title>
<span>{{ tab.name }}</span>
<gl-badge size="sm" class="gl-tab-counter-badge">{{ tab.count }}</gl-badge>
</template>
</gl-tab>
</gl-tabs>
<container <container
:is-loading="isLoading" :is-loading="isLoading"
......
---
title: Migrate environments folder tabs to GlTabs
merge_request: 42894
author:
type: changed
...@@ -46,9 +46,10 @@ describe('Environments Folder View', () => { ...@@ -46,9 +46,10 @@ describe('Environments Folder View', () => {
wrapper = mount(EnvironmentsFolderViewComponent, { propsData: mockData }); wrapper = mount(EnvironmentsFolderViewComponent, { propsData: mockData });
}; };
const findEnvironmentsTabAvailable = () => wrapper.find('.js-environments-tab-available'); const findEnvironmentsTabAvailable = () =>
wrapper.find('[data-testid="environments-tab-available"]');
const findEnvironmentsTabStopped = () => wrapper.find('.js-environments-tab-stopped'); const findEnvironmentsTabStopped = () => wrapper.find('[data-testid="environments-tab-stopped"]');
beforeEach(() => { beforeEach(() => {
mock = new MockAdapter(axios); mock = new MockAdapter(axios);
......
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