/// class PD.Manage.Modules.SyncCreateDialogCommand

PD.Manage.Modules.SyncCreateDialogCommand =
PD.Commands.Command.extend({

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

    setDefaults: function () {
        this.props("id", "sync/create-dialog");
        this.props("enabled", true);
        this.props("icon", PD.Path.to16x16("plus.png"));
        this.props("label", "New");
        this.props("tooltip", "Create a new Active Directory synchronization.");
    },

    execute: function (e) {
        this._super(e);
        this._openDialog();
    },

    //===================================
    // PRIVATE METHODS
    //===================================

    _openDialog: function () {

        PDJS.Shared.Features.FeatureDialogForNhib.open({
            title: "New | Active Directory Sync",
            height: 500,
            width: 500,
            args: {
                targetType: "ProspectDirector.Web.Manage.Modules.Security.SyncSettingsUIO",
                arbiterType: "ProspectDirector.Web.Manage.Modules.Security.SyncSettingsArbiter"
            },
            callbacks: {
                "ok": (sender, e) => {

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

                }
            }
        });

    }

});