[NIFI-13535] - Fix: Issues selecting GitHub branch on version control screens in new UI (#9087)

* [NIFI-13535] - Fix: Issues selecting GitHub branch on version control screens in new UI

* ensure branch is provided when querying flow versions in import from registry dialog

* add branch to loadFlows call on bucketChange

This closes #9087
This commit is contained in:
Rob Fellows 2024-07-24 09:28:54 -04:00 committed by GitHub
parent 11fdc44fb9
commit 2dd7cf7f92
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 10 additions and 8 deletions

View File

@ -35,17 +35,17 @@ export class RegistryService {
}
getBuckets(registryId: string, branch?: string): Observable<any> {
const params: HttpParams = new HttpParams();
let params: HttpParams = new HttpParams();
if (branch) {
params.set('branch', branch);
params = params.set('branch', branch);
}
return this.httpClient.get(`${RegistryService.API}/flow/registries/${registryId}/buckets`, { params });
}
getFlows(registryId: string, bucketId: string, branch?: string): Observable<any> {
const params: HttpParams = new HttpParams();
let params: HttpParams = new HttpParams();
if (branch) {
params.set('branch', branch);
params = params.set('branch', branch);
}
return this.httpClient.get(`${RegistryService.API}/flow/registries/${registryId}/buckets/${bucketId}/flows`, {
params
@ -53,9 +53,9 @@ export class RegistryService {
}
getFlowVersions(registryId: string, bucketId: string, flowId: string, branch?: string): Observable<any> {
const params: HttpParams = new HttpParams();
let params: HttpParams = new HttpParams();
if (branch) {
params.set('branch', branch);
params = params.set('branch', branch);
}
return this.httpClient.get(
`${RegistryService.API}/flow/registries/${registryId}/buckets/${bucketId}/flows/${flowId}/versions`,

View File

@ -200,7 +200,8 @@ export class ImportFromRegistry extends CloseOnEscapeDialog implements OnInit {
bucketChanged(bucketId: string): void {
this.clearFlows();
const registryId = this.importFromRegistryForm.get('registry')?.value;
this.loadFlows(registryId, bucketId);
const branch = this.importFromRegistryForm.get('branch')?.value;
this.loadFlows(registryId, bucketId, branch);
}
private clearFlows() {
@ -212,7 +213,8 @@ export class ImportFromRegistry extends CloseOnEscapeDialog implements OnInit {
flowChanged(flowId: string): void {
const registryId = this.importFromRegistryForm.get('registry')?.value;
const bucketId = this.importFromRegistryForm.get('bucket')?.value;
this.loadVersions(registryId, bucketId, flowId);
const branch = this.importFromRegistryForm.get('branch')?.value;
this.loadVersions(registryId, bucketId, flowId, branch);
}
loadBranches(registryId: string): void {