Skip to content

Conversation

renczesstefan
Copy link
Member

@renczesstefan renczesstefan commented Jun 13, 2023

Description

It is now possible to render taskref as list of tasks (aka. taskView).

Implements NAE-1901

Dependencies

No new dependencies were introduced.

Third party dependencies

No new dependencies were introduced.

Blocking Pull requests

Depends on #198

How Has Been This Tested?

This was tested manually and with unit tests.

Test Configuration

Name Tested on
OS macOS Ventura 13.1
Runtime Node 14.19.3
Dependency Manager NPM 6.14.17
Framework version Angular 13.3.1
Run parameters
Other configuration

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • My changes have been checked, personally or remotely, with @mazarijuraj
  • I have commented my code, particularly in hard-to-understand areas
  • I have resolved all conflicts with the target branch of the PR
  • I have updated and synced my code with the target branch
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing tests pass locally with my changes:
    • Lint test
    • Unit tests
    • Integration tests
  • I have checked my contribution with code analysis tools:
  • I have made corresponding changes to the documentation:
    • Developer documentation
    • User Guides
    • Migration Guides

- added component resolution to data-field-template.component component
- modified resolveComponentPortal
- added abstract-base-data-field.component.ts
- refactored data component attributes
- corrected tests
- updated abstract components
- modified data-field-template.component.html
- updated filter-data-fields-module
- updated filter-data-fields-module
# Conflicts:
#	docs/compodoc/components/js/search/search_index.js
#	docs/typedoc/components-core/modules.html
- modified task content rendering algorithm to keep taskRef in datafields when it is needed
- created default component for taskref and update taskref components according to component register
- updated data-fields.module.ts
-
- added default component
- removed unnecessary component resolution
- marked unused code as deprecated
- implemented resolution for updateOn strategy
- modified abstract classes according to test
- modified according to PR
Copy link
Contributor

@minop minop left a comment

Choose a reason for hiding this comment

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

could we arrange a meeting to go over the high-level ideas of the changes? Due to the size of the PR, I was unable to fully grasp what is being done and what the ultimate goal of the changes is

Copy link
Contributor

Choose a reason for hiding this comment

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

are docs/ files supposed to be part of the repository? I thought they were auto-generated

this.dataField = dataFieldPortalData.dataField;
this.formControlRef = dataFieldPortalData.formControlRef;
this.showLargeLayout = dataFieldPortalData.showLargeLayout;
if (!this.formControlRef) {
Copy link
Contributor

Choose a reason for hiding this comment

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

formControlRef is guaranteed to always be false, since @Input()s are first set during the OnInit lifecycle hook

Copy link
Member Author

Choose a reason for hiding this comment

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

I think in this case it is not guaranteed. It is possible, that dataFieldPortalData contains defined formControlRef that is provided through AbstractDataFieldTemplateComponent and AbstractFieldComponentResolver via datafield object.
But you are right it would be better to check whether datafield has registered formcontrol, I will change it.

if (!this.formControlRef) {
this.formControlRef = new FormControl('', {updateOn: this.dataField.getUpdateOnStrategy()});
}
if (!this.dataField.initialized) {
Copy link
Contributor

Choose a reason for hiding this comment

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

if the datafield was already initialized and we have created a new FormControl is it a problem?

Copy link
Member Author

Choose a reason for hiding this comment

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

AS mentioned above, a I changed the check.

undefined,
undefined,
[{validationRule: 'requiredTrue', validationMessage: 'this is custom message'}]),
formControlRef: new FormControl(),
Copy link
Contributor

Choose a reason for hiding this comment

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

must a FormControl be set to the field? Is it not more natura for there to be no control yet?

return this._translate.instant('dataField.values.boolean.' + this.dataField.value);
}

private resolveErrorMessage(dataField: BooleanField, search: string, generalMessage: string) {
Copy link
Contributor

Choose a reason for hiding this comment

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

this implementation seems quite generic. Why is it specific only for a boolean field?

Copy link
Member Author

Choose a reason for hiding this comment

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

This is refactored too in other PR, there it is managed as generic function.

@@ -0,0 +1 @@
<ng-template [cdkPortalOutlet]="componentPortal"></ng-template>
Copy link
Contributor

Choose a reason for hiding this comment

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

what is the point of this component? Can't the host just display the portal?

[showLargeLayout]="showLargeLayout"></nc-simple-text-field>
</div>
</ng-template>
<!--<ng-template #textFieldTemplate let-showLargeLayout="showLargeLayout">-->
Copy link
Contributor

Choose a reason for hiding this comment

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

why leave this in?

editable: true,
hidden: true
}, undefined, []),
formControlRef: new FormControl(),
Copy link
Contributor

