Skip to content

Commit

Permalink
from code review - use a Governance specific markdown github componen…
Browse files Browse the repository at this point in the history
…t to rely on the backend to find the correct tag
  • Loading branch information
jay-hodgson committed Oct 2, 2024
1 parent d91542c commit 415f70a
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import jsinterop.annotations.JsType;

@JsType(isNative = true, namespace = JsPackage.GLOBAL, name = "Object")
public class MarkdownGithubProps extends ReactComponentProps {
public class GovernanceMarkdownGithubProps extends ReactComponentProps {

@JsNullable
public String repoOwner;
Expand All @@ -18,12 +18,12 @@ public class MarkdownGithubProps extends ReactComponentProps {
public String filePath;

@JsOverlay
public static MarkdownGithubProps create(
public static GovernanceMarkdownGithubProps create(
String repoOwner,
String repoName,
String filePath
) {
MarkdownGithubProps props = new MarkdownGithubProps();
GovernanceMarkdownGithubProps props = new GovernanceMarkdownGithubProps();
props.repoOwner = repoOwner;
props.repoName = repoName;
props.filePath = filePath;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,9 @@ public static class SynapseComponents {
public static ReactComponentType<
RejectProfileValidationRequestModalProps
> RejectProfileValidationRequestModal;
public static ReactComponentType<MarkdownGithubProps> MarkdownGithub;
public static ReactComponentType<
GovernanceMarkdownGithubProps
> GovernanceMarkdownGithub;

/**
* Pushes a global toast message. In SWC, you should use {@link DisplayUtils#notify}, rather than calling this method directly.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import com.google.gwt.user.client.ui.Composite;
import com.google.inject.Inject;
import org.sagebionetworks.web.client.context.SynapseReactClientFullContextPropsProvider;
import org.sagebionetworks.web.client.jsinterop.MarkdownGithubProps;
import org.sagebionetworks.web.client.jsinterop.GovernanceMarkdownGithubProps;
import org.sagebionetworks.web.client.jsinterop.React;
import org.sagebionetworks.web.client.jsinterop.ReactElement;
import org.sagebionetworks.web.client.jsinterop.SRC;
Expand Down Expand Up @@ -35,14 +35,14 @@ public void render(String repoOwner, String repoName, String filePath) {
scrollToTop();
ReactElement component;

MarkdownGithubProps props = MarkdownGithubProps.create(
GovernanceMarkdownGithubProps props = GovernanceMarkdownGithubProps.create(
repoOwner,
repoName,
filePath
);
component =
React.createElementWithSynapseContext(
SRC.SynapseComponents.MarkdownGithub,
SRC.SynapseComponents.GovernanceMarkdownGithub,
props,
propsProvider.getJsInteropContextProps()
);
Expand Down

0 comments on commit 415f70a

Please sign in to comment.