-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feature #177 Create component search with custom filter tokens
- Loading branch information
Showing
22 changed files
with
405 additions
and
235 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
49 changes: 49 additions & 0 deletions
49
ui/projects/spline-api/src/lib/execution-event/services/label-api.service.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
/* | ||
* Copyright 2021 ABSA Group Limited | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
import { HttpClient, HttpErrorResponse } from '@angular/common/http' | ||
import { Injectable } from '@angular/core' | ||
import { Observable, throwError } from 'rxjs' | ||
import { catchError } from 'rxjs/operators' | ||
import { LabelPageQueryParams, LabelValuesPageQueryParams } from 'spline-utils' | ||
|
||
import { ExecutionEventsQuery } from '../models' | ||
|
||
import { BaseApiService } from './base-api.service' | ||
|
||
|
||
@Injectable() | ||
export class LabelApiService extends BaseApiService { | ||
|
||
constructor(protected readonly http: HttpClient) { | ||
super(http) | ||
} | ||
|
||
fetchList(queryParams: LabelPageQueryParams | LabelValuesPageQueryParams): Observable<string[]> { | ||
// Apadter LabelQuery to LabelHttpParams | ||
const params = ExecutionEventsQuery.labelQueryParamsToHttpParams(queryParams) | ||
const url = this.getConsumerApiResourceURL(`labels/names${ ('labelName' in queryParams) && queryParams.labelName | ||
? `/${ queryParams.labelName }/values` | ||
: '' }`) | ||
return this.http.get<string[]>(url, { params: params }) | ||
.pipe( | ||
catchError((error: HttpErrorResponse) => { | ||
console.error(error) | ||
return throwError(error) | ||
}) | ||
) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.