Skip to content
This repository has been archived by the owner on Apr 12, 2022. It is now read-only.

Import all Sample Profiles #2634

Merged
merged 6 commits into from
Dec 3, 2021
Merged

Conversation

evantahler
Copy link
Member

@evantahler evantahler commented Dec 3, 2021

Adds a Button in ui-config to import all sample Records.
Also automatically tries to pre-load all the existing sample records at boot when using ui-cofig

Screen Shot 2021-12-02 at 6 18 45 PM

Screen Shot 2021-12-02 at 6 17 22 PM

Checklists

Development

  • Application changes have been tested appropriately

Impact

  • Code follows company security practices and guidelines
  • Security impact of change has been considered
  • Performance impact of change has been considered
  • Possible migration needs considered (model migrations, config migrations, etc.)

Please explain any security, performance, migration, or other impacts if relevant:

Code review

  • Pull request has a descriptive title and context useful to a reviewer. Screenshots or screencasts are attached where applicable.
  • Relevant tags have been added to the PR (bug, enhancement, internal, etc.)

@evantahler evantahler added the enhancement New feature or request label Dec 3, 2021
api.codeConfig.allowLockedModelChanges = false; // after this point in the Actionhero boot lifecycle, locked models cannot be changed
await loadSampleProfiles();
Copy link
Member Author

@evantahler evantahler Dec 3, 2021

Choose a reason for hiding this comment

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

The story called for this to not be awaited and run in the "background". However, I'm concerned about creating parallel queries when using SQLite (which ui-config is guaranteed to be using).

At the very least, we now are using a "regular" Initializer, not CLSInitializer so failures are OK and the transaction won't be polluted by an import failure here.

Copy link
Member

@bleonard bleonard Dec 3, 2021

Choose a reason for hiding this comment

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

That's a good point but I'm also worried it might take a while to launch.
At a minimum, let's log before we do that so it's clear what is happening on the console.

Copy link
Member Author

Choose a reason for hiding this comment

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

Screen Shot 2021-12-02 at 6 41 08 PM

added in f89ddaa

@evantahler evantahler marked this pull request as ready for review December 3, 2021 02:42
@krishnaglick
Copy link
Contributor

This has conflicts.

@evantahler evantahler merged commit ace9800 into main Dec 3, 2021
@evantahler evantahler deleted the 179930439-import-all-sample-profiles branch December 3, 2021 17:55
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants