You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@streampipes.apache.org by GitBox <gi...@apache.org> on 2023/01/02 14:36:30 UTC
[GitHub] [streampipes] aamirxshaikh opened a new pull request, #1012: [#877] Apply UI linting to projects module
aamirxshaikh opened a new pull request, #1012:
URL: https://github.com/apache/streampipes/pull/1012
<!--
~ Licensed to the Apache Software Foundation (ASF) under one or more
~ contributor license agreements. See the NOTICE file distributed with
~ this work for additional information regarding copyright ownership.
~ The ASF licenses this file to You 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.
~
-->
<!--
Thanks for contributing! Here are some tips you can follow to help us incorporate your contribution quickly and easily:
1. If this is your first time, please read our contributor guidelines:
- https://streampipes.apache.org/getinvolved.html
- https://cwiki.apache.org/confluence/display/STREAMPIPES/Getting+Started
2. Make sure the PR title is formatted like: `[#<GitHub issue id>] PR title ...`
3. If the PR is unfinished, add '[WIP]' in your PR title, e.g., `[WIP][#<GitHub issue id>] PR title ...`.
4. Please write your PR title to summarize what this PR proposes/fixes.
5. Link the PR to the corresponding GitHub issue (if present) in the `Development` section in the right menu bar.
6. Be sure to keep the PR description updated to reflect all changes.
7. If possible, provide a concise example to reproduce the issue for a faster review.
8. Make sure tests pass via `mvn clean install`.
9. (Optional) If the contribution is large, please file an Apache ICLA
- http://apache.org/licenses/icla.pdf
-->
### Purpose
<!--
Please clarify what changes you are proposing and describe how those changes will address the issue.
Furthermore, describe potential consequences the changes might have.
-->
Applying UI linting to projects module. Removing projects module from ui/.eslintignore and ui/.prettierignore and fixing formatting.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@streampipes.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [streampipes] aamirxshaikh commented on pull request #1012: [#877] Apply UI linting to projects module
Posted by GitBox <gi...@apache.org>.
aamirxshaikh commented on PR #1012:
URL: https://github.com/apache/streampipes/pull/1012#issuecomment-1369112536
Thanks @tenthe I have updated the PR.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@streampipes.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [streampipes] tenthe merged pull request #1012: [#877] Apply UI linting to projects module
Posted by GitBox <gi...@apache.org>.
tenthe merged PR #1012:
URL: https://github.com/apache/streampipes/pull/1012
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@streampipes.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [streampipes] tenthe commented on pull request #1012: [#877] Apply UI linting to projects module
Posted by GitBox <gi...@apache.org>.
tenthe commented on PR #1012:
URL: https://github.com/apache/streampipes/pull/1012#issuecomment-1369071549
Hi @aamirxshaikh thanks for providing the PR.
I tried it locally and added a comment with a fix that worked for me. Please try it out and update the PR.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@streampipes.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [streampipes] bossenti commented on pull request #1012: [#877] Apply UI linting to projects module
Posted by GitBox <gi...@apache.org>.
bossenti commented on PR #1012:
URL: https://github.com/apache/streampipes/pull/1012#issuecomment-1369136343
@aamirxshaikh thanks for your continuous contributions 🙏🏼
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@streampipes.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [streampipes] tenthe commented on a diff in pull request #1012: [#877] Apply UI linting to projects module
Posted by GitBox <gi...@apache.org>.
tenthe commented on code in PR #1012:
URL: https://github.com/apache/streampipes/pull/1012#discussion_r1060116497
##########
ui/projects/streampipes/platform-services/src/lib/apis/datalake-rest.service.ts:
##########
@@ -19,190 +19,243 @@
import { Injectable } from '@angular/core';
import { HttpClient, HttpParams, HttpRequest } from '@angular/common/http';
import { Observable, of } from 'rxjs';
-import { DataLakeMeasure, PageResult, SpQueryResult } from '../model/gen/streampipes-model';
+import {
+ DataLakeMeasure,
+ PageResult,
+ SpQueryResult,
+} from '../model/gen/streampipes-model';
import { map } from 'rxjs/operators';
import { DatalakeQueryParameters } from '../model/datalake/DatalakeQueryParameters';
@Injectable({
- providedIn: 'root'
+ providedIn: 'root',
})
export class DatalakeRestService {
- constructor(private http: HttpClient) {
- }
-
- private get baseUrl() {
- return '/streampipes-backend';
- }
-
- public get dataLakeUrl() {
- return this.baseUrl + '/api/v4' + '/datalake';
- }
-
- public get dataLakeMeasureUrl() {
- return this.baseUrl + '/api/v4/datalake/measure';
- }
-
- getAllMeasurementSeries(): Observable<DataLakeMeasure[]> {
- const url = this.dataLakeUrl + '/measurements/';
- return this.http.get(url).pipe(map(response => {
- return (response as any[]).map(p => DataLakeMeasure.fromData(p));
- }));
- }
-
- getMeasurement(id: string): Observable<DataLakeMeasure> {
- return this.http.get(`${this.dataLakeMeasureUrl}/${id}`).pipe(map(res => res as DataLakeMeasure));
- }
-
- performMultiQuery(queryParams: DatalakeQueryParameters[]): Observable<SpQueryResult[]> {
- return this.http.post(`${this.dataLakeUrl}/query`, queryParams, {headers: {ignoreLoadingBar: ''}})
- .pipe(map(response => response as SpQueryResult[]));
- }
-
- getData(index: string,
- queryParams: DatalakeQueryParameters,
- ignoreLoadingBar?: boolean): Observable<SpQueryResult> {
-
- const columns = queryParams.columns;
- if (columns === '') {
- const emptyQueryResult = new SpQueryResult();
- emptyQueryResult.total = 0;
- return of(emptyQueryResult);
- } else {
- const url = this.dataLakeUrl + '/measurements/' + index;
- const headers = ignoreLoadingBar ? {ignoreLoadingBar: ''} : {};
- // @ts-ignore
- return this.http.get<SpQueryResult>(url, {params: queryParams, headers});
- }
- }
-
-
- getPagedData(index: string, itemsPerPage: number, page: number, columns?: string, order?: string): Observable<PageResult> {
- const url = this.dataLakeUrl + '/measurements/' + index;
-
- const queryParams: DatalakeQueryParameters = this.getQueryParameters(columns, undefined, undefined, page,
- itemsPerPage, undefined, undefined, order, undefined, undefined);
-
- // @ts-ignore
- return this.http.get<PageResult>(url, {params: queryParams});
- }
-
- getTagValues(index: string,
- fieldNames: string[]): Observable<Map<string, string[]>> {
-
- if (fieldNames.length === 0) {
- return of(new Map<string, string[]>());
- } else {
- return this.http.get(this.dataLakeUrl + '/measurements/' + index + '/tags?fields=' + fieldNames.toString())
- .pipe(map(r => r as Map<string, string[]>));
+ constructor(private http: HttpClient) {}
+ private get baseUrl() {
+ return '/streampipes-backend';
}
- }
-
- downloadRawData(index: string,
- format: string,
- delimiter: string,
- missingValueBehaviour: string,
- startTime?: number,
- endTime?: number) {
- const queryParams = (startTime && endTime) ? {format, delimiter, startDate: startTime, endDate: endTime} : {
- format,
- delimiter,
- missingValueBehaviour
- };
- return this.buildDownloadRequest(index, queryParams);
- }
-
- downloadQueriedData(
- index: string,
- format: string,
- delimiter: string,
- missingValueBehaviour: string,
- queryParams: DatalakeQueryParameters) {
-
- (queryParams as any).format = format;
- (queryParams as any).delimiter = delimiter;
- (queryParams as any).missingValueBehaviour = missingValueBehaviour;
-
- return this.buildDownloadRequest(index, queryParams);
-
- }
-
- buildDownloadRequest(index: string,
- queryParams: any) {
- const url = this.dataLakeUrl + '/measurements/' + index + '/download';
- const request = new HttpRequest('GET', url, {
- reportProgress: true,
- responseType: 'text',
- params: this.toHttpParams(queryParams)
- });
-
- return this.http.request(request);
- }
- toHttpParams(queryParamObject: any): HttpParams {
- return new HttpParams({fromObject: queryParamObject});
- }
-
- removeData(index: string) {
- const url = this.dataLakeUrl + '/measurements/' + index;
+ public get dataLakeUrl() {
+ return this.baseUrl + '/api/v4' + '/datalake';
+ }
- return this.http.delete(url);
- }
+ public get dataLakeMeasureUrl() {
+ return this.baseUrl + '/api/v4/datalake/measure';
+ }
- dropSingleMeasurementSeries(index: string) {
- const url = this.dataLakeUrl + '/measurements/' + index + '/drop';
- return this.http.delete(url);
- }
+ getAllMeasurementSeries(): Observable<DataLakeMeasure[]> {
+ const url = this.dataLakeUrl + '/measurements/';
+ return this.http.get(url).pipe(
+ map(response => {
+ return (response as any[]).map(p =>
+ DataLakeMeasure.fromData(p),
+ );
+ }),
+ );
+ }
- dropAllMeasurementSeries() {
- const url = this.dataLakeUrl + '/measurements/';
- return this.http.delete(url);
- }
+ getMeasurement(id: string): Observable<DataLakeMeasure> {
+ return this.http
+ .get(`${this.dataLakeMeasureUrl}/${id}`)
+ .pipe(map(res => res as DataLakeMeasure));
+ }
- private getQueryParameters(columns?: string, startDate?: number, endDate?: number, page?: number, limit?: number,
- offset?: number, groupBy?: string, order?: string, aggregationFunction?: string, timeInterval?: string):
- DatalakeQueryParameters {
- const queryParams: DatalakeQueryParameters = new DatalakeQueryParameters();
+ performMultiQuery(
+ queryParams: DatalakeQueryParameters[],
+ ): Observable<SpQueryResult[]> {
+ return this.http
+ .post(`${this.dataLakeUrl}/query`, queryParams, {
+ headers: { ignoreLoadingBar: '' },
+ })
+ .pipe(map(response => response as SpQueryResult[]));
+ }
- if (columns) {
- queryParams.columns = columns;
+ getData(
+ index: string,
+ queryParams: DatalakeQueryParameters,
+ ignoreLoadingBar?: boolean,
+ ): Observable<SpQueryResult> {
+ const columns = queryParams.columns;
+ if (columns === '') {
+ const emptyQueryResult = new SpQueryResult();
+ emptyQueryResult.total = 0;
+ return of(emptyQueryResult);
+ } else {
+ const url = this.dataLakeUrl + '/measurements/' + index;
+ const headers = ignoreLoadingBar ? { ignoreLoadingBar: '' } : {};
+ // @ts-ignore
Review Comment:
I think this is the reason why the PR validation failed.
Can you try to replace it with:
```
return this.http.get<SpQueryResult>(url, {
params: queryParams as unknown as HttpParams,
headers,
});
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@streampipes.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [streampipes] aamirxshaikh commented on pull request #1012: [#877] Apply UI linting to projects module
Posted by GitBox <gi...@apache.org>.
aamirxshaikh commented on PR #1012:
URL: https://github.com/apache/streampipes/pull/1012#issuecomment-1369460218
Thanks @bossenti and @tenthe for helping me with fixes and documentation for the contributions 🙏🏼, I hope to contribute more 🚀
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@streampipes.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org