[bug] process page can find all processes
This commit is contained in:
parent
239ddae893
commit
8fbcb769d6
@ -5,9 +5,6 @@ import { Process } from 'pkg/sdk_client';
|
|||||||
import chatStyle from '../../../public/style/chat.css?inline';
|
import chatStyle from '../../../public/style/chat.css?inline';
|
||||||
import { Database } from '../../services/database.service';
|
import { Database } from '../../services/database.service';
|
||||||
|
|
||||||
let myProcesses = (await Services.getInstance()).getMyProcesses();
|
|
||||||
let allProcesses = (await Services.getInstance()).getAllProcesses();
|
|
||||||
|
|
||||||
// Initialize function, create initial tokens with itens that are already selected by the user
|
// Initialize function, create initial tokens with itens that are already selected by the user
|
||||||
export async function init() {
|
export async function init() {
|
||||||
|
|
||||||
@ -49,16 +46,6 @@ export async function init() {
|
|||||||
wrapper.appendChild(search_div);
|
wrapper.appendChild(search_div);
|
||||||
|
|
||||||
addPlaceholder(wrapper);
|
addPlaceholder(wrapper);
|
||||||
|
|
||||||
// await loadAllProcesses();
|
|
||||||
|
|
||||||
const database = await Database.getInstance();
|
|
||||||
|
|
||||||
try {
|
|
||||||
await database.updateMyProcesses({ myProcessesId: Array.from(myProcesses) });
|
|
||||||
} catch (error) {
|
|
||||||
console.error("Error updating my processes:", error);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function removePlaceholder(wrapper: HTMLElement) {
|
function removePlaceholder(wrapper: HTMLElement) {
|
||||||
@ -176,10 +163,11 @@ async function populateAutocompleteList(select: HTMLSelectElement, query: string
|
|||||||
|
|
||||||
let options_to_show = [];
|
let options_to_show = [];
|
||||||
|
|
||||||
console.log(myProcesses);
|
const service = await Services.getInstance();
|
||||||
|
const myProcesses = await service.getMyProcesses();
|
||||||
|
const allProcesses = new Set(Object.keys(await service.getProcesses()));
|
||||||
const mineArray = Array.from(myProcesses);
|
const mineArray = Array.from(myProcesses);
|
||||||
const allArray = Array.from(allProcesses).filter(id => !myProcesses.has(id));
|
const allArray = Array.from(allProcesses.difference(myProcesses));
|
||||||
|
|
||||||
const wrapper = select.parentNode;
|
const wrapper = select.parentNode;
|
||||||
const input_search = wrapper?.querySelector('.search-container');
|
const input_search = wrapper?.querySelector('.search-container');
|
||||||
@ -385,20 +373,6 @@ addSubscription(document, 'click', () => {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
// async function loadAllProcesses() {
|
|
||||||
// try {
|
|
||||||
// const [allProcessesNew, myProcessesNew] = await Promise.all([
|
|
||||||
// getProcesses(),
|
|
||||||
// getMyProcesses()
|
|
||||||
// ]);
|
|
||||||
|
|
||||||
// myProcesses = myProcesses.union(myProcessesNew);
|
|
||||||
// allProcesses = allProcesses.union(allProcessesNew);
|
|
||||||
// } catch (error) {
|
|
||||||
// console.error("Error loading processes:", error);
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
|
|
||||||
async function showSelectedProcess(elem: MouseEvent) {
|
async function showSelectedProcess(elem: MouseEvent) {
|
||||||
const container = getCorrectDOM('process-list-4nk-component') as HTMLElement;
|
const container = getCorrectDOM('process-list-4nk-component') as HTMLElement;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user