Skip to content

[EASI-5033] power platform wrapper#3414

Open
samoddball wants to merge 14 commits intomainfrom
EASI-5033/power_platform_wrapper
Open

[EASI-5033] power platform wrapper#3414
samoddball wants to merge 14 commits intomainfrom
EASI-5033/power_platform_wrapper

Conversation

@samoddball
Copy link
Contributor

EASI-5033

Description

  • UI: adds wrapper around system intake routes to check if power platform is enabled for the active user, in which case we redirect to power platform with the system intake id in the url params
  • BE: adds block to edit routes for system intakes and will block if power platform is enabled for the active user

How to test this change

  1. in your .envrc.local add the following line: export FLAG_SOURCE=LAUNCH_DARKLY # LAUNCH_DARKLY, LOCAL, or FILE - this ensures your local env is looking at live LaunchDarkly data
  2. log into EASI locally - you should be able to perform all normal actions
  3. nav to LaunchDarkly, add your current user's context as true in the local env for this flag: enablePowerPlatform
  4. in the UI, attempt to nav to any part of a system intake (the intake must already have an id, i.e., the url must have an id in it)
  5. you should get redirected to the power platform login screen (or likely whatever is past that if you are already logged in - i don't have access)

PR Author Checklist

  • I have provided a detailed description of the changes in this PR.
  • I have provided clear instructions on how to test the changes in this PR.
  • I have updated tests or written new tests as appropriate in this PR.
  • Updated the BRUNO Collection if necessary.

PR Reviewer Guidelines

  • It's best to pull the branch locally and test it, rather than just looking at the code online!
  • When approving a PR, provide a reason why you're approving it
    • e.g. "Approving because I tested it locally and all functionality works as expected"
    • e.g. "Approving because the change is simple and matches the Figma design"
  • Don't be afraid to leave comments or ask questions, especially if you don't understand why something was done! (This is often a great time to suggest code comments or documentation updates)
  • Check that all code is adequately covered by tests - if it isn't feel free to suggest the addition of tests.

@samoddball samoddball requested review from a team as code owners January 27, 2026 23:03
@samoddball samoddball requested review from Peyton232 and garyjzhao and removed request for a team January 27, 2026 23:03
@samoddball samoddball changed the title Easi 5033/power platform wrapper [EASI-5033] power platform wrapper Jan 27, 2026
@aterstriep aterstriep self-requested a review February 4, 2026 22:17
export default function PowerPlatformFlagWrapper({
children
}: React.PropsWithChildren) {
const { systemIntakeID } = useParams<{ systemIntakeID?: string }>();
Copy link
Contributor

Choose a reason for hiding this comment

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

The routes use id as the param instead of systemIntakeID, so this is returning undefined.

Suggested change
const { systemIntakeID } = useParams<{ systemIntakeID?: string }>();
const { id: systemIntakeID } = useParams<{ id?: string }>();

Copy link
Contributor

Choose a reason for hiding this comment

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

The admin header and navigation are rendering before the redirect. Can you move the wrapper so that no page content (other than maybe <PageLoading />) shows if being redirected?


if (flags.enablePowerPlatform) {
window.location.href = `https://icpg-dev.crm9.dynamics.com/main.aspx?appid=bc878d88-0468-f011-bec2-001dd8062d4a&pagetype=entityrecord&etn=new_systemintake&id=${systemIntakeID}`;
return null;
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 returning <PageLoading /> here instead of null would make sense so that the user doesn't see a blank screen before the redirect.

const flags = useFlags();

if (flags.enablePowerPlatform) {
window.location.href = `https://icpg-dev.crm9.dynamics.com/main.aspx?appid=bc878d88-0468-f011-bec2-001dd8062d4a&pagetype=entityrecord&etn=new_systemintake&id=${systemIntakeID}`;
Copy link
Contributor

Choose a reason for hiding this comment

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

  1. Should we add this base URL as an env variable instead of hard-coding it?
  2. Are there different power platform URLs for the different environments (local, dev, impl, and prod)?

Copy link
Contributor

Choose a reason for hiding this comment

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

There are some additional components in this file related to system intake that need to be wrapped with <PowerPlatformFlagWrapper />.

Copy link
Contributor

Choose a reason for hiding this comment

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

I'm seeing "this page cannot be found" instead of being redirected when I try to create a new intake. I think we need to redirect from the request type form instead of the task list.

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