UNPKG

contentful-migration

Version:
59 lines 1.97 kB
"use strict"; 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_update_field_group_1 = require("../../action/editor-layout/editor-layout-update-field-group"); class EditorLayoutChangeFieldGroupIdIntent extends base_intent_1.default { isEditorInterfaceIntent() { return true; } isEditorLayoutUpdate() { return true; } isFieldGroupIdChange() { return true; } isGroupable() { return true; } groupsWith(other) { return other.isGroupable() && other.isEditorLayoutUpdate() && this.isSameContentType(other); } endsGroup() { return false; } shouldSave() { return true; } shouldPublish() { return false; } getFieldGroupId() { return this.payload.fieldGroupId; } getNewFieldGroupId() { return this.payload.newFieldGroupId; } toActions() { return [ new editor_layout_update_field_group_1.EditorLayoutChangeFieldGroupIdAction(this.payload.contentTypeId, this.getFieldGroupId(), this.getNewFieldGroupId()) ]; } toPlanMessage() { return { heading: (0, chalk_1.default) `Update editor layout for content type {bold.yellow ${this.getContentTypeId()}}`, sections: [{ heading: (0, chalk_1.default) `Change field group id from {yellow ${this.payload.fieldGroupId}} to {yellow ${this.payload.newFieldGroupId}}`, details: [] }], details: [] }; } } exports.default = EditorLayoutChangeFieldGroupIdIntent; //# sourceMappingURL=editor-layout-change-field-group-id.js.map