Change the user session SocketIO Logic

This commit is contained in:
Patrick Jentsch
2022-07-04 14:09:17 +02:00
parent b8bf004684
commit 76924956de
20 changed files with 200 additions and 99 deletions

View File

@ -96,7 +96,7 @@ class CorpusFileList extends RessourceList {
}
}
usersPatchHandler(patch) {
onPATCH(patch) {
let corpusFileId;
let filteredPatch;
let match;

View File

@ -88,7 +88,7 @@ class CorpusList extends RessourceList {
}
}
usersPatchHandler(patch) {
onPATCH(patch) {
let corpusId;
let filteredPatch;
let match;

View File

@ -54,5 +54,5 @@ class JobInputList extends RessourceList {
}
}
usersPatchHandler(patch) {return;}
onPATCH(patch) {return;}
}

View File

@ -94,7 +94,7 @@ class JobList extends RessourceList {
}
}
usersPatchHandler(patch) {
onPATCH(patch) {
let filteredPatch;
let jobId;
let match;

View File

@ -57,7 +57,7 @@ class JobResultList extends RessourceList {
}
}
usersPatchHandler(patch) {
onPATCH(patch) {
let filteredPatch;
let operation;
let re;

View File

@ -89,7 +89,7 @@ class QueryResultList extends RessourceList {
}
}
usersPatchHandler(patch) {
onPATCH(patch) {
let filteredPatch;
let match;
let operation;

View File

@ -91,10 +91,10 @@ class RessourceList {
this.userId = this.listjs.listContainer.dataset.userId;
this.listjs.list.addEventListener('click', event => this.onclick(event));
if (this.userId) {
app.addEventListener('users.patch', patch => this.usersPatchHandler(patch));
app.getUserById(this.userId).then(
user => this.init(user),
error => {throw JSON.stringify(error);}
app.socket.on('PATCH', (patch) => {this.onPATCH(patch);});
app.subscribeUser(this.userId).then(
(user) => {this.init(user);},
(error) => {throw JSON.stringify(error);}
);
}
}
@ -117,7 +117,7 @@ class RessourceList {
onclick(event) {throw 'Not implemented';}
usersPatchHandler(patch) {throw 'Not implemented';}
onPATCH(patch) {throw 'Not implemented';}
add(ressources) {
let values = Array.isArray(ressources) ? ressources : [ressources];