Commit e41151b7 authored by Illya Klymov's avatar Illya Klymov

Merge branch '212867-clean-up-dependency_list_ui-for-table' into 'master'

Remove feature flag from dependencies table

See merge request gitlab-org/gitlab!31079
parents 7dcbe647 5b76787c
...@@ -2,8 +2,6 @@ ...@@ -2,8 +2,6 @@
import { cloneDeep } from 'lodash'; import { cloneDeep } from 'lodash';
import { GlBadge, GlIcon, GlLink, GlButton, GlSkeletonLoading, GlTable } from '@gitlab/ui'; import { GlBadge, GlIcon, GlLink, GlButton, GlSkeletonLoading, GlTable } from '@gitlab/ui';
import { s__ } from '~/locale'; import { s__ } from '~/locale';
import glFeatureFlagsMixin from '~/vue_shared/mixins/gl_feature_flags_mixin';
import DependenciesTableRow from './dependencies_table_row.vue';
import DependencyLicenseLinks from './dependency_license_links.vue'; import DependencyLicenseLinks from './dependency_license_links.vue';
import DependencyVulnerabilities from './dependency_vulnerabilities.vue'; import DependencyVulnerabilities from './dependency_vulnerabilities.vue';
...@@ -26,7 +24,6 @@ const tdClass = (value, key, item) => { ...@@ -26,7 +24,6 @@ const tdClass = (value, key, item) => {
export default { export default {
name: 'DependenciesTable', name: 'DependenciesTable',
components: { components: {
DependenciesTableRow,
DependencyLicenseLinks, DependencyLicenseLinks,
DependencyVulnerabilities, DependencyVulnerabilities,
GlBadge, GlBadge,
...@@ -36,7 +33,6 @@ export default { ...@@ -36,7 +33,6 @@ export default {
GlSkeletonLoading, GlSkeletonLoading,
GlTable, GlTable,
}, },
mixins: [glFeatureFlagsMixin()],
props: { props: {
dependencies: { dependencies: {
type: Array, type: Array,
...@@ -48,18 +44,8 @@ export default { ...@@ -48,18 +44,8 @@ export default {
}, },
}, },
data() { data() {
const tableSections = [
{ className: 'section-20', label: s__('Dependencies|Status') },
{ className: 'section-20', label: s__('Dependencies|Component') },
{ className: 'section-10', label: s__('Dependencies|Version') },
{ className: 'section-20', label: s__('Dependencies|Packager') },
{ className: 'section-15', label: s__('Dependencies|Location') },
{ className: 'section-15', label: s__('Dependencies|License') },
];
return { return {
localDependencies: this.transformDependenciesForUI(this.dependencies), localDependencies: this.transformDependenciesForUI(this.dependencies),
tableSections,
}; };
}, },
computed: { computed: {
...@@ -96,7 +82,6 @@ export default { ...@@ -96,7 +82,6 @@ export default {
<!-- tbody- and thead-class props can be removed when <!-- tbody- and thead-class props can be removed when
https://gitlab.com/gitlab-org/gitlab/-/issues/213324 is fixed --> https://gitlab.com/gitlab-org/gitlab/-/issues/213324 is fixed -->
<gl-table <gl-table
v-if="glFeatures.dependencyListUi"
:fields="$options.fields" :fields="$options.fields"
:items="localDependencies" :items="localDependencies"
:busy="isLoading" :busy="isLoading"
...@@ -168,25 +153,4 @@ export default { ...@@ -168,25 +153,4 @@ export default {
</div> </div>
</template> </template>
</gl-table> </gl-table>
<div v-else>
<div class="gl-responsive-table-row table-row-header text-2 bg-secondary-50 px-2" role="row">
<div
v-for="(section, index) in tableSections"
:key="index"
class="table-section"
:class="section.className"
role="rowheader"
>
{{ section.label }}
</div>
</div>
<dependencies-table-row
v-for="(dependency, index) in dependencies"
:key="index"
:dependency="dependency"
:is-loading="isLoading"
/>
</div>
</template> </template>
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`DependenciesTable component given a list of dependencies (loaded) matches the snapshot 1`] = `
<div>
<div
class="gl-responsive-table-row table-row-header text-2 bg-secondary-50 px-2"
role="row"
>
<div
class="table-section section-20"
role="rowheader"
>
Status
</div>
<div
class="table-section section-20"
role="rowheader"
>
Component
</div>
<div
class="table-section section-10"
role="rowheader"
>
Version
</div>
<div
class="table-section section-20"
role="rowheader"
>
Packager
</div>
<div
class="table-section section-15"
role="rowheader"
>
Location
</div>
<div
class="table-section section-15"
role="rowheader"
>
License
</div>
</div>
<dependencies-table-row-stub
dependency="[object Object]"
/>
<dependencies-table-row-stub
dependency="[object Object]"
/>
</div>
`;
exports[`DependenciesTable component given a list of dependencies (loading) matches the snapshot 1`] = `
<div>
<div
class="gl-responsive-table-row table-row-header text-2 bg-secondary-50 px-2"
role="row"
>
<div
class="table-section section-20"
role="rowheader"
>
Status
</div>
<div
class="table-section section-20"
role="rowheader"
>
Component
</div>
<div
class="table-section section-10"
role="rowheader"
>
Version
</div>
<div
class="table-section section-20"
role="rowheader"
>
Packager
</div>
<div
class="table-section section-15"
role="rowheader"
>
Location
</div>
<div
class="table-section section-15"
role="rowheader"
>
License
</div>
</div>
<dependencies-table-row-stub
dependency="[object Object]"
isloading="true"
/>
<dependencies-table-row-stub
dependency="[object Object]"
isloading="true"
/>
</div>
`;
exports[`DependenciesTable component given an empty list of dependencies matches the snapshot 1`] = `
<div>
<div
class="gl-responsive-table-row table-row-header text-2 bg-secondary-50 px-2"
role="row"
>
<div
class="table-section section-20"
role="rowheader"
>
Status
</div>
<div
class="table-section section-20"
role="rowheader"
>
Component
</div>
<div
class="table-section section-10"
role="rowheader"
>
Version
</div>
<div
class="table-section section-20"
role="rowheader"
>
Packager
</div>
<div
class="table-section section-15"
role="rowheader"
>
Location
</div>
<div
class="table-section section-15"
role="rowheader"
>
License
</div>
</div>
</div>
`;
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