mirror of
				https://github.com/Unleash/unleash.git
				synced 2025-10-27 11:02:16 +01:00 
			
		
		
		
	chore: add change request events to teams integration (#9309)
https://linear.app/unleash/issue/2-3265/investigate-teams-integration-for-change-request-notifications Adds change request events to the Teams integration.
This commit is contained in:
		
							parent
							
								
									1dad28fdb5
								
							
						
					
					
						commit
						0e208fd8eb
					
				@ -13,6 +13,24 @@ import {
 | 
			
		||||
import type { IEvent } from '../types/events';
 | 
			
		||||
import type { IntegrationEventState } from '../features/integration-events/integration-events-store';
 | 
			
		||||
 | 
			
		||||
import {
 | 
			
		||||
    CHANGE_ADDED,
 | 
			
		||||
    CHANGE_DISCARDED,
 | 
			
		||||
    CHANGE_EDITED,
 | 
			
		||||
    CHANGE_REQUEST_APPLIED,
 | 
			
		||||
    CHANGE_REQUEST_APPROVAL_ADDED,
 | 
			
		||||
    CHANGE_REQUEST_APPROVED,
 | 
			
		||||
    CHANGE_REQUEST_CANCELLED,
 | 
			
		||||
    CHANGE_REQUEST_CREATED,
 | 
			
		||||
    CHANGE_REQUEST_DISCARDED,
 | 
			
		||||
    CHANGE_REQUEST_REJECTED,
 | 
			
		||||
    CHANGE_REQUEST_SENT_TO_REVIEW,
 | 
			
		||||
    CHANGE_REQUEST_SCHEDULED,
 | 
			
		||||
    CHANGE_REQUEST_SCHEDULED_APPLICATION_SUCCESS,
 | 
			
		||||
    CHANGE_REQUEST_SCHEDULED_APPLICATION_FAILURE,
 | 
			
		||||
    CHANGE_REQUEST_SCHEDULE_SUSPENDED,
 | 
			
		||||
} from '../types/events';
 | 
			
		||||
 | 
			
		||||
interface ITeamsParameters {
 | 
			
		||||
    url: string;
 | 
			
		||||
    customHeaders?: string;
 | 
			
		||||
@ -23,6 +41,26 @@ export default class TeamsAddon extends Addon {
 | 
			
		||||
    flagResolver: IFlagResolver;
 | 
			
		||||
 | 
			
		||||
    constructor(args: IAddonConfig) {
 | 
			
		||||
        if (args.flagResolver.isEnabled('teamsIntegrationChangeRequests')) {
 | 
			
		||||
            teamsDefinition.events = [
 | 
			
		||||
                ...teamsDefinition.events!,
 | 
			
		||||
                CHANGE_ADDED,
 | 
			
		||||
                CHANGE_DISCARDED,
 | 
			
		||||
                CHANGE_EDITED,
 | 
			
		||||
                CHANGE_REQUEST_APPLIED,
 | 
			
		||||
                CHANGE_REQUEST_APPROVAL_ADDED,
 | 
			
		||||
                CHANGE_REQUEST_APPROVED,
 | 
			
		||||
                CHANGE_REQUEST_CANCELLED,
 | 
			
		||||
                CHANGE_REQUEST_CREATED,
 | 
			
		||||
                CHANGE_REQUEST_DISCARDED,
 | 
			
		||||
                CHANGE_REQUEST_REJECTED,
 | 
			
		||||
                CHANGE_REQUEST_SENT_TO_REVIEW,
 | 
			
		||||
                CHANGE_REQUEST_SCHEDULED,
 | 
			
		||||
                CHANGE_REQUEST_SCHEDULED_APPLICATION_SUCCESS,
 | 
			
		||||
                CHANGE_REQUEST_SCHEDULED_APPLICATION_FAILURE,
 | 
			
		||||
                CHANGE_REQUEST_SCHEDULE_SUSPENDED,
 | 
			
		||||
            ];
 | 
			
		||||
        }
 | 
			
		||||
        super(teamsDefinition, args);
 | 
			
		||||
        this.msgFormatter = new FeatureEventFormatterMd({
 | 
			
		||||
            unleashUrl: args.unleashUrl,
 | 
			
		||||
 | 
			
		||||
@ -66,7 +66,8 @@ export type IFlagKey =
 | 
			
		||||
    | 'frontendHeaderRedesign'
 | 
			
		||||
    | 'dataUsageMultiMonthView'
 | 
			
		||||
    | 'uiGlobalFontSize'
 | 
			
		||||
    | 'connectionCount';
 | 
			
		||||
    | 'connectionCount'
 | 
			
		||||
    | 'teamsIntegrationChangeRequests';
 | 
			
		||||
 | 
			
		||||
export type IFlags = Partial<{ [key in IFlagKey]: boolean | Variant }>;
 | 
			
		||||
 | 
			
		||||
@ -319,6 +320,10 @@ const flags: IFlags = {
 | 
			
		||||
        process.env.EXPERIMENTAL_CONNECTION_COUNT,
 | 
			
		||||
        false,
 | 
			
		||||
    ),
 | 
			
		||||
    teamsIntegrationChangeRequests: parseEnvVarBoolean(
 | 
			
		||||
        process.env.EXPERIMENTAL_TEAMS_INTEGRATION_CHANGE_REQUESTS,
 | 
			
		||||
        false,
 | 
			
		||||
    ),
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
export const defaultExperimentalOptions: IExperimentalOptions = {
 | 
			
		||||
 | 
			
		||||
@ -60,6 +60,7 @@ process.nextTick(async () => {
 | 
			
		||||
                        dataUsageMultiMonthView: true,
 | 
			
		||||
                        filterExistingFlagNames: true,
 | 
			
		||||
                        uiGlobalFontSize: true,
 | 
			
		||||
                        teamsIntegrationChangeRequests: true,
 | 
			
		||||
                    },
 | 
			
		||||
                },
 | 
			
		||||
                authentication: {
 | 
			
		||||
 | 
			
		||||
		Loading…
	
		Reference in New Issue
	
	Block a user