Skip to content

Commit 6a30925

Browse files
committed
run prettier
1 parent 64937e1 commit 6a30925

File tree

6 files changed

+56
-25
lines changed

6 files changed

+56
-25
lines changed

backend/src/explorer/search/search.controller.ts

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,17 @@ export class SearchController {
3030

3131
@HttpCode(200)
3232
@Post('/scroll/:scroll')
33-
async searchScroll(@Body() query: SearchRequest, @Param('scroll') scroll: string) {
33+
async searchScroll(
34+
@Body() query: SearchRequest,
35+
@Param('scroll') scroll: string,
36+
) {
3437
query['track_total_hits'] = true;
35-
const body = await this.elasticSearvice.get(null, 'DEFAULT_DASHBOARD', query, scroll);
38+
const body = await this.elasticSearvice.get(
39+
null,
40+
'DEFAULT_DASHBOARD',
41+
query,
42+
scroll,
43+
);
3644
return body;
3745
}
3846
}

backend/src/export/export.controller.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,12 @@ export class ExportController {
3131
const searchQuery: any = { ...query, size: 2000 };
3232
this.exportService.downloadFile(
3333
res,
34-
await this.elasticService.get(index_name, dashboard, searchQuery, scrollId),
34+
await this.elasticService.get(
35+
index_name,
36+
dashboard,
37+
searchQuery,
38+
scrollId,
39+
),
3540
type,
3641
part,
3742
fileName,

backend/src/harvesters/DSpace7/dspace7.service.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -231,8 +231,8 @@ export class DSpace7Service {
231231
);
232232
if (mappedValue !== '' && mappedValue != null) {
233233
finalValues[schemaName] = this.formatService.setValue(
234-
finalValues[schemaName],
235-
mappedValue,
234+
finalValues[schemaName],
235+
mappedValue,
236236
);
237237
}
238238
} else {

backend/src/shared/services/elastic/elastic.service.ts

Lines changed: 22 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,12 @@ export class ElasticService {
233233
}
234234
}
235235

236-
async get(index_name: string, dashboardName = 'DEFAULT_DASHBOARD', query: SearchRequest, scrollId?: string) {
236+
async get(
237+
index_name: string,
238+
dashboardName = 'DEFAULT_DASHBOARD',
239+
query: SearchRequest,
240+
scrollId?: string,
241+
) {
237242
try {
238243
let scrollSearch: SearchResponse;
239244
if (scrollId) {
@@ -256,21 +261,31 @@ export class ElasticService {
256261
}
257262

258263
async addPreDefinedFiltersQuery(query: SearchRequest, dashboardName: string) {
259-
const predefinedFilters = await this.jsonFilesService.getPredefinedFiltersFromDashboard(dashboardName);
260-
if (!predefinedFilters || !Array.isArray(predefinedFilters) || predefinedFilters.length === 0) {
264+
const predefinedFilters =
265+
await this.jsonFilesService.getPredefinedFiltersFromDashboard(
266+
dashboardName,
267+
);
268+
if (
269+
!predefinedFilters ||
270+
!Array.isArray(predefinedFilters) ||
271+
predefinedFilters.length === 0
272+
) {
261273
return query;
262274
}
263275
const predefinedQuery: QueryDslQueryContainer = {
264276
bool: {
265277
filter: {
266278
bool: {
267279
must: predefinedFilters,
268-
}
269-
}
270-
}
280+
},
281+
},
282+
},
271283
};
272284
if (query?.query) {
273-
((predefinedQuery.bool.filter as QueryDslQueryContainer).bool.must as QueryDslQueryContainer[]).push(query?.query);
285+
(
286+
(predefinedQuery.bool.filter as QueryDslQueryContainer).bool
287+
.must as QueryDslQueryContainer[]
288+
).push(query?.query);
274289
}
275290
query.query = predefinedQuery;
276291

frontend/src/app/admin/design/design.component.ts

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,9 @@ export class DesignComponent implements OnInit {
3737
dashboard_name: string;
3838
exportLink: string;
3939
predefinedFilters: any = null;
40-
predefinedFiltersExample = JSON.stringify([{"terms": {"FIELD_NAME": ["VALUE"]}}]);
40+
predefinedFiltersExample = JSON.stringify([
41+
{ terms: { FIELD_NAME: ['VALUE'] } },
42+
]);
4143
footer: any = null;
4244
welcome: any;
4345
welcome_text = '';
@@ -80,14 +82,8 @@ export class DesignComponent implements OnInit {
8082
await this.spinner.show();
8183
const dashboard_name = (this.dashboard_name =
8284
this.activeRoute.snapshot.paramMap.get('dashboard_name'));
83-
const {
84-
counters,
85-
filters,
86-
dashboard,
87-
footer,
88-
predefinedFilters,
89-
welcome
90-
} = await this.settingsService.readExplorerSettings(dashboard_name);
85+
const { counters, filters, dashboard, footer, predefinedFilters, welcome } =
86+
await this.settingsService.readExplorerSettings(dashboard_name);
9187
if (welcome.componentConfigs && welcome.componentConfigs.text)
9288
this.welcome_text = welcome.componentConfigs.text;
9389
if (!this.welcome)
@@ -123,7 +119,8 @@ export class DesignComponent implements OnInit {
123119
}
124120

125121
populateForm(settings) {
126-
const { counters, filters, dashboard, footer, predefinedFilters, welcome } = settings;
122+
const { counters, filters, dashboard, footer, predefinedFilters, welcome } =
123+
settings;
127124
if (welcome.componentConfigs && welcome.componentConfigs.text)
128125
this.welcome_text = welcome.componentConfigs.text;
129126
if (!this.welcome)
@@ -258,15 +255,20 @@ export class DesignComponent implements OnInit {
258255
.length == 0
259256
) {
260257
let predefinedFilters = null;
261-
if (this.predefinedFilters && this.predefinedFilters.trim(this.predefinedFilters) !== '') {
258+
if (
259+
this.predefinedFilters &&
260+
this.predefinedFilters.trim(this.predefinedFilters) !== ''
261+
) {
262262
try {
263263
predefinedFilters = JSON.parse(this.predefinedFilters);
264264
} catch (e) {
265265
predefinedFilters = null;
266266
}
267267
if (predefinedFilters == null || !Array.isArray(predefinedFilters)) {
268268
await this.spinner.hide();
269-
this.toastr.error('Please add a valid JSON array in the Predefined filters field');
269+
this.toastr.error(
270+
'Please add a valid JSON array in the Predefined filters field',
271+
);
270272
return;
271273
}
272274
}

frontend/src/app/explorer/dashboard/components/pie/pie.component.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,8 @@ export class PieComponent extends ParentChart implements OnInit {
6868
commonProperties.legend.labelFormatter = function () {
6969
const label = `${this.name} (${(this as any).y})`;
7070
return label.replace(
71-
new RegExp(`(?![^\\n]{1,${30}}$)([^\\n]{1,${30}})\\s`, 'g'), '$1<br>'
71+
new RegExp(`(?![^\\n]{1,${30}}$)([^\\n]{1,${30}})\\s`, 'g'),
72+
'$1<br>',
7273
);
7374
};
7475
commonProperties.legend.useHTML = true;

0 commit comments

Comments
 (0)