-
Notifications
You must be signed in to change notification settings - Fork 40
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
SWC-7067 #5611
Merged
Merged
SWC-7067 #5611
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
14af2e3
SWC-7067: in progress
jay-hodgson 6bbd278
make DataCatalog place accessible (and in the open access area)
jay-hodgson 1491eb5
New Data Catalog page is unlinked but functional
jay-hodgson d31ed8a
native column alias map is not working, just remove for initial release
jay-hodgson f9f6bff
fix bugs from accidental refactor in VS Code
jay-hodgson File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
src/main/java/org/sagebionetworks/web/client/jsinterop/CardConfiguration.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
package org.sagebionetworks.web.client.jsinterop; | ||
|
||
import java.util.Map; | ||
import jsinterop.annotations.JsFunction; | ||
import jsinterop.annotations.JsOverlay; | ||
import jsinterop.annotations.JsPackage; | ||
import jsinterop.annotations.JsType; | ||
import jsinterop.base.Js; | ||
import jsinterop.base.JsPropertyMap; | ||
|
||
@JsType(isNative = true, namespace = JsPackage.GLOBAL, name = "Object") | ||
public class CardConfiguration { | ||
|
||
String type; | ||
double secondaryLabelLimit; | ||
GenericCardSchema genericCardSchema; | ||
|
||
@JsOverlay | ||
public static CardConfiguration create( | ||
String type, | ||
int secondaryLabelLimit, | ||
GenericCardSchema genericCardSchema | ||
) { | ||
CardConfiguration config = new CardConfiguration(); | ||
config.type = type; | ||
config.secondaryLabelLimit = secondaryLabelLimit; | ||
config.genericCardSchema = genericCardSchema; | ||
return config; | ||
} | ||
} |
36 changes: 36 additions & 0 deletions
36
src/main/java/org/sagebionetworks/web/client/jsinterop/GenericCardSchema.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
package org.sagebionetworks.web.client.jsinterop; | ||
|
||
import java.util.Map; | ||
import jsinterop.annotations.JsNullable; | ||
import jsinterop.annotations.JsOverlay; | ||
import jsinterop.annotations.JsPackage; | ||
import jsinterop.annotations.JsType; | ||
import jsinterop.base.Js; | ||
import jsinterop.base.JsPropertyMap; | ||
|
||
@JsType(isNative = true, namespace = JsPackage.GLOBAL, name = "Object") | ||
public class GenericCardSchema { | ||
|
||
String type; | ||
String title; | ||
String subTitle; | ||
String description; | ||
String[] secondaryLabels; | ||
|
||
@JsOverlay | ||
public static GenericCardSchema create( | ||
String type, | ||
String title, | ||
String subTitle, | ||
String description, | ||
String[] secondaryLabels | ||
) { | ||
GenericCardSchema config = new GenericCardSchema(); | ||
config.type = type; | ||
config.title = title; | ||
config.subTitle = subTitle; | ||
config.description = description; | ||
config.secondaryLabels = secondaryLabels; | ||
return config; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 33 additions & 0 deletions
33
src/main/java/org/sagebionetworks/web/client/place/DataCatalogPagePlace.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
package org.sagebionetworks.web.client.place; | ||
|
||
import com.google.gwt.place.shared.Place; | ||
import com.google.gwt.place.shared.PlaceTokenizer; | ||
import com.google.gwt.place.shared.Prefix; | ||
|
||
public class DataCatalogPagePlace extends Place { | ||
|
||
private String token; | ||
|
||
public DataCatalogPagePlace(String token) { | ||
this.token = token; | ||
} | ||
|
||
public String toToken() { | ||
return token; | ||
} | ||
|
||
@Prefix("DataCatalog") | ||
public static class Tokenizer | ||
implements PlaceTokenizer<DataCatalogPagePlace> { | ||
|
||
@Override | ||
public String getToken(DataCatalogPagePlace place) { | ||
return place.toToken(); | ||
} | ||
|
||
@Override | ||
public DataCatalogPagePlace getPlace(String token) { | ||
return new DataCatalogPagePlace(token); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 32 additions & 0 deletions
32
src/main/java/org/sagebionetworks/web/client/presenter/DataCatalogPagePresenter.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
package org.sagebionetworks.web.client.presenter; | ||
|
||
import com.google.gwt.activity.shared.AbstractActivity; | ||
import com.google.gwt.event.shared.EventBus; | ||
import com.google.gwt.user.client.ui.AcceptsOneWidget; | ||
import com.google.inject.Inject; | ||
import org.sagebionetworks.web.client.view.DataCatalogPageView; | ||
|
||
public class DataCatalogPagePresenter | ||
extends AbstractActivity | ||
implements | ||
Presenter<org.sagebionetworks.web.client.place.DataCatalogPagePlace> { | ||
|
||
private DataCatalogPageView view; | ||
|
||
@Inject | ||
public DataCatalogPagePresenter(DataCatalogPageView view) { | ||
this.view = view; | ||
} | ||
|
||
@Override | ||
public void start(AcceptsOneWidget panel, EventBus eventBus) { | ||
panel.setWidget(view.asWidget()); | ||
} | ||
|
||
@Override | ||
public void setPlace( | ||
final org.sagebionetworks.web.client.place.DataCatalogPagePlace place | ||
) { | ||
view.render(); | ||
} | ||
} |
7 changes: 7 additions & 0 deletions
7
src/main/java/org/sagebionetworks/web/client/view/DataCatalogPageView.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
package org.sagebionetworks.web.client.view; | ||
|
||
import com.google.gwt.user.client.ui.IsWidget; | ||
|
||
public interface DataCatalogPageView extends IsWidget { | ||
public void render(); | ||
} |
76 changes: 76 additions & 0 deletions
76
src/main/java/org/sagebionetworks/web/client/view/DataCatalogPageViewImpl.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
package org.sagebionetworks.web.client.view; | ||
|
||
import com.google.gwt.user.client.Window; | ||
import com.google.gwt.user.client.ui.SimplePanel; | ||
import com.google.gwt.user.client.ui.Widget; | ||
import com.google.inject.Inject; | ||
import java.util.HashMap; | ||
import java.util.Map; | ||
import org.sagebionetworks.web.client.context.SynapseReactClientFullContextPropsProvider; | ||
import org.sagebionetworks.web.client.jsinterop.CardConfiguration; | ||
import org.sagebionetworks.web.client.jsinterop.GenericCardSchema; | ||
import org.sagebionetworks.web.client.widget.header.Header; | ||
import org.sagebionetworks.web.client.widget.table.explore.QueryWrapperPlotNav; | ||
|
||
public class DataCatalogPageViewImpl implements DataCatalogPageView { | ||
|
||
SimplePanel container; | ||
|
||
private Header headerWidget; | ||
private SynapseReactClientFullContextPropsProvider propsProvider; | ||
|
||
@Inject | ||
public DataCatalogPageViewImpl( | ||
Header headerWidget, | ||
SynapseReactClientFullContextPropsProvider propsProvider | ||
) { | ||
container = new SimplePanel(); | ||
container.addStyleName("padding-30"); | ||
this.headerWidget = headerWidget; | ||
this.propsProvider = propsProvider; | ||
} | ||
|
||
@Override | ||
public void render() { | ||
Window.scrollTo(0, 0); // scroll user to top of page | ||
headerWidget.configure(); | ||
|
||
String[] secondaryLabels = { "contributors", "individuals", "id", "link" }; | ||
GenericCardSchema genericCardSchema = GenericCardSchema.create( | ||
"dataset", | ||
"name", | ||
"community", | ||
"description", | ||
secondaryLabels | ||
); | ||
CardConfiguration cardConfiguration = CardConfiguration.create( | ||
"GENERIC_CARD", | ||
4, | ||
genericCardSchema | ||
); | ||
|
||
QueryWrapperPlotNav plotNav = new QueryWrapperPlotNav( | ||
propsProvider, | ||
"SELECT * FROM syn61609402 WHERE includedInDataCatalog = 'true'", | ||
null, | ||
null, | ||
newBundle -> {}, | ||
null, | ||
true, | ||
false, | ||
true, | ||
true, | ||
true, | ||
null, | ||
cardConfiguration, | ||
"Data Catalog" | ||
); | ||
container.clear(); | ||
container.setWidget(plotNav); | ||
} | ||
|
||
@Override | ||
public Widget asWidget() { | ||
return container.asWidget(); | ||
} | ||
} |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
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.
Did something change, I thought long values were disallowed? Or perhaps I'm misunderstanding.
From https://www.gwtproject.org/doc/latest/DevGuideCodingBasicsJSNI.html
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.
This is JsInterop, not JSNI. However, it seems like
double
is the least problematic primitive type for JsInterop. In JsInterop,int
andlong
do work; we're using those for properties in other JsInterop types. I cannot find an authoritative document that describes exactly what Java primitives and classes JsInterop supports.Keeping double is probably fine!
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.
Right! I'm still thinking in JSNI. I guess I'll leave it, for the small potential performance gain