Skip to content
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

feat: add osmosys-form library #4

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

xixas
Copy link
Contributor

@xixas xixas commented Jul 12, 2024

OsmosysForm PR Checklist

Pre-requisites

  • I have gone through the Contributing guidelines for Submitting a Pull Request (PR) and ensured that this is not a duplicate PR.
  • I have performed preliminary testing to ensure that any existing features are not impacted and any new features are working as expected.
  • I have tested the library in a demo Angular application to verify functionality and integration.

PR Details

PR details have been updated as per the given format (see below)

  • PR title adheres to the format specified in guidelines (e.g., feat: add dynamic form validation).
  • Description has been added.
  • Related changes have been added (optional).
  • Screenshots have been added (optional).
  • Pending actions have been added (optional).
  • Any other additional notes have been added (optional).

Additional Information

  • Appropriate label(s) have been added (ready for review should be added if the PR is ready to be reviewed).
  • Assignee(s) and reviewer(s) have been added (optional).

Development Specific

  • Unit Tests: Relevant unit tests have been added or updated, and all tests pass (run ng test) (optional).
  • Library Build: Run ng build osmosys-form to ensure the library builds without errors.
  • Demo Application Testing: The new feature or fix has been tested within a demo application to ensure proper functionality and integration.
  • Documentation: Relevant documentation has been updated, including the README and any inline comments.
  • Version Bump: The version number has been incremented following semantic versioning guidelines if necessary.

Description:

Added osmosys form library code.
Added documentaion on usage.

Related changes:

NA

Screenshots:

NA

Pending actions:

NA

Additional notes:

NA


Summary by CodeRabbit

  • New Features

    • Added dynamic form rendering to the app, which generates various form elements based on a configuration object.
  • Documentation

    • Introduced a comprehensive "Setup and Usage" section in the README with a link to detailed usage documentation.
    • Added a new usage.md file with extensive documentation for setting up and using the Osmosys Form Library.
  • Style

    • Simplified formatting in various configuration files (angular.json, ng-package.json, tsconfig.lib.json, tsconfig.spec.json, tsconfig.json) by removing unnecessary line breaks and spaces.
  • Enhancements

    • Enhanced OsmosysFormComponent functionality by adding dynamic form creation, value updates, validation, and form reset capabilities.

Copy link

coderabbitai bot commented Jul 12, 2024

Walkthrough

The recent changes introduce a new "Setup and Usage" section in the README and add comprehensive documentation for the Osmosys Form Library. A dynamic form rendering logic is implemented in osmosys-form.component.html, driven by a configuration object. Significant modifications to the OsmosysFormComponent class enhance dynamic form creation, validation, and form management. Formatting improvements in various configuration files streamline the project's structure.

Changes

File(s) Summary
README.md Added "Setup and Usage" section, removed redundant sentence about Angular CLI help.
docs/usage.md New file with detailed usage documentation for Osmosys Form Library including setup, form configuration, and examples.
projects/.../osmosys-form.component.html Introduced dynamic form rendering logic based on a configuration object (formConfig).
projects/.../osmosys-form.component.ts Enhanced OsmosysFormComponent class with dynamic form creation, validation, value update, and form reset functionalities.
angular.json, .../ng-package.json, .../tsconfig.* Simplified array formatting and removed unnecessary line breaks and spaces for cleaner configuration files.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant ParentComponent
    participant OsmosysFormComponent
    participant BackendService

    User->>ParentComponent: Open Form Page
    ParentComponent->>OsmosysFormComponent: Initialize Component with `formJsonData` and `modelData`
    OsmosysFormComponent->>OsmosysFormComponent: ngOnInit()
    OsmosysFormComponent->>OsmosysFormComponent: createForm()
    OsmosysFormComponent->>ParentComponent: Emit formInstance
    User->>OsmosysFormComponent: Fill Form and Submit
    OsmosysFormComponent->>OsmosysFormComponent: handleButtonClick()
    OsmosysFormComponent->>OsmosysFormComponent: validateAllFormFields()
    alt Form Valid
        OsmosysFormComponent->>BackendService: Submit Form Data
        BackendService->>OsmosysFormComponent: Response
    else Form Invalid
        OsmosysFormComponent->>User: Show Errors
    end
Loading

Poem

