Skip to content

refactor(webapp): replace any types in auth directive and training-card guard#11073

Open
aniketsingh1023 wants to merge 1 commit into
medic:masterfrom
aniketsingh1023:fix/10883-replace-any-types
Open

refactor(webapp): replace any types in auth directive and training-card guard#11073
aniketsingh1023 wants to merge 1 commit into
medic:masterfrom
aniketsingh1023:fix/10883-replace-any-types

Conversation

@aniketsingh1023
Copy link
Copy Markdown

Part of #10883.

Changes

  • webapp/src/ts/directives/auth.directive.ts: replace mmAuthAny?: any with a narrow union (AuthAnyValue | AuthAnyValue[]) that reflects the runtime branches in dynamicChecks — a value is either true (short-circuit allow), a single permission name, or an AND-group of permission names; the input accepts a single value or an array of them representing OR-of-AND-groups.
  • webapp/src/ts/training-card.guard.provider.ts: replace CanDeactivate<any> and component: any with unknown. The guard does not use the component parameter — unknown matches the actual contract without resorting to any.

No behavior change

Pure typing change. No runtime logic touched. The new types match all existing call sites.

…rd guard

Part of medic#10883.

- auth.directive.ts: replace `mmAuthAny?: any` with a narrow union
  reflecting the runtime branches in `dynamicChecks` (a value is either
  `true` for short-circuit allow, a single permission name, or an
  AND-group of permission names; the input accepts a single value or
  an array of them representing OR-of-AND-groups).
- training-card.guard.provider.ts: replace `CanDeactivate<any>` and
  `component: any` with `unknown`. The guard doesn't use the component
  parameter — `unknown` matches the actual contract while avoiding the
  `any` escape hatch.

No runtime behavior changes. The new types match the existing call
sites (no compile errors expected).
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.

1 participant