Skip to content

Commit 0e87489

Browse files
authored
Merge pull request #7623 from ProcessMaker/bugfix/FOUR-19800
FOUR-19800:UI: Remove the link in the process column in the cases list
2 parents 1b6761d + 02bd54f commit 0e87489

File tree

3 files changed

+111
-4
lines changed

3 files changed

+111
-4
lines changed

resources/jscomposition/cases/casesMain/config/columns.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import {
44
ParticipantsCell,
55
StatusCell,
66
LinkCell,
7+
TruncatedColumn,
78
} from "../../../system/index";
89
import { formatDate } from "../../../utils";
910

@@ -67,11 +68,8 @@ export const processColumn = () => ({
6768
resizable: true,
6869
width: 200,
6970
cellRenderer: () => ({
70-
component: TruncatedOptionsCell,
71+
component: TruncatedColumn,
7172
params: {
72-
click: (option, row, column, columns) => {
73-
window.document.location = `/tasks/${option.id}/edit`;
74-
},
7573
formatterOptions: (option, row, column, columns) => option.name,
7674
},
7775
}),
Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
<template>
2+
<div class="tw-flex tw-relative tw-text-nowrap tw-whitespace-nowrap tw-p-3">
3+
<div class="tw-overflow-hidden tw-text-ellipsis ">
4+
<span class="tw-text-gray-500">
5+
{{ getValue() }}
6+
</span>
7+
</div>
8+
9+
<AppPopover
10+
v-if="optionsModel.length > 1"
11+
v-model="show"
12+
:hover="false"
13+
position="bottom"
14+
class="!tw-absolute tw-right-0 tw-top-0 tw-h-full tw-flex tw-items-center"
15+
>
16+
<div
17+
class="tw-self-center tw-px-2 tw-rounded-md hover:tw-cursor-pointer hover:tw-bg-gray-200 tw-bg-white "
18+
@click.prevent="onClick"
19+
>
20+
<i class="fas fa-ellipsis-v" />
21+
</div>
22+
23+
<template #content>
24+
<ul
25+
class="tw-bg-white tw-list-none tw-text-gray-600
26+
tw-overflow-hidden tw-rounded-lg tw-w-50 tw-text-sm tw-border tw-border-gray-300"
27+
>
28+
<template v-for="(option, index) in optionsModel">
29+
<li
30+
v-if="index > 0"
31+
:key="index"
32+
class="hover:tw-bg-gray-100"
33+
>
34+
<span class="tw-flex tw-py-2 tw-px-4 transition duration-300">
35+
{{ getValueOption(option, index) }}
36+
</span>
37+
</li>
38+
</template>
39+
</ul>
40+
</template>
41+
</AppPopover>
42+
</div>
43+
</template>
44+
<script>
45+
import { defineComponent, ref } from "vue";
46+
import { isFunction } from "lodash";
47+
import { AppPopover } from "../../../base/index";
48+
49+
export default defineComponent({
50+
components: {
51+
AppPopover,
52+
},
53+
props: {
54+
columns: {
55+
type: Array,
56+
default: () => [],
57+
},
58+
column: {
59+
type: Object,
60+
default: () => ({}),
61+
},
62+
row: {
63+
type: Object,
64+
default: () => ({}),
65+
},
66+
formatterOptions: {
67+
type: Function,
68+
default: new Function(),
69+
},
70+
},
71+
setup(props) {
72+
const show = ref(false);
73+
const optionsModel = ref(props.row[props.column.field]);
74+
75+
const getValue = () => {
76+
if (isFunction(props.column?.formatter)) {
77+
return props.column?.formatter(props.row, props.column, props.columns);
78+
}
79+
return props.row[props.column.field].length ? props.row[props.column.field][0].name : "";
80+
};
81+
82+
const getValueOption = (option) => {
83+
if (isFunction(props.formatterOptions)) {
84+
return props.formatterOptions(option, props.row, props.column, props.columns);
85+
}
86+
return "";
87+
};
88+
89+
const onClick = () => {
90+
show.value = !show.value;
91+
};
92+
93+
const onClose = () => {
94+
show.value = false;
95+
};
96+
97+
return {
98+
show,
99+
optionsModel,
100+
onClose,
101+
onClick,
102+
getValue,
103+
getValueOption,
104+
};
105+
},
106+
});
107+
</script>

resources/jscomposition/system/table/cell/index.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import StatusCell from "./StatusCell.vue";
55
import CaseTitleCell from "./CaseTitleCell.vue";
66
import LinkCell from "./LinkCell.vue";
77
import CollapseFormCell from "./CollapseFormCell.vue";
8+
import TruncatedColumn from "./TruncatedColumn.vue";
89

910
export {
1011
ParticipantsCell,
@@ -14,4 +15,5 @@ export {
1415
LinkCell,
1516
CollapseFormCell,
1617
ParticipantCell,
18+
TruncatedColumn,
1719
};

0 commit comments

Comments
 (0)