Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,11 @@ const createFilterShareOption = (labelKey, value) => ({
return {
name: filterName,
criteria,
id: attributeFilter?.id,
created: attributeFilter?.created,
modified: attributeFilter?.modified,
createdBy:attributeFilter?.createdBy,
modifiedBy:attributeFilter?.modifiedBy,
parentFilterId: selectedFilter.id,
roles,
users,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,10 @@ export const AttributeFilterModal = ({ show, onClose, toggleModal }) => {
attributeFilterToEdit?.id
);
setUpdateSuccess(onClose, 2);
const filterList = attributeFilterList.filter((item) => item.id !== response.data.id);
dispatch(setSelectedBpmAttributeFilter(response.data));
const newAttributeFilterList = [response.data, ...filterList];
dispatch(setAttributeFilterList(newAttributeFilterList));
dispatch(fetchServiceTaskList(response.data, null, 1, limit));
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ const SaveFilterTab = ({
return null;
}

if (createFilters && selectedFilter.name !== "All Tasks") {
if (createFilters && (selectedFilter.name === "All Tasks" && !filterToEdit)) {
return (
<div className="pt-4">
<CustomButton
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,11 @@ const AttributeFilterDropdown = () => {
(item) => item.name !== "formId"
);
// we need to patch the current criteria with process variables from attribute filter
if (processVariables && processVariables.length > 0) {
currentCriteria.processVariables?.push(...processVariables);
}
if (processVariables && processVariables.length > 0) {
currentCriteria.processVariables = currentCriteria.processVariables || [];
currentCriteria.processVariables.push(...processVariables);
}

// changing assignee if assignee changed in attirbuite filter
currentCriteria.assignee = attributeFilter?.criteria.assignee;
const data = { ...selectedFilter, criteria: currentCriteria };
Expand Down Expand Up @@ -91,16 +93,11 @@ const AttributeFilterDropdown = () => {
}),
}))
: [];
const noAttributeFilter = {
content: <em>{t("No attribute filters found")}</em>,
onClick: () => {},
type: "none",
dataTestId: "no-attr-filters",
ariaLabel: t("No attribute filters available"),
};


const clearAttributeFilter = {
content: <em>{t("All Fields")}</em>,
className: !selectedAttributeFilter?.id ? "selected-filter-item" : "",
content: <>{t("All Fields")}</>,
onClick: () => changeAttributeFilterSelection(null),
type: "none",
dataTestId: "no-attr-filters",
Expand Down Expand Up @@ -144,7 +141,7 @@ const AttributeFilterDropdown = () => {
reorderOption,
];
} else {
options = [noAttributeFilter, customAttribute];
options = [clearAttributeFilter, customAttribute];
}

return options;
Expand All @@ -171,7 +168,7 @@ const AttributeFilterDropdown = () => {
dropdownType="DROPDOWN_WITH_EXTRA_ACTION"
dropdownItems={filterDropdownAttributeItems()}
extraActionIcon={<PencilIcon color="white" />}
extraActionOnClick={handleEditAttrFilter}
extraActionOnClick={!selectedAttributeFilter ? handleToggleAttrFilterModal : handleEditAttrFilter}
dataTestId="attribute-filter-dropdown"
ariaLabel={t("Select attribute filter")}
extraActionAriaLabel={t("Edit attribute filters")}
Expand Down
4 changes: 2 additions & 2 deletions forms-flow-review/src/components/TaskList/TaskList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -206,8 +206,8 @@ const TaskList = () => {
dispatch(setDateRangeFilter({ startDate: null, endDate: null }));
dispatch(fetchAttributeFilterList(currentFilter.id));
dispatch(setBPMTaskListActivePage(1));
dispatch(setTaskListLimit(15));
dispatch(fetchServiceTaskList(currentFilter, null, 1, 15));
dispatch(setTaskListLimit(25));
dispatch(fetchServiceTaskList(currentFilter, null, 1, 25));
});
}
}, [defaultFilterId]);
Expand Down
8 changes: 8 additions & 0 deletions forms-flow-review/src/components/TaskList/TasklistTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,24 +39,32 @@ interface Task {
assignee?: string;
_embedded?: {
variable?: Array<{ name: string; value: any }>;
candidateGroups?: Array<{ groupId: string }>;
};
}

const getCellValue = (column: Column, task: Task) => {
const { sortKey } = column;
const { name: taskName, created, _embedded } = task ?? {};
const variables = _embedded?.variable ?? [];
const candidateGroups = _embedded?.candidateGroups ?? [];

if (column.sortKey === "applicationId") {
return variables.find((v) => v.name === "applicationId")?.value ?? "-";
}



switch (sortKey) {
case "name":
return taskName ?? "-";
case "created":
return created ? HelperServices.getLocaldate(created) : "N/A";
case "assignee":
return <TaskAssigneeManager task={task} />;
case "roles": {
return candidateGroups.length > 0 ? candidateGroups[0]?.groupId ?? "-" : "-";
}
default:
return variables.find((v) => v.name === sortKey)?.value ?? "-";
}
Expand Down
2 changes: 1 addition & 1 deletion forms-flow-theme/scss/_table.scss
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,7 @@ $white-color: var(--ff-white);
background-color: var(--ff-body-bg);
z-index: 2;
border-left: 1px solid var(--ff-gray-medium-dark);
text-align: center;
text-align: left;
vertical-align: middle;
.empty-table-message{
border-left: none !important;
Expand Down
Loading