refactor: replace TSLint with ESLint

This commit is contained in:
Wieland Schöbl
2021-06-30 13:53:44 +02:00
committed by Jovan Krunić
parent 67fb4a43c9
commit d696215d08
147 changed files with 5471 additions and 2704 deletions

View File

@@ -12,7 +12,7 @@
* You should have received a copy of the GNU General Public License along with
* this program. If not, see <https://www.gnu.org/licenses/>.
*/
/* tslint:disable */
/* eslint-disable */
import moment from 'moment'

View File

@@ -42,22 +42,15 @@ export const sampleAggregations: SCBackendAggregationConfiguration[] = [
},
{
fieldName: 'academicTerms.acronym',
onlyOnTypes: [
SCThingType.AcademicEvent,
SCThingType.SportCourse,
],
onlyOnTypes: [SCThingType.AcademicEvent, SCThingType.SportCourse],
},
{
fieldName: 'academicTerm.acronym',
onlyOnTypes: [
SCThingType.Catalog,
],
onlyOnTypes: [SCThingType.Catalog],
},
{
fieldName: 'majors',
onlyOnTypes: [
SCThingType.AcademicEvent,
],
onlyOnTypes: [SCThingType.AcademicEvent],
},
{
fieldName: 'keywords',

View File

@@ -16,95 +16,98 @@ import {SCFacet, SCThingType} from '@openstapps/core';
export const facetsMock: SCFacet[] = [
{
'buckets': [
buckets: [
{
'count': 60,
'key': 'academic event',
count: 60,
key: 'academic event',
},
{
'count': 160,
'key': 'message',
count: 160,
key: 'message',
},
{
'count': 151,
'key': 'date series',
count: 151,
key: 'date series',
},
{
'count': 106,
'key': 'dish',
count: 106,
key: 'dish',
},
{
'count': 20,
'key': 'building',
count: 20,
key: 'building',
},
{
'count': 20,
'key': 'semester',
count: 20,
key: 'semester',
},
],
'field': 'type',
field: 'type',
},
{
'buckets': [
buckets: [
{
'count': 12,
'key': 'Max Mustermann',
count: 12,
key: 'Max Mustermann',
},
{
'count': 2,
'key': 'Foo Bar',
count: 2,
key: 'Foo Bar',
},
],
'field': 'performers',
'onlyOnType': SCThingType.AcademicEvent,
field: 'performers',
onlyOnType: SCThingType.AcademicEvent,
},
{
'buckets': [
buckets: [
{
'count': 5,
'key': 'colloquium',
count: 5,
key: 'colloquium',
},
{
'count': 15,
'key': 'course',
count: 15,
key: 'course',
},
],
'field': 'categories',
'onlyOnType': SCThingType.AcademicEvent,
field: 'categories',
onlyOnType: SCThingType.AcademicEvent,
},
{
'buckets': [
buckets: [
{
'count': 5,
'key': 'unipedia',
}],
'field': 'categories',
'onlyOnType': SCThingType.Article,
count: 5,
key: 'unipedia',
},
],
field: 'categories',
onlyOnType: SCThingType.Article,
},
{
'buckets': [
buckets: [
{
'count': 5,
'key': 'employees',
count: 5,
key: 'employees',
},
{
'count': 15,
'key': 'students',
}],
'field': 'audiences',
'onlyOnType': SCThingType.Message,
count: 15,
key: 'students',
},
],
field: 'audiences',
onlyOnType: SCThingType.Message,
},
{
'buckets': [
buckets: [
{
'count': 5,
'key': 'main dish',
count: 5,
key: 'main dish',
},
{
'count': 15,
'key': 'salad',
}],
'field': 'categories',
'onlyOnType': SCThingType.Dish,
count: 15,
key: 'salad',
},
],
field: 'categories',
onlyOnType: SCThingType.Dish,
},
];

View File

@@ -15,15 +15,29 @@
import {HttpClient} from '@angular/common/http';
import {Injectable} from '@angular/core';
import {
SCAcademicEvent, SCArticle, SCBook, SCBuilding, SCCatalog,
SCDateSeries, SCDish, SCFavorite, SCMessage, SCPerson, SCRoom, SCSearchFilter,
SCThing, SCThingOriginType, SCThingType, SCToDo, SCToDoPriority,
SCAcademicEvent,
SCArticle,
SCBook,
SCBuilding,
SCCatalog,
SCDateSeries,
SCDish,
SCFavorite,
SCMessage,
SCPerson,
SCRoom,
SCSearchFilter,
SCThing,
SCThingOriginType,
SCThingType,
SCToDo,
SCToDoPriority,
} from '@openstapps/core';
import {Observable, of} from 'rxjs';
import {checkFilter} from '../fakesearch/filters';
import {sampleResources} from './resources/test-resources';
// tslint:disable:no-magic-numbers
/* eslint-disable */
const sampleMessages: SCMessage[] = [
{
audiences: ['students'],
@@ -385,9 +399,9 @@ export class SampleThings {
/**
* TODO
*/
// tslint:disable-next-line:prefer-function-over-method no-any
// eslint-disable-next-line class-methods-use-this, @typescript-eslint/no-explicit-any
getSampleThing(uid: string): Observable<any[]> {
// tslint:disable-next-line:no-any
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const sampleThings: any[] = [];
for (const resource of sampleResources) {
if (resource.instance.uid as SCThingType === uid) {
@@ -403,12 +417,12 @@ export class SampleThings {
/**
* TODO
*/
// tslint:disable-next-line:prefer-function-over-method no-any
// eslint-disable-next-line class-methods-use-this, @typescript-eslint/no-explicit-any
getSampleThings(filter?: SCSearchFilter): Observable<any[]> {
// tslint:disable-next-line:no-any
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const sampleThings: any[] = [];
for (const resource of sampleResources) {
// tslint:disable-next-line:max-line-length
// eslint-disable-next-line max-len
// if ([SCThingType.Video].includes(resource.instance.type as SCThingType)) {
if (typeof filter === 'undefined' || checkFilter(resource.instance as SCThing, filter)) {
sampleThings.push(resource.instance);