Skip to content

Commit

Permalink
[NIFI-13269] - Order parameter reference list alphabetically
Browse files Browse the repository at this point in the history
  • Loading branch information
rfellows committed May 28, 2024
1 parent 2598068 commit 9e6f8ff
Showing 1 changed file with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ import { MatTooltipModule } from '@angular/material/tooltip';
import { TextTip } from '../../../tooltips/text-tip/text-tip.component';
import { A11yModule } from '@angular/cdk/a11y';
import { NgxSkeletonLoaderModule } from 'ngx-skeleton-loader';
import { NiFiCommon } from '../../../../../service/nifi-common.service';

export interface AllowableValueItem extends AllowableValue {
id: number;
Expand Down Expand Up @@ -108,7 +109,10 @@ export class ComboEditor {
configuredValue: string | null = null;
_parameters!: Parameter[];

constructor(private formBuilder: FormBuilder) {
constructor(
private formBuilder: FormBuilder,
private nifiCommon: NiFiCommon
) {
this.comboEditorForm = this.formBuilder.group({
value: new FormControl(null, Validators.required)
});
Expand Down Expand Up @@ -202,7 +206,9 @@ export class ComboEditor {
this.configuredParameterId = parameterItem.id;
}
});

this.parameterAllowableValues.sort((a, b) =>
this.nifiCommon.compareString(a.displayName, b.displayName)
);
// if combo still set to reference a parameter, set the default value
if (selectedItem?.id == this.referencesParametersId) {
this.comboEditorForm.get('parameterReference')?.setValue(this.configuredParameterId);
Expand Down

0 comments on commit 9e6f8ff

Please sign in to comment.