diff --git a/matsen-tool/src/app/_components/search-select/search-select.component.ts b/matsen-tool/src/app/_components/search-select/search-select.component.ts
index 9fb545d..91fc11c 100644
--- a/matsen-tool/src/app/_components/search-select/search-select.component.ts
+++ b/matsen-tool/src/app/_components/search-select/search-select.component.ts
@@ -98,8 +98,10 @@ export class SearchSelectComponent implements OnInit, AfterViewInit {
this.documentForm.get(this.formId)?.setValue(row.id);
if (this.displayedDataSubResource !== undefined) {
this.paragraphRef.nativeElement.textContent = row[this.displayedDataSubResource][this.displayedDataField];
+ console.log(row[this.displayedDataSubResource][this.displayedDataField]);
} else {
this.paragraphRef.nativeElement.textContent = row[this.displayedDataField];
+ console.log(row[this.displayedDataField]);
}
this.searchBoxFilled = true;
this.searchBoxOpen = false;
diff --git a/matsen-tool/src/app/_views/posts/new-post/new-post.component.html b/matsen-tool/src/app/_views/posts/new-post/new-post.component.html
index 0241344..88f4947 100644
--- a/matsen-tool/src/app/_views/posts/new-post/new-post.component.html
+++ b/matsen-tool/src/app/_views/posts/new-post/new-post.component.html
@@ -1,38 +1,48 @@
-
{{'basic.new-post' | translate}}
-{{'basic.edit-post' | translate}}
+{{ 'basic.new-post' | translate }}
+{{ 'basic.edit-post' | translate }}
diff --git a/matsen-tool/src/app/_views/posts/new-post/new-post.component.ts b/matsen-tool/src/app/_views/posts/new-post/new-post.component.ts
index 1f33d7f..f5f9d30 100644
--- a/matsen-tool/src/app/_views/posts/new-post/new-post.component.ts
+++ b/matsen-tool/src/app/_views/posts/new-post/new-post.component.ts
@@ -22,6 +22,7 @@ import {SearchInputColDef} from "@app/_components/search-input/search-input-col-
})
export class NewPostComponent implements OnInit {
@Input() public posting!: PostJsonld;
+ @Input() public product!: ProductJsonld;
@Output() public submit: EventEmitter = new EventEmitter();
@ViewChild('productSearchSelect', { static: false }) productSearchSelect!: SearchSelectComponent;
@@ -48,6 +49,7 @@ export class NewPostComponent implements OnInit {
}
ngOnInit(): void {
+ console.log(this.posting);
this.postForm = FormGroupInitializer.initFormGroup(this.postForm, this.posting);
}
diff --git a/matsen-tool/src/app/_views/posts/post-list/post-list.component.ts b/matsen-tool/src/app/_views/posts/post-list/post-list.component.ts
index ab0e187..fa2ca06 100644
--- a/matsen-tool/src/app/_views/posts/post-list/post-list.component.ts
+++ b/matsen-tool/src/app/_views/posts/post-list/post-list.component.ts
@@ -135,6 +135,7 @@ export class PostListComponent implements OnInit, AfterViewInit {
}
openModalNewPost() {
+ let postInputs: any = {};
let post: PostJsonld = {} as PostJsonld;
if (this.partner !== undefined) {
@@ -142,9 +143,12 @@ export class PostListComponent implements OnInit, AfterViewInit {
}
if (this.sale !== undefined) {
post.partnerIri = this.sale?.partnerIri;
+ post.productIri = this.sale?.productIri;
post.saleIri = this.sale?.id;
+ postInputs['product'] = this.sale.product;
}
- this.appHelperService.openModal(NewPostComponent, { 'posting': post }, this.getPostsData);
+ postInputs['posting'] = post;
+ this.appHelperService.openModal(NewPostComponent, postInputs, this.getPostsData);
}
openModalEditPost(post: PostJsonld) {