Skip to content

Commit

Permalink
Fix linting
Browse files Browse the repository at this point in the history
  • Loading branch information
sausage-todd committed Jul 2, 2024
1 parent fc29df7 commit c3c2160
Show file tree
Hide file tree
Showing 9 changed files with 21 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ class OrganizationRepository {
const attributeDefinition = findAttribute(name)

if (!(attribute as any).custom) {
continue
continue // eslint-disable-line no-continue
}

for (const value of (attribute as any).custom) {
Expand Down
7 changes: 6 additions & 1 deletion backend/src/services/memberService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -416,7 +416,12 @@ export default class MemberService extends LoggerBase {
const org = await organizationService.createOrUpdate(
{
displayName: domain,
names: [domain],
attributes: {
name: {
default: domain,
custom: [domain],
},
},
identities: [
{
value: domain,
Expand Down
7 changes: 0 additions & 7 deletions backend/src/services/organizationService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -723,13 +723,6 @@ export default class OrganizationService extends LoggerBase {
}

try {
const primaryIdentity = verifiedIdentities[0]
const name = primaryIdentity.value

if (!data.names) {
data.names = [name]
}

// Normalize the website identities
for (const i of data.identities.filter((i) =>
[
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,7 @@ import { QueryExecutor, pgpQx } from '@crowd/data-access-layer/src/queryExecutor

import { queryOrgs, OrganizationField, findOrgById } from '@crowd/data-access-layer/src/orgs'
import { buildFullOrgForMergeSuggestions } from '@crowd/opensearch'
import {
fetchManyOrgIdentities,
fetchOrgIdentities,
findOrgAttributes,
} from '@crowd/data-access-layer/src/organizations'
import { fetchOrgIdentities, findOrgAttributes } from '@crowd/data-access-layer/src/organizations'

export async function getOrganizations(
tenantId: string,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ export async function generateOrganizationMergeSuggestions(
lastUuid,
organizationIds: args.organizationIds
? args.organizationIds.filter(
(organizationId) => !result.map((r) => r.uuid_organizationId).includes(organizationId),
(organizationId) => !result.map((r) => r.id).includes(organizationId),
)
: undefined,
})
Expand Down
10 changes: 5 additions & 5 deletions services/libs/data-access-layer/src/query.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ enum Operator {

type ANY_LITERAL = string | number | boolean

type GT = { [Operator.GT]: number }
type GTE = { [Operator.GTE]: number }
type LT = { [Operator.LT]: number }
type LTE = { [Operator.LTE]: number }
type GT = { [Operator.GT]: ANY_LITERAL }
type GTE = { [Operator.GTE]: ANY_LITERAL }
type LT = { [Operator.LT]: ANY_LITERAL }
type LTE = { [Operator.LTE]: ANY_LITERAL }
type EQ = { [Operator.EQ]: ANY_LITERAL }
type NE = { [Operator.NE]: ANY_LITERAL }
type LIKE = { [Operator.LIKE]: string }
Expand All @@ -38,7 +38,7 @@ type NOT = { [Operator.NOT]: ANY_CLAUSE }
type AND = { [Operator.AND]: ANY_CLAUSE[] }
type OR = { [Operator.OR]: ANY_CLAUSE[] }

type ANY_CLAUSE = AND | OR | FIELD
type ANY_CLAUSE = AND | OR | FIELD | null

type EMPTY = Record<string, never>
export type QueryFilter = ANY_CLAUSE | EMPTY
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,11 @@ const parseMember = (memberData: GithubPrepareMemberOutput): IMemberData => {
if (IS_TEST_ENV) {
member.organizations = [
{
names: ['crowd.dev'],
attributes: {
name: {
integration: ['crowd.dev'],
},
},
identities: [
{
value: 'crowd.dev',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ export class HubspotMemberFieldMapper extends HubspotFieldMapper {
// TODO uros check if this is verified or not with anil
member.organizations = [
{
names: [contactProperties[hubspotPropertyName]],
// names: [contactProperties[hubspotPropertyName]], // TODO migrate to attributes
identities: [
{
value: contactProperties[hubspotPropertyName],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ export class HubspotOrganizationFieldMapper extends HubspotFieldMapper {

// TODO uros check if this is verified or not with anil
const organization: IOrganization = {
names: [organizationProperties.name],
// names: [organizationProperties.name], // TODO migrate to attributes
identities: [
{
value: `${this.hubspotId}:${hubspotOrganization.id}`,
Expand Down

0 comments on commit c3c2160

Please sign in to comment.