-
Notifications
You must be signed in to change notification settings - Fork 1
Simplify and expand use of LinkBuilder factory methods #251
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -11,6 +11,7 @@ | |
| import org.labkey.api.query.FieldKey; | ||
| import org.labkey.api.security.User; | ||
| import org.labkey.api.security.UserManager; | ||
| import org.labkey.api.util.LinkBuilder; | ||
| import org.labkey.api.util.PageFlowUtil; | ||
| import org.labkey.api.writer.HtmlWriter; | ||
| import org.labkey.mcc.MccManager; | ||
|
|
@@ -44,7 +45,7 @@ public void renderGridCellContents(RenderContext ctx, HtmlWriter out) | |
| String requestId = ctx.get(getBoundKey("requestId"), String.class); | ||
| Container requestContainer = MccManager.get().getMCCRequestContainer(ctx.getContainer()); | ||
| DetailsURL url = DetailsURL.fromString("/mcc/requestReview.view?requestId=" + requestId + "&mode=rabReview", requestContainer); | ||
| out.write(PageFlowUtil.link("Enter Review").href(url.getActionURL().addReturnUrl(ctx.getViewContext().getActionURL())).addClass("labkey-text-link")); | ||
| out.write(LinkBuilder.labkeyLink("Enter Review", url.getActionURL().addReturnUrl(ctx.getViewContext().getActionURL())).addClass("labkey-text-link")); | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. same as above. this was pre-existing your change and doesnt really harm anything either
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Correct... not needed (it's set by default) but harmless. I'll clear these out before merging, just for clarity. |
||
| } | ||
|
|
||
| @Override | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -13,6 +13,7 @@ | |
| import org.labkey.api.security.User; | ||
| import org.labkey.api.security.UserManager; | ||
| import org.labkey.api.util.HtmlString; | ||
| import org.labkey.api.util.LinkBuilder; | ||
| import org.labkey.api.util.PageFlowUtil; | ||
| import org.labkey.api.view.HttpView; | ||
| import org.labkey.api.view.template.ClientDependency; | ||
|
|
@@ -49,7 +50,7 @@ public void renderGridCellContents(RenderContext ctx, HtmlWriter out) | |
| return; | ||
| } | ||
|
|
||
| out.write(PageFlowUtil.link("Contact Investigator").addClass("labkey-text-link").href("mailto:" + u.getEmail() + "?subject=MCC Request #" + requestRowId)); | ||
| out.write(LinkBuilder.labkeyLink("Contact Investigator", "mailto:" + u.getEmail() + "?subject=MCC Request #" + requestRowId).addClass("labkey-text-link")); | ||
| } | ||
|
|
||
| String status = ctx.get(getBoundKey("requestId", "status"), String.class); | ||
|
|
@@ -77,7 +78,7 @@ public void renderGridCellContents(RenderContext ctx, HtmlWriter out) | |
| { | ||
| DetailsURL url = DetailsURL.fromString("/mcc/requestReview.view?requestId=" + requestId + "&mode=primaryReview", requestContainer); | ||
| out.write(HtmlString.BR); | ||
| out.write(PageFlowUtil.link("Enter MCC Internal Review").addClass("labkey-text-link").href(url.getActionURL().addReturnUrl(ctx.getViewContext().getActionURL()))); | ||
| out.write(LinkBuilder.labkeyLink("Enter MCC Internal Review", url.getActionURL().addReturnUrl(ctx.getViewContext().getActionURL())).addClass("labkey-text-link")); | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. same as above |
||
| } | ||
| } | ||
| else if (st == MccManager.RequestStatus.RabReview && ctx.get(FieldKey.fromString("pendingRabReviews"), Integer.class) == 0) | ||
|
|
@@ -86,7 +87,7 @@ else if (st == MccManager.RequestStatus.RabReview && ctx.get(FieldKey.fromString | |
| { | ||
| DetailsURL url = DetailsURL.fromString("/mcc/requestReview.view?requestId=" + requestId + "&mode=resourceAvailability", requestContainer); | ||
| out.write(HtmlString.BR); | ||
| out.write(PageFlowUtil.link("Enter Resource Availability Assessment").addClass("labkey-text-link").href(url.getActionURL().addReturnUrl(ctx.getViewContext().getActionURL()))); | ||
| out.write(LinkBuilder.labkeyLink("Enter Resource Availability Assessment", url.getActionURL().addReturnUrl(ctx.getViewContext().getActionURL())).addClass("labkey-text-link")); | ||
| } | ||
| } | ||
| else if (st == MccManager.RequestStatus.PendingDecision) | ||
|
|
@@ -95,16 +96,17 @@ else if (st == MccManager.RequestStatus.PendingDecision) | |
| { | ||
| DetailsURL url = DetailsURL.fromString("/mcc/requestReview.view?requestId=" + requestId + "&mode=finalReview", requestContainer); | ||
| out.write(HtmlString.BR); | ||
| out.write(PageFlowUtil.link("Enter Final Review").addClass("labkey-text-link").href(url.getActionURL().addReturnUrl(ctx.getViewContext().getActionURL()))); | ||
| out.write(LinkBuilder.labkeyLink("Enter Final Review", url.getActionURL().addReturnUrl(ctx.getViewContext().getActionURL())).addClass("labkey-text-link")); | ||
| } | ||
| } | ||
| else if (st == MccManager.RequestStatus.Approved) | ||
| { | ||
| out.write(HtmlString.BR); | ||
| out.write(PageFlowUtil.link("Mark Fulfilled"). | ||
| out.write(LinkBuilder.labkeyLink("Mark Fulfilled"). | ||
| addClass("labkey-text-link"). | ||
| addClass("rsadc-approved"). | ||
| attributes(PageFlowUtil.map("data-requestrowid", String.valueOf(requestRowId)))); | ||
| attributes(PageFlowUtil.map("data-requestrowid", String.valueOf(requestRowId))) | ||
| ); | ||
|
|
||
| if (!_hasRegisteredApprovedHandler) | ||
| { | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
addClass not needed, right (and maybe not needed before either)?