contentful-migration
Version:
Migration tooling for contentful
54 lines • 1.93 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 editor_layout_create_field_group_1 = require("../../action/editor-layout/editor-layout-create-field-group");
class EditorLayoutCreateFieldGroupIntent extends base_intent_1.default {
isEditorInterfaceIntent() {
return true;
}
isEditorLayoutUpdate() {
return true;
}
isFieldGroupCreate() {
return true;
}
isGroupable() {
return true;
}
groupsWith(other) {
return other.isGroupable()
&& other.isEditorLayoutUpdate()
&& this.isSameContentType(other);
}
endsGroup() {
return false;
}
shouldSave() {
return false;
}
shouldPublish() {
return false;
}
toActions() {
return [
new editor_layout_create_field_group_1.EditorLayoutCreateFieldGroupAction(this.payload.contentTypeId, this.payload.fieldGroupId, this.payload.parentFieldGroupId)
];
}
toPlanMessage() {
const parentInfo = this.payload.parentFieldGroupId ? (0, chalk_1.default) ` in field group {yellow ${this.payload.parentFieldGroupId}}` : '';
return {
heading: (0, chalk_1.default) `Update editor layout for content type {bold.yellow ${this.getContentTypeId()}}`,
sections: [{
heading: (0, chalk_1.default) `Create field group {yellow ${this.getFieldGroupId()}}${parentInfo}`,
details: []
}],
details: []
};
}
}
exports.default = EditorLayoutCreateFieldGroupIntent;
//# sourceMappingURL=editor-layout-create-field-group.js.map