chore: extend root eslint config in twenty-server (#5101)
Reopening @thaisguigon work from https://github.com/twentyhq/twenty/pull/4781 --------- Co-authored-by: Thaïs Guigon <guigon.thais@gmail.com>
This commit is contained in:
@ -84,7 +84,7 @@ describe('FindDuplicatesQueryFactory', () => {
|
||||
});
|
||||
|
||||
expect(query.trim()).toEqual(`query {
|
||||
personCollection(filter: {or:[{nameFirstName:{eq:\"John\"},nameLastName:{eq:\"Doe\"}}]}) {
|
||||
personCollection(filter: {or:[{nameFirstName:{eq:"John"},nameLastName:{eq:"Doe"}}]}) {
|
||||
fieldsString
|
||||
}
|
||||
}`);
|
||||
@ -171,7 +171,7 @@ describe('FindDuplicatesQueryFactory', () => {
|
||||
);
|
||||
|
||||
expect(query.trim()).toEqual(`query {
|
||||
personCollection(filter: {id:{neq:\"uuid\"},or:[{nameFirstName:{eq:\"Peter\"},nameLastName:{eq:\"Parker\"}}]}) {
|
||||
personCollection(filter: {id:{neq:"uuid"},or:[{nameFirstName:{eq:"Peter"},nameLastName:{eq:"Parker"}}]}) {
|
||||
fieldsString
|
||||
}
|
||||
}`);
|
||||
@ -189,7 +189,7 @@ describe('FindDuplicatesQueryFactory', () => {
|
||||
});
|
||||
|
||||
expect(query.trim()).toEqual(`query {
|
||||
personCollection(filter: { id: { eq: \"uuid\" }}){
|
||||
personCollection(filter: { id: { eq: "uuid" }}){
|
||||
edges {
|
||||
node {
|
||||
__typename
|
||||
|
||||
@ -10,7 +10,7 @@ import { ObjectMetadataInterface } from 'src/engine/metadata-modules/field-metad
|
||||
import { computeObjectTargetTable } from 'src/engine/utils/compute-object-target-table.util';
|
||||
import { stringifyWithoutKeyQuote } from 'src/engine/api/graphql/workspace-query-builder/utils/stringify-without-key-quote.util';
|
||||
import { ArgsAliasFactory } from 'src/engine/api/graphql/workspace-query-builder/factories/args-alias.factory';
|
||||
import { duplicateCriteriaCollection } from 'src/engine/api/graphql/workspace-resolver-builder/constants/duplicate-criteria.constants';
|
||||
import { DUPLICATE_CRITERIA_COLLECTION } from 'src/engine/api/graphql/workspace-resolver-builder/constants/duplicate-criteria.constants';
|
||||
import { settings } from 'src/engine/constants/settings';
|
||||
|
||||
import { FieldsStringFactory } from './fields-string.factory';
|
||||
@ -145,7 +145,7 @@ export class FindDuplicatesQueryFactory {
|
||||
private getApplicableDuplicateCriteriaCollection(
|
||||
objectMetadataItem: ObjectMetadataInterface,
|
||||
) {
|
||||
return duplicateCriteriaCollection.filter(
|
||||
return DUPLICATE_CRITERIA_COLLECTION.filter(
|
||||
(duplicateCriteria) =>
|
||||
duplicateCriteria.objectName === objectMetadataItem.nameSingular,
|
||||
);
|
||||
|
||||
@ -34,6 +34,7 @@ export const parseResult = (obj: any): any => {
|
||||
const result: any = {};
|
||||
|
||||
for (const key in obj) {
|
||||
// eslint-disable-next-line no-prototype-builtins
|
||||
if (obj.hasOwnProperty(key)) {
|
||||
if (typeof obj[key] === 'object' && obj[key] !== null) {
|
||||
result[key] = parseResult(obj[key]);
|
||||
|
||||
@ -6,7 +6,7 @@ import { RecordDuplicateCriteria } from 'src/engine/api/graphql/workspace-query-
|
||||
* So if we need to reference a custom field, we should directly add the column name like `_customColumn`.
|
||||
* If we need to terence a composite field, we should add all children of the composite like `nameFirstName` and `nameLastName`
|
||||
*/
|
||||
export const duplicateCriteriaCollection: RecordDuplicateCriteria[] = [
|
||||
export const DUPLICATE_CRITERIA_COLLECTION: RecordDuplicateCriteria[] = [
|
||||
{
|
||||
objectName: 'company',
|
||||
columnNames: ['domainName'],
|
||||
|
||||
@ -24,6 +24,7 @@ export class ArgsFactory {
|
||||
const fieldConfigMap: GraphQLFieldConfigArgumentMap = {};
|
||||
|
||||
for (const key in args) {
|
||||
// eslint-disable-next-line no-prototype-builtins
|
||||
if (!args.hasOwnProperty(key)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
@ -1,11 +1,11 @@
|
||||
export * from './big-float-filter.input-type';
|
||||
export * from './big-int-filter.input-type';
|
||||
export * from './boolean-filter.input-type';
|
||||
export * from './date-filter.input-type';
|
||||
export * from './date-time-filter.input-type';
|
||||
export * from './float-filter.input-type';
|
||||
export * from './int-filter.input-type';
|
||||
export * from './raw-json-filter.input-type';
|
||||
export * from './string-filter.input-type';
|
||||
export * from './time-filter.input-type';
|
||||
export * from './uuid-filter.input-type';
|
||||
export * from './boolean-filter.input-type';
|
||||
export * from './raw-json-filter.input-type';
|
||||
|
||||
Reference in New Issue
Block a user