Skip to content

Commit

Permalink
Fixed export theme logic. Only export when visual data and wildcard d…
Browse files Browse the repository at this point in the history
…ata is correct
  • Loading branch information
bhavesh-jadav committed Jan 27, 2019
1 parent d2cadad commit 1cc8fd8
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/main/python/PowerBIThemeGeneratorGUI.py
Original file line number Diff line number Diff line change
Expand Up @@ -596,6 +596,8 @@ def __selectDeselectAll():

def generateTheme(self):
try:
correctVisualData = True
correctWildcardData = True
themeData = {
'name': self._generalProperties['name']
if self._generalProperties.get('name') is not None else 'My Theme',
Expand Down Expand Up @@ -654,6 +656,7 @@ def generateTheme(self):
if selectedVisual in repeatedVisuals:
detailMessage += selectedVisual + ' is selected in report page'\
+ selectedVisualsList[0][i] + '\n'
correctVisualData = False
self._showDialogAfterThemeGeneration(message, detailMessage=detailMessage)

else:
Expand All @@ -677,7 +680,7 @@ def generateTheme(self):
if wildCardProperty in repeatedWildCardProperties:
detailMessage += wildCardProperty + 'is selected in report page' +\
wildCardPropertiesList[0][i]

correctWildcardData = False
self._showDialogAfterThemeGeneration(message, detailMessage=detailMessage)
else:
themeData['visualStyles']['*'] = {
Expand All @@ -691,8 +694,8 @@ def generateTheme(self):
themeData['visualStyles'][selectedVisualsList[1][i]] = {
"*": selectedVisualsList[2][i]
}

self._saveThemeFile(themeData, 'C:/Users/bjadav/Desktop/', themeData['name'])
if correctVisualData is True and correctWildcardData is True:
self._saveThemeFile(themeData, 'C:/Users/bjadav/Desktop/', themeData['name'])

except Exception as e:
ShowErrorDialog(LogException(e))
Expand Down

0 comments on commit 1cc8fd8

Please sign in to comment.