fix: update app type declaration#133
Conversation
|
Thanks for the pull request, @dcoa! This repository is currently maintained by Once you've gone through the following steps feel free to tag them in a comment and let them know that your changes are ready for engineering review. 🔘 Get product approvalIf you haven't already, check this list to see if your contribution needs to go through the product review process.
🔘 Provide contextTo help your reviewers and other members of the community understand the purpose and larger context of your changes, feel free to add as much of the following information to the PR description as you can:
🔘 Get a green buildIf one or more checks are failing, continue working on your changes until this is no longer the case and your build turns green. 🔘 Update the status of your PRYour PR is currently marked as a draft. After completing the steps above, update its status by clicking "Ready for Review", or removing "WIP" from the title, as appropriate. Where can I find more information?If you'd like to get more details on all aspects of the review process for open source pull requests (OSPRs), check out the following resources: When can I expect my changes to be merged?Our goal is to get community contributions seen and reviewed as efficiently as possible. However, the amount of time that it takes to review and merge a PR can vary significantly based on factors such as:
💡 As a result it may take up to several weeks or months to complete a review and merge your PR. |
Summary
Important
Needs #131 to use frontend-platform type imports
Tighten TypeScript coverage across the authz module and enable type validation in CI.
CI
npm run types(tsc --noEmit) step between Lint and Testtsconfig
ignoreDeprecations: "6.0"to quiet TS 6.0 deprecation warnings on inherited options,baseUrl+ wildcard*path, kept@src/*aliasType shims (new)
TableCellValue<T>,DataTableColumn, andDataTableContextShapeto type Paragon's loosely-typedDataTableContext(declared asContext<{}>upstream) and column shapelodash.debounce,@edx/frontend-component-header)Import normalization
Switched 7 bare
'types'imports to'@src/types':src/authz-module/constants.tssrc/authz-module/libraries-manager/context.tsxsrc/authz-module/libraries-manager/LibrariesUserManager.tsxsrc/authz-module/libraries-manager/components/AssignNewRoleModal/AssignNewRoleModal.tsx+.test.tsxsrc/authz-module/roles-permissions/courses/constants.tssrc/authz-module/roles-permissions/libraries/constants.tsRemoved all
@ts-ignore+anycastssrc/authz-module/audit-user/index.tsx— typed error shape instead of ts-ignoresrc/authz-module/components/TableControlBar/TableControlBar.tsx— removed@ts-ignore, castDataTableContextviaDataTableContextShape, typedhandleCloseFilter/handleSetFiltersparams, narrowedFILTER_CHIPS_ICONS/FILTER_GROUP_TO_IDindex access withas keyof typeof, spread propscast via
React.ComponentProps<typeof X>src/authz-module/components/TableFooter/TableFooter.tsx— same context cast patternsrc/authz-module/libraries-manager/components/TeamTable/components/SortDropdown.tsx+TableControlBar.tsx— same context cast patternsrc/authz-module/libraries-manager/LibrariesUserManager.tsx— removedrole.resources as any[], use typedRoleResourceGroup[]src/authz-module/libraries-manager/LibrariesTeamManager.tsx— removedas any[]castType refinements
AppContextType/TableCellValue(moved/replaced); updated commentReact.ContextType<typeof AppContext>instead of custom duplicateshowErrorToast(error: unknown, …), widenedAppToast.messagetostring | ReactNode[], typedBoldchunks asReactNode, narrowedERROR_TOAST_MAP/messageskeys withas keyof typeofgetErrorConfigparamsactionsDictionary[permission.actionKey as ActionKey]permissionsByResourceasRoleResourceGroup[]permission.label?.trim()React.ContextType<typeof AppContext>, rely on sharedTableCellValuesetFilterto(string | undefined) => void, typed onChange eventparams
DataTableFilterstype fromDataTableContextShape['state']actionMessages[messageKey as keyof typeof actionMessages]AddNewTeamMemberModalProps,simplified
onChange={handleChangeForm}(removed redundant arrow wrapper)messages[errorMessageId as keyof typeof messages]AddNewTeamMemberModalPropsfor the mockTableCellValuefrom@src/paragon, wrapped barestring returns in
<span>for typed ReactNode consistencyAPP_INIT_ERRORsubscriber params, usedatapayload instead of positional error argrenderWithAllProviders/renderWrapperui: ReactNode; castmockAppContextviaReact.ContextType<typeof AppContext>Test fixtures
(getAuthenticatedHttpClient as jest.Mock).mockReturnValue(...)as unknown as IntlShapefor mock intldescription+resourcefields to satisfyRoleResourceGroup/PermissionMetadataTest plan
npm run typespassesnpm run lintpassesnpm run testpassesTypesstepLLM usage notice
Built with assistance from Claude.