contentful-migration
Version:
Migration tooling for contentful
57 lines • 2.06 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 lodash_1 = require("lodash");
const editor_layout_change_field_group_control_1 = require("../../action/editor-layout/editor-layout-change-field-group-control");
class EditorLayoutChangeFieldGroupControlIntent extends base_intent_1.default {
isEditorInterfaceIntent() {
return true;
}
isEditorLayoutUpdate() {
return true;
}
isFieldGroupControlChange() {
return true;
}
isGroupable() {
return true;
}
groupsWith(other) {
return other.isGroupable()
&& other.isEditorLayoutUpdate()
&& this.isSameContentType(other);
}
endsGroup() {
return false;
}
shouldSave() {
return true;
}
shouldPublish() {
return false;
}
toActions() {
return [
new editor_layout_change_field_group_control_1.EditorLayoutChangeFieldGroupControlAction(this.payload.contentTypeId, this.payload.fieldGroupId, this.payload.groupControl)
];
}
toPlanMessage() {
const details = (0, lodash_1.entries)(this.payload.groupControl).map(([key, value]) => {
return (0, chalk_1.default) `{italic ${key}}: ${JSON.stringify(value)}`;
});
return {
heading: (0, chalk_1.default) `Update editor layout for content type {bold.yellow ${this.getContentTypeId()}}`,
sections: [{
heading: (0, chalk_1.default) `Update group controls for field group {yellow ${this.getFieldGroupId()}}`,
details
}],
details: []
};
}
}
exports.default = EditorLayoutChangeFieldGroupControlIntent;
//# sourceMappingURL=editor-layout-change-field-group-control.js.map