/// class PD.Manage.Modules.ObjectModel.EntityTypeCreateDialogCommand

PD.Manage.Modules.ObjectModel.EntityTypeCreateDialogCommand =
PD.Commands.Command.extend({

    //===================================
    // PUBLIC METHODS
    //===================================

    setDefaults: function () {
        this.props("id", "entity-type/create-dialog");
        this.props("enabled", true);
        this.props("icon", PD.Path.to16x16("PLUS.PNG"));
        this.props("label", "New");
        this.props("tooltip", "Create a new Entity Type.");
    },

    execute: function (e) {
        this._super(e);
       
        PDJS.Shared.Features.FeatureDialogForNhib.open({
            title: "New Entity Type",
            args: {
                targetType: "ProspectDirector.Web.Shared.Modules.EntityTypes.EntityTypeUIO",
                arbiterType: "ProspectDirector.Web.Manage.Modules.EntityTypes.EntityTypeArbiter"
            },
            callbacks: {
                "ok": (sender, e) => {

                    PD.context
                        .get_default()
                        .get_events()
                        .publish("entity-type/create", {
                            id: e.target.id
                        });

                }
            }
        });

    }

});