Choose a reason for hiding this comment

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

FC

hidden: true
}, undefined,
undefined),
formControlRef: new FormControl(),
Copy link
Contributor

Choose a reason for hiding this comment

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

FC

@@ -1,54 +1,4 @@
<div fxLayout="row" fxLayoutAlign="start center" class="netgrif-input" [ngClass]="{'min-row-height': isField() && !isCustomHeight()}" [ngSwitch]="getElementType()">
Copy link
Contributor

Choose a reason for hiding this comment

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

can't the ngSwitch be completely replaced with portals?

Copy link
Member Author

Choose a reason for hiding this comment

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

DataGroup does not have a field implementation and we may want to deprecate the use of them in future resleases. Builder does not supports them neither. A fully portal-based solution would be better, so I decided to replace ngSwitch, and add ngIf for remiaining fields, then if the datagroup solution will be removed, we can remove the div too.

Kovy95
Kovy95 previously approved these changes Jun 15, 2023
@renczesstefan renczesstefan requested a review from minop June 16, 2023 08:33
- corrected according to PR
# Conflicts:
#	docs/compodoc/components/js/search/search_index.js
#	docs/typedoc/components-core/modules.html
# Conflicts:
#	docs/compodoc/components/js/search/search_index.js
#	docs/typedoc/components-core/modules.html
@Kovy95 Kovy95 mentioned this pull request Jun 21, 2023
18 tasks
- corrected according to tests.
@pull-request-quantifier-deprecated

This PR has 6855 quantified lines of changes. In general, a change size of upto 200 lines is ideal for the best PR experience!


Quantification details

Label      : Extra Large
Size       : +4342 -2513
Percentile : 100%

Total files changed: 291

Change summary by file extension:
.html : +433 -551
.ts : +3756 -1829
.scss : +153 -133

Change counts above are quantified counts, based on the PullRequestQuantifier customizations.

Why proper sizing of changes matters

Optimal pull request sizes drive a better predictable PR flow as they strike a
balance between between PR complexity and PR review overhead. PRs within the
optimal size (typical small, or medium sized PRs) mean:

  • Fast and predictable releases to production:
    • Optimal size changes are more likely to be reviewed faster with fewer
      iterations.
    • Similarity in low PR complexity drives similar review times.
  • Review quality is likely higher as complexity is lower:
    • Bugs are more likely to be detected.
    • Code inconsistencies are more likely to be detected.
  • Knowledge sharing is improved within the participants:
    • Small portions can be assimilated better.
  • Better engineering practices are exercised:
    • Solving big problems by dividing them in well contained, smaller problems.
    • Exercising separation of concerns within the code changes.

What can I do to optimize my changes

  • Use the PullRequestQuantifier to quantify your PR accurately
    • Create a context profile for your repo using the context generator
    • Exclude files that are not necessary to be reviewed or do not increase the review complexity. Example: Autogenerated code, docs, project IDE setting files, binaries, etc. Check out the Excluded section from your prquantifier.yaml context profile.
    • Understand your typical change complexity, drive towards the desired complexity by adjusting the label mapping in your prquantifier.yaml context profile.
    • Only use the labels that matter to you, see context specification to customize your prquantifier.yaml context profile.
  • Change your engineering behaviors
    • For PRs that fall outside of the desired spectrum, review the details and check if:
      • Your PR could be split in smaller, self-contained PRs instead
      • Your PR only solves one particular issue. (For example, don't refactor and code new features in the same PR).

How to interpret the change counts in git diff output

  • One line was added: +1 -0
  • One line was deleted: +0 -1
  • One line was modified: +1 -1 (git diff doesn't know about modified, it will
    interpret that line like one addition plus one deletion)
  • Change percentiles: Change characteristics (addition, deletion, modification)
    of this PR in relation to all other PRs within the repository.


Was this comment helpful? 👍  :ok_hand:  :thumbsdown: (Email)
Customize PullRequestQuantifier for this repository.

@sonarqubecloud
Copy link

SonarCloud Quality Gate failed.    Quality Gate failed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot E 4 Security Hotspots
Code Smell A 100 Code Smells

33.0% 33.0% Coverage
1.4% 1.4% Duplication

idea Catch issues before they fail your Quality Gate with our IDE extension sonarlint SonarLint

@machacjozef machacjozef merged commit 34f310f into release/6.4.0 Feb 9, 2024
Copy link

dpulls bot commented Feb 9, 2024

🎉 All dependencies have been resolved !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Extra Large improvement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants