Skip to content

Commit

Permalink
FOUR-19753 : The task comments is not showing the buttons to register…
Browse files Browse the repository at this point in the history
… the comments
  • Loading branch information
hjonathan committed Oct 24, 2024
1 parent 5537009 commit 7824dbb
Showing 1 changed file with 19 additions and 19 deletions.
38 changes: 19 additions & 19 deletions resources/jscomposition/cases/casesMain/utils/filters.js
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
import { formatDate } from "../../../utils";

export const formatFilters = (filters) => {
const response = filters.map((e) => {
let { value } = e;
const response = filters.map((element) => {
let { value } = element;

if (!e.operator) {
if (!element.operator) {
return null;
}

if (e.operator === "between" || e.operator === "in") {
value = e.value.map((o) => o.value);
if (element.operator === "between" || element.operator === "in") {
value = element.value.map((o) => o.value);
}

// Case status is a dropdown filter, using for the API
if (e.field === "case_status") {
value = e.value.value;
if (element.field === "case_status") {
value = element.value.value;
}

return {
subject: {
type: "Field",
value: e.field,
value: element.field,
},
operator: e.operator,
operator: element.operator,
value,
};
});
Expand All @@ -32,21 +32,21 @@ export const formatFilters = (filters) => {

// Format filters to convert in badges data
export const formatFilterBadges = (filters, columns) => {
const response = filters.map((e) => {
let { value } = e;
const col = columns.find((c) => c.field === e.field);
const response = filters.map((element) => {
let { value } = element;
const col = columns.find((c) => c.field === element.field);

if (!e.operator) {
if (!element.operator) {
return null;
}

if (e.operator === "between" || e.operator === "in") {
value = e.value.map((o) => o.value);
if (element.operator === "between" || element.operator === "in") {
value = element.value.map((o) => o.value);
}

// Case status is a dropdown filter, using with badges
if (e.field === "case_status") {
value = e.value.label;
if (element.field === "case_status") {
value = element.value.label;
}

// Format datetime value to badges
Expand All @@ -56,8 +56,8 @@ export const formatFilterBadges = (filters, columns) => {

return {
fieldName: col.header,
field: e.field,
operator: e.operator,
field: element.field,
operator: element.operator,
value,
};
});
Expand Down

0 comments on commit 7824dbb

Please sign in to comment.