File tree Expand file tree Collapse file tree 6 files changed +26
-18
lines changed
integrations/services/integrations Expand file tree Collapse file tree 6 files changed +26
-18
lines changed Original file line number Diff line number Diff line change @@ -467,7 +467,7 @@ class SegmentRepository extends RepositoryBase<
467
467
{
468
468
replacements : {
469
469
tenantId : this . currentTenant . id ,
470
- name : `${ criteria . filter ?. name } %` ,
470
+ name : `% ${ criteria . filter ?. name } %` ,
471
471
status : criteria . filter ?. status ,
472
472
} ,
473
473
type : QueryTypes . SELECT ,
@@ -642,8 +642,10 @@ class SegmentRepository extends RepositoryBase<
642
642
activityTypes . default = lodash . cloneDeep ( DEFAULT_ACTIVITY_TYPE_SETTINGS )
643
643
activityTypes . custom = { }
644
644
645
- if ( Object . keys ( record . customActivityTypes ) . length > 0 ) {
646
- activityTypes . custom = record . customActivityTypes
645
+ const customActivityTypes = record . customActivityTypes || { }
646
+
647
+ if ( Object . keys ( customActivityTypes ) . length > 0 ) {
648
+ activityTypes . custom = customActivityTypes
647
649
}
648
650
649
651
return activityTypes
Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ import _get from 'lodash/get'
2
2
import SequelizeRepository from './sequelizeRepository'
3
3
import AuditLogRepository from './auditLogRepository'
4
4
import { IRepositoryOptions } from './IRepositoryOptions'
5
+ import SegmentService from '../../services/segmentService'
5
6
6
7
export default class SettingsRepository {
7
8
static async findOrCreateDefault ( defaults , options : IRepositoryOptions ) {
@@ -82,15 +83,11 @@ export default class SettingsRepository {
82
83
return record
83
84
}
84
85
85
- let segment = null
86
-
87
- if ( options . currentSegments ?. length > 0 ) {
88
- segment = SequelizeRepository . getStrictlySingleActiveSegment ( options )
89
- }
86
+ const activityTypes = await SegmentService . getTenantActivityTypes ( options . currentSegments )
90
87
91
88
const settings = record . get ( { plain : true } )
92
89
93
- settings . activityTypes = segment ? segment . activityTypes : null
90
+ settings . activityTypes = activityTypes
94
91
settings . slackWebHook = ! ! settings . slackWebHook
95
92
96
93
return settings
Original file line number Diff line number Diff line change @@ -88,7 +88,7 @@ async function bulkOperations(
88
88
operation : string ,
89
89
records : Array < any > ,
90
90
options : IServiceOptions ,
91
- fireCrowdWebhooks : boolean = true ,
91
+ fireCrowdWebhooks : boolean = false ,
92
92
) : Promise < any > {
93
93
switch ( operation ) {
94
94
case Operations . UPDATE_MEMBERS :
Original file line number Diff line number Diff line change @@ -1018,7 +1018,7 @@ export class GithubIntegrationService extends IntegrationServiceBase {
1018
1018
prNumber,
1019
1019
} ,
1020
1020
}
1021
-
1021
+ // create a new stream
1022
1022
await streamRepo . create ( stream )
1023
1023
1024
1024
if ( ! isExistingRun ) {
Original file line number Diff line number Diff line change 1
1
/* eslint-disable no-case-declarations */
2
+ import { Edition } from '@crowd/types'
2
3
import { weeklyAnalyticsEmailsWorker } from './analytics/workers/weeklyAnalyticsEmailsWorker'
3
4
import {
4
5
AutomationMessage ,
@@ -27,6 +28,7 @@ import { integrationDataCheckerWorker } from './integration-data-checker/integra
27
28
import { refreshSampleDataWorker } from './integration-data-checker/refreshSampleDataWorker'
28
29
import { mergeSuggestionsWorker } from './merge-suggestions/mergeSuggestionsWorker'
29
30
import { BulkorganizationEnrichmentWorker } from './bulk-enrichment/bulkOrganizationEnrichmentWorker'
31
+ import { API_CONFIG } from '../../../conf'
30
32
31
33
/**
32
34
* Worker factory for spawning different microservices
@@ -77,6 +79,9 @@ async function workerFactory(event: NodeMicroserviceMessage): Promise<any> {
77
79
}
78
80
79
81
case 'automation-process' :
82
+ if ( API_CONFIG . edition === Edition . LFX ) {
83
+ return { }
84
+ }
80
85
const automationProcessRequest = event as ProcessAutomationMessage
81
86
82
87
switch ( automationProcessRequest . automationType ) {
@@ -103,6 +108,9 @@ async function workerFactory(event: NodeMicroserviceMessage): Promise<any> {
103
108
}
104
109
105
110
case 'automation' :
111
+ if ( API_CONFIG . edition === Edition . LFX ) {
112
+ return { }
113
+ }
106
114
const automationRequest = event as AutomationMessage
107
115
108
116
switch ( automationRequest . trigger ) {
Original file line number Diff line number Diff line change @@ -384,19 +384,20 @@ export default class SegmentService extends LoggerBase {
384
384
}
385
385
386
386
static async getTenantActivityTypes ( subprojects : any ) {
387
- return subprojects . reduce (
388
- ( acc : any , subproject ) => ( {
387
+ return subprojects . reduce ( ( acc : any , subproject ) => {
388
+ const activityTypes = SegmentRepository . buildActivityTypes ( subproject )
389
+
390
+ return {
389
391
custom : {
390
392
...acc . custom ,
391
- ...subproject . activityTypes . custom ,
393
+ ...activityTypes . custom ,
392
394
} ,
393
395
default : {
394
396
...acc . default ,
395
- ...subproject . activityTypes . default ,
397
+ ...activityTypes . default ,
396
398
} ,
397
- } ) ,
398
- { } ,
399
- )
399
+ }
400
+ } , { } )
400
401
}
401
402
402
403
static async getTenantActivityChannels ( subprojects : any ) {
You can’t perform that action at this time.
0 commit comments