Skip to content

Commit

Permalink
Added integration code
Browse files Browse the repository at this point in the history
Signed-off-by: Chaitali Mane <cmane@progress.com>
  • Loading branch information
chaitali-mane committed Dec 15, 2021
1 parent aebd7b7 commit 3005c7e
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,7 @@ export class ChefServersListComponent implements OnInit, OnDestroy {
]]
});
this.webUIKeyForm = this.fb.group({
webui_key: ['', [Validators.required,
Validators.pattern(Regex.patterns.NON_BLANK)
]]
webui_key: ['', [Validators.required]]
});
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -152,21 +152,22 @@ <h2 slot="title">Add Chef Infra Server </h2>
autofocus></textarea>
</label>
<chef-error
*ngIf="webUIKeyForm.get('webui_key').hasError('required') && webUIKeyForm.get('webui_key').dirty">
*ngIf="(webUIKeyForm.get('webui_key').hasError('required') || webUIKeyForm.get('webui_key').hasError('pattern')) && webUIKeyForm.get('webui_key').dirty">
WEB UI KEY is required.
</chef-error>
<span class="note_text">Note: A web UI Key is located <span>Here</span>(Need Better Help Text).</span>
<span class="note_text">Note: A web UI Key is located <a href=''>Here</a>(Need Better Help Text).</span>
</chef-form-field>
</div>
<div id="button-bar">
<div id="button-bar">
<chef-button id="cancel-server-popup" tertiary [disabled]="creating" (click)="closeSeverSlider()">Cancel</chef-button>
<chef-button [disabled]="!createForm?.valid || webUIKeyForm?.valid || creating || conflictError || (selected === 'fqdn') ? !fqdnForm?.valid : !ipForm?.valid"
primaryt
<chef-button
[disabled]="!createForm?.valid || !webUIKeyForm?.valid || creating || conflictError || ((selected === 'fqdn') ? !fqdnForm?.valid : !ipForm?.valid)"
primary
data-cy="add-button"
id="create-button-object-modal"
(click)="createChefServer()">
<chef-loading-spinner *ngIf="creating"></chef-loading-spinner>
<span *ngIf="!creating">Add</span>
<span *ngIf="!creating">Add Chef Infra Server</span>
<span *ngIf="creating">Adding Chef Infra Server ...</span>
</chef-button>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ describe('CreateChefServerSliderComponent', () => {
expect(createForm.valid).toBeFalsy();
expect(fqdnForm.valid).toBeFalsy();
expect(ipForm.valid).toBeFalsy();
expect(webUIKeyForm).toBeFalsy();
expect(webUIKeyForm.valid).toBeFalsy();
});

it('when name is missing', () => {
Expand Down

0 comments on commit 3005c7e

Please sign in to comment.