-
Notifications
You must be signed in to change notification settings - Fork 263
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
Simplify timelines UI/reuse UI elements #2629
Commits on Jan 9, 2023
-
Configuration menu - View commit details
-
Copy full SHA for b514517 - Browse repository at this point
Copy the full SHA b514517View commit details -
Configuration menu - View commit details
-
Copy full SHA for 3648259 - Browse repository at this point
Copy the full SHA 3648259View commit details -
Configuration menu - View commit details
-
Copy full SHA for 5d35dda - Browse repository at this point
Copy the full SHA 5d35ddaView commit details -
Configuration menu - View commit details
-
Copy full SHA for 26e6918 - Browse repository at this point
Copy the full SHA 26e6918View commit details -
Use temporal extent to render start/end dates
This allows us to render entities of any type in timelines, not only entities that have `date`/`startDate`/`endDate` properties
Configuration menu - View commit details
-
Copy full SHA for e297833 - Browse repository at this point
Copy the full SHA e297833View commit details -
Configuration menu - View commit details
-
Copy full SHA for a6ca505 - Browse repository at this point
Copy the full SHA a6ca505View commit details
Commits on Jan 29, 2023
-
Configuration menu - View commit details
-
Copy full SHA for 376300f - Browse repository at this point
Copy the full SHA 376300fView commit details -
Configuration menu - View commit details
-
Copy full SHA for e50ab1b - Browse repository at this point
Copy the full SHA e50ab1bView commit details -
Configuration menu - View commit details
-
Copy full SHA for 3f69a56 - Browse repository at this point
Copy the full SHA 3f69a56View commit details -
Handle updates to timeline state
This might be a very good idea and a step towards eliminating Redux in our app in most cases where it's not really required (i.e. most CRUD operations.) Or it's a very dumb idea (if we keep using Redux and now have inconsistent state management.)
Configuration menu - View commit details
-
Copy full SHA for 8fd8217 - Browse repository at this point
Copy the full SHA 8fd8217View commit details -
Configuration menu - View commit details
-
Copy full SHA for d636196 - Browse repository at this point
Copy the full SHA d636196View commit details -
Configuration menu - View commit details
-
Copy full SHA for 36c2642 - Browse repository at this point
Copy the full SHA 36c2642View commit details -
The item background is now a shade of the item color
Configuration menu - View commit details
-
Copy full SHA for d548c96 - Browse repository at this point
Copy the full SHA d548c96View commit details -
Configuration menu - View commit details
-
Copy full SHA for c5d0770 - Browse repository at this point
Copy the full SHA c5d0770View commit details -
Configuration menu - View commit details
-
Copy full SHA for 4cbdd68 - Browse repository at this point
Copy the full SHA 4cbdd68View commit details -
Handle timelines without layout
New entitysets do not have a layout by default.
Configuration menu - View commit details
-
Copy full SHA for 3ac5a93 - Browse repository at this point
Copy the full SHA 3ac5a93View commit details -
Fix jerky scrollbar in entity select autocomplete
The loading spinner is implemented using CSS transitions, animating the rotate transform of a rectangle. Depending on the rotation angle, the rectangle will create an overflow and scrollbars will be displayed shortly, then disappear again.
Configuration menu - View commit details
-
Copy full SHA for f370285 - Browse repository at this point
Copy the full SHA f370285View commit details -
Configuration menu - View commit details
-
Copy full SHA for e33f4c2 - Browse repository at this point
Copy the full SHA e33f4c2View commit details -
Configuration menu - View commit details
-
Copy full SHA for e4b0fbd - Browse repository at this point
Copy the full SHA e4b0fbdView commit details -
* Allows users to focus prev/next list items using arrow keys * Focuses list items on click * Selects focused list item by pressing space/enter
Configuration menu - View commit details
-
Copy full SHA for d06822c - Browse repository at this point
Copy the full SHA d06822cView commit details -
Configuration menu - View commit details
-
Copy full SHA for f9d876a - Browse repository at this point
Copy the full SHA f9d876aView commit details -
Configuration menu - View commit details
-
Copy full SHA for fd6e3cb - Browse repository at this point
Copy the full SHA fd6e3cbView commit details -
Configuration menu - View commit details
-
Copy full SHA for cb74955 - Browse repository at this point
Copy the full SHA cb74955View commit details -
Configuration menu - View commit details
-
Copy full SHA for 9187c33 - Browse repository at this point
Copy the full SHA 9187c33View commit details -
Configuration menu - View commit details
-
Copy full SHA for 1916710 - Browse repository at this point
Copy the full SHA 1916710View commit details -
Do not reset properties when changing schema
This copies the property values that are present in the old and the new schema.
Configuration menu - View commit details
-
Copy full SHA for b24b850 - Browse repository at this point
Copy the full SHA b24b850View commit details -
Configuration menu - View commit details
-
Copy full SHA for 29822f5 - Browse repository at this point
Copy the full SHA 29822f5View commit details -
Configuration menu - View commit details
-
Copy full SHA for 10ffaec - Browse repository at this point
Copy the full SHA 10ffaecView commit details -
Configuration menu - View commit details
-
Copy full SHA for 2331d1e - Browse repository at this point
Copy the full SHA 2331d1eView commit details -
Refactor: Introduce
TimelineItem
, a wrapper class for entities`TimelineItem` encapsulates logic commonly required when displaying entities in a timeline, e.g. determining which color to use or what the earliest and latest date the entity covers are. This is in preparation for a new chart view, to ensure common display logic can be shared with the existing list view.
Configuration menu - View commit details
-
Copy full SHA for 26fe059 - Browse repository at this point
Copy the full SHA 26fe059View commit details -
Refactor: Extract keyboard navigation logic into custom hook
This allows sharing the logic across list and chart renderers.
Configuration menu - View commit details
-
Copy full SHA for 59e5cd2 - Browse repository at this point
Copy the full SHA 59e5cd2View commit details -
Configuration menu - View commit details
-
Copy full SHA for caf3d0b - Browse repository at this point
Copy the full SHA caf3d0bView commit details -
Add basic chart renderer for timelines
This isn't enabled/visible to users at the moment. * Supports displaying timeline items in a Gantt-chart like view. * Supports single-day and multi-day items. * Supports different degrees of precision (e.g. `2022`, `2022-01`, `2022-01-15`). * Right now, there's no way to change the scale/resolution of the chart (day/week/month/quarter/year view). I've added a new dependency, `date-fns`, to work with date intervals. We already use a date utility library (Moment.js), however, the project authors recommend not using Moment.js for new projects and Moment.js doesn't have out-of-the-box support for what I needed (e.g. calculating all the months, quarters, etc. within an interval). `date-fns` is a very modular library and allows us to use only what we need, so this adds less than 1kB to the bundle size.
Configuration menu - View commit details
-
Copy full SHA for 79d3967 - Browse repository at this point
Copy the full SHA 79d3967View commit details -
Configuration menu - View commit details
-
Copy full SHA for 533733c - Browse repository at this point
Copy the full SHA 533733cView commit details -
Make timeline item captions sticky
… so they stay visible even if the timeline item is wider than the viewport
Configuration menu - View commit details
-
Copy full SHA for 1aed501 - Browse repository at this point
Copy the full SHA 1aed501View commit details -
Configuration menu - View commit details
-
Copy full SHA for 412e6bc - Browse repository at this point
Copy the full SHA 412e6bcView commit details -
Configuration menu - View commit details
-
Copy full SHA for 4023889 - Browse repository at this point
Copy the full SHA 4023889View commit details -
Configuration menu - View commit details
-
Copy full SHA for cd882d6 - Browse repository at this point
Copy the full SHA cd882d6View commit details -
Extract logic to fetch entity suggestions into custom hook
This makes the component code less complex and allows us to reuse logic in the future.
Configuration menu - View commit details
-
Copy full SHA for 4328b32 - Browse repository at this point
Copy the full SHA 4328b32View commit details -
Configuration menu - View commit details
-
Copy full SHA for 9aa0304 - Browse repository at this point
Copy the full SHA 9aa0304View commit details -
Configuration menu - View commit details
-
Copy full SHA for 7361f7b - Browse repository at this point
Copy the full SHA 7361f7bView commit details -
Refactor: Reduce use of optional props
Initially, I kept types a little more relaxed, allowing component consumers to omit certain event handlers. This is handy especially in tests. For example, a test case may not be dependent on passing a real `onChange` handler to a component. When rendering the component in that test, it's convenient to simply omit the `onChange` property rather than passing a no-op event handler. However, this requires at least some conditional logic in the components. This logic exists only to make writing tests easier. In order to keep the components and prop types as simple as possible, I've marked all props required that are only option for testing purposes. In order to avoid cluttering tests with the same boilerplate props over and over again, I've simply created `defaultProps` objects that can be spread into the components.
Configuration menu - View commit details
-
Copy full SHA for 79b5c44 - Browse repository at this point
Copy the full SHA 79b5c44View commit details -
Use full entity ID when creating new timeline items
This fixes a bug where creating and removing an entity (without reloading the page between both actions) would result in an error. When a user creates a new entity in a timeline, an ID for the entity is auto-generated. When creating a new entity, Aleph appends a HMAC signature (based on dataset ID and entity ID). The auto-generated ID and the signature form the full ID. In order to remove an entity, the full ID needs to be supplied. Previously, when creating a new timeline item, only the auto-generated ID was stored. As a consequence, trying to remove an entity using this ID failed. Now, when creating a new item, we wait for the API response that includes the full entity ID and use that for subsequent requests.
Configuration menu - View commit details
-
Copy full SHA for bbedac2 - Browse repository at this point
Copy the full SHA bbedac2View commit details -
Configuration menu - View commit details
-
Copy full SHA for 5e6bb5d - Browse repository at this point
Copy the full SHA 5e6bb5dView commit details -
Configuration menu - View commit details
-
Copy full SHA for 87e9156 - Browse repository at this point
Copy the full SHA 87e9156View commit details -
Configuration menu - View commit details
-
Copy full SHA for 5409e53 - Browse repository at this point
Copy the full SHA 5409e53View commit details -
Configuration menu - View commit details
-
Copy full SHA for 64f4b11 - Browse repository at this point
Copy the full SHA 64f4b11View commit details -
Replace old Timeline component
I have kept the old implementation around while developing and have selectively used bits and pieces of the existing implementation. That is why there was a src/components/Timeline directory with the old implementation and a src/components/Timeline2 directory with the new implementation.
Configuration menu - View commit details
-
Copy full SHA for f59e1df - Browse repository at this point
Copy the full SHA f59e1dfView commit details -
Configuration menu - View commit details
-
Copy full SHA for 3a45add - Browse repository at this point
Copy the full SHA 3a45addView commit details