Correct typing in showProcess
This commit is contained in:
parent
26ba3e6e93
commit
b828e5197a
@ -855,23 +855,38 @@ private async showProcess(): Promise<void> {
|
||||
if (container) {
|
||||
const service = await Services.getInstance();
|
||||
const myProcesses = await service.getMyProcesses();
|
||||
let myProcessesData = await Promise.all(myProcesses.map(async processId => {
|
||||
const process = await service.getProcess(processId);
|
||||
const lastState = service.getLastCommitedState(process);
|
||||
if (!lastState) {
|
||||
return null;
|
||||
}
|
||||
const description = await service.decryptAttribute(processId, lastState, 'description');
|
||||
const name = description ? description : 'N/A';
|
||||
const publicData = await service.getPublicData(process);
|
||||
console.log(publicData);
|
||||
return {
|
||||
name: name,
|
||||
publicData: publicData
|
||||
};
|
||||
}));
|
||||
myProcessesData = myProcessesData.filter(process => process !== null);
|
||||
createProcessTab(container, myProcessesData);
|
||||
if (myProcesses && myProcesses.length != 0) {
|
||||
const myProcessesDataUnfiltered: { name: string, publicData: Record<string, any> }[] = await Promise.all(myProcesses.map(async processId => {
|
||||
const process = await service.getProcess(processId);
|
||||
const lastState = service.getLastCommitedState(process);
|
||||
if (!lastState) {
|
||||
return {
|
||||
name: '',
|
||||
publicData: {}
|
||||
};
|
||||
}
|
||||
const description = await service.decryptAttribute(processId, lastState, 'description');
|
||||
const name = description ? description : 'N/A';
|
||||
const publicData = await service.getPublicData(process);
|
||||
if (!publicData) {
|
||||
return {
|
||||
name: '',
|
||||
publicData: {}
|
||||
};
|
||||
}
|
||||
return {
|
||||
name: name,
|
||||
publicData: publicData
|
||||
};
|
||||
}));
|
||||
const myProcessesData = myProcessesDataUnfiltered.filter(
|
||||
(p) => p.name !== '' && Object.keys(p.publicData).length != 0
|
||||
);
|
||||
|
||||
createProcessTab(container, myProcessesData);
|
||||
} else {
|
||||
createProcessTab(container, []);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user