Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(create-link-value): Create new resource instance to link when adding a new value (DEV-789) #709

Merged
merged 1 commit into from Apr 7, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -13,7 +13,7 @@
<app-time-value #createVal *ngSwitchCase="constants.TimeValue" [mode]="mode"></app-time-value>
<app-geoname-value #createVal *ngSwitchCase="constants.GeonameValue" [mode]="mode"></app-geoname-value>
<app-link-value #createVal *ngSwitchCase="constants.LinkValue" [mode]="mode"
[parentResource]="parentResource" [propIri]="resourcePropertyDefinition.id"></app-link-value>
[parentResource]="parentResource" [propIri]="resourcePropertyDefinition.id" [currentOntoIri]="ontoIri"></app-link-value>
<app-date-value #createVal *ngSwitchCase="constants.DateValue" [mode]="mode"></app-date-value>
<app-list-value #createVal *ngSwitchCase="constants.ListValue" [mode]="mode"
[propertyDef]="resourcePropertyDefinition"></app-list-value>
Expand Down
Expand Up @@ -57,13 +57,15 @@ export class AddValueComponent implements OnInit, AfterViewInit {
// gui element in case of textValue
textValueGuiEle: 'simpleText' | 'textArea' | 'richText';

ontoIri: string;

constructor(
@Inject(DspApiConnectionToken) private _dspApiConnection: KnoraApiConnection,
private _valueOperationEventService: ValueOperationEventService,
private _valueService: ValueService) { }

ngOnInit() {

this.ontoIri = this.parentResource.type.split('#')[0];
this.mode = 'create';

// since simple text values and rich text values share the same object type 'TextValue',
Expand Down