Skip to content

Commit f643fcc

Browse files
committed
resolving conflict
2 parents 95857fc + dbcb38f commit f643fcc

File tree

4 files changed

+15
-12
lines changed

4 files changed

+15
-12
lines changed

docs/property.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ Here are shortlinks to the different methods explanation.
2222

2323
## Get methods
2424

25-
When you have your property instance created, the methods that you may want to call first are the get methods. They never take any argument, they don't actually need any argument.\
25+
When you have your property instance created, the methods that you may want to call first are the get methods. They never take any argument, they dont actually need any argument.
2626
The only thing important to know is that you must run the getRules() method before the getRuleComponents() method.
2727

2828
The different get methods are the following :

docs/synchronizer.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,4 +131,4 @@ An example on how the data element looks like:
131131
]
132132
}
133133
]
134-
```
134+
```

docs/translator.md

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,15 @@ What is really required is the base property extensions and rules. The id of the
1313
This is an assumption that I have when I created this facilitator, you would have a blueprint that you will use to copy elements from.
1414
The translator class provide 2 methods to add base rule and base extension ids:
1515

16-
* setBaseExtensions
17-
* setBaseRules
18-
19-
Both elements are taking the 2 same arguments:
20-
21-
* base_property : list of all of the extensions or rules that you want to remember for matching.
22-
* property_name : name to establish the matching.
16+
* **setBaseExtensions** : Pass all the extensions from the base property to start building the table.
17+
Arguments:
18+
* base_property : REQUIRED : list of all extensions retrieve through getExtensions method
19+
* property_name : REQUIRED : name of your base property.
20+
21+
* **setBaseRules**: Pass all the rules from the base property to start building the table.
22+
Arguments:
23+
* base_property : REQUIRED : list of all rules retrieve through getExtensions method
24+
* property_name : REQUIRED : name of your base property.
2325

2426
## Set Target Rule and Extensions ids
2527

launchpy/synchronizer.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -139,20 +139,21 @@ def syncComponent(self,componentName:str=None,componentId:str=None,publishedVers
139139
cmp_baseDict['copy'] = copySettings(publishedVersion)
140140
## handling the data element
141141
if cmp_baseDict['component']['type'] == 'data_elements':
142-
latestCompVersion = self.base['api'].getDataElement(cmp_baseDict['id'],cmp_baseDict['component'])
142+
latestCompVersion = self.base['api'].getDataElement(cmp_baseDict['id']).get('data',cmp_baseDict['component'])
143143
cmp_baseDict = {'id':latestCompVersion['id'],'name':latestCompVersion['attributes']['name'],'component':latestCompVersion,'copy':copySettings(latestCompVersion)}
144144
for target in list(self.targets.keys()):
145145
flagAllowList = False
146146
## check if the component is in the exclComponentList
147147
if any([bool(re.search(key,cmp_baseDict['name'])) for key in self.target_configs.get(target,{}).get('exclComponents',[])]):
148148
return {cmp_baseDict['name']:False}
149-
translatedComponent = self.translator.translate(target,data_element=cmp_baseDict['copy'])
150149
## if there is an allow list for that property
151150
if len(self.target_configs.get(target,{}).get('inclComponents',[]))>0:
152151
if any([bool(re.search(key,cmp_baseDict['name'])) for key in self.target_configs.get(target,{}).get('inclComponents',[])]):
153152
flagAllowList = True
154153
## if there is no allow list for that property, or no match in the list of target properties, or component was allow
155154
if len(self.target_configs.get(target,{}).get('inclComponents',[]))==0 or flagAllowList:
155+
translatedComponent = self.translator.translate(target,data_element=cmp_baseDict['copy'])
156+
## if it does not exist
156157
if cmp_baseDict['name'] not in [de['attributes']['name'] for de in self.targets[target]['dataElements']]:
157158
comp = self.targets[target]['api'].createDataElement(
158159
name=cmp_baseDict['name'],
@@ -191,7 +192,7 @@ def syncComponent(self,componentName:str=None,componentId:str=None,publishedVers
191192
self.targets[target]['libraryStack']['dataElements'].append(comp)
192193
## Rules part
193194
if cmp_baseDict['component']['type'] == 'rules':
194-
latestCompVersion = self.base['api'].getRule(cmp_baseDict['id'],cmp_baseDict['component'])
195+
latestCompVersion = self.base['api'].getRule(cmp_baseDict['id']).get('data',cmp_baseDict['component'])
195196
cmp_baseDict = {'id':latestCompVersion['id'],'name':latestCompVersion['attributes']['name'],'component':latestCompVersion,'copy':copySettings(latestCompVersion)}
196197
## fetching all rule components associated with a rule.
197198
rcsLink = cmp_baseDict['component'].get('relationships',{}).get('rule_components',{}).get('links',{}).get('related')

0 commit comments

Comments
 (0)