Skip to content

Commit

Permalink
[NIFI-13656] allow enter button to submit create PG and create Port f…
Browse files Browse the repository at this point in the history
…orm (#9181)

* [NIFI-13656] allow enter button to submit create PG and create Port form

* restore scrolling for hints in codemirrors in update attribute

* fix unit tests

* update unit test

* remove duplicate imports

This closes #9181
  • Loading branch information
scottyaslan authored Aug 20, 2024
1 parent 7f41bc1 commit 8919955
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@
* limitations under the License.
*/

ul.CodeMirror-hints {
overflow-y: scroll;
}

div.el-section {
margin: 5px 0;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@
*/

import { ComponentFixture, TestBed } from '@angular/core/testing';

import { MatSidenavModule } from '@angular/material/sidenav';
import { NoopAnimationsModule } from '@angular/platform-browser/animations';
import { Canvas } from './canvas.component';
import { provideMockStore } from '@ngrx/store/testing';
import { initialState } from '../../state/flow/flow.reducer';
Expand All @@ -30,9 +31,7 @@ import { HeaderComponent } from './header/header.component';
import { FooterComponent } from './footer/footer.component';
import { canvasFeatureKey } from '../../state';
import { flowFeatureKey } from '../../state/flow';
import { MatSidenavModule } from '@angular/material/sidenav';
import { FlowAnalysisDrawerComponent } from './header/flow-analysis-drawer/flow-analysis-drawer.component';
import { NoopAnimationsModule } from '@angular/platform-browser/animations';
import { CanvasActionsService } from '../../service/canvas-actions.service';

describe('Canvas', () => {
Expand Down Expand Up @@ -60,6 +59,8 @@ describe('Canvas', () => {
ContextMenu,
MatSidenavModule,
NoopAnimationsModule,
MatSidenavModule,
NoopAnimationsModule,
MockComponent(GraphControls),
MockComponent(HeaderComponent),
MockComponent(FooterComponent),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ <h2 mat-dialog-title>Create New {{ portTypeLabel }}</h2>
<button mat-button mat-dialog-close>Cancel</button>
<button
[disabled]="!createPortForm.dirty || createPortForm.invalid || saving.value"
type="button"
type="submit"
color="primary"
(click)="createPort()"
mat-button>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ <h2 mat-dialog-title>Create Process Group</h2>
<button mat-button mat-dialog-close>Cancel</button>
<button
[disabled]="!createProcessGroupForm.dirty || createProcessGroupForm.invalid || saving.value"
type="button"
type="submit"
color="primary"
(click)="createProcessGroup()"
mat-button>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,11 @@ describe('ComboEditor', () => {
it('should create', () => {
if (item) {
component.item = item;
component.parameterConfig = {
supportsParameters: false,
parameters: null
};

fixture.detectChanges();

expect(component).toBeTruthy();
Expand All @@ -131,6 +136,11 @@ describe('ComboEditor', () => {
it('verify combo value', () => {
if (item) {
component.item = item;
component.parameterConfig = {
supportsParameters: false,
parameters: null
};

fixture.detectChanges();

const formValue = component.comboEditorForm.get('value')?.value;
Expand All @@ -149,6 +159,11 @@ describe('ComboEditor', () => {
item.descriptor.required = false;

component.item = item;
component.parameterConfig = {
supportsParameters: false,
parameters: null
};

fixture.detectChanges();

const formValue = component.comboEditorForm.get('value')?.value;
Expand All @@ -168,6 +183,11 @@ describe('ComboEditor', () => {
item.descriptor.defaultValue = undefined;

component.item = item;
component.parameterConfig = {
supportsParameters: false,
parameters: null
};

fixture.detectChanges();

const formValue = component.comboEditorForm.get('value')?.value;
Expand All @@ -185,7 +205,11 @@ describe('ComboEditor', () => {
item.value = '#{one}';

component.item = item;
component.parameters = parameters;
component.parameterConfig = {
supportsParameters: true,
parameters
};

fixture.detectChanges();
await fixture.whenStable();

Expand All @@ -207,7 +231,11 @@ describe('ComboEditor', () => {
item.value = '#{three}';

component.item = item;
component.parameters = parameters;
component.parameterConfig = {
supportsParameters: true,
parameters
};

fixture.detectChanges();
await fixture.whenStable();

Expand Down

0 comments on commit 8919955

Please sign in to comment.