In the world of code, we made a leap,
Dynamic forms, a joy to keep.
With JSON guides and docs anew,
Angular magic, straight to you.
Form creation, validation sleek,
Osmosys Form, the tool you seek.
🎨📜✨


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 311d167 and fdd0ac3.

Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
Files selected for processing (4)
  • README.md (2 hunks)
  • docs/usage.md (1 hunks)
  • projects/osmosys-form/src/lib/osmosys-form.component.html (1 hunks)
  • projects/osmosys-form/src/lib/osmosys-form.component.ts (1 hunks)
Files skipped from review due to trivial changes (1)
  • README.md
Additional context used
Markdownlint
docs/usage.md

5-5: null
Link fragments should be valid

(MD051, link-fragments)


6-6: null
Link fragments should be valid

(MD051, link-fragments)


7-7: null
Link fragments should be valid

(MD051, link-fragments)


8-8: null
Link fragments should be valid

(MD051, link-fragments)


9-9: null
Link fragments should be valid

(MD051, link-fragments)


10-10: null
Link fragments should be valid

(MD051, link-fragments)

GitHub Check: Lint
projects/osmosys-form/src/lib/osmosys-form.component.ts

[failure] 29-29:
Unexpected any. Specify a different type


[failure] 30-30:
Expected blank line between class members


[failure] 30-30:
Expected blank line between class members


[failure] 30-30:
Unexpected any. Specify a different type


[failure] 31-31:
Expected blank line between class members


[failure] 31-31:
Expected blank line between class members


[failure] 31-31:
Unexpected any. Specify a different type


[failure] 32-32:
Expected blank line between class members


[failure] 32-32:
Expected blank line between class members


[failure] 33-33:
Expected blank line between class members

Additional comments not posted (16)
docs/usage.md (5)

12-14: Good introduction!

The introduction provides a clear overview of the Osmosys Form Library.


16-47: Clear setup instructions!

The setup instructions are clear and detailed, covering building, linking, and installing dependencies.


49-61: Clear configuration instructions!

The configuration instructions are clear and provide a good overview of the key components.


63-90: Clear usage instructions!

The usage instructions are clear and provide a good example of how to use the library in a parent component.


92-105: Comprehensive feature list!

The feature list is comprehensive and accurately describes the supported features.

projects/osmosys-form/src/lib/osmosys-form.component.ts (6)

21-27: Correct component metadata!

The component metadata is correctly defined, with appropriate selector, standalone flag, imports, template URL, and styles.


46-62: Good implementation of lifecycle methods!

The lifecycle methods correctly handle initialization and input changes.


64-104: Good implementation of form creation logic!

The form creation logic is well-structured and handles validations appropriately.


106-109: Good implementation of form update logic!

The form update logic correctly updates the form values based on the provided data.


112-142: Good implementation of form management methods!

The form management methods correctly handle button actions, validation, and form reset.


1-19: Ensure all imports are necessary.

Verify that all imported modules and services are used in the component.

Verification successful

To verify that all imported modules and services are used in the osmosys-form.component.ts file, we need to adjust our search pattern to work around the file type issue with rg.


All imports are necessary and used within the component.

The following imports in projects/osmosys-form/src/lib/osmosys-form.component.ts are verified to be used:

  • ChangeDetectorRef
  • EventEmitter
  • Input
  • OnInit
  • Output
  • SimpleChanges
  • FormBuilder
  • FormGroup
  • FormsModule
  • ReactiveFormsModule
  • ValidatorFn
  • Validators
  • Router
  • CommonModule

There are no unnecessary imports.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify that all imports in osmosys-form.component.ts are used in the component.

# Test: Search for usage of imported modules and services in the component file.
rg --type typescript -A 5 'ChangeDetectorRef|EventEmitter|Input|OnInit|Output|SimpleChanges|FormBuilder|FormGroup|FormsModule|ReactiveFormsModule|ValidatorFn|Validators|Router|CommonModule' projects/osmosys-form/src/lib/osmosys-form.component.ts

Length of output: 282


Script:

#!/bin/bash
# Description: Verify that all imports in osmosys-form.component.ts are used in the component.

# Test: Search for usage of imported modules and services in the component file.
rg 'ChangeDetectorRef|EventEmitter|Input|OnInit|Output|SimpleChanges|FormBuilder|FormGroup|FormsModule|ReactiveFormsModule|ValidatorFn|Validators|Router|CommonModule' projects/osmosys-form/src/lib/osmosys-form.component.ts

Length of output: 1514

