contentful-migration
Version:
Migration tooling for contentful
53 lines • 1.94 kB
JavaScript
;
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const base_intent_1 = __importDefault(require("./base-intent"));
const chalk_1 = __importDefault(require("chalk"));
const editorinterface_save_1 = require("../action/editorinterface-save");
const sidebarwidget_remove_1 = require("../action/sidebarwidget-remove");
class SidebarWidgetRemoveIntent extends base_intent_1.default {
isSidebarUpdate() {
return true;
}
isEditorInterfaceIntent() {
return true;
}
isGroupable() {
return true;
}
groupsWith(other) {
return other.isGroupable() && other.isEditorInterfaceIntent() && this.isSameContentType(other);
}
endsGroup() {
return false;
}
shouldSave() {
return false;
}
shouldPublish() {
return false;
}
toActions() {
return [
new sidebarwidget_remove_1.SidebarWidgetRemoveAction(this.payload.contentTypeId, this.payload.sidebarWidget.widgetId, this.payload.sidebarWidget.widgetNamespace),
new editorinterface_save_1.SaveEditorInterfaceAction(this.payload.contentTypeId)
];
}
toPlanMessage() {
const { widgetId, widgetNamespace } = this.payload.sidebarWidget;
return {
heading: (0, chalk_1.default) `Update sidebar for Content Type {bold.yellow ${this.getContentTypeId()}}`,
details: [],
sections: [
{
heading: (0, chalk_1.default) `Remove sidebar widget {yellow ${widgetId}}`,
details: [(0, chalk_1.default) `{italic widgetNamespace}: "${widgetNamespace}"`]
}
]
};
}
}
exports.default = SidebarWidgetRemoveIntent;
//# sourceMappingURL=sidebarwidget-remove.js.map