Fix some list problems

This commit is contained in:
Patrick Jentsch 2023-02-10 14:51:47 +01:00
parent 1767ceee01
commit 874c963cc4
7 changed files with 8 additions and 1 deletions

View File

@ -11,6 +11,7 @@ class CorpusFileList extends ResourceList {
this.isInitialized = false; this.isInitialized = false;
this.userId = listContainerElement.dataset.userId; this.userId = listContainerElement.dataset.userId;
this.corpusId = listContainerElement.dataset.corpusId; this.corpusId = listContainerElement.dataset.corpusId;
if (this.userId === undefined || this.corpusId === undefined) {return;}
app.subscribeUser(this.userId).then((response) => { app.subscribeUser(this.userId).then((response) => {
app.socket.on('PATCH', (patch) => { app.socket.on('PATCH', (patch) => {
if (this.isInitialized) {this.onPatch(patch);} if (this.isInitialized) {this.onPatch(patch);}

View File

@ -8,8 +8,9 @@ class CorpusList extends ResourceList {
constructor(listContainerElement, options = {}) { constructor(listContainerElement, options = {}) {
super(listContainerElement, options); super(listContainerElement, options);
this.listjs.list.addEventListener('click', (event) => {this.onClick(event)}); this.listjs.list.addEventListener('click', (event) => {this.onClick(event)});
this.isInitialized = false; this.isInitialized = false
this.userId = listContainerElement.dataset.userId; this.userId = listContainerElement.dataset.userId;
if (this.userId === undefined) {return;}
app.subscribeUser(this.userId).then((response) => { app.subscribeUser(this.userId).then((response) => {
app.socket.on('PATCH', (patch) => { app.socket.on('PATCH', (patch) => {
if (this.isInitialized) {this.onPatch(patch);} if (this.isInitialized) {this.onPatch(patch);}

View File

@ -11,6 +11,7 @@ class JobInputList extends ResourceList {
this.isInitialized = false; this.isInitialized = false;
this.userId = listContainerElement.dataset.userId; this.userId = listContainerElement.dataset.userId;
this.jobId = listContainerElement.dataset.jobId; this.jobId = listContainerElement.dataset.jobId;
if (this.userId === undefined || this.jobId === undefined) {return;}
app.subscribeUser(this.userId).then((response) => { app.subscribeUser(this.userId).then((response) => {
app.socket.on('PATCH', (patch) => { app.socket.on('PATCH', (patch) => {
if (this.isInitialized) {this.onPatch(patch);} if (this.isInitialized) {this.onPatch(patch);}

View File

@ -10,6 +10,7 @@ class JobList extends ResourceList {
this.listjs.list.addEventListener('click', (event) => {this.onClick(event)}); this.listjs.list.addEventListener('click', (event) => {this.onClick(event)});
this.isInitialized = false; this.isInitialized = false;
this.userId = listContainerElement.dataset.userId; this.userId = listContainerElement.dataset.userId;
if (this.userId === undefined) {return;}
app.subscribeUser(this.userId).then((response) => { app.subscribeUser(this.userId).then((response) => {
app.socket.on('PATCH', (patch) => { app.socket.on('PATCH', (patch) => {
if (this.isInitialized) {this.onPatch(patch);} if (this.isInitialized) {this.onPatch(patch);}

View File

@ -11,6 +11,7 @@ class JobResultList extends ResourceList {
this.isInitialized = false; this.isInitialized = false;
this.userId = listContainerElement.dataset.userId; this.userId = listContainerElement.dataset.userId;
this.jobId = listContainerElement.dataset.jobId; this.jobId = listContainerElement.dataset.jobId;
if (this.userId === undefined || this.jobId === undefined) {return;}
app.subscribeUser(this.userId).then((response) => { app.subscribeUser(this.userId).then((response) => {
app.socket.on('PATCH', (patch) => { app.socket.on('PATCH', (patch) => {
if (this.isInitialized) {this.onPatch(patch);} if (this.isInitialized) {this.onPatch(patch);}

View File

@ -11,6 +11,7 @@ class SpaCyNLPPipelineModelList extends ResourceList {
this.listjs.list.addEventListener('click', (event) => {this.onClick(event)}); this.listjs.list.addEventListener('click', (event) => {this.onClick(event)});
this.isInitialized = false; this.isInitialized = false;
this.userId = listContainerElement.dataset.userId; this.userId = listContainerElement.dataset.userId;
if (this.userId === undefined) {return;}
app.subscribeUser(this.userId).then((response) => { app.subscribeUser(this.userId).then((response) => {
app.socket.on('PATCH', (patch) => { app.socket.on('PATCH', (patch) => {
if (this.isInitialized) {this.onPatch(patch);} if (this.isInitialized) {this.onPatch(patch);}

View File

@ -11,6 +11,7 @@ class TesseractOCRPipelineModelList extends ResourceList {
this.listjs.list.addEventListener('click', (event) => {this.onClick(event)}); this.listjs.list.addEventListener('click', (event) => {this.onClick(event)});
this.isInitialized = false; this.isInitialized = false;
this.userId = listContainerElement.dataset.userId; this.userId = listContainerElement.dataset.userId;
if (this.userId === undefined) {return;}
app.subscribeUser(this.userId).then((response) => { app.subscribeUser(this.userId).then((response) => {
app.socket.on('PATCH', (patch) => { app.socket.on('PATCH', (patch) => {
if (this.isInitialized) {this.onPatch(patch);} if (this.isInitialized) {this.onPatch(patch);}