projects/osmosys-form/src/lib/osmosys-form.component.html (5)

1-5: Correct implementation of form container and title!

The form container and title are correctly rendered based on the configuration.


6-15: Correct implementation of form structure!

The form structure is correctly rendered with dynamic rows and columns based on the configuration.


16-318: Comprehensive implementation of form elements!

The form elements are comprehensively implemented, covering various input types, select boxes, range sliders, date pickers, file uploads, multiselect dropdowns, buttons, color pickers, radio buttons, and text areas. Validations are handled appropriately.


212-220: Correct implementation of button actions!

The button actions are correctly handled based on the configuration, including form submission and other actions.


38-317: Correct implementation of form validation feedback!

The form validation feedback is correctly displayed based on the form control state, providing appropriate validation messages.

Comment on lines +5 to +10
1. [Introduction](#introduction)
2. [Setting Up the Library](#setting-up-the-library)
3. [Creating the Configuration](#creating-the-configuration)
4. [Using in Parent Component](#using-in-parent-component)
5. [Supported Features](#supported-features)
6. [Demo Repository](#demo-repository)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fix invalid link fragments.

The link fragments in the Table of Contents should be valid.

- 1. [Introduction](#introduction)
- 2. [Setting Up the Library](#setting-up-the-library)
- 3. [Creating the Configuration](#creating-the-configuration)
- 4. [Using in Parent Component](#using-in-parent-component)
- 5. [Supported Features](#supported-features)
- 6. [Demo Repository](#demo-repository)
+ 1. [Introduction](#1-introduction)
+ 2. [Setting Up the Library](#2-setting-up-the-library)
+ 3. [Creating the Configuration](#3-creating-the-configuration)
+ 4. [Using in Parent Component](#4-using-in-parent-component)
+ 5. [Supported Features](#5-supported-features)
+ 6. [Demo Repository](#6-demo-repository)

Committable suggestion was skipped due to low confidence.

Tools
Markdownlint

5-5: null
Link fragments should be valid

(MD051, link-fragments)


6-6: null
Link fragments should be valid

(MD051, link-fragments)


7-7: null
Link fragments should be valid

(MD051, link-fragments)


8-8: null
Link fragments should be valid

(MD051, link-fragments)


9-9: null
Link fragments should be valid

(MD051, link-fragments)


10-10: null
Link fragments should be valid

(MD051, link-fragments)

Comment on lines 29 to 44
@Input() formJsonData: any;
@Input() modelData: any;
@Output() formSubmit = new EventEmitter<any>();
@Output() formInstance = new EventEmitter<FormGroup>();
@Output() buttonAction = new EventEmitter<{ action: string; form: FormGroup }>();

form: FormGroup;
formConfig: any;

constructor(
private fb: FormBuilder,
private router: Router,
private cdr: ChangeDetectorRef,
) {
this.form = this.fb.group({});
}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Specify types for class properties.

Avoid using any type for formJsonData, modelData, and formConfig.

-  @Input() formJsonData: any;
-  @Input() modelData: any;
-  formConfig: any;
+  @Input() formJsonData: { layout: { rows: any[] } };
+  @Input() modelData: Record<string, any>;
+  formConfig: { layout: { rows: any[] } };

Add blank lines between class members.

Improve readability by adding blank lines between class members.

-  @Input() modelData: any;
+  
+  @Input() modelData: any;
Tools
GitHub Check: Lint

[failure] 29-29:
Unexpected any. Specify a different type


[failure] 30-30:
Expected blank line between class members


[failure] 30-30:
Expected blank line between class members


[failure] 30-30:
Unexpected any. Specify a different type


[failure] 31-31:
Expected blank line between class members


[failure] 31-31:
Expected blank line between class members


[failure] 31-31:
Unexpected any. Specify a different type


[failure] 32-32:
Expected blank line between class members


[failure] 32-32:
Expected blank line between class members


[failure] 33-33:
Expected blank line between class members

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 4

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between fdd0ac3 and a6cdb72.

Files selected for processing (6)
  • angular.json (1 hunks)
  • projects/osmosys-form/ng-package.json (1 hunks)
  • projects/osmosys-form/src/lib/osmosys-form.component.ts (1 hunks)
  • projects/osmosys-form/tsconfig.lib.json (1 hunks)
  • projects/osmosys-form/tsconfig.spec.json (1 hunks)
  • tsconfig.json (1 hunks)
Files skipped from review due to trivial changes (5)
  • angular.json
  • projects/osmosys-form/ng-package.json
  • projects/osmosys-form/tsconfig.lib.json
  • projects/osmosys-form/tsconfig.spec.json
  • tsconfig.json
Additional context used
GitHub Check: Build
projects/osmosys-form/src/lib/osmosys-form.component.ts

[failure] 60-60:
Property 'formJsonData' comes from an index signature, so it must be accessed with ['formJsonData'].


[failure] 67-67:
Property 'modelData' comes from an index signature, so it must be accessed with ['modelData'].


[failure] 67-67:
Property 'formJsonData' comes from an index signature, so it must be accessed with ['formJsonData'].

Additional comments not posted (3)
projects/osmosys-form/src/lib/osmosys-form.component.ts (3)

45-51: Constructor looks good.

The constructor correctly initializes the form using FormBuilder.


53-57: ngOnInit method looks good.

The ngOnInit method correctly initializes formConfig and calls createForm with the appropriate arguments.


122-127: Methods look good.

The methods handleButtonClick, validateAllFormFields, and onReset are well-implemented and do not have any issues.

Also applies to: 130-140, 142-153

Comment on lines +31 to +33
@Input() formJsonData: any;

@Input() modelData: any;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Specify types and improve readability.

Avoid using any type for formJsonData, modelData, and formConfig. Add blank lines between class members to improve readability.

-  @Input() formJsonData: any;
-
-  @Input() modelData: any;
-
+  @Input() formJsonData: { layout: { rows: any[] } };
+  
+  @Input() modelData: Record<string, any>;
+  
+  formConfig: { layout: { rows: any[] } };

Also applies to: 43-43

Comment on lines +116 to +119
updateFormValues(data: any) {
if (data) {
this.form.patchValue(data);
}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Specify types for parameters.

Avoid using any type for parameters in the updateFormValues method.

-  updateFormValues(data: any) {
+  updateFormValues(data: Record<string, any>) {
Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
updateFormValues(data: any) {
if (data) {
this.form.patchValue(data);
}
updateFormValues(data: Record<string, any>) {
if (data) {
this.form.patchValue(data);
}

Comment on lines +72 to +113
createForm(rows: any) {
const group: any = {};
rows.forEach((row: any) => {
row.columns.forEach((column: any) => {
column.elements.forEach((element: any) => {
if (
element.type === 'input' ||
element.type === 'select' ||
element.type === 'radio' ||
element.type === 'checkbox' ||
element.type === 'range' ||
element.type === 'date' ||
element.type === 'multiselect' ||
element.type === 'textarea' ||
element.type === 'file' ||
element.type === 'color'
) {
const validations: ValidatorFn[] = [];

if (element.validations) {
element.validations.forEach((validation: any) => {
if (validation.validator === 'required') {
validations.push(Validators.required);
} else if (validation.validator === 'minlength') {
validations.push(Validators.minLength(validation.value));
} else if (validation.validator === 'maxlength') {
validations.push(Validators.maxLength(validation.value));
} else if (validation.validator === 'pattern') {
validations.push(Validators.pattern(validation.value));
} else if (validation.validator === 'requiredTrue') {
validations.push(Validators.requiredTrue);
}
});
}

group[element.name] = this.fb.control(element.value || '', validations);
}
});
});
});
this.form = this.fb.group(group);
this.updateFormValues(this.modelData);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Specify types for parameters and variables.

Avoid using any type for parameters and variables in the createForm method.

-  createForm(rows: any) {
-    const group: any = {};
-    rows.forEach((row: any) => {
-      row.columns.forEach((column: any) => {
-        column.elements.forEach((element: any) => {
+  createForm(rows: { columns: { elements: { name: string, value: any, validations: { validator: string, value?: any }[] }[] }[] }[]) {
+    const group: { [key: string]: any } = {};
+    rows.forEach((row: { columns: { elements: { name: string, value: any, validations: { validator: string, value?: any }[] }[] }[] }) => {
+      row.columns.forEach((column: { elements: { name: string, value: any, validations: { validator: string, value?: any }[] }[] }) => {
+        column.elements.forEach((element: { name: string, value: any, validations: { validator: string, value?: any }[] }) => {
Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
createForm(rows: any) {
const group: any = {};
rows.forEach((row: any) => {
row.columns.forEach((column: any) => {
column.elements.forEach((element: any) => {
if (
element.type === 'input' ||
element.type === 'select' ||
element.type === 'radio' ||
element.type === 'checkbox' ||
element.type === 'range' ||
element.type === 'date' ||
element.type === 'multiselect' ||
element.type === 'textarea' ||
element.type === 'file' ||
element.type === 'color'
) {
const validations: ValidatorFn[] = [];
if (element.validations) {
element.validations.forEach((validation: any) => {
if (validation.validator === 'required') {
validations.push(Validators.required);
} else if (validation.validator === 'minlength') {
validations.push(Validators.minLength(validation.value));
} else if (validation.validator === 'maxlength') {
validations.push(Validators.maxLength(validation.value));
} else if (validation.validator === 'pattern') {
validations.push(Validators.pattern(validation.value));
} else if (validation.validator === 'requiredTrue') {
validations.push(Validators.requiredTrue);
}
});
}
group[element.name] = this.fb.control(element.value || '', validations);
}
});
});
});
this.form = this.fb.group(group);
this.updateFormValues(this.modelData);
createForm(rows: { columns: { elements: { name: string, value: any, validations: { validator: string, value?: any }[] }[] }[] }[]) {
const group: { [key: string]: any } = {};
rows.forEach((row: { columns: { elements: { name: string, value: any, validations: { validator: string, value?: any }[] }[] }[] }) => {
row.columns.forEach((column: { elements: { name: string, value: any, validations: { validator: string, value?: any }[] }[] }) => {
column.elements.forEach((element: { name: string, value: any, validations: { validator: string, value?: any }[] }) => {

Comment on lines 59 to 69
ngOnChanges(changes: SimpleChanges) {
if (changes.formJsonData) {
this.formConfig = this.formJsonData || {};
this.createForm(this.formConfig.layout.rows);
this.cdr.detectChanges();
this.formInstance.emit(this.form);
}

if (changes.modelData && !changes.formJsonData) {
this.updateFormValues(this.modelData);
}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fix property access from index signatures.

Properties formJsonData and modelData come from an index signature, so they must be accessed with ['formJsonData'] and ['modelData'].

-    if (changes.formJsonData) {
-      this.formConfig = this.formJsonData || {};
+    if (changes['formJsonData']) {
+      this.formConfig = this['formJsonData'] || {};
       
-    if (changes.modelData && !changes.formJsonData) {
-      this.updateFormValues(this.modelData);
+    if (changes['modelData'] && !changes['formJsonData']) {
+      this.updateFormValues(this['modelData']);
Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
ngOnChanges(changes: SimpleChanges) {
if (changes.formJsonData) {
this.formConfig = this.formJsonData || {};
this.createForm(this.formConfig.layout.rows);
this.cdr.detectChanges();
this.formInstance.emit(this.form);
}
if (changes.modelData && !changes.formJsonData) {
this.updateFormValues(this.modelData);
}
ngOnChanges(changes: SimpleChanges) {
if (changes['formJsonData']) {
this.formConfig = this['formJsonData'] || {};
this.createForm(this.formConfig.layout.rows);
this.cdr.detectChanges();
this.formInstance.emit(this.form);
}
if (changes['modelData'] && !changes['formJsonData']) {
this.updateFormValues(this['modelData']);
}
Tools
GitHub Check: Build

[failure] 60-60:
Property 'formJsonData' comes from an index signature, so it must be accessed with ['formJsonData'].


[failure] 67-67:
Property 'modelData' comes from an index signature, so it must be accessed with ['modelData'].


[failure] 67-67:
Property 'formJsonData' comes from an index signature, so it must be accessed with ['formJsonData'].

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between a6cdb72 and 6082dd8.

Files selected for processing (2)
  • projects/osmosys-form/src/lib/osmosys-form.component.html (1 hunks)
  • projects/osmosys-form/src/lib/osmosys-form.component.ts (1 hunks)
Files skipped from review as they are similar to previous changes (2)
  • projects/osmosys-form/src/lib/osmosys-form.component.html
  • projects/osmosys-form/src/lib/osmosys-form.component.ts

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 6082dd8 and d2150ed.

Files selected for processing (1)
  • projects/osmosys-form/src/lib/osmosys-form.component.html (1 hunks)
Files skipped from review as they are similar to previous changes (1)
  • projects/osmosys-form/src/lib/osmosys-form.component.html

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