Skip to content

Commit 43240b5

Browse files
authored
Merge pull request #6167 from ProcessMaker/observation/FOUR-13973-B
observation/FOUR-13973-B Added an identifier for multiple instances of the table component
2 parents 784bf89 + 2d6441b commit 43240b5

File tree

5 files changed

+16
-6
lines changed

5 files changed

+16
-6
lines changed

resources/js/components/shared/FilterTable.vue

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
<tr>
1919
<th
2020
v-for="(column, index) in headers"
21-
:id="`column-${index}`"
21+
:id="`${tableName}-column-${index}`"
2222
:key="index"
2323
class="pm-table-ellipsis-column"
2424
:class="{ 'pm-table-filter-applied': column.filterApplied }"
@@ -65,15 +65,15 @@
6565
>
6666
<template v-if="containsHTML(getNestedPropertyValue(row, header.field))">
6767
<div
68-
:id="`element-${rowIndex}-${index}`"
68+
:id="`${tableName}-element-${rowIndex}-${index}`"
6969
:class="{ 'pm-table-truncate': header.truncate }"
7070
:style="{ maxWidth: header.width + 'px' }"
7171
>
7272
<div v-html="sanitize(getNestedPropertyValue(row, header.field))"></div>
7373
</div>
7474
<b-tooltip
7575
v-if="header.truncate"
76-
:target="`element-${rowIndex}-${index}`"
76+
:target="`${tableName}-element-${rowIndex}-${index}`"
7777
custom-class="pm-table-tooltip"
7878
>
7979
{{ sanitizeTooltip(getNestedPropertyValue(row, header.field)) }}
@@ -88,14 +88,14 @@
8888
</template>
8989
<template v-else>
9090
<div
91-
:id="`element-${rowIndex}-${index}`"
91+
:id="`${tableName}-element-${rowIndex}-${index}`"
9292
:class="{ 'pm-table-truncate': header.truncate }"
9393
:style="{ maxWidth: header.width + 'px' }"
9494
>
9595
{{ getNestedPropertyValue(row, header.field) }}
9696
<b-tooltip
9797
v-if="header.truncate"
98-
:target="`element-${rowIndex}-${index}`"
98+
:target="`${tableName}-element-${rowIndex}-${index}`"
9999
custom-class="pm-table-tooltip"
100100
>
101101
{{ getNestedPropertyValue(row, header.field) }}
@@ -141,6 +141,12 @@ export default {
141141
return false;
142142
}
143143
},
144+
tableName: {
145+
type: String,
146+
default: function () {
147+
return "";
148+
}
149+
},
144150
},
145151
data() {
146152
return {
@@ -194,7 +200,7 @@ export default {
194200
document.addEventListener("mouseup", this.stopResize);
195201
},
196202
calculateContent(index) {
197-
const miDiv = document.getElementById(`column-${index}`);
203+
const miDiv = document.getElementById(`${this.tableName}-column-${index}`);
198204
return miDiv.scrollWidth;
199205
},
200206
doResize(event) {

resources/js/processes/categories/components/CategoriesListing.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
<filter-table
1212
:headers="fields"
1313
:data="data"
14+
table-name="categories"
1415
style="height: calc(100vh - 355px);"
1516
>
1617
<!-- Slot Table Header filter Button -->

resources/js/processes/components/ArchivedProcessList.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
<filter-table
1616
:headers="fields"
1717
:data="data"
18+
table-name="archived"
1819
style="height: calc(100vh - 355px);"
1920
>
2021
<!-- Slot Table Header filter Button -->

resources/js/processes/components/ProcessesListing.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
<filter-table
1616
:headers="fields"
1717
:data="data"
18+
table-name="processes"
1819
style="height: calc(100vh - 355px);"
1920
>
2021
<!-- Slot Table Header filter Button -->

resources/js/templates/components/ProcessTemplatesListing.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
<filter-table
1212
:headers="fields"
1313
:data="data"
14+
table-name="templates"
1415
style="height: calc(100vh - 355px);"
1516
>
1617
<!-- Slot Table Header filter Button -->

0 commit comments

Comments
 (0)