Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

REVIEW: Add event for plugins to add to or change the server settings view #796

Merged
merged 2 commits into from

2 participants

@nabcos

No description provided.

@jdillon
Owner

How is a plugin intended to use this event? Looks like the plugins will have to know about the fields of this object, making the integration brittle. Should consider adding some public methods to expose to publics the types of changes they can add. ie. addFormField() or addFieldSet() etc.

@nabcos

(Only) usage of the event is here:
https://github.com/sonatype/nexus-ssl/pull/8/files#L2R38
https://github.com/sonatype/nexus-ssl/pull/8/files#L3R77

Note that the event was updated to use the formPanel as payload, so that handlers do not need to know about the wrapper object, and that the first event was removed which was used to mangle the configuration used to initialize the form panel.

@jdillon jdillon commented on the diff
...main/webapp/js/Sonatype/repoServer/ServerEditPanel.js
@@ -687,6 +690,8 @@ Ext.define('Sonatype.repoServer.ServerEditPanel', {
securityConfigField = this.formPanel.find('name', 'securityEnabled')[0];
securityConfigField.on('select', this.securitySelectHandler, securityConfigField);
+
+ Sonatype.Events.fireEvent('serverConfigViewPostInit', this.formPanel);
@jdillon Owner
jdillon added a note

is this documented anywhere? if not then should add jsduck /** @event ... */ muck here to explain what this event is.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@nabcos nabcos merged commit 9c98eb8 into master
@nabcos nabcos deleted the server-config-plugin-contrib branch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Apr 8, 2013
  1. @nabcos
Commits on Apr 15, 2013
  1. @nabcos

    Add docs

    nabcos authored
This page is out of date. Refresh to see the latest.
View
18 nexus-webapp/src/main/webapp/js/Sonatype/repoServer/ServerEditPanel.js
@@ -11,6 +11,13 @@
* Eclipse Foundation. All other trademarks are the property of their respective owners.
*/
/*global Ext, Sonatype, Nexus*/
+/**
+ * The server settings view.
+ *
+ * @event serverConfigViewPostInit
+ * Global event for plugins to change the server settings view. (Uses Sonatype.Events.)
+ * @param {Ext.FormPanel} The form panel used as the server settings view.
+ */
Ext.define('Sonatype.repoServer.ServerEditPanel', {
extend : 'Ext.Panel',
requires : 'Nexus.util.Strings',
@@ -80,12 +87,12 @@ Ext.define('Sonatype.repoServer.ServerEditPanel', {
layoutConfig : {
labelSeparator : ''
},
-
items : [
{
xtype : 'fieldset',
checkboxToggle : false,
title : 'SMTP Settings',
+ name : 'smtp-settings',
anchor : Sonatype.view.FIELDSET_OFFSET,
collapsible : true,
autoHeight : true,
@@ -149,14 +156,17 @@ Ext.define('Sonatype.repoServer.ServerEditPanel', {
anchor : Sonatype.view.FIELD_OFFSET,
allowBlank : false,
itemCls : 'required-field'
- },
+ }
+ ],
+ buttons : [
{
xtype : 'button',
scope : this,
text : 'Test SMTP settings',
handler : this.testSmtpBtnHandler
}
- ]
+ ],
+ buttonAlign : 'left'
},
{
xtype : 'fieldset',
@@ -687,6 +697,8 @@ Ext.define('Sonatype.repoServer.ServerEditPanel', {
securityConfigField = this.formPanel.find('name', 'securityEnabled')[0];
securityConfigField.on('select', this.securitySelectHandler, securityConfigField);
+
+ Sonatype.Events.fireEvent('serverConfigViewPostInit', this.formPanel);
@jdillon Owner
jdillon added a note

is this documented anywhere? if not then should add jsduck /** @event ... */ muck here to explain what this event is.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
},
optionalFieldsetExpandHandler : function(panel) {
Something went wrong with that request. Please try again.