Skip to content

Commit

Permalink
[NIFI-13535] - Fix: Issues selecting GitHub branch on version control…
Browse files Browse the repository at this point in the history
… 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
  • Loading branch information
rfellows authored Jul 24, 2024
1 parent 11fdc44 commit 2dd7cf7
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,27 +35,27 @@ 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
});
}

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`,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand All @@ -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 {
Expand Down

0 comments on commit 2dd7cf7

Please sign in to comment.