Skip to content

Commit

Permalink
feat: minor dashboard changes
Browse files Browse the repository at this point in the history
  • Loading branch information
brianhdk committed Oct 28, 2022
1 parent 16879ed commit ae8473c
Show file tree
Hide file tree
Showing 4 changed files with 54 additions and 12 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
function relewiseDashboardController(relewiseDashboardResources) {
var vm = this;
vm.exportLoading = false;
vm.configurationError = false;
vm.relewiseNotAddedToUmbracoBuilder = false;
vm.unhandledError = false;
vm.configuration = null;
vm.exportContent = function () {
vm.exportLoading = true;
Expand Down Expand Up @@ -41,13 +42,19 @@
function init() {
relewiseDashboardResources.getConfiguration().then((response) => {
if (response.status === 200) {
vm.configurationError = false;
vm.unhandledError = false;
vm.configuration = response.data;
} else if (response.status === 403) {
vm.relewiseNotAddedToUmbracoBuilder = true;
} else {
vm.configurationError = true;
vm.unhandledError = true;
}
}, (response) => {
if (response && response.status === 403) {
vm.relewiseNotAddedToUmbracoBuilder = true;
} else {
vm.unhandledError = true;
}
}, () => {
vm.configurationError = true;
});
}

Expand Down
16 changes: 15 additions & 1 deletion samples/UmbracoV10/App_Plugins/Relewise.Dashboard/dashboard.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,21 @@ <h3 class="bold">Welcome to the Relewise dashboard!</h3>
<umb-box>
<umb-box-content>
<h3>Settings</h3>
<div ng-if="vm.configurationError">
<div ng-if="vm.relewiseNotAddedToUmbracoBuilder">
<span class="error">Relewise has not been added to the Umbraco builder. In 'Startup.cs' locate the 'services.AddUmbraco(...)'-method:</span><br />
<pre>
services.AddUmbraco(_env, _config)
.AddBackOffice()
.AddWebsite()
.AddComposers()
.AddRelewise()
.Build();
...
</pre>
Note the '.AddRelewise()' method-call above - insert that and re-run the site.
</div>

<div ng-if="vm.unhandledError">
<span class="error">Unexpected error occurred. Please check the response on the XHR request or check logs.</span><br />
</div>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
function relewiseDashboardController(relewiseDashboardResources) {
var vm = this;
vm.exportLoading = false;
vm.configurationError = false;
vm.relewiseNotAddedToUmbracoBuilder = false;
vm.unhandledError = false;
vm.configuration = null;
vm.exportContent = function () {
vm.exportLoading = true;
Expand Down Expand Up @@ -41,13 +42,19 @@
function init() {
relewiseDashboardResources.getConfiguration().then((response) => {
if (response.status === 200) {
vm.configurationError = false;
vm.unhandledError = false;
vm.configuration = response.data;
} else if (response.status === 403) {
vm.relewiseNotAddedToUmbracoBuilder = true;
} else {
vm.configurationError = true;
vm.unhandledError = true;
}
}, (response) => {
if (response && response.status === 403) {
vm.relewiseNotAddedToUmbracoBuilder = true;
} else {
vm.unhandledError = true;
}
}, () => {
vm.configurationError = true;
});
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,21 @@ <h3 class="bold">Welcome to the Relewise dashboard!</h3>
<umb-box>
<umb-box-content>
<h3>Settings</h3>
<div ng-if="vm.configurationError">
<div ng-if="vm.relewiseNotAddedToUmbracoBuilder">
<span class="error">Relewise has not been added to the Umbraco builder. In 'Startup.cs' locate the 'services.AddUmbraco(...)'-method:</span><br />
<pre>
services.AddUmbraco(_env, _config)
.AddBackOffice()
.AddWebsite()
.AddComposers()
.AddRelewise()
.Build();
...
</pre>
Note the '.AddRelewise()' method-call above - insert that and re-run the site.
</div>

<div ng-if="vm.unhandledError">
<span class="error">Unexpected error occurred. Please check the response on the XHR request or check logs.</span><br />
</div>

Expand Down

0 comments on commit ae8473c

Please sign in to comment.