-
Notifications
You must be signed in to change notification settings - Fork 16
Initial SaveButtonComponent implementation #3261
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
base: feature/ng19-forms
Are you sure you want to change the base?
Conversation
* feature/ng19-forms: Extract typescript types used by server and client (#3153) # Conflicts: # angular/projects/researchdatabox/form/src/app/form.service.ts # angular/projects/researchdatabox/form/src/app/static-comp-field.dictionary.ts
…component definitions.
… Moved the FormComponent's FormGroup creation until after all the components have been intialised.
…dcoding specific types.
…tab initialization, enhance test coverage, and ensure proper CSS class application.
…ieval - Implemented a test for tab switching in TabComponent. - Enhanced TabComponent to correctly apply active classes and aria attributes. - Added a convenience method in FormComponent to find component definitions by name.
* feature/ng19-forms: Update server-side processing to create form config for client-side (#3179) try to include more of the details in the logging Bugfix trigger service regex not working (#3152) Bugfix: deselect children when parent node is deselected as default behaviour (#3120) Build(deps): Bump wkt-parser-helper from 4.2.0 to 5.0.0 (#3062) Build(deps): Bump bootstrap from 5.3.6 to 5.3.7 (#3072) Build(deps): Bump postcss from 8.5.5 to 8.5.6 (#3068) Build(deps): Bump axios from 1.9.0 to 1.10.0 (#3067) Build(deps): Bump @researchdatabox/sails-ng-common from 0.1.0 to 0.2.1 (#3064) Build(deps): Bump i18next from 24.2.3 to 25.2.1 (#3063) # Conflicts: # typescript/form-config/default-1.0-draft.ts
…dling; update form module and configuration
* feature/ng19-forms: (35 commits) add npm run script to build raido package Feature ng19 forms config baseline migration script implementation (#3232) Update config.yml Build(deps): Bump sails from 1.5.14 to 1.5.15 (#3231) Build(deps): Bump luxon from 3.6.1 to 3.7.1 (#3226) Build(deps): Bump mongodb from 6.17.0 to 6.18.0 (#3230) Build(deps): Bump express-session from 1.18.1 to 1.18.2 (#3229) Build(deps): Bump less from 4.3.0 to 4.4.0 (#3228) Build(deps): Bump pino from 9.7.0 to 9.8.0 (#3227) Build(deps-dev): Bump chai from 5.2.0 to 5.2.1 (#3225) Build(deps): Bump mini-css-extract-plugin from 2.9.2 to 2.9.3 (#3224) Build(deps-dev): Bump typescript from 5.8.3 to 5.9.2 in /core (#3211) Merge branch 'develop' into feature/ng19-forms_server-api-round-4 Server-side record merge, compare, and validation (#3197) TabComponent initial implementation (#3209) Build(deps): Bump dotenv from 16.5.0 to 17.2.1 (#3193) Build(deps-dev): Bump supertest from 7.1.1 to 7.1.4 (#3180) Build(deps-dev): Bump form-data from 2.5.1 to 2.5.5 in /support/raido (#3177) Build(deps): Bump core-js from 3.43.0 to 3.45.0 (#3213) Build(deps): Bump webpack from 5.99.9 to 5.101.0 (#3198) ... # Conflicts: # angular/projects/researchdatabox/form/src/app/component/tab.component.ts # angular/projects/researchdatabox/form/src/app/form.component.ts # angular/projects/researchdatabox/form/src/app/static-comp-field.dictionary.ts # packages/sails-ng-common/src/config/component/index.ts # typescript/form-config/default-1.0-draft.ts
…e utility service with trimStringSignal method. Added validation when accessing FormComponent's string parameters. Added support to reload the form when the OID is changed.
…option for improved form submission handling.
…alidation'. Added tests. Added providers param when preparing the TestBed.
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.
Pull Request Overview
This PR introduces a new SaveButtonComponent
for Angular forms and refactors the FormComponent
to use signals for better reactivity. The main purpose is to add a save button that can interact with the parent form, trigger save logic, and disable itself when the form is unchanged or invalid.
- Implementation of a new
SaveButtonComponent
with configuration options for save behavior - Refactoring of
FormComponent
to use Angular signals instead of@Input
properties for better reactivity - Addition of form save logic with create/update operations via
RecordService
Reviewed Changes
Copilot reviewed 13 out of 13 changed files in this pull request and generated 3 comments.
Show a summary per file
File | Description |
---|---|
typescript/form-config/default-1.0-draft.ts |
Adds save button configuration and minor formatting updates |
packages/sails-ng-common/src/config/component/save-button.model.ts |
Defines TypeScript model interfaces for the SaveButtonComponent |
packages/sails-ng-common/src/config/component/index.ts |
Exports the new save button model types |
angular/projects/researchdatabox/portal-ng-common/src/lib/utility.service.ts |
Adds utility method for handling string signals |
angular/projects/researchdatabox/portal-ng-common/src/lib/record.service.ts |
Implements create/update methods and result type for record operations |
angular/projects/researchdatabox/portal-ng-common/src/lib/form/form-field-base.component.ts |
Minor cleanup of import and access modifier |
angular/projects/researchdatabox/form/src/app/static-comp-field.dictionary.ts |
Registers SaveButtonComponent in the component dictionary |
angular/projects/researchdatabox/form/src/app/helpers.spec.ts |
Updates test helpers to support new signal-based FormComponent API |
angular/projects/researchdatabox/form/src/app/form.module.ts |
Declares SaveButtonComponent in the module |
angular/projects/researchdatabox/form/src/app/form.component.ts |
Major refactoring to use signals and adds save functionality |
angular/projects/researchdatabox/form/src/app/component/tab.component.ts |
Removes unused getter method |
angular/projects/researchdatabox/form/src/app/component/save-button.component.ts |
Implements the new SaveButtonComponent |
angular/projects/researchdatabox/form/src/app/component/save-button.component.spec.ts |
Adds comprehensive unit tests for SaveButtonComponent |
Comments suppressed due to low confidence (1)
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
angular/projects/researchdatabox/portal-ng-common/src/lib/record.service.ts
Outdated
Show resolved
Hide resolved
angular/projects/researchdatabox/form/src/app/component/save-button.component.ts
Outdated
Show resolved
Hide resolved
angular/projects/researchdatabox/form/src/app/component/save-button.component.spec.ts
Outdated
Show resolved
Hide resolved
* feature/ng19-forms: populate client form from server data (#3233) Build(deps): Bump fs-extra from 11.3.0 to 11.3.1 (#3237) Build(deps): Bump mini-css-extract-plugin from 2.9.3 to 2.9.4 (#3236) Build(deps): Bump csv-stringify from 6.5.2 to 6.6.0 (#3235) Feature: Upgrade to rxjs7 (#3246) Build(deps): Bump pino from 9.8.0 to 9.9.0 (#3245) Build(deps): Bump copy-webpack-plugin from 13.0.0 to 13.0.1 (#3243) Build(deps): Bump webpack from 5.101.0 to 5.101.1 (#3242) Build(deps): Bump i18next from 25.3.2 to 25.3.4 (#3239) Build(deps): Bump sass from 1.89.2 to 1.90.0 (#3238) Feature: Remove MomentJS (#3244) Add init flag to redbox portal as a replacement for dumb-init. (#3241) Build(deps): Migrate to Font Awesome 6 and update package references # Conflicts: # angular/projects/researchdatabox/form/src/app/form.module.ts
…and fixed SaveButtonComponent import in FormModule.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## feature/ng19-forms #3261 +/- ##
======================================================
+ Coverage 49.93% 49.97% +0.04%
======================================================
Files 199 200 +1
Lines 12147 12213 +66
Branches 1984 2008 +24
======================================================
+ Hits 6065 6103 +38
- Misses 5821 5849 +28
Partials 261 261
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
angular/projects/researchdatabox/portal-ng-common/src/lib/utility.service.ts
Outdated
Show resolved
Hide resolved
What's the motivation for using |
To enable two-way integration if another NG component is creating and is interested in the Form app's OID and other parameters. |
* feature/ng19-forms: fix getting form config and model data
This pull request introduces a new
SaveButtonComponent
to the Angular form system and refactors the form handling logic to use Angular signals for better reactivity and maintainability. The changes include the implementation of the save button, updates to the form component to support signal-based parameters and save logic, and the integration of the new component into the form's module and static dictionary. Additionally, comprehensive unit tests for theSaveButtonComponent
are added.New Save Button Feature:
Implemented
SaveButtonComponent
:Added unit tests for
SaveButtonComponent
:Form Component Refactoring and Enhancements:
Refactored
FormComponent
to use Angular signals:@Input
properties with signals foroid
,recordType
,formName
,editMode
, anddownloadAndCreateOnInit
.Implemented form save logic:
saveForm
method to handle form submission, including validation, pristine/dirty checks, and status updates.RecordService
for create/update actions and error handling.dataStatus
for use by child components (e.g.,SaveButtonComponent
).Minor Cleanup:
TabContentComponent
.These changes collectively improve the form system's usability, testability, and maintainability, and introduce a reusable save button component.