crownpeak-dxm-sdk-core
Advanced tools
Comparing version 3.1.0 to 3.2.0
@@ -324,3 +324,3 @@ const CrownpeakApi = require("crownpeak-dxm-accessapi-helper"); | ||
//#endregion | ||
const createOrUpdateTemplate = async (shortName, markup, shortWrapperName, useTmf = false) => { | ||
const createOrUpdateTemplate = async (shortName, markup, shortWrapperName, useTmf = false, useMetadata = false) => { | ||
const name = expandName(shortName, ' ') + " Template"; | ||
@@ -341,2 +341,4 @@ const wrapperName = expandName(shortWrapperName, ' ') + " Wrapper"; | ||
content.enable_tmf = "yes"; | ||
if (useMetadata) | ||
content.meta = "yes"; | ||
if (wrapperName) { | ||
@@ -363,3 +365,3 @@ const wrapperAsset = await getByPath((await getWrapperDefinitionFolder()).fullPath + wrapperName); | ||
progressBar(message, completed, total, `Saving template [${template.name}]`); | ||
let result = await createOrUpdateTemplate(template.name, template.content, template.wrapper || wrapperName, template.useTmf === true); | ||
let result = await createOrUpdateTemplate(template.name, template.content, template.wrapper || wrapperName, template.useTmf === true, template.useMetadata === true); | ||
template.assetId = result.asset.id; | ||
@@ -366,0 +368,0 @@ template.assetPath = await getPath(template.assetId); |
import { ICmsDataProvider } from './ICmsDataProvider'; | ||
export default class CmsStaticDataProvider implements ICmsDataProvider { | ||
private _getPath; | ||
private _getData; | ||
@@ -4,0 +5,0 @@ private _getDataSync; |
@@ -46,2 +46,8 @@ "use strict"; | ||
} | ||
CmsStaticDataProvider.prototype._getPath = function (filename) { | ||
if (cmsDataCache_1.default.cmsStaticDataLocation && cmsDataCache_1.default.cmsStaticDataLocation.indexOf("$file") >= 0) { | ||
return cmsDataCache_1.default.cmsStaticDataLocation.replace("$file", filename); | ||
} | ||
return cmsDataCache_1.default.cmsStaticDataLocation + '/' + filename; | ||
}; | ||
CmsStaticDataProvider.prototype._getData = function (filename) { | ||
@@ -51,3 +57,3 @@ return __awaiter(this, void 0, void 0, function () { | ||
switch (_a.label) { | ||
case 0: return [4 /*yield*/, fetch(cmsDataCache_1.default.cmsStaticDataLocation + '/' + filename)]; | ||
case 0: return [4 /*yield*/, fetch(this._getPath(filename))]; | ||
case 1: return [4 /*yield*/, (_a.sent()).json()]; | ||
@@ -61,3 +67,3 @@ case 2: return [2 /*return*/, _a.sent()]; | ||
var request = new XMLHttpRequest(); | ||
request.open('GET', cmsDataCache_1.default.cmsStaticDataLocation + '/' + filename, false); | ||
request.open('GET', this._getPath(filename), false); | ||
request.send(null); | ||
@@ -64,0 +70,0 @@ if (request.status === 200) { |
{ | ||
"name": "crownpeak-dxm-sdk-core", | ||
"version": "3.1.0", | ||
"version": "3.2.0", | ||
"description": "Crownpeak Digital Experience Management (DXM) Software Development Kits (SDK) have been constructed to assist the Single Page App developer in developing client-side applications that leverage DXM for content management purposes.", | ||
@@ -5,0 +5,0 @@ "repository": "https://github.com/Crownpeak/DXM-SDK-Core", |
@@ -21,3 +21,4 @@ <a href="https://www.crownpeak.com" target="_blank">![Crownpeak Logo](https://github.com/Crownpeak/DXM-SDK-Core/raw/master/images/crownpeak-logo.png?raw=true "Crownpeak Logo")</a> | ||
| 3.0.0 | 2020NOV06 | Change to asynchronous data loading, drag and drop zone governance, new upgrade method. Bug fixes. | | ||
| 3.1.0 | 2021JAN04 | Add string repacements via .cpscaffold.json. | | ||
| 3.1.0 | 2021JAN04 | Add string replacements via .cpscaffold.json. | | ||
| 3.2.0 | 2021JAN07 | Add cp-scaffold for wrappers, option to include metadata on pages, $file macro in CMS_STATIC_CONTENT_LOCATION. | | ||
@@ -24,0 +25,0 @@ ## Credit |
Sorry, the diff of this file is not supported yet
640678
2406
52