Skip to content

Commit

Permalink
Added a fix to the descriptor initialization
Browse files Browse the repository at this point in the history
Added a fix to the descriptor initialization
  • Loading branch information
NelsonPereira1991 committed Aug 2, 2017
1 parent bc7ca45 commit 173ab9d
Showing 1 changed file with 26 additions and 25 deletions.
51 changes: 26 additions & 25 deletions src/models/meta/descriptor.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,32 @@ function Descriptor(object, typeConfigsToRetain)
self.label = Elements[self.prefix][self.shortName].label;
self.comment = Elements[self.prefix][self.shortName].comment;


if(!isNull(object.label))
{
self.label = object.label;
}
else
{
self.label = Elements[self.prefix][self.shortName].label;
}

if(!isNull(object.comment))
{
self.comment = object.comment;
}
else
{
self.comment = Elements[self.prefix][self.shortName].comment;
}

//override type if supplied in object argument

if(!isNull(object.type))
{
self.type = object.type;
}

if(!isNull(Elements[self.prefix][self.shortName].hasAlternative))
{
self.hasAlternative = Elements[self.prefix][self.shortName].hasAlternative;
Expand Down Expand Up @@ -125,31 +151,6 @@ function Descriptor(object, typeConfigsToRetain)
}
}

if(!isNull(object.label))
{
self.label = object.label;
}
else
{
self.label = Elements[self.prefix][self.shortName].label;
}

if(!isNull(object.comment))
{
self.comment = object.comment;
}
else
{
self.comment = Elements[self.prefix][self.shortName].comment;
}

//override type if supplied in object argument

if(!isNull(object.type))
{
self.type = object.type;
}

self.setValue(object.value);

//try to get parametrization from ontology level
Expand Down

0 comments on commit 173ab9d

Please sign in to comment.