Prettier: Upgrade to 2 (#30387)

* Updated package json but not updated source files

* Update eslint plugin

* updated files
This commit is contained in:
Torkel Ödegaard
2021-01-20 07:59:48 +01:00
committed by GitHub
parent f27450ed94
commit 1d689888b0
1069 changed files with 4370 additions and 5260 deletions

View File

@ -123,14 +123,14 @@ export class PostgresQueryCtrl extends QueryCtrl {
updateProjection() {
this.selectParts = _.map(this.target.select, (parts: any) => {
return _.map(parts, sqlPart.create).filter(n => n);
return _.map(parts, sqlPart.create).filter((n) => n);
});
this.whereParts = _.map(this.target.where, sqlPart.create).filter(n => n);
this.groupParts = _.map(this.target.group, sqlPart.create).filter(n => n);
this.whereParts = _.map(this.target.where, sqlPart.create).filter((n) => n);
this.groupParts = _.map(this.target.group, sqlPart.create).filter((n) => n);
}
updatePersistedParts() {
this.target.select = _.map(this.selectParts, selectParts => {
this.target.select = _.map(this.selectParts, (selectParts) => {
return _.map(selectParts, (part: any) => {
return { type: part.def.type, datatype: part.datatype, params: part.params };
});
@ -325,7 +325,7 @@ export class PostgresQueryCtrl extends QueryCtrl {
transformToSegments(config: { addNone?: any; addTemplateVars?: any; templateQuoter?: any }) {
return (results: any) => {
const segments = _.map(results, segment => {
const segments = _.map(results, (segment) => {
return this.uiSegmentSrv.newSegment({
value: segment.text,
expandable: segment.expandable,
@ -525,10 +525,10 @@ export class PostgresQueryCtrl extends QueryCtrl {
// add aggregates when adding group by
for (const selectParts of this.selectParts) {
if (!selectParts.some(part => part.def.type === 'aggregate')) {
if (!selectParts.some((part) => part.def.type === 'aggregate')) {
const aggregate = sqlPart.create({ type: 'aggregate', params: ['avg'] });
selectParts.splice(1, 0, aggregate);
if (!selectParts.some(part => part.def.type === 'alias')) {
if (!selectParts.some((part) => part.def.type === 'alias')) {
const alias = sqlPart.create({ type: 'alias', params: [selectParts[0].part.params[0]] });
selectParts.push(alias);
}