contentful-migration
Version:
Migration tooling for contentful
45 lines • 1.71 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 editorinterface_copy_1 = require("../action/editorinterface-copy");
const chalk_1 = __importDefault(require("chalk"));
const editorinterface_save_1 = require("../action/editorinterface-save");
class EditorInterfaceCopyIntent extends base_intent_1.default {
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 editorinterface_copy_1.CopyEditorInterfaceAction(this.payload.contentTypeId, this.payload.editorInterfaceCopy.source, this.payload.editorInterfaceCopy.destination),
new editorinterface_save_1.SaveEditorInterfaceAction(this.payload.contentTypeId)
];
}
toPlanMessage() {
const { source, destination } = this.payload.editorInterfaceCopy;
return {
heading: (0, chalk_1.default) `Copy field control for Content Type {bold.yellow ${this.getContentTypeId()}} from field {italic ${source}} to field {italic ${destination}}`,
details: [],
sections: []
};
}
}
exports.default = EditorInterfaceCopyIntent;
//# sourceMappingURL=editorinterface-copy.js.map