Skip to content
Permalink
Browse files
fix(property-form): only send API request to change the guiElement fo…
…r TextValue object types (#783)
  • Loading branch information
mdelez committed Jul 29, 2022
1 parent e73ab41 commit 109ca05717962c792214991fe791eb0462ddaac8
Showing 1 changed file with 12 additions and 2 deletions.
@@ -455,7 +455,12 @@ export class PropertyFormComponent implements OnInit {
(propertyCommentResponse: ResourcePropertyDefinitionWithAllLanguages) => {
this.lastModificationDate = propertyCommentResponse.lastModificationDate;

if (!this.unsupportedPropertyType) {
// if property type is supported and is of type TextValue and the guiElement is different from its initial value, call replaceGuiElement() to update the guiElement
// this only works for the TextValue object type currently
// https://docs.dasch.swiss/latest/DSP-API/03-apis/api-v2/ontology-information/#changing-the-gui-element-and-gui-attributes-of-a-property
if (!this.unsupportedPropertyType &&
this.propertyInfo.propDef.objectType === Constants.TextValue &&
this.propertyInfo.propDef.guiElement !== this.propertyForm.controls['propType'].value.guiEle) {
this.replaceGuiElement();
} else {
this.loading = false;
@@ -478,7 +483,12 @@ export class PropertyFormComponent implements OnInit {
(deleteCommentResponse: ResourcePropertyDefinitionWithAllLanguages) => {
this.lastModificationDate = deleteCommentResponse.lastModificationDate;

if (!this.unsupportedPropertyType) {
// if property type is supported and is of type TextValue and the guiElement is different from its initial value, call replaceGuiElement() to update the guiElement
// this only works for the TextValue object type currently
// https://docs.dasch.swiss/latest/DSP-API/03-apis/api-v2/ontology-information/#changing-the-gui-element-and-gui-attributes-of-a-property
if (!this.unsupportedPropertyType &&
this.propertyInfo.propDef.objectType === Constants.TextValue &&
this.propertyInfo.propDef.guiElement !== this.propertyForm.controls['propType'].value.guiEle) {
this.replaceGuiElement();
} else {
this.loading = false;

0 comments on commit 109ca05

Please sign in to comment.