NIFI-13416: (#8987)

- Allowing new parameters to override inherited parameters.
- Adding a new Override action to prepopulate the parameter name and sensitivity.
- Showing an indicator when a parameter in the listing is inherited.

This closes #8987
This commit is contained in:
Matt Gilman 2024-06-20 12:18:17 -04:00 committed by GitHub
parent 9a69a28544
commit 8c89225029
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 44 additions and 3 deletions

View File

@ -39,7 +39,9 @@
<th mat-header-cell *matHeaderCellDef mat-sort-header>Name</th>
<td mat-cell *matCellDef="let item">
<div class="flex justify-between items-center">
<div>
<div
class="whitespace-nowrap overflow-hidden text-ellipsis leading-normal"
[title]="item.entity.parameter.name">
{{ item.entity.parameter.name }}
</div>
@if (hasDescription(item)) {
@ -47,7 +49,16 @@
class="fa fa-info-circle primary-color"
nifiTooltip
[tooltipComponentType]="TextTip"
[tooltipInputData]="item.entity.parameter.description"></i>
[tooltipInputData]="item.entity.parameter.description"
[delayClose]="false"></i>
}
@if (canOverride(item)) {
<i
class="fa fa-level-down primary-color"
nifiTooltip
[tooltipComponentType]="TextTip"
tooltipInputData="This parameter is inherited form another Parameter Context."
[delayClose]="false"></i>
}
</div>
</td>
@ -121,6 +132,12 @@
Go to
</button>
}
@if (canOverride(item)) {
<button mat-menu-item (click)="overrideParameter(item)">
<i class="fa mr-2"></i>
Override
</button>
}
@if (canEdit(item) && !isDisabled) {
<button mat-menu-item (click)="editClicked(item)">
<i class="fa fa-cog primary-color mr-2"></i>

View File

@ -178,6 +178,7 @@ export class ParameterTable implements AfterViewInit, ControlValueAccessor {
// unmarked for deletion if the user chooses to enter the same name
const existingParameters: string[] = this.dataSource.data
.filter((item) => !item.deleted)
.filter((item) => !item.entity.parameter.inherited)
.map((item) => item.entity.parameter.name);
this.createNewParameter(existingParameters)
@ -208,6 +209,7 @@ export class ParameterTable implements AfterViewInit, ControlValueAccessor {
// update the existing item
item.deleted = false;
item.dirty = true;
item.entity.parameter = {
...parameter
};
@ -253,7 +255,7 @@ export class ParameterTable implements AfterViewInit, ControlValueAccessor {
canGoToParameter(item: ParameterItem): boolean {
return (
item.entity.parameter.inherited == true &&
item.entity.parameter.inherited === true &&
item.entity.parameter.parameterContext?.permissions.canRead == true
);
}
@ -266,6 +268,28 @@ export class ParameterTable implements AfterViewInit, ControlValueAccessor {
return [];
}
canOverride(item: ParameterItem): boolean {
return item.entity.parameter.inherited === true;
}
overrideParameter(item: ParameterItem): void {
const overriddenParameter: Parameter = {
...item.entity.parameter,
value: null
};
this.editParameter(overriddenParameter)
.pipe(take(1))
.subscribe((parameter) => {
item.dirty = true;
item.entity.parameter = {
...parameter
};
this.handleChanged();
});
}
canEdit(item: ParameterItem): boolean {
const canWrite: boolean = item.entity.canWrite == true;
const provided: boolean = item.entity.parameter.provided == true;