提交 46e185d3 编写于 作者: K kohsuke

bug fix in the UI hookup

git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@33851 71c3de6d-444a-0410-be80-ed276b4c234a
上级 e7a2a53a
......@@ -101,10 +101,17 @@ public abstract class Label extends Actionable implements Comparable<Label>, Mod
return name;
}
public String getSearchUrl() {
/**
* Relative URL from the context path.
*/
public String getUrl() {
return "label/"+name;
}
public String getSearchUrl() {
return getUrl();
}
/**
* Evaluates whether the label expression is true given the specified value assignment.
* IOW, returns true if the assignment provided by the resolver matches this label expression.
......
......@@ -91,22 +91,25 @@ public class LabelAtom extends Label implements Saveable {
Vector<Action> ta = new Vector<Action>();
// add the config link
ta.add(new Action() {
public String getIconFileName() {
if (Hudson.getInstance().hasPermission(Hudson.ADMINISTER))
return "setting.gif";
else
return null;
}
public String getDisplayName() {
return "Configure";
}
public String getUrlName() {
return "configure";
}
});
if (!getApplicablePropertyDescriptors().isEmpty()) {
// if there's no property descriptor, there's nothing interesting to configure.
ta.add(new Action() {
public String getIconFileName() {
if (Hudson.getInstance().hasPermission(Hudson.ADMINISTER))
return "setting.gif";
else
return null;
}
public String getDisplayName() {
return "Configure";
}
public String getUrlName() {
return "configure";
}
});
}
for (LabelAtomProperty p : properties)
ta.addAll(p.getActions(this));
......@@ -156,6 +159,7 @@ public class LabelAtom extends Label implements Saveable {
}
}
properties.setOwner(this);
updateTransientActions();
}
/**
......
......@@ -36,10 +36,12 @@ THE SOFTWARE.
<f:textbox value="${it.name}" readonly="true" />
</f:entry>
<f:hetero-list name="properties" hasHeader="true"
descriptors="${it.getApplicablePropertyDescriptors()}"
items="${it.properties}"
addCaption="${%Add label property}"/>
<f:block>
<f:hetero-list name="properties" hasHeader="true"
descriptors="${it.getApplicablePropertyDescriptors()}"
items="${it.properties}"
addCaption="${%Add label property}"/>
</f:block>
<f:block>
<f:submit value="${%Save}"/>
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册