Skip to content
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

Custom types config #719

Merged
merged 15 commits into from
May 1, 2020
Merged

Custom types config #719

merged 15 commits into from
May 1, 2020

Conversation

jameskerr
Copy link
Member

fixes #694

Adds a global user preference for which JSON type config file the app should use when ingesting json files. If it is empty, then we use the default provided within the app. Otherwise, we read the contents of that file each time we ingest, and send it over in the payload of our POST /logs/ request.

Of interest:

  • Created a useDropzone hook for making dropzones
  • Created a new global state slice called Prefs to hold user preferences
  • If there is no search window opened when the user selects "Preferences...", the app will now create new one and open the preferences in it

Providing a custom types.json and ingest a custom ndjson file

happy_path

A little bit of validation (check if the file exists and if its json)

error_validation

What happens when you select a garbage file as your types_config

garbage_json_config

@jameskerr jameskerr requested a review from a team April 30, 2020 23:28
Copy link
Contributor

@mason-fish mason-fish left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm!

css rule of pointer-events: none.
*/

export default function useDropzone(dropCallback: Function) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔥

@jameskerr jameskerr force-pushed the custom-types-config branch from 63cfc9f to 4beb940 Compare May 1, 2020 20:48
@jameskerr jameskerr merged commit 2187a0d into master May 1, 2020
@jameskerr jameskerr deleted the custom-types-config branch May 1, 2020 21:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow user to provide a custom JSON typing schema
2 participants