git.psu.edu will be upgraded to critical security release 13.7.4 Monday, 11/18 between 9 and 10pm. Please email support@git.psu.edu if you have trouble with anything Gitlab-related. Please see the git.psu.edu Yammer group for more information.

Commit ab21d3d9 authored by Ryan Diehl's avatar Ryan Diehl

Merge branch 'feature/form' into 'develop'

fix(form): support ivy in DisableControlDirective

See merge request !35
parents ced5f7c0 982aa95c
Pipeline #106162 passed with stages
in 4 minutes and 48 seconds
import { Directive, Input } from '@angular/core';
import { Directive, Input, OnChanges, Self, SimpleChanges } from '@angular/core';
import { NgControl } from '@angular/forms';
@Directive({
selector: '[utDisableControl]'
})
export class DisableControlDirective {
constructor(private ngControl: NgControl) {}
export class DisableControlDirective implements OnChanges {
constructor(@Self() private ngControl: NgControl) {}
@Input('utDisableControl')
public set disableControl(condition: boolean) {
const action = !!condition ? 'disable' : 'enable';
this.ngControl.control[action]();
public disableControl: boolean;
public ngOnChanges(changes: SimpleChanges): void {
if (changes && changes['disableControl']) {
const action = !!this.disableControl ? 'disable' : 'enable';
this.ngControl.control[action]();
}
}
}
  • SonarQube analysis indicates that quality gate is failed.

    • Bugs is failed: Actual value 1 > 0
    • high_severity_vulns is passed: Actual value 0
    • medium_severity_vulns is passed: Actual value 0

    SonarQube analysis reported 13 issues

    • 1 major
    • 🔽 7 minor
    • 5 info

    Top 10 extra issues

    Note: The following issues were found on lines that were not modified in the commit. Because these issues can't be reported as line comments, they are summarized here:

    1. Unexpected empty source 📘
    2. 🔽 Add an "alt" attribute to this image. 📘
    3. 🔽 This assertion is unnecessary since it does not change the type of the expression. 📘
    4. 🔽 This assertion is unnecessary since it does not change the type of the expression. 📘
    5. 🔽 This assertion is unnecessary since it does not change the type of the expression. 📘
    6. 🔽 This assertion is unnecessary since it does not change the type of the expression. 📘
    7. 🔽 This assertion is unnecessary since it does not change the type of the expression. 📘
    8. 🔽 This assertion is unnecessary since it does not change the type of the expression. 📘
    9. Make sure that cookie is written safely here. 📘
    10. Make sure that using a regular expression is safe here. 📘
    • ... 3 more
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment