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

feat: import config #55

Merged
merged 33 commits into from
Jan 8, 2025
Merged

feat: import config #55

merged 33 commits into from
Jan 8, 2025

Conversation

cimigree
Copy link
Contributor

@cimigree cimigree commented Dec 11, 2024

Related to Onboarding Screens

  • Adds the ability when creating a project to import a config file.
  • Adds a hook to do so.
  • The easiest and most straightforward way to do this was through using html
  • Added a test to test the hook
  • Took out the extra function in DeviceNaming file
  • Took out the test for device naming because that test is now related to the new onboardingLogic file

@cimigree cimigree requested a review from ErikSin December 11, 2024 22:15
@cimigree cimigree requested review from achou11 and removed request for ErikSin January 6, 2025 16:01
Copy link
Member

@achou11 achou11 left a comment

Choose a reason for hiding this comment

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

Think this PR is blocked on some changes we need to make at the Electron level - I'm going to spend a small amount of time putting up a separate PR to help this!

src/renderer/src/hooks/useConfigFileImporter.ts Outdated Show resolved Hide resolved
src/renderer/src/hooks/useConfigFileImporter.ts Outdated Show resolved Hide resolved
src/renderer/src/hooks/mutations/projects.ts Outdated Show resolved Hide resolved
…Adjusts some naming in create project screen. Adjusts test accordingly. Removes extra invalidation.
@cimigree cimigree requested a review from achou11 January 6, 2025 21:25
Copy link
Member

@achou11 achou11 left a comment

Choose a reason for hiding this comment

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

couple of minor code suggestions and then also some UX-related feedback

src/renderer/src/routes/Onboarding/CreateProjectScreen.tsx Outdated Show resolved Hide resolved
src/renderer/src/routes/Onboarding/CreateProjectScreen.tsx Outdated Show resolved Hide resolved
src/renderer/src/routes/Onboarding/CreateProjectScreen.tsx Outdated Show resolved Hide resolved
src/renderer/src/hooks/useConfigFileImporter.test.tsx Outdated Show resolved Hide resolved
src/renderer/src/hooks/useConfigFileImporter.test.tsx Outdated Show resolved Hide resolved
src/renderer/src/routes/Onboarding/CreateProjectScreen.tsx Outdated Show resolved Hide resolved

import { useSelectProjectConfigFile } from './mutations/file-system'

describe('useSelectProjectConfigFile', () => {
Copy link
Member

Choose a reason for hiding this comment

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

non-blocking but would be good to add a test here for when the payload from window.runtime.selectFile() is invalid e.g. the path or name are not strings

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Just FYI, to get it to "throw" the error, I have to mock the selectFile as a rejected promise... because otherwise I would actually have to spin up Electron or the preload script with an integration test or an E2E test. Hope that is ok. Is this useful? Not sure...

Copy link
Member

@achou11 achou11 Jan 8, 2025

Choose a reason for hiding this comment

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

I have to mock the selectFile as a rejected promise

yeah this is what I figured you would do for now. think that's fine 👍

EDIT: re-reading it and yeah, my initial suggestion was something that can't be done easily (i.e. stub the ipc call to electron). there's probably a way to do it but not worth figuring it out. Given that, maybe not as useful as I initially thought

@cimigree cimigree merged commit 6a9ffae into main Jan 8, 2025
4 checks passed
@cimigree cimigree deleted the feat/import-config branch January 8, 2025 18:29
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.

2 participants