home page tables are working again w/ burnettk
This commit is contained in:
parent
80ec1194db
commit
b179b66e26
|
@ -527,7 +527,7 @@ class ProcessInstanceReportService:
|
||||||
results = cls.add_metadata_columns_to_process_instance(process_instances.items, report_metadata["columns"])
|
results = cls.add_metadata_columns_to_process_instance(process_instances.items, report_metadata["columns"])
|
||||||
|
|
||||||
for value in cls.check_filter_value(filters, "oldest_open_human_task_fields"):
|
for value in cls.check_filter_value(filters, "oldest_open_human_task_fields"):
|
||||||
results = cls.add_human_task_fields(results, value)
|
results = cls.add_human_task_fields(results, value.split(","))
|
||||||
response_json = {
|
response_json = {
|
||||||
"report_metadata": report_metadata,
|
"report_metadata": report_metadata,
|
||||||
"results": results,
|
"results": results,
|
||||||
|
|
|
@ -6,7 +6,7 @@ import {
|
||||||
Modal,
|
Modal,
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
} from '@carbon/react';
|
} from '@carbon/react';
|
||||||
import { ProcessInstanceReport, ReportMetadata } from '../interfaces';
|
import { ProcessInstanceReport } from '../interfaces';
|
||||||
import HttpService from '../services/HttpService';
|
import HttpService from '../services/HttpService';
|
||||||
|
|
||||||
type OwnProps = {
|
type OwnProps = {
|
||||||
|
|
|
@ -87,7 +87,7 @@ type OwnProps = {
|
||||||
textToShowIfEmpty?: string;
|
textToShowIfEmpty?: string;
|
||||||
paginationClassName?: string;
|
paginationClassName?: string;
|
||||||
autoReload?: boolean;
|
autoReload?: boolean;
|
||||||
additionalParams?: string;
|
additionalReportFilters?: ReportFilter[];
|
||||||
variant?: string;
|
variant?: string;
|
||||||
canCompleteAllTasks?: boolean;
|
canCompleteAllTasks?: boolean;
|
||||||
showActionsColumn?: boolean;
|
showActionsColumn?: boolean;
|
||||||
|
@ -102,7 +102,7 @@ export default function ProcessInstanceListTable({
|
||||||
processModelFullIdentifier,
|
processModelFullIdentifier,
|
||||||
paginationQueryParamPrefix,
|
paginationQueryParamPrefix,
|
||||||
perPageOptions,
|
perPageOptions,
|
||||||
additionalParams,
|
additionalReportFilters,
|
||||||
showReports = true,
|
showReports = true,
|
||||||
reportIdentifier,
|
reportIdentifier,
|
||||||
textToShowIfEmpty,
|
textToShowIfEmpty,
|
||||||
|
@ -330,6 +330,9 @@ export default function ProcessInstanceListTable({
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// this is the code to re-populate the widgets on the page
|
||||||
|
// with values from the report metadata, which is derived
|
||||||
|
// from the searchParams (often report_hash)
|
||||||
let selectedProcessModelIdentifier = processModelFullIdentifier;
|
let selectedProcessModelIdentifier = processModelFullIdentifier;
|
||||||
reportMetadataBodyToUse.filter_by.forEach(
|
reportMetadataBodyToUse.filter_by.forEach(
|
||||||
(reportFilter: ReportFilter) => {
|
(reportFilter: ReportFilter) => {
|
||||||
|
@ -360,7 +363,6 @@ export default function ProcessInstanceListTable({
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
processModelSelectionItemsForUseEffect.forEach(
|
processModelSelectionItemsForUseEffect.forEach(
|
||||||
(processModel: ProcessModel) => {
|
(processModel: ProcessModel) => {
|
||||||
if (processModel.id === selectedProcessModelIdentifier) {
|
if (processModel.id === selectedProcessModelIdentifier) {
|
||||||
|
@ -384,9 +386,13 @@ export default function ProcessInstanceListTable({
|
||||||
// eslint-disable-next-line prefer-destructuring
|
// eslint-disable-next-line prefer-destructuring
|
||||||
perPage = perPageOptions[1];
|
perPage = perPageOptions[1];
|
||||||
}
|
}
|
||||||
let queryParamString = `per_page=${perPage}&page=${page}`;
|
const queryParamString = `per_page=${perPage}&page=${page}`;
|
||||||
if (additionalParams) {
|
if (additionalReportFilters) {
|
||||||
queryParamString += `&${additionalParams}`;
|
additionalReportFilters.forEach((arf: ReportFilter) => {
|
||||||
|
if (!reportMetadataBodyToUse.filter_by.includes(arf)) {
|
||||||
|
reportMetadataBodyToUse.filter_by.push(arf);
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
HttpService.makeCallToBackend({
|
HttpService.makeCallToBackend({
|
||||||
|
@ -405,13 +411,14 @@ export default function ProcessInstanceListTable({
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const queryParams: string[] = [];
|
const queryParams: string[] = [];
|
||||||
['report_hash', 'report_id', 'report_identifier'].forEach(
|
['report_hash', 'report_id'].forEach((paramName: string) => {
|
||||||
(paramName: string) => {
|
|
||||||
if (searchParams.get(paramName)) {
|
if (searchParams.get(paramName)) {
|
||||||
queryParams.push(`${paramName}=${searchParams.get(paramName)}`);
|
queryParams.push(`${paramName}=${searchParams.get(paramName)}`);
|
||||||
}
|
}
|
||||||
|
});
|
||||||
|
if (reportIdentifier) {
|
||||||
|
queryParams.push(`report_identifier=${reportIdentifier}`);
|
||||||
}
|
}
|
||||||
);
|
|
||||||
|
|
||||||
if (queryParams.length > 0) {
|
if (queryParams.length > 0) {
|
||||||
const queryParamString = `?${queryParams.join('&')}`;
|
const queryParamString = `?${queryParams.join('&')}`;
|
||||||
|
@ -476,7 +483,7 @@ export default function ProcessInstanceListTable({
|
||||||
processModelFullIdentifier,
|
processModelFullIdentifier,
|
||||||
perPageOptions,
|
perPageOptions,
|
||||||
reportIdentifier,
|
reportIdentifier,
|
||||||
additionalParams,
|
additionalReportFilters,
|
||||||
processInstanceApiSearchPath,
|
processInstanceApiSearchPath,
|
||||||
permissionsLoaded,
|
permissionsLoaded,
|
||||||
listHasBeenFiltered,
|
listHasBeenFiltered,
|
||||||
|
|
|
@ -32,7 +32,9 @@ export default function CompletedInstances() {
|
||||||
reportIdentifier="system_report_completed_instances_with_tasks_completed_by_my_groups"
|
reportIdentifier="system_report_completed_instances_with_tasks_completed_by_my_groups"
|
||||||
showReports={false}
|
showReports={false}
|
||||||
textToShowIfEmpty="This group has no completed instances at this time."
|
textToShowIfEmpty="This group has no completed instances at this time."
|
||||||
additionalParams={`user_group_identifier=${userGroup}`}
|
additionalReportFilters={[
|
||||||
|
{ field_name: 'user_group_identifier', field_value: userGroup },
|
||||||
|
]}
|
||||||
showActionsColumn
|
showActionsColumn
|
||||||
/>
|
/>
|
||||||
</>
|
</>
|
||||||
|
|
|
@ -35,7 +35,9 @@ export default function InProgressInstances() {
|
||||||
reportIdentifier="system_report_in_progress_instances_with_tasks_for_my_group"
|
reportIdentifier="system_report_in_progress_instances_with_tasks_for_my_group"
|
||||||
showReports={false}
|
showReports={false}
|
||||||
textToShowIfEmpty="This group has no instances waiting on it at this time."
|
textToShowIfEmpty="This group has no instances waiting on it at this time."
|
||||||
additionalParams={`user_group_identifier=${userGroup}`}
|
additionalReportFilters={[
|
||||||
|
{ field_name: 'user_group_identifier', field_value: userGroup },
|
||||||
|
]}
|
||||||
canCompleteAllTasks
|
canCompleteAllTasks
|
||||||
showActionsColumn
|
showActionsColumn
|
||||||
autoReload
|
autoReload
|
||||||
|
|
Loading…
Reference in New Issue