Skip to content

Commit

Permalink
Bugfixes
Browse files Browse the repository at this point in the history
  • Loading branch information
lrosenth committed Nov 21, 2021
1 parent dfa899b commit af72d2c
Show file tree
Hide file tree
Showing 8 changed files with 126 additions and 89 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "0826-wordweb-app",
"version": "2.10.15",
"version": "2.10.16",
"scripts": {
"ng": "ng",
"start": "ng serve",
Expand Down
2 changes: 1 addition & 1 deletion src/app/app.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
</main>

<footer>
© 2019-2021 WordWeb | Made by WordWeb at DHLab | {{version}}
© 2019-2021 WordWeb | Made by WordWeb at DHLab (VT/LR) | v{{version}}
</footer>

</mat-sidenav-content>
Expand Down
35 changes: 20 additions & 15 deletions src/app/edit/edit-book/edit-book.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1420,23 +1420,28 @@ export class EditBookComponent implements OnInit {
this.working = true;
console.log('this.value:', this.value);
if (this.inData.bookIri === undefined) {
this.knoraService.createBook(this.value).subscribe(
res => {
console.log('CREATE_RESULT:', res);
this.working = false;
this.location.back();
},
error => {
this.snackBar.open('Error storing the passage object!', 'OK');
console.log('EditCompany.save(): ERROR', error);
this.working = false;
this.location.back();
}
);
if (this.form.valid) {
this.knoraService.createBook(this.value).subscribe(
res => {
console.log('CREATE_RESULT:', res);
this.working = false;
this.location.back();
},
error => {
this.snackBar.open('Error storing the passage object!', 'OK');
console.log('EditCompany.save(): ERROR', error);
this.working = false;
this.location.back();
}
);
} else {
this.snackBar.open('Invalid/incomplete data in form – Please check!',
'OK',
{duration: 10000});
this.working = false;
}
} else {
const obs: Array<Observable<string>> = [];
console.log('this.valIds:', this.valIds);

if (this.valIds.label.changed) {
const gaga: Observable<string> = this.knoraService.updateLabel(
this.resId,
Expand Down
38 changes: 24 additions & 14 deletions src/app/edit/edit-company/edit-company.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -389,6 +389,10 @@ export class EditCompanyComponent implements OnInit {

onTouched = () => {};

onSubmit() {

}

_handleLinkInput(what: string, index?: number): void {
switch(what) {
case 'members':
Expand Down Expand Up @@ -536,21 +540,27 @@ export class EditCompanyComponent implements OnInit {

save(): void {
this.working = true;
console.log('this.value:', this.value);
if (this.inData.companyIri === undefined) {
this.knoraService.createCompany(this.value).subscribe(
res => {
console.log('CREATE_RESULT:', res);
this.working = false;
this.location.back();
},
error => {
this.snackBar.open('Error storing the company object!', 'OK');
console.log('EditCompany.save(): ERROR', error);
this.working = false;
this.location.back();
}
);
if (this.form.valid) {
this.knoraService.createCompany(this.value).subscribe(
res => {
console.log('CREATE_RESULT:', res);
this.working = false;
this.location.back();
},
error => {
this.snackBar.open('Error storing the company object!', 'OK');
console.log('EditCompany.save(): ERROR', error);
this.working = false;
this.location.back();
}
);
} else {
this.snackBar.open('Invalid/incomplete data in form – Please check!',
'OK',
{duration: 10000});
this.working = false;
}
} else {
const obs: Array<Observable<string>> = [];

Expand Down
34 changes: 20 additions & 14 deletions src/app/edit/edit-lexia/edit-lexia.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -525,21 +525,27 @@ export class EditLexiaComponent implements OnInit {

save(): void {
this.working = true;
console.log('this.value:', this.value);
if (this.inData.lexiaIri === undefined) {
this.knoraService.createLexia(this.value).subscribe(
res => {
console.log('CREATE_RESULT:', res);
this.working = false;
this.location.back();
},
error => {
this.snackBar.open('Error storing the lexia object!', 'OK');
console.log('EditLexia.save(): ERROR', error);
this.working = false;
this.location.back();
}
);
if (this.form.valid) {
this.knoraService.createLexia(this.value).subscribe(
res => {
console.log('CREATE_RESULT:', res);
this.working = false;
this.location.back();
},
error => {
this.snackBar.open('Error storing the lexia object!', 'OK');
console.log('EditLexia.save(): ERROR', error);
this.working = false;
this.location.back();
}
);
} else {
this.snackBar.open('Invalid/incomplete data in form – Please check!',
'OK',
{duration: 10000});
this.working = false;
}
} else {
const obs: Array<Observable<string>> = [];

Expand Down
34 changes: 20 additions & 14 deletions src/app/edit/edit-passage/edit-passage.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1224,21 +1224,27 @@ export class EditPassageComponent implements OnInit {

save(): void {
this.working = true;
console.log('this.value:', this.value);
if (this.inData.passageIri === undefined) {
this.knoraService.createPassage(this.value).subscribe(
res => {
console.log('CREATE_RESULT:', res);
this.working = false;
this.location.back();
},
error => {
this.snackBar.open('Error storing the passage object!', 'OK');
console.log('EditCompany.save(): ERROR', error);
this.working = false;
this.location.back();
}
);
if (this.form.valid) {
this.knoraService.createPassage(this.value).subscribe(
res => {
console.log('CREATE_RESULT:', res);
this.working = false;
this.location.back();
},
error => {
this.snackBar.open('Error storing the passage object!', 'OK');
console.log('EditCompany.save(): ERROR', error);
this.working = false;
this.location.back();
}
);
} else {
this.snackBar.open('Invalid/incomplete data in form – Please check!',
'OK',
{duration: 10000});
this.working = false;
}
} else {
const obs: Array<Observable<string>> = [];

Expand Down
36 changes: 20 additions & 16 deletions src/app/edit/edit-person/edit-person.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -581,24 +581,28 @@ export class EditPersonComponent implements OnInit {

save(): void {
this.working = true;
console.log('this.value:', this.value);
if (this.inData.personIri === undefined) {
this.knoraService.createPerson(this.value).subscribe(
res => {
console.log('CREATE_RESULT:', res);
this.working = false;
this.location.back();
},
error => {
this.snackBar.open('Error storing the person object!', 'OK');
console.log('EditPerson.save(): ERROR', error);
this.working = false;
this.location.back();
}
);
if (this.form.valid) {
this.knoraService.createPerson(this.value).subscribe(
res => {
console.log('CREATE_RESULT:', res);
this.working = false;
this.location.back();
},
error => {
this.snackBar.open('Error storing the person object!', 'OK');
console.log('EditPerson.save(): ERROR', error);
this.working = false;
this.location.back();
}
);
} else {
this.snackBar.open('Invalid/incomplete data in form – Please check!',
'OK',
{duration: 10000});
this.working = false;
}
} else {
console.log('this.valIds:', this.valIds);

const obs: Array<Observable<string>> = [];

if (this.valIds.label.changed) {
Expand Down
34 changes: 20 additions & 14 deletions src/app/edit/edit-venue/edit-venue.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -424,21 +424,27 @@ export class EditVenueComponent implements OnInit {

save(): void {
this.working = true;
console.log('this.value:', this.value);
if (this.inData.venueIri === undefined) {
this.knoraService.createVenue(this.value).subscribe(
res => {
console.log('CREATE_RESULT:', res);
this.working = false;
this.location.back();
},
error => {
this.snackBar.open('Error storing the venue object!', 'OK');
console.log('EditVenue.save(): ERROR', error);
this.working = false;
this.location.back();
}
);
if (this.form.valid) {
this.knoraService.createVenue(this.value).subscribe(
res => {
console.log('CREATE_RESULT:', res);
this.working = false;
this.location.back();
},
error => {
this.snackBar.open('Error storing the venue object!', 'OK');
console.log('EditVenue.save(): ERROR', error);
this.working = false;
this.location.back();
}
);
} else {
this.snackBar.open('Invalid/incomplete data in form – Please check!',
'OK',
{duration: 10000});
this.working = false;
}
} else {
const obs: Array<Observable<string>> = [];

Expand Down

0 comments on commit af72d2c

Please sign in to comment.