diff options
author | Sai Gandham <sai.gandham@att.com> | 2019-03-13 23:40:45 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2019-03-13 23:40:45 +0000 |
commit | da6154df2951bbdedea753f588d41153e3582ef5 (patch) | |
tree | c1775704aef15ca129bdd9b36a35ca696a38adf3 /auth/auth-gui | |
parent | cf3cdabcaeb2a4854618ff31fdf24e6793277c9a (diff) | |
parent | 889a9891f6df5bbb26a760cfb106be947e87aa5c (diff) |
Merge "Batch Test improvements"
Diffstat (limited to 'auth/auth-gui')
-rw-r--r-- | auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/pages/ApprovalForm.java | 40 | ||||
-rw-r--r-- | auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/table/TextToolTipCell.java | 51 |
2 files changed, 68 insertions, 23 deletions
diff --git a/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/pages/ApprovalForm.java b/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/pages/ApprovalForm.java index f1730380..0c984e4d 100644 --- a/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/pages/ApprovalForm.java +++ b/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/pages/ApprovalForm.java @@ -40,13 +40,12 @@ import org.onap.aaf.auth.gui.Table.Cells; import org.onap.aaf.auth.gui.table.AbsCell; import org.onap.aaf.auth.gui.table.ButtonCell; import org.onap.aaf.auth.gui.table.RadioCell; -import org.onap.aaf.auth.gui.table.RefCell; import org.onap.aaf.auth.gui.table.TableData; -import org.onap.aaf.auth.gui.table.TextAndRefCell; import org.onap.aaf.auth.gui.table.TextCell; +import org.onap.aaf.auth.gui.table.TextToolTipCell; import org.onap.aaf.auth.org.Organization; -import org.onap.aaf.auth.org.OrganizationFactory; import org.onap.aaf.auth.org.Organization.Identity; +import org.onap.aaf.auth.org.OrganizationFactory; import org.onap.aaf.cadi.CadiException; import org.onap.aaf.cadi.client.Future; import org.onap.aaf.cadi.client.Rcli; @@ -91,7 +90,7 @@ public class ApprovalForm extends Page { } }, new Form(true,new Table<AAF_GUI,AuthzTrans>("Approval Requests", gui.env.newTransNoAvg(),new Model(gui.env),"class=stdform")) - .preamble("The following requires your Approval to proceed in the AAF System.</p><p class=subtext>Hover on Identity for Name; click for WebPhone; If Deny is the only option, User is no longer valid."), + .preamble("The following requires your Approval to proceed in the AAF System.</p><p class=subtext>Hover on Name for Identity; If Deny is the only option, User is no longer valid."), new NamedCode(false, "selectAlljs") { @Override public void code(final Cache<HTMLGen> cache, final HTMLGen hgen) throws APIException, IOException { @@ -116,7 +115,7 @@ public class ApprovalForm extends Page { */ private static class Model extends TableData<AAF_GUI,AuthzTrans> { //TODO come up with a generic way to do ILM Info (people page) - private static final String TODO_ILM_INFO = "TODO: ILM Info"; +// private static final String TODO_ILM_INFO = "TODO: ILM Info"; private static final String[] headers = new String[] {"Identity","Request","Approve","Deny"}; @@ -216,7 +215,7 @@ public class ApprovalForm extends Page { // } else { approverHeader = new AbsCell[] { new TextCell("Approvals Delegated to Me by " + iapprover.fullName() - + '(' + iapprover.id() +')', + + '(' + iapprover.id() + ')', new String[] {"colspan=4", "class=head"}) }; // } @@ -242,34 +241,29 @@ public class ApprovalForm extends Page { userCell = AbsCell.Null; } else if (user.endsWith(trans.org().getRealm())){ userOK=true; -// String title; + String title; Organization org = OrganizationFactory.obtain(trans.env(), user); if (org==null) { -// title=""; + title=""; userCell = new TextCell(user); } else { Identity au = org.getIdentity(trans, user); if (au!=null) { if(au.isPerson()) { - userCell = new TextCell(au.fullName() + "\n(" + au.id() + ')'); + userCell = new TextToolTipCell(au.fullName(),"Identity: " + au.id()); } else { - userCell = new TextCell(au.fullID()); + Identity managedBy = au.responsibleTo(); + if (managedBy==null) { + title ="Identity: " + au.type(); + } else { + title="Sponsor: " + managedBy.fullName(); + } + userCell = new TextToolTipCell(au.fullID(),title); } -// -// if ("MECHID".equals(au.type())) { -// Identity managedBy = au.responsibleTo(); -// if (managedBy==null) { -// title ="title=" + au.type(); -// } else { -// title="title=Sponsor is " + managedBy.fullName(); -// } -// } else { -// title="title=" + au.fullName(); -// } } else { userOK=false; -// title="title=Not a User at " + org.getName(); - userCell = new TextCell(user); + title="Not a User at " + org.getName(); + userCell = new TextToolTipCell(user,title); } } prevUser=user; diff --git a/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/table/TextToolTipCell.java b/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/table/TextToolTipCell.java new file mode 100644 index 00000000..986b8245 --- /dev/null +++ b/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/table/TextToolTipCell.java @@ -0,0 +1,51 @@ +/** + * ============LICENSE_START==================================================== + * org.onap.aaf + * =========================================================================== + * Copyright (c) 2018 AT&T Intellectual Property. All rights reserved. + * =========================================================================== + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END==================================================== + * + */ + +package org.onap.aaf.auth.gui.table; + +import org.onap.aaf.misc.xgen.html.HTMLGen; + +/** + * Write Simple Text into a Cell + * @author Jonathan + * + */ +public class TextToolTipCell extends AbsCell { + public final String name; + private final String[] attrs; + private final String tooltip; + + public TextToolTipCell(String name, String tooltip, String... attributes) { + attrs = attributes; + this.name = name; + this.tooltip = "<abbr title=\"" + tooltip + "\">"; + } + + @Override + public void write(HTMLGen hgen) { + hgen.text(tooltip + name + "</abbr>"); + } + + @Override + public String[] attrs() { + return attrs; + } +} |