-
Notifications
You must be signed in to change notification settings - Fork 31
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
Subform pdf summary #2447
Subform pdf summary #2447
Conversation
content = textLookup ? textLookup : defaultValue; | ||
} | ||
|
||
if (typeof content === 'object' || content === undefined || content === null) { |
Check warning
Code scanning / CodeQL
Comparison between inconvertible types Warning
an expression
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.
Looks good to me! Not sure why the non-subform summary changes are in here, but the more the marrier 👍
<PdfWrapping> | ||
<PlainPage pageKey={pdfLayoutName} /> | ||
</PdfWrapping> | ||
<DataLoaderStoreInit> |
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! I didn't really know what this branch of the PdfView2 component was used for, but wrapping this in the DataLoaderStoreInit seems like the right choice 🙂
Quality Gate failedFailed conditions |
* Feat/subform/url (#2206) * feat: initial sub form scaffold * feat: add subform and config.ts * feat: scaffold for sub form * Exposes `useNavigationParams.isSubFormPage` bool, English error msg * Mostly functional "exit sub-form" method * Default text and style for CustomButton with SubFormAction bindings * Changes default button text from `add` to `done` * Improves sub-form table layout --------- Co-authored-by: Daniel Skovli <[email protected]> * Feat/subform 08 07 ds (#2223) * add queries * add mutations for sub forms * Rough implementation of add/remove functionality * use app mutations instead of queries directly * add error handling * use empty object --------- Co-authored-by: Daniel Skovli <[email protected]> * Feature/subform jh.lek (#2225) * use changeData instead of refetch * add language files * rm todos * Makes `textResourceBindings.addButton` self contained, instead of concatenated with some standard text * Adds edit button, updates error messages, simplifies error checking * Implements dynamic headers/columns in subform table component * Default table header+column if configuration omitted * Disables table row buttons during delete process * Disables `add` button during add process * Removes incorrect TODO item * Redefines SubFormAction as ClientAction * Just return the result, makes more sense for the caller * Only offer data query for sub-form table cells, static content doesn't make sense * Trim trailing slash when calculating current page index * Release UI effects when add/remove has finished/failed, navigate into newly created subform data instance * Additional CustomButton props * Marks new CustomButton props as optional * Hides table header while there's no data to display * Handles DataController reponse for MaxCount reached * Sub-form min/max validations * Updates validation wording and formatting * Disallows FileUpload component in sub-forms * Adds validation hooks to CustomButton actions * Very early WIP summary component * WIP summary * Bugfixes * Summary spacing * Default value for cellContent * Uses internal label wrapper and adjusts summary spacing * Reuses data query code * Lifts `taskStoreContext` out from `Summary2` and generalises implementaion * Implements ComponentStructureWrapper to fix validation-not-displayed bug * Splits Summary2StoreContext out to simple store only holding summary-node reference * Fixes #2320 * Post-merge tweaks * Removes DebugRouter * Fixes CustomButton default behaviour for SubForm * Changes SubForm to category: Form, fixes validation provider issue * Housekeeping * Disallows recursive sub-forms * Add subform identifier in applogic (#2355) * intermediate solution for assessing subform data type * add subformvalidator * add subform test * cleanup * rm user input validation as configuration error is handled * Resolves TODO: removes unnecessary code https://digdir.slack.com/archives/C076T2293CM/p1724928772871299 * Updates CustomButton->resetScrollPosition implementation * Consolidates `getDataModelUrl` methods * Enforces `subform` spelling over previous `sub-form` * Enables focus back on the SubFormComponent after exiting a subform * Bugfix: allow `exitSubForm` to circumvent `resetReturnToView` Eg. preserve "back to summary" context after having clicked an edit button from a summary page * Converts `DataQueryWithDefaultValue` to a React component * Housekeeping: Replaces `sub_form` language keys with `subform` * Improved error handling * Move data model binding out of the SubForm component definition over to layout-sets.json * translation work * add layout set disciminated union, type guards (#2381) * add layout set disciminated union, type guards * fix todo * update typeguard logic do not rely on tasks array being populated * Adding data model type name to error message * Not rendering out anything when lookup in subform finds incompatible values * Adds necessary, removes unnecessary `key` props * Fixes query exit subform param bugs * Removing unused class * Fixing typo * Fixes subform expression test * Avoiding using a hook in non-react code (this was warned against in the console) * Reverts getDataModelUrl consolidation * Enforces spelling `Subform` instead of `SubForm` * rename files and folders * Null checks before accessing `layoutset.tasks` * Fixes `layoutSetIsDefault` check * Tweaks `InvalidSubformLayoutError` page * Bugfix: subform routing * Typeguarding after merge * Making the tasks array optional again * fix import path after merge * Hopefully fixing support for multiple subforms in DataModelsProvider.tsx * Fixing loading of stale form data (happened because setInitialData was hindered). This should also work without unneccessary re-renders due to over-selection. * Updates SubformValidator. Adds language support and checks for `disallowUserCreate` property * add subform cypress tests (#2423) * add subform cypress tests * subform test app changed to require auth level 1 * add more tests * Removes `validateSubform` action * Subform pdf summary (#2447) * Basic Summary2 component support without edit buttons (#2459) --------- Co-authored-by: Daniel Skovli <[email protected]> Co-authored-by: Ole Martin Handeland <[email protected]> * WIP summary/pdf layout improvements * Fixes empty-summary styling for Subform and Attachment * Removes debug woops * Summary spacing * Adds page-break before each subform in print context * Removes (presumed) unnecessary TaskStoreProvider * Avoids re-creating stores on each render * Revert "Removes (presumed) unnecessary TaskStoreProvider" This reverts commit 92a2f70. * remove isFormDataLoading and clean up data element override * Validate subform data in main form (#2479) * basic subform validation * set validation visibility when opening a subform marked with errors * added subform validation test case * trying a slightly more hacky approach to synchronizing AppRoutingContext with react-router-dom * trying a slightly less hacky approach that avoids using flushSync * back to basics * finally some progess * fix broken navigation and apparently inconsistent taskErrors?? * . * Fixes after merge from main * Removing undefined class * fix type * show subform rows with validation errors in summary * fix code-ql warnings --------- Co-authored-by: Daniel Skovli <[email protected]> Co-authored-by: Ole Martin Handeland <[email protected]> Co-authored-by: adamhaeger <[email protected]> Co-authored-by: Bjørnar Østtveit <[email protected]> Co-authored-by: Bjørnar Østtveit <[email protected]>
* Feat/subform/url (#2206) * feat: initial sub form scaffold * feat: add subform and config.ts * feat: scaffold for sub form * Exposes `useNavigationParams.isSubFormPage` bool, English error msg * Mostly functional "exit sub-form" method * Default text and style for CustomButton with SubFormAction bindings * Changes default button text from `add` to `done` * Improves sub-form table layout --------- Co-authored-by: Daniel Skovli <[email protected]> * Feat/subform 08 07 ds (#2223) * add queries * add mutations for sub forms * Rough implementation of add/remove functionality * use app mutations instead of queries directly * add error handling * use empty object --------- Co-authored-by: Daniel Skovli <[email protected]> * Feature/subform jh.lek (#2225) * use changeData instead of refetch * add language files * rm todos * Makes `textResourceBindings.addButton` self contained, instead of concatenated with some standard text * Adds edit button, updates error messages, simplifies error checking * Implements dynamic headers/columns in subform table component * Default table header+column if configuration omitted * Disables table row buttons during delete process * Disables `add` button during add process * Removes incorrect TODO item * Redefines SubFormAction as ClientAction * Just return the result, makes more sense for the caller * Only offer data query for sub-form table cells, static content doesn't make sense * Trim trailing slash when calculating current page index * Release UI effects when add/remove has finished/failed, navigate into newly created subform data instance * Additional CustomButton props * Marks new CustomButton props as optional * Hides table header while there's no data to display * Handles DataController reponse for MaxCount reached * Sub-form min/max validations * Updates validation wording and formatting * Disallows FileUpload component in sub-forms * Adds validation hooks to CustomButton actions * Very early WIP summary component * WIP summary * Bugfixes * Summary spacing * Default value for cellContent * Uses internal label wrapper and adjusts summary spacing * Reuses data query code * Lifts `taskStoreContext` out from `Summary2` and generalises implementaion * Implements ComponentStructureWrapper to fix validation-not-displayed bug * Splits Summary2StoreContext out to simple store only holding summary-node reference * Fixes #2320 * Post-merge tweaks * Removes DebugRouter * Fixes CustomButton default behaviour for SubForm * Changes SubForm to category: Form, fixes validation provider issue * Housekeeping * Disallows recursive sub-forms * Add subform identifier in applogic (#2355) * intermediate solution for assessing subform data type * add subformvalidator * add subform test * cleanup * rm user input validation as configuration error is handled * Resolves TODO: removes unnecessary code https://digdir.slack.com/archives/C076T2293CM/p1724928772871299 * Updates CustomButton->resetScrollPosition implementation * Consolidates `getDataModelUrl` methods * Enforces `subform` spelling over previous `sub-form` * Enables focus back on the SubFormComponent after exiting a subform * Bugfix: allow `exitSubForm` to circumvent `resetReturnToView` Eg. preserve "back to summary" context after having clicked an edit button from a summary page * Converts `DataQueryWithDefaultValue` to a React component * Housekeeping: Replaces `sub_form` language keys with `subform` * Improved error handling * Move data model binding out of the SubForm component definition over to layout-sets.json * translation work * add layout set disciminated union, type guards (#2381) * add layout set disciminated union, type guards * fix todo * update typeguard logic do not rely on tasks array being populated * Adding data model type name to error message * Not rendering out anything when lookup in subform finds incompatible values * Adds necessary, removes unnecessary `key` props * Fixes query exit subform param bugs * Removing unused class * Fixing typo * Fixes subform expression test * Avoiding using a hook in non-react code (this was warned against in the console) * Reverts getDataModelUrl consolidation * Enforces spelling `Subform` instead of `SubForm` * rename files and folders * Null checks before accessing `layoutset.tasks` * Fixes `layoutSetIsDefault` check * Tweaks `InvalidSubformLayoutError` page * Bugfix: subform routing * Typeguarding after merge * Making the tasks array optional again * fix import path after merge * Hopefully fixing support for multiple subforms in DataModelsProvider.tsx * Fixing loading of stale form data (happened because setInitialData was hindered). This should also work without unneccessary re-renders due to over-selection. * Updates SubformValidator. Adds language support and checks for `disallowUserCreate` property * add subform cypress tests (#2423) * add subform cypress tests * subform test app changed to require auth level 1 * add more tests * Removes `validateSubform` action * Subform pdf summary (#2447) * Basic Summary2 component support without edit buttons (#2459) --------- Co-authored-by: Daniel Skovli <[email protected]> Co-authored-by: Ole Martin Handeland <[email protected]> * WIP summary/pdf layout improvements * Fixes empty-summary styling for Subform and Attachment * Removes debug woops * Summary spacing * Adds page-break before each subform in print context * Removes (presumed) unnecessary TaskStoreProvider * Avoids re-creating stores on each render * Revert "Removes (presumed) unnecessary TaskStoreProvider" This reverts commit 92a2f70. * remove isFormDataLoading and clean up data element override * Validate subform data in main form (#2479) * basic subform validation * set validation visibility when opening a subform marked with errors * added subform validation test case * trying a slightly more hacky approach to synchronizing AppRoutingContext with react-router-dom * trying a slightly less hacky approach that avoids using flushSync * back to basics * finally some progess * fix broken navigation and apparently inconsistent taskErrors?? * . * Fixes after merge from main * Removing undefined class * fix type * show subform rows with validation errors in summary * fix visibility broken by perf-PR, use noIncrementalUpdates, and improve showAllErrors * validate onlyIncremental on initial validation * less hacky method of refetching validations * clean up in taskErrors * fix performance issues with useTaskStore causing infinite loops because the selector returned new objects every time * added unit tests for regression in performance PR * (hopefully) got rid of waitForAnimationFrames when waiting for validations to process, these were causing problems in unit tests * hopefully fix validations from process/next for old apps blocking submit * make sure processed last gets updated regardless of deepEqual * make sure showAllErrors is visible on components and not just the error report * fix code-ql warnings * remove snake_case --------- Co-authored-by: Johannes Haukland <[email protected]> Co-authored-by: Daniel Skovli <[email protected]> Co-authored-by: HauklandJ <[email protected]> Co-authored-by: Ole Martin Handeland <[email protected]> Co-authored-by: adamhaeger <[email protected]>
Description
Related Issue(s)
Verification/QA
kind/*
label to this PR for proper release notes grouping