fixed table re-rendering
parent
506bbc8ecc
commit
c36c926352
|
@ -430,11 +430,7 @@ export default function GroupTasksViewModal({ isOpen }) {
|
|||
|
||||
// occurs when tasks were taken from the group task config, but at a previous time the tasks existed
|
||||
if (currentGroupTask.NumberOfSteps > groupTasks.length) {
|
||||
for (
|
||||
let i = groupTasks.length - 1;
|
||||
i < currentGroupTask.NumberOfSteps;
|
||||
i++
|
||||
) {
|
||||
for (let i = groupTasks.length; i < currentGroupTask.NumberOfSteps; i++) {
|
||||
let stepParams = [];
|
||||
|
||||
if (groupTaskSteps[i].Inputs !== "") {
|
||||
|
|
|
@ -19,41 +19,14 @@ export default function GroupTasks({ isGroupTasksViewModalOpen }) {
|
|||
setCurrentSelectedModalGroupType(null);
|
||||
};
|
||||
|
||||
const GroupTaskTableListItems = () => {
|
||||
const items = [];
|
||||
|
||||
webSocketContext.CategoryGroups.forEach((categoryGroup) => {
|
||||
if (
|
||||
const filteredCategoryGroups = webSocketContext.CategoryGroups.filter(
|
||||
(categoryGroup) =>
|
||||
hasXYPermission(
|
||||
webSocketContext.User.Permissions,
|
||||
Constants.PERMISSIONS.GROUP_TASKS.OVERVIEW.XYView,
|
||||
categoryGroup.category
|
||||
)
|
||||
) {
|
||||
items.push(
|
||||
<GroupTaskTableList
|
||||
key={categoryGroup.category}
|
||||
categoryGroup={categoryGroup}
|
||||
showGroupTypeSelectionModal={showGroupTypeSelectionModal}
|
||||
groupTasks={webSocketContext.GroupTasks}
|
||||
/>
|
||||
);
|
||||
}
|
||||
});
|
||||
|
||||
if (items.length === 0) {
|
||||
items.push(
|
||||
<Result
|
||||
key="result"
|
||||
status="403"
|
||||
title="You were not assigned to any group tasks"
|
||||
subTitle="Please contact an administrator"
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
return items;
|
||||
};
|
||||
|
||||
return (
|
||||
<>
|
||||
|
@ -62,7 +35,29 @@ export default function GroupTasks({ isGroupTasksViewModalOpen }) {
|
|||
{webSocketContext.CategoryGroups.length === 0 ? (
|
||||
<Result status="404" title="No group tasks found" />
|
||||
) : (
|
||||
<GroupTaskTableListItems />
|
||||
<>
|
||||
{filteredCategoryGroups.length > 0 ? (
|
||||
<>
|
||||
{filteredCategoryGroups.map((categoryGroup) => {
|
||||
return (
|
||||
<GroupTaskTableList
|
||||
key={categoryGroup.category}
|
||||
categoryGroup={categoryGroup}
|
||||
showGroupTypeSelectionModal={showGroupTypeSelectionModal}
|
||||
groupTasks={webSocketContext.GroupTasks}
|
||||
/>
|
||||
);
|
||||
})}
|
||||
</>
|
||||
) : (
|
||||
<Result
|
||||
key="result"
|
||||
status="403"
|
||||
title="You were not assigned to any group tasks"
|
||||
subTitle="Please contact an administrator"
|
||||
/>
|
||||
)}
|
||||
</>
|
||||
)}
|
||||
|
||||
<GroupTypeSelectionModal
|
||||
|
|
Loading…
Reference in New Issue