Commit 1c5fc6c6 authored by Mark Florian's avatar Mark Florian

Remove repetition from template

parent 8afdc2c9
<script> <script>
import { s__ } from '~/locale';
import DependenciesTableRow from './dependencies_table_row.vue'; import DependenciesTableRow from './dependencies_table_row.vue';
export default { export default {
...@@ -16,23 +17,30 @@ export default { ...@@ -16,23 +17,30 @@ export default {
required: true, required: true,
}, },
}, },
data() {
return {
tableSections: [
{ className: 'section-20', label: s__('Dependencies|Component') },
{ className: 'section-15', label: s__('Dependencies|Version') },
{ className: 'section-20', label: s__('Dependencies|Packager') },
{ className: 'flex-grow-1', label: s__('Dependencies|Location') },
],
};
},
}; };
</script> </script>
<template> <template>
<div> <div>
<div class="gl-responsive-table-row table-row-header text-2 bg-secondary-50 px-2" role="row"> <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"> <div
{{ s__('Dependencies|Component') }} v-for="(section, index) in tableSections"
</div> :key="index"
<div class="table-section section-15" role="rowheader"> class="table-section"
{{ s__('Dependencies|Version') }} :class="section.className"
</div> role="rowheader"
<div class="table-section section-20" role="rowheader"> >
{{ s__('Dependencies|Packager') }} {{ section.label }}
</div>
<div class="table-section flex-grow-1" role="rowheader">
{{ s__('Dependencies|Location') }}
</div> </div>
</div> </div>
......
...@@ -14,7 +14,6 @@ exports[`DependenciesTable component given a list of dependencies (loaded) match ...@@ -14,7 +14,6 @@ exports[`DependenciesTable component given a list of dependencies (loaded) match
Component Component
</div> </div>
<div <div
class="table-section section-15" class="table-section section-15"
role="rowheader" role="rowheader"
...@@ -23,7 +22,6 @@ exports[`DependenciesTable component given a list of dependencies (loaded) match ...@@ -23,7 +22,6 @@ exports[`DependenciesTable component given a list of dependencies (loaded) match
Version Version
</div> </div>
<div <div
class="table-section section-20" class="table-section section-20"
role="rowheader" role="rowheader"
...@@ -32,7 +30,6 @@ exports[`DependenciesTable component given a list of dependencies (loaded) match ...@@ -32,7 +30,6 @@ exports[`DependenciesTable component given a list of dependencies (loaded) match
Packager Packager
</div> </div>
<div <div
class="table-section flex-grow-1" class="table-section flex-grow-1"
role="rowheader" role="rowheader"
...@@ -66,7 +63,6 @@ exports[`DependenciesTable component given a list of dependencies (loading) matc ...@@ -66,7 +63,6 @@ exports[`DependenciesTable component given a list of dependencies (loading) matc
Component Component
</div> </div>
<div <div
class="table-section section-15" class="table-section section-15"
role="rowheader" role="rowheader"
...@@ -75,7 +71,6 @@ exports[`DependenciesTable component given a list of dependencies (loading) matc ...@@ -75,7 +71,6 @@ exports[`DependenciesTable component given a list of dependencies (loading) matc
Version Version
</div> </div>
<div <div
class="table-section section-20" class="table-section section-20"
role="rowheader" role="rowheader"
...@@ -84,7 +79,6 @@ exports[`DependenciesTable component given a list of dependencies (loading) matc ...@@ -84,7 +79,6 @@ exports[`DependenciesTable component given a list of dependencies (loading) matc
Packager Packager
</div> </div>
<div <div
class="table-section flex-grow-1" class="table-section flex-grow-1"
role="rowheader" role="rowheader"
...@@ -120,7 +114,6 @@ exports[`DependenciesTable component given an empty list of dependencies matches ...@@ -120,7 +114,6 @@ exports[`DependenciesTable component given an empty list of dependencies matches
Component Component
</div> </div>
<div <div
class="table-section section-15" class="table-section section-15"
role="rowheader" role="rowheader"
...@@ -129,7 +122,6 @@ exports[`DependenciesTable component given an empty list of dependencies matches ...@@ -129,7 +122,6 @@ exports[`DependenciesTable component given an empty list of dependencies matches
Version Version
</div> </div>
<div <div
class="table-section section-20" class="table-section section-20"
role="rowheader" role="rowheader"
...@@ -138,7 +130,6 @@ exports[`DependenciesTable component given an empty list of dependencies matches ...@@ -138,7 +130,6 @@ exports[`DependenciesTable component given an empty list of dependencies matches
Packager Packager
</div> </div>
<div <div
class="table-section flex-grow-1" class="table-section flex-grow-1"
role="rowheader" role="rowheader"
......
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