-
Notifications
You must be signed in to change notification settings - Fork 12
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
enh: add dandi-asset as an additional parameter to external services #1655
Conversation
@@ -388,7 +392,7 @@ function getExternalServices(path: AssetPath) { | |||
.filter((service) => servicePredicate(service, path)) | |||
.map((service) => ({ | |||
name: service.name, | |||
url: `${service.endpoint}${trimEnd((path.asset as AssetFile).url, '/')}`, | |||
url: `${service.endpoint}${trimEnd((path.asset as AssetFile).url, '/')}&dandi-asset=${assetMetadataURI((path.asset as AssetFile).asset_id)}`, |
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.
why not just provide as a separate kwarg to be used in definition of the url to jump to in the service? i.e.
url: `${service.endpoint}${trimEnd((path.asset as AssetFile).url, '/')}&dandi-asset=${assetMetadataURI((path.asset as AssetFile).asset_id)}`, | |
url: `${service.endpoint}${trimEnd((path.asset as AssetFile).url, '/')}`, | |
asset_id: `${assetMetadataURI((path.asset as AssetFile).asset_id)}`, |
?
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.
AH -- I just now saw that we didn't follow the original design idea here and had only prefix for the url:
{
name: 'Neurosift',
regex: /\.nwb$/,
maxsize: Infinity,
endpoint: 'https://flatironinstitute.github.io/neurosift?p=/nwb&url=',
},
my bad -- we ideally would need to RF it to provide all those "format" kwargs, so here it would become
{
name: 'Neurosift',
regex: /\.nwb$/,
maxsize: Infinity,
endpoint: 'https://flatironinstitute.github.io/neurosift?p=/nwb&url={url}&dandi-asset={asset_id}',
},
or some other way java script allows for such embeddings...
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.
according to chatgpt JS/vue has similar to python f-strings so we can easily do that.
const struct = { field1: "value" };
const v = `something ${struct.field1}`;
Closing this as superseded by #1706 and its followups. |
to address passing additional info this adds a new parameter for external services.