Skip to content

Conversation

@robyngit
Copy link
Member

@robyngit robyngit commented Oct 23, 2025

Create a new DatasetControlsView to contain logic for rendering the metrics & cite/anaylze/edit/publish buttons for a dataset. This moves the logic out of the already large MetadataView. The buttons that are rendered in the DatasetControlsView are also now fully configurable in the buttons property of the view, making it easy to add the Notification Service button in the future (#2757).

The styles & layout of the buttons have also been updated to match the mockups in issue #2755, with the metrics and report buttons having a more subtle appearance compared to the "action" buttons like Cite, Edit, Publish, etc. The buttons & layout also now adapt to smaller screen sizes.

During development, I fixed an issue that kept popping up where the edit and publish buttons sometimes wouldn't appear when they should. This was due to the authorization properties on the metadata model not being reset between datasets (so the permissions from the previous dataset would persist!). This fixes #1639 and #1894. I also adjusted some of the small-screen styles of the dataset view header (citation view).

Other minor changes and fixes are documented in the commit messages.

Closes #2755

After

image

Before

image

After

image

Before

image

- Move from beside the metrics buttons
- Replace some repeated colours with CSS vars
- Remove unused styles

Issue #2755
- Fix ESLint errors
- Use Semantic tooltips instead of Bootstrap tooltips
- Move class names, metric icons, and descriptions to constants
- Add missing JSDocs
- Simplify redundant code (make DRY)

Issue #2755
- Remove all styles associated with the buttons in the dataset landing page header (metrics, cit, analyze, edit, etc.)
- Remove unused templates

Issue #2755
- Remove templates that made buttons
- Add a single createButton function
- Use createButton to make the Publish with DOI button
- Break up large functions for readability

Issue #2755
- Move from the MetadataView to a new DatasetControlsView
- Use fetch for publish (with DOI) method in the MetadataView instead of callbacks
- Add try/catch & fetching status flags to Metrics Model to allow avoidance of repeated fetch attempts
- Make the metric name used to initialize the MetricView case insensitive
- Add miscellaneous Utility functions
- In drawMetricsChart in the ModalView, if no metricsModel on currentView of app, use the model that was passed into the MetricModalView

Issue #2755
Properly reset the model between renders by setting the isAuthorized* attributes to null

Issue #1639, #1894, #2755
- De-emphasize metric/report buttons
- Adjust styles on small screens
- Shorten the text of buttons, allow changing text based on screen size
- Make "report" singular when only 1 is available in the Assessment Reports button
- Add placeholder for eventual notifications service button
- Add screenshot to docs

Issue #2755, #2757
- Put methods in a more logical order
- Make the dataset header styles (title, datasource logo, etc.) better for smaller screens

Issue #2755
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: In Review

2 participants