https://github.com/sparna-git/sparnatural-history
Sparnatural query history component
https://github.com/sparna-git/sparnatural-history
sparnatural sparql
Last synced: 12 months ago
JSON representation
Sparnatural query history component
- Host: GitHub
- URL: https://github.com/sparna-git/sparnatural-history
- Owner: sparna-git
- Created: 2025-04-11T08:38:58.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2025-06-11T12:57:23.000Z (about 1 year ago)
- Last Synced: 2025-06-22T02:07:26.232Z (12 months ago)
- Topics: sparnatural, sparql
- Language: TypeScript
- Homepage:
- Size: 2.28 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Sparnatural-history
Sparnatural query history component
## Features Summary
- **Local storage** of stored queries : queries are stored locally in the browser, and persist across sessions
- **Query summary rendering** each query is displayed in a compact way in the history
- **Easy integration** : open the modal dialog from any button or link or icon
- **Favorites support** : Toggle the "star" to put queries in favorite and easily retrieve them
- **Search inside the history** by date range and inside the query structure
- **Sort the history** by date, type searched entity, or by favorites
- **Copy, Load, Delete** actions for each saved query
- **Internationalization** (English/French)
## Internal Components
### `SparnaturalHistoryComponent`
The main component rendered inside . Responsible for:
- Rendering the full history interface
- Initializing the selected language
### `HistorySection`
Handles all the UI logic for the modal, including:
- Loading and displaying saved queries
- Applying a custom scrollable summary renderer
- Favoriting (star icons)
- Copying to clipboard
- Deleting entries
- Filtering by date range with a modal
- Graceful fallback for missing `specProvider`
### `DateFilterModal`
A modal window triggered by a calendar icon, allowing users to apply a date range filter (`minDate` / `maxDate`) on saved queries.
### `ConfirmationModal`
A confirmation dialog shown before critical actions, such as deleting a query or clearing all non-favorited history entries.
### `SparnaturalHistoryI18n`
Loads translation labels from language files in `/assets/lang/en-Hist.json` or `/fr-Hist.json`.
### `LocalDataStorage`
Singleton for handling browser `localStorage`:
- `getHistory()` — retrieves saved history
- `saveQuery(queryJson)` — saves a query with date
- `deleteQuery(id)` — deletes a query
- `clearHistory()` — clears all