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
|
// occurs when tasks were taken from the group task config, but at a previous time the tasks existed
|
||||||
if (currentGroupTask.NumberOfSteps > groupTasks.length) {
|
if (currentGroupTask.NumberOfSteps > groupTasks.length) {
|
||||||
for (
|
for (let i = groupTasks.length; i < currentGroupTask.NumberOfSteps; i++) {
|
||||||
let i = groupTasks.length - 1;
|
|
||||||
i < currentGroupTask.NumberOfSteps;
|
|
||||||
i++
|
|
||||||
) {
|
|
||||||
let stepParams = [];
|
let stepParams = [];
|
||||||
|
|
||||||
if (groupTaskSteps[i].Inputs !== "") {
|
if (groupTaskSteps[i].Inputs !== "") {
|
||||||
|
|
|
@ -19,41 +19,14 @@ export default function GroupTasks({ isGroupTasksViewModalOpen }) {
|
||||||
setCurrentSelectedModalGroupType(null);
|
setCurrentSelectedModalGroupType(null);
|
||||||
};
|
};
|
||||||
|
|
||||||
const GroupTaskTableListItems = () => {
|
const filteredCategoryGroups = webSocketContext.CategoryGroups.filter(
|
||||||
const items = [];
|
(categoryGroup) =>
|
||||||
|
|
||||||
webSocketContext.CategoryGroups.forEach((categoryGroup) => {
|
|
||||||
if (
|
|
||||||
hasXYPermission(
|
hasXYPermission(
|
||||||
webSocketContext.User.Permissions,
|
webSocketContext.User.Permissions,
|
||||||
Constants.PERMISSIONS.GROUP_TASKS.OVERVIEW.XYView,
|
Constants.PERMISSIONS.GROUP_TASKS.OVERVIEW.XYView,
|
||||||
categoryGroup.category
|
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 (
|
return (
|
||||||
<>
|
<>
|
||||||
|
@ -62,7 +35,29 @@ export default function GroupTasks({ isGroupTasksViewModalOpen }) {
|
||||||
{webSocketContext.CategoryGroups.length === 0 ? (
|
{webSocketContext.CategoryGroups.length === 0 ? (
|
||||||
<Result status="404" title="No group tasks found" />
|
<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
|
<GroupTypeSelectionModal
|
||||||
|
|
Loading…
Reference in New Issue