-
Notifications
You must be signed in to change notification settings - Fork 31
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
Dataset details configurable #1642
Comments
Configuration for the current dataset details view could be the following:
|
The configuration that would meet our needs at ESS would be the following:
|
which will create a dataset detail page with the following structure and labels:
|
After some brainstorming here at ESS, we might think that separate Dataset details components might be the way to go. Here the link to the relevant documentation to load component dynamically: |
Additional references on how to dynamically load modules: |
After internal brainstorming, we thing that it might be more useful create a dataset details interface, which allows anybody to contribute customized details pages. |
is ScientificMetadata display also intended to be customisable? why not checking iframes? I like the idea anyway |
I think something to look into is custom scripts loading/execution for custom visualisation in the dataset details page. The datasetDetail page could send data to these scripts that will render it accordingly, inside the dataset details page. This can either be done with iframes or with direct-controlled script loading (I think). We can then create a visualisation registry where we deposit visualisers and enable script loading only from this registry. E.g., with iframes: <iframe src="https://example.com/page?data=someValue"></iframe> This snippet would live in the scicat FE details page https://stackoverflow.com/questions/536538/pass-value-to-iframe-from-a-window |
@minottic I have in the past floated the idea of a rules-based link configuration (#960). If we had a mechanism to configure links to display based on a set of rules that match metadata in the dataset, we could also make this produce the links in iframes. I have proposed iframes before but I feel like it was rejected for some reason. Anyway, I have someone here who will soon start looking into the base rules layer of that proposal. |
Maybe because of this: https://stackoverflow.com/a/23178537 Also, why not just provide API for a build time plugin, and then in the runtime create a corresponding visualization object, based on the whatever parameters you have? Thanks |
I still think that such a runtime framework would benefit from some sort of selector api (similar to k8s) that can come up with a list of templated URLs. Each individual facility might have visualizations that are not directly tied to SciCat, that a user accesses from other frameworks. |
yes, for me the idea would mostly be the capability of loading external (maybe even local) loadScript(src: string): Promise<void> {
return new Promise((resolve, reject) => {
const script = document.createElement('script');
script.src = src;
script.async = true;
script.onload = resolve;
script.onerror = () => reject(new Error(`Failed to load script: ${src}`));
document.body.appendChild(script);
});
}
ngOnInit() {
this.loadScript('https://example.com/external-script.js').then(() => {
(window as any).externalFunction({ key: 'value' }); // No sanitization involved
});
} I guess one advantage of
I like this idea, but I always struggle to understand how it would work in practice. Would we need to develop multiple angular components and install them all together in the FE container and then import them dynamically conditionally based on the need? |
Loading external scripts, especially from arbitrary sources seem like a very bad idea, as it opens up for very easy cross-site scripting. And iframe access to parent ressources (like session cookies etc.) gets more and more restricted in modern browsers, so this calls for more trouble in the future. |
but what if these scripts can only come from a maintained registry (that we manage inside the scicatproject org on github) or from the /assets folder only? |
Great discussion, everybody!!! The work will allow us as core developers to gain the knowledge necessary to formalize how to allow additional core views that can be rule-based selected, but also how to allow third-party views. |
I think the discussion of how to serve facility-specific frontend components should be primarily discussed in #1519 (and SciCatProject/scicat-backend-next#862 on the backend). For now I expect we will continue to implement most features in core and then disable/enable them in the config file. I do think that being able to customize the frontend is an important feature and can have a big impact on usability. I'm slightly concerned about the ballooning of config files. This can make it more difficult to set up and maintain scicat. For instance, config changes are often a source of merge conflicts. That shouldn't block configuration where necessary, but we should keep in mind the need to have good defaults and not require a long config file to start scicat. I'll note that PSI also has a requirement to add some dataset info (namely integration with EMDB for some datasets), so we are quite interested in this. |
Issue Name
Make Dataset Details page configurable through site configuration
Summary
Currently the dataset details page is hard coded as is. There is no option to customize labels, fields order, and which field is in which tile.
We would like to be able to do so by the page structure in configuration.
This feature request arise from the need to restructure such page according to the facility requirements. In our case, the librarian is providing valuable feedback about how to present the dataset information in the most user friendly way. Unfortunately, we would nee to change the FE code to follow up, which will impact other facilities instances.
The text was updated successfully, but these errors were encountered: