-
Notifications
You must be signed in to change notification settings - Fork 75
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
Make FormData type stable, and add/improve lots of related Typescirpt typings #7718
Conversation
/AzurePipelines run |
You have several pipelines (over 10) configured to build pull requests in this repository. Specify which pipelines you would like to run by using /azp run [pipelines] command. You can specify multiple pipelines using a comma separated list. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good stuff 🦖 I have some minor comments and a "question".
...tinn.Apps/AppFrontend/react/altinn-app-frontend/__tests__/utils/conditionalRendering.test.ts
Outdated
Show resolved
Hide resolved
src/Altinn.Apps/AppFrontend/react/altinn-app-frontend/src/components/GenericComponent.tsx
Outdated
Show resolved
Hide resolved
src/Altinn.Apps/AppFrontend/react/altinn-app-frontend/src/components/base/TextAreaComponent.tsx
Outdated
Show resolved
Hide resolved
src/Altinn.Apps/AppFrontend/react/altinn-app-frontend/src/components/index.ts
Outdated
Show resolved
Hide resolved
src/Altinn.Apps/AppFrontend/react/altinn-app-frontend/src/components/index.ts
Outdated
Show resolved
Hide resolved
src/Altinn.Apps/AppFrontend/react/altinn-app-frontend/src/components/index.ts
Outdated
Show resolved
Hide resolved
src/Altinn.Apps/AppFrontend/react/altinn-app-frontend/src/components/index.ts
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice cleanup! Thanks for the improvements!
Would like to clarify the change for index as key (see other comment) before approval.
...pps/AppFrontend/react/altinn-app-frontend/__tests__/components/base/ButtonComponent.test.tsx
Show resolved
Hide resolved
...pFrontend/react/altinn-app-frontend/__tests__/features/form/data/submitFormDataSagas.test.ts
Show resolved
Hide resolved
...tinn.Apps/AppFrontend/react/altinn-app-frontend/__tests__/utils/conditionalRendering.test.ts
Outdated
Show resolved
Hide resolved
src/Altinn.Apps/AppFrontend/react/shared/src/components/molecules/AltinnMobileTableItem.tsx
Outdated
Show resolved
Hide resolved
Explains better how the function is used. Also fix some minor type issues. New interface IComponentProps Previously all components had their own interface. It is better when all share the common props from GenericComponent ``` export interface IComponentProps extends IGenericComponentProps { handleDataChange: (value: string, key?:string) => void, handleFocusUpdate: (componentId: string, step?: number) => void, getTextResource: (key: string) => React.ReactNode, getTextResourceAsString: (key: string) => string, formData: any, isValid: boolean, language: any, shouldFocus: boolean, text: React.ReactNode, label: ()=>JSX.Element, legend: ()=>JSX.Element, }; ``` Make formData type stable and use .simpleBinding everywhere Use React.ReactNode as type for getTextResource Apply formatting corrections from code review Co-authored-by: Steffen Lorang Ekeberg <steffen.ekeberg@gmail.com> Use a proper key for AltinnMobileTable Rename componentRendersItsOwnValidationErrors => componentValidationsHandledByGenericComponent Fix missing `?.simpleBinding` in Components Remove ITextAreaComponentProps to fix @typescript-eslint/no-empty-interface
5ddebd5
to
25c8529
Compare
I fixed merge conflicts with #7721 and squashed commits. |
@jeevananthank would you run regression tests for this branch? |
/azp run |
You have several pipelines (over 10) configured to build pull requests in this repository. Specify which pipelines you would like to run by using /azp run [pipelines] command. You can specify multiple pipelines using a comma separated list. |
@jeevananthank I took the freedom to merge #7843 into this, so that I likely would get my first "green PR" |
Yea, I can see that, but strangely the change I picked out as responsible is not part of this PR. I'll need too look into it later this week. Is the tests or screenshots available somewhere, so I can get some more insight into what is failing. |
you can find the test results here. Screenshots are not available for runs from fork PR (unfortunately to enable test runs on fork PR, we had to give up the recording feature) |
Yey, 💚 So much time wasted on the assumption that this was a different issue than the one in #7843, and a quick look at the diff to (wrongly) confirm that this change was not part of the first PR. Anyway. This is green now. 🥳 🎉 |
automated tests have run green 😀 |
/azp run |
You have several pipelines (over 10) configured to build pull requests in this repository. Specify which pipelines you would like to run by using /azp run [pipelines] command. You can specify multiple pipelines using a comma separated list. |
/azp run |
You have several pipelines (over 10) configured to build pull requests in this repository. Specify which pipelines you would like to run by using /azp run [pipelines] command. You can specify multiple pipelines using a comma separated list. |
When working with Altinn/app-frontend-react#789 I had some problems working around the issue that the existence of
dataModelBindings.simpleBinding
changed the type offormData
tostring
and prevents me from reading the otherdataModelBindings
. This pull request fixes that issue, so thatformData
is always an object that usually has a single propertysimpleBinding
.Description
In fixing this, I also had to fix lots of typescript types and renamed a function
isSimpleComponent
->componentRendersItsOwnValidationErrors
. I have tried to group related changes into separate commits, so most likely a reviewer should consider reviewing each commit separately (ps: I know i screwed up so intermediate commits does not all compile).Fixes
Verification
Documentation