Skip to content

Commit

Permalink
Multiple fixes around handling broken links and website reset/provisi…
Browse files Browse the repository at this point in the history
…oning. (#615)
  • Loading branch information
azaslonov authored May 14, 2020
1 parent 5a640d4 commit 64491d5
Show file tree
Hide file tree
Showing 8 changed files with 47 additions and 32 deletions.
40 changes: 20 additions & 20 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,11 @@
"webpack-merge": "^4.2.2"
},
"dependencies": {
"@paperbits/azure": "0.1.279",
"@paperbits/common": "0.1.279",
"@paperbits/core": "0.1.279",
"@paperbits/prosemirror": "0.1.279",
"@paperbits/styles": "0.1.279",
"@paperbits/azure": "0.1.280",
"@paperbits/common": "0.1.280",
"@paperbits/core": "0.1.280",
"@paperbits/prosemirror": "0.1.280",
"@paperbits/styles": "0.1.280",
"@webcomponents/custom-elements": "1.3.2",
"@webcomponents/shadydom": "^1.7.2",
"adal-vanilla": "^1.0.18",
Expand Down
2 changes: 1 addition & 1 deletion src/components/content/content.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export class ContentWorkshop {
component: {
name: "reset-details-workshop",
}
}
};
this.viewManager.openViewAsWorkshop(view);
}
}
7 changes: 6 additions & 1 deletion src/components/content/resetDetails.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { OfflineObjectStorage } from "@paperbits/common/persistence";
import * as ko from "knockout";
import template from "./resetDetails.html";
import { Component } from "@paperbits/common/ko/decorators";
Expand All @@ -18,6 +19,7 @@ export class ResetDetailsWorkshop {
constructor (
private readonly viewManager: ViewManager,
private readonly provisioningService: ProvisionService,
private readonly offlineObjectStorage: OfflineObjectStorage,
private readonly logger: Logger
) {
this.response = ko.observable("");
Expand All @@ -28,10 +30,13 @@ export class ResetDetailsWorkshop {
try {
this.logger.traceEvent("Click: Reset website");

this.offlineObjectStorage.discardChanges();
this.viewManager.clearJourney();
this.viewManager.hideToolboxes();
this.viewManager.notifySuccess("Website reset", `The website is being reset...`);
this.viewManager.setShutter();

await this.provisioningService.cleanup();
await this.provisioningService.provision();

this.logger.traceEvent("Success: Website reset");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,15 +99,15 @@ export class OperationDetails {
const apiName = this.routeHelper.getApiName();
const operationName = this.routeHelper.getOperationName();

if (apiName !== this.selectedApiName()) {
if (apiName && apiName !== this.selectedApiName()) {
this.selectedApiName(apiName);
this.loadApi(apiName);
}

if (apiName !== this.selectedApiName() || operationName !== this.selectedOperationName()) {
this.operation(null);

if (operationName) {
if (apiName && operationName) {
this.selectedOperationName(operationName);
await this.loadOperation(apiName, operationName);
}
Expand Down
2 changes: 1 addition & 1 deletion src/components/setup/setupDialog.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export class SetupDialog {
this.viewManager.removeShutter();
await this.provisioningService.provision();
await this.router.navigateTo("/");

window.location.reload();
}
catch (error) {
Expand Down
2 changes: 0 additions & 2 deletions src/services/provisioningService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ export class ProvisionService {
const dataUrl = `/editors/themes/default.json`;

try {
this.viewManager.removeShutter();
const dataObj = await this.fetchData(dataUrl);
const keys = Object.keys(dataObj);
const accessToken = await this.authenticator.getAccessToken();
Expand Down Expand Up @@ -79,7 +78,6 @@ export class ProvisionService {
}
this.router.navigateTo("/");
this.viewManager.setHost({ name: "page-host" });
this.viewManager.showToolboxes();
}
catch (error) {
throw error;
Expand Down
12 changes: 12 additions & 0 deletions src/themes/website/styles/utils.scss
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,19 @@
display: block;
}

.mt-auto {
margin-top: auto;
}

.mb-auto {
margin-bottom: auto;
}

.text-truncate {
overflow: hidden;
text-overflow: ellipsis;
}

.text-center {
text-align: center;
}

0 comments on commit 64491d5

Please sign in to comment.