Skip to content

Commit 608190f

Browse files
authored
Revert "Move default media files to regional storage (#2407)" (#2461)
This reverts commit cad0c52.
1 parent bd98aac commit 608190f

File tree

8 files changed

+2
-27
lines changed

8 files changed

+2
-27
lines changed

src/services/provisioningService.ts

Lines changed: 1 addition & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import * as Constants from "../constants";
77
import { MapiClient } from "./mapiClient";
88
import { KnownMimeTypes } from "../models/knownMimeTypes";
99
import { KnownHttpHeaders } from "../models/knownHttpHeaders";
10-
import { ISettingsProvider } from "@paperbits/common/configuration";
1110

1211
export class ProvisionService {
1312
constructor(
@@ -16,8 +15,7 @@ export class ProvisionService {
1615
private readonly authenticator: IAuthenticator,
1716
private readonly viewManager: ViewManager,
1817
private readonly router: Router,
19-
private readonly blobStorage: AzureBlobStorage,
20-
private readonly settingsProvider: ISettingsProvider
18+
private readonly blobStorage: AzureBlobStorage
2119
) { }
2220

2321
private async fetchData(url: string): Promise<Object> {
@@ -29,9 +27,6 @@ export class ProvisionService {
2927
const dataUrl = `/editors/templates/default.json`;
3028
const dataObj = await this.fetchData(dataUrl);
3129
const keys = Object.keys(dataObj);
32-
33-
await this.setUpDefaultContent(dataObj);
34-
3530
const accessToken = await this.authenticator.getAccessTokenAsString();
3631

3732
if (!accessToken) {
@@ -111,24 +106,4 @@ export class ProvisionService {
111106
await this.cleanupBlobs();
112107
await this.cleanupContent();
113108
}
114-
115-
private async setUpDefaultContent(dataObj: object): Promise<void> {
116-
const backendUrl = await this.settingsProvider.getSetting<string>("backendUrl") || `https://${location.hostname}`;
117-
const defaultMedias: { [name: string]: string } = {
118-
"hero-gradient": "hero-gradient.jpg",
119-
"featured-1": "featured-1.jpg",
120-
"featured-2": "featured-2.jpg",
121-
"featured-3": "featured-3.jpg",
122-
"contoso-black": "contoso-black.png",
123-
"logo-contoso-small": "logo-contoso-small.png"
124-
}
125-
126-
const keyPath = "/contentTypes/blob/contentItems";
127-
const downloadUrl = "/assets/images/";
128-
129-
for (const key in defaultMedias) {
130-
const media = defaultMedias[key];
131-
dataObj[`${keyPath}/${key}`]["properties"]["downloadUrl"] = backendUrl + downloadUrl + media;
132-
}
133-
}
134109
}
-6.66 KB
Binary file not shown.
-8.78 KB
Binary file not shown.
-9.47 KB
Binary file not shown.
-9.71 KB
Binary file not shown.
-58.9 KB
Binary file not shown.
-1.74 KB
Binary file not shown.

templates/default.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)