Skip to content

Commit

Permalink
Merge pull request #30 from tomaszrondio/master
Browse files Browse the repository at this point in the history
SWP-1146 add proper error message to theme uploader
  • Loading branch information
takeit authored May 28, 2018
2 parents b3d24ba + 3c90978 commit 542e01e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion client/directives/themeManager/ThemeManagerDirective.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ export function ThemeManagerDirective(publisher) {
});
})
.catch((err) => {
scope.uploadError = true;
scope.uploadError = err.data.errors.errors[0] ? err.data.errors.errors[0] : true;
scope.uploading = false;
});
}
Expand Down
8 changes: 5 additions & 3 deletions client/directives/themeManager/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,16 @@
<i class="icon-refresh"></i>
</span>
</div>
<div class="sd-alert sd-alert--hollow sd-alert--alert" ng-show="uploadError">
<button class="sd-alert__close" ng-click="uploadError=false"></button>
<span ng-if="uploadError != true">{{uploadError}}</span>
<span ng-if="uploadError === true"><span translate="">Error</span>: Something went wrong. Try again.</span>
</div>
<div class="flex-grid flex-grid--boxed flex-grid--wrap-items" ng-class="{'flex-grid--small-2' : grid == '2', 'flex-grid--small-4': grid == '4'}">
<div class="flex-grid__item upload-media">
<div class="wizardThemeBox wizardThemeBox--upload">
<div class="drag-area" ngf-drop="uploadTheme($files)"
ngf-multiple="false" ng-class="{compact: items.length}">
<div class="upload-error" ng-show="uploadError">
<span class="action"><span translate="">Error</span>: Something went wrong. Try again.</span>
</div>
<div class="title" translate>Drop Your Theme Here</div>
<div class="upload-manual">
<div class="or-label" translate>or</div>
Expand Down

0 comments on commit 542e01e

Please sign in to comment.