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

WellKnownTemplateIds and AddPowerAppsPersistence refactoring #638

Closed
wants to merge 2 commits into from

Conversation

joem-msft
Copy link
Contributor

@joem-msft joem-msft commented Apr 13, 2024

  • WellKnownTemplateIds constants for id's used in the persistence assembly. Updated ServiceCollectionExtensions to use these.
  • AddPowerAppsPersistence modified:
    • accepts additional parameter for configuring template store. This allows callers unrestricted ability to build the template store removing need to add code in product implementation for testing setup logic.
    • removed parameter useDefaultTemplates in preference for tests to make explicit call to utility method or to do other custom logic.
    • Renamed AddDefaultTemplates to TESTING_ONLY_AddDefaultTemplates to be clear about intention of usage. Made it public so it can be called by DocServer test code directly.
  • Revert "Update ControlTemplate to indicate whether it's a Component or Pcf control template (Update ControlTemplate to indicate whether it's a Component or Pcf control template #631)"
  • Fixed AppGenerator to use ProjectReference to Persistence.csproj to ensure correct nuget dependency validation etc.

@joem-msft joem-msft requested review from a team as code owners April 13, 2024 01:02

namespace Microsoft.PowerPlatform.PowerApps.Persistence.Templates;

public static class WellKnownTemplateIds
Copy link
Contributor

Choose a reason for hiding this comment

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

@petrochuk has added something similar in https://github.com/microsoft/PowerApps-Tooling/pull/636/files#diff-ac4572e52bc9a7f059eddb37ee233946299b268991310aaf4caefd7c1484ad22 . I'd wait for his PR to go in first and then adapt the changes.

Copy link
Contributor

Choose a reason for hiding this comment

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

I think it makes more sense to have names and ids in one place instead of having two separate classes: one for names and one for ids

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This class only hods IDs. the names are extra metadata which are out of scope of document template Ids.
I've remerged with master and used these constants in your 'BuiltInTemplates' class so there's still a single source of truth.

Copy link
Contributor

Choose a reason for hiding this comment

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

I think it would be useful to have ids in the same place as names

… or Pcf control template (#631)"

This reverts commit 368eb14.
@joem-msft joem-msft force-pushed the users/joemay/Persistence-misc branch from 31a3254 to ce383d1 Compare April 15, 2024 23:16
  - accepts additional parameter for configuring template store.
  - removed parameter `useDefaultTemplates` in preference for tests to make explicit call to utility method or to do other custom logic.
  - Renamed `AddDefaultTemplates` to `TESTING_ONLY_AddDefaultTemplates` to be clear about intention of usage.
- `WellKnownTemplateIds` constants for id's used in the persistence assembly. Updated ServiceCollectionExtensions to use these.
- Update AppGenerator to use ProjectReferences
@joem-msft joem-msft force-pushed the users/joemay/Persistence-misc branch from ce383d1 to e08274c Compare April 15, 2024 23:28
@joem-msft joem-msft enabled auto-merge (squash) April 17, 2024 15:56

namespace Microsoft.PowerPlatform.PowerApps.Persistence.Templates;

public static class WellKnownTemplateIds
Copy link
Contributor

Choose a reason for hiding this comment

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

I think it would be useful to have ids in the same place as names

@joem-msft joem-msft closed this Apr 17, 2024
auto-merge was automatically disabled April 17, 2024 20:17

Pull request was closed

@joem-msft joem-msft deleted the users/joemay/Persistence-misc branch April 17, 2024 20:18
@microsoft microsoft deleted a comment from joem-msft Apr 18, 2024
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.

5